# # # patch "NEWS" # from [ef1d05f70e9d9f4b61022f4c59ac3b4a129dfeb5] # to [14fe4cce36d4542fe77716c95f443d4142362640] # # patch "guitone.pro" # from [ed6059a0be9839473da75757415268b8087dc03d] # to [54b9d7d520973b9d1d6be0a13b0e5c228e985a01] # # patch "res/forms/open_prompt.ui" # from [a724da94e2ef7a6b9dc3cc92e45ae6ce47721835] # to [13dfa418269f3bd5244fcac23ba8098a26720c70] # # patch "src/GuitoneStandalone.cpp" # from [96136d4e4938b1b0551565c536e42714b4f82c74] # to [a7187318bd91210e6bf854ba2ab1b31cc5d96e3c] # # patch "src/view/MainWindow.cpp" # from [e1e2577bbcce3b8beaa16dd8c855f89b62f18358] # to [8402316ca923fe2fcb0014e9c184df91c908f774] # # patch "src/view/MenuBar.cpp" # from [534210bc90eebe4eee2b468402ce595406901a74] # to [a0c5b2b2ac36829aed03f65459c12624e4cfdced] # # patch "src/view/MenuBar.h" # from [3c15ed81f367bad013dfeb2cdd6b5aa24102db2f] # to [9619a501e3a2c3a195324e48db1b9d224d13a911] # # patch "src/view/dialogs/DialogManager.cpp" # from [00d41983314163980b4ab74c405dbd3d9c3b5524] # to [17c83a36fb60eb7e122c0b80b8e6ead7f8ba5796] # # patch "src/view/dialogs/DialogManager.h" # from [8a3054aa20ecbfe9fa9e9d076eabbaf46a9568ab] # to [1c2a1058e045624b89b8281861727447366f7fb6] # # patch "src/view/dialogs/OpenPrompt.cpp" # from [66c2a020585da37cc096b8cc72cc1eb065017c89] # to [74f3450be09bd97a1fe68ad0b2426fb3c2a9781f] # ============================================================ --- NEWS ef1d05f70e9d9f4b61022f4c59ac3b4a129dfeb5 +++ NEWS 14fe4cce36d4542fe77716c95f443d4142362640 @@ -1,3 +1,8 @@ +????-??-?? (0.10) + - new: create / initialize new monotone databases + - bugfix: no longer crash the changeset browser when a database contains no + revisions and the user clicks on "more/all changes" + 2008-10-04 (0.9) - new: panel to inspect an selected workspace item - shows several mtn and fs-specific data on the item and links to the birth revision of the node, ============================================================ --- guitone.pro ed6059a0be9839473da75757415268b8087dc03d +++ guitone.pro 54b9d7d520973b9d1d6be0a13b0e5c228e985a01 @@ -59,6 +59,7 @@ HEADERS = src/view/TreeView.h \ src/view/dialogs/AddEditAttribute.h \ src/view/dialogs/OpenPrompt.h \ src/view/dialogs/AddEditDatabaseVariable.h \ + src/view/dialogs/CreateDatabase.h \ src/view/panels/IconHelp.h \ src/view/panels/DatabaseVariables.h \ src/view/panels/NodeInfo.h \ @@ -140,6 +141,7 @@ SOURCES += src/view/TreeView.cpp \ src/view/dialogs/AddEditAttribute.cpp \ src/view/dialogs/OpenPrompt.cpp \ src/view/dialogs/AddEditDatabaseVariable.cpp \ + src/view/dialogs/CreateDatabase.cpp \ src/view/panels/IconHelp.cpp \ src/view/panels/DatabaseVariables.cpp \ src/view/panels/NodeInfo.cpp \ @@ -208,7 +210,8 @@ FORMS += res/forms/select_revision.ui res/forms/icon_help.ui \ res/forms/db_variables.ui \ res/forms/add_edit_variables.ui \ - res/forms/nodeinfo.ui + res/forms/nodeinfo.ui \ + res/forms/create_database.ui UI_DIR = tmp OBJECTS_DIR = tmp ============================================================ --- res/forms/open_prompt.ui a724da94e2ef7a6b9dc3cc92e45ae6ce47721835 +++ res/forms/open_prompt.ui 13dfa418269f3bd5244fcac23ba8098a26720c70 @@ -7,8 +7,16 @@ true + + + 0 + 0 + 560 + 500 + + - + 0 0 @@ -17,201 +25,272 @@ guitone - ../../../../.designer/backup + + ../../../../.designer/backup../../../../.designer/backup - + - - - - - Open Database - - + + + Create Database + + + + - - - - - Opens an existing monotone database to browse revisions, files and metadata. + + + + 300 + 0 + + + + + true + + + + Create a new monotone database as starting point for a +new project or to pull changes from other nodes into. + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Create... + + + false + + + + + + + + + + + + Open Database + + + + + + + true + + + + Opens an existing monotone database to browse revisions, files and metadata. If you like to checkout a new workspace, open a database first and then use "Checkout revision" in the "Database" menu. - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - 5 - - + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + false + + + 5 + + + + + + + + + false + + + + Recent databases... + - - - - false - - - - Recent databases... - - - + + + + + + Qt::Horizontal + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + Browse... + + + false + + + + + + + + + + + + Open Workspace + + + + + + + true + + + + Opens an existing workspace directory. +If you previously checked out a workspace, use this to manage it. + + + Qt::AutoText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + false + + + 5 + + + + + + + + + false + + + + Recent workspaces... + - - - - Qt::Horizontal - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - Browse... - - - false - - - - + + + + + Qt::Horizontal + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + Browse... + + + false + + + + + + + + + + + + + About + + + false + - - - Open Workspace + + + Preferences - - - - - - - Opens an existing workspace directory. -If you previously checked out a workspace, use this to manage it. - - - Qt::AutoText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - 5 - - - - - - - false - - - - Recent workspaces... - - - - - - - - Qt::Horizontal - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - Browse... - - - false - - - - - - + + false + - - - - - About - - - false - - - - - - - Preferences - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Quit - - - - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + Quit + + + ============================================================ --- src/GuitoneStandalone.cpp 96136d4e4938b1b0551565c536e42714b4f82c74 +++ src/GuitoneStandalone.cpp a7187318bd91210e6bf854ba2ab1b31cc5d96e3c @@ -19,6 +19,7 @@ #include "GuitoneStandalone.h" #include "WorkspaceWindow.h" #include "DatabaseWindow.h" +#include "CreateDatabase.h" #include "Settings.h" #include ============================================================ --- src/view/MainWindow.cpp e1e2577bbcce3b8beaa16dd8c855f89b62f18358 +++ src/view/MainWindow.cpp 8402316ca923fe2fcb0014e9c184df91c908f774 @@ -64,6 +64,11 @@ void MainWindow::init() ); connect( + menuBar, SIGNAL(showCreateDatabase()), + dialogManager, SLOT(showCreateDatabase()) + ); + + connect( menuBar, SIGNAL(closeWindow()), this, SLOT(close()) ); @@ -79,6 +84,11 @@ void MainWindow::init() ); connect( + dialogManager, SIGNAL(databaseCreated(const QString &)), + app, SLOT(loadDatabase(const QString &)) + ); + + connect( menuBar, SIGNAL(loadWorkspace(const QString &)), app, SLOT(loadWorkspace(const QString &)) ); ============================================================ --- src/view/MenuBar.cpp 534210bc90eebe4eee2b468402ce595406901a74 +++ src/view/MenuBar.cpp a0c5b2b2ac36829aed03f65459c12624e4cfdced @@ -37,6 +37,8 @@ MenuBar::MenuBar(QWidget * parent) : QMe // actionOpen_Workspace = new QAction(tr("Open Workspace"), this); actionOpen_Workspace->setShortcut(tr("Ctrl+O")); + actionCreate_Database = new QAction(tr("Create a new Database"), this); + actionCreate_Database->setShortcut(tr("Ctrl+N")); actionOpen_Database = new QAction(tr("Open Database"), this); actionOpen_Database->setShortcut(tr("Ctrl+Shift+O")); actionPreferences = new QAction(tr("Preferences..."), this); @@ -55,6 +57,7 @@ MenuBar::MenuBar(QWidget * parent) : QMe menuFile->addAction(actionOpen_Workspace); menuFile->addAction(menuRecent_Workspaces->menuAction()); menuFile->addSeparator(); + menuFile->addAction(actionCreate_Database); menuFile->addAction(actionOpen_Database); menuFile->addAction(menuRecent_Databases->menuAction()); menuFile->addSeparator(); @@ -116,6 +119,11 @@ MenuBar::MenuBar(QWidget * parent) : QMe ); connect( + actionCreate_Database, SIGNAL(triggered()), + this, SIGNAL(showCreateDatabase()) + ); + + connect( actionAbout_guitone, SIGNAL(triggered()), this, SIGNAL(showAbout()) ); ============================================================ --- src/view/MenuBar.h 3c15ed81f367bad013dfeb2cdd6b5aa24102db2f +++ src/view/MenuBar.h 9619a501e3a2c3a195324e48db1b9d224d13a911 @@ -35,6 +35,7 @@ signals: signals: void loadWorkspace(const QString &); void loadDatabase(const QString &); + void showCreateDatabase(); void showPreferences(); void showAbout(); void checkForApplicationUpdates(); @@ -43,6 +44,7 @@ protected: void raiseAllWindows(); protected: + QAction * actionCreate_Database; QAction * actionOpen_Database; QAction * actionOpen_Workspace; QAction * actionPreferences; ============================================================ --- src/view/dialogs/DialogManager.cpp 00d41983314163980b4ab74c405dbd3d9c3b5524 +++ src/view/dialogs/DialogManager.cpp 17c83a36fb60eb7e122c0b80b8e6ead7f8ba5796 @@ -20,13 +20,14 @@ DialogManager::DialogManager(QWidget * p #include "vocab.h" DialogManager::DialogManager(QWidget * parentWidget) - : QObject(parentWidget), about(0), preferences(0) + : QObject(parentWidget), about(0), preferences(0), createDatabase(0) {} DialogManager::~DialogManager() { if (about) delete about; if (preferences) delete preferences; + if (createDatabase) delete createDatabase; } QWidget * DialogManager::parentWidget() const @@ -38,6 +39,7 @@ void DialogManager::closeAllDialogs() { if (about) about->close(); if (preferences) preferences->close(); + if (createDatabase) createDatabase->close(); emit allDialogsClosed(); } @@ -59,6 +61,20 @@ void DialogManager::showPreferences() showDialog(preferences); } +void DialogManager::showCreateDatabase() +{ + if (!createDatabase) + { + createDatabase = new CreateDatabase(parentWidget()); + + connect( + createDatabase, SIGNAL(databaseCreated(const QString &)), + this, SIGNAL(databaseCreated(const QString &)) + ); + } + showDialog(createDatabase); +} + void DialogManager::showDialog(Dialog * dlg) { if (!openDialogs.contains(dlg)) ============================================================ --- src/view/dialogs/DialogManager.h 8a3054aa20ecbfe9fa9e9d076eabbaf46a9568ab +++ src/view/dialogs/DialogManager.h 1c2a1058e045624b89b8281861727447366f7fb6 @@ -21,6 +21,7 @@ #include "About.h" #include "Preferences.h" +#include "CreateDatabase.h" #include "vocab.h" #include @@ -35,17 +36,21 @@ public slots: public slots: void showAbout(); void showPreferences(); + void showCreateDatabase(); + virtual void closeAllDialogs(); signals: + void databaseCreated(const QString &); void allDialogsClosed(); protected: QWidget * parentWidget() const; void showDialog(Dialog *); - About * about; - Preferences * preferences; + About * about; + Preferences * preferences; + CreateDatabase * createDatabase; private: void cleanup(); ============================================================ --- src/view/dialogs/OpenPrompt.cpp 66c2a020585da37cc096b8cc72cc1eb065017c89 +++ src/view/dialogs/OpenPrompt.cpp 74f3450be09bd97a1fe68ad0b2426fb3c2a9781f @@ -21,6 +21,8 @@ #include +class GuitoneStandalone; + OpenPrompt::OpenPrompt(QWidget * parent) : Dialog(parent) { setupUi(this); @@ -74,6 +76,16 @@ OpenPrompt::OpenPrompt(QWidget * parent) dialogManager = new DialogManager(this); connect( + btnCreateDatabase, SIGNAL(clicked()), + dialogManager, SLOT(showCreateDatabase()) + ); + + connect( + dialogManager, SIGNAL(databaseCreated(const QString &)), + qApp, SLOT(loadDatabase(const QString &)) + ); + + connect( btnAbout, SIGNAL(clicked()), dialogManager, SLOT(showAbout()) ); @@ -84,7 +96,10 @@ OpenPrompt::OpenPrompt(QWidget * parent) ); } -OpenPrompt::~OpenPrompt() {}; +OpenPrompt::~OpenPrompt() +{ + delete dialogManager; +} void OpenPrompt::openDatabase() { @@ -130,3 +145,4 @@ void OpenPrompt::recentDatabaseChanged(i emit loadDatabase(recentDatabases->itemText(idx)); } +