# # # add_file "res/forms/open_prompt.ui" # content [e585d375ad1f9889467b3c8e16f30b458227cad0] # # add_file "src/view/dialogs/OpenPrompt.cpp" # content [30503eeda646434d42512c0840f453bb4449daac] # # add_file "src/view/dialogs/OpenPrompt.h" # content [a86213e4f773ea820f7789f887e3eea4df3e958d] # ============================================================ --- res/forms/open_prompt.ui e585d375ad1f9889467b3c8e16f30b458227cad0 +++ res/forms/open_prompt.ui e585d375ad1f9889467b3c8e16f30b458227cad0 @@ -0,0 +1,240 @@ + + OpenPromptDialog + + + Qt::ApplicationModal + + + true + + + + 0 + 0 + 536 + 303 + + + + + 0 + 0 + + + + guitone + + + ../../../../.designer/backup + + + false + + + + + + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + Open Database + + + false + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Opens an existing monotone database to browse revisions, files and metadata.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">If you like to checkout a new workspace, open a database first and then use "Checkout revision" in the "Database" menu.</p></body></html> + + + Qt::AutoText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 5 + + + + + + + + + Qt::Horizontal + + + + + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + Open Workspace + + + false + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Opens an existing workspace directory.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">If you previously checked out a workspace, use this to manage it.</p></body></html> + + + Qt::AutoText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 5 + + + + + + + + + Qt::Horizontal + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Quit guitone + + + + + + + + + + + + + + ============================================================ --- src/view/dialogs/OpenPrompt.cpp 30503eeda646434d42512c0840f453bb4449daac +++ src/view/dialogs/OpenPrompt.cpp 30503eeda646434d42512c0840f453bb4449daac @@ -0,0 +1,73 @@ +/*************************************************************************** + * Copyright (C) 2007 by Thomas Keller * + * address@hidden * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "OpenPrompt.h" + +#include + +OpenPrompt::OpenPrompt(QWidget * parent) : Dialog(parent) +{ + setupUi(this); + Dialog::init(); + + connect( + btnOpenDatabase, SIGNAL(clicked()), + this, SLOT(openDatabase()) + ); + + connect( + btnOpenWorkspace, SIGNAL(clicked()), + this, SLOT(openWorkspace()) + ); + + connect( + btnExit, SIGNAL(clicked()), + this, SIGNAL(quitApp()) + ); +} + +OpenPrompt::~OpenPrompt() {}; + +void OpenPrompt::openDatabase() +{ + QString fn = QFileDialog::getOpenFileName( + this, + tr("Select your database..."), + QString(), + tr("monotone Databases (*.mtn *.db)") + ); + + if (fn.isEmpty()) return; + + emit loadDatabase(fn); +} + +void OpenPrompt::openWorkspace() +{ + QString fn = QFileDialog::getExistingDirectory( + this, + tr("Select your workspace...") + ); + + if (fn.isEmpty()) return; + + emit loadWorkspace(fn); +} + ============================================================ --- src/view/dialogs/OpenPrompt.h a86213e4f773ea820f7789f887e3eea4df3e958d +++ src/view/dialogs/OpenPrompt.h a86213e4f773ea820f7789f887e3eea4df3e958d @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2007 by Thomas Keller * + * address@hidden * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef OPEN_PROMPT_H +#define OPEN_PROMPT_H + +#include "Dialog.h" +#include "ui_open_prompt.h" + +class OpenPrompt : public Dialog, private Ui::OpenPromptDialog +{ + Q_OBJECT +public: + OpenPrompt(QWidget *); + ~OpenPrompt(); + +signals: + void loadDatabase(const QString &); + void loadWorkspace(const QString &); + void quitApp(); + +private slots: + void openDatabase(); + void openWorkspace(); +}; + +#endif