# # # add_file "res/forms/db_variables.ui" # content [a6fa8671e9b38ce67507fe3fc41ec353425ce531] # # add_file "src/view/panels/DatabaseVariables.cpp" # content [f6a69a4a3cdb36396813204fc5c9e2601ad909cf] # # add_file "src/view/panels/DatabaseVariables.h" # content [e86e4bb48f04db7f59a9c2927f89d36d3c234321] # # patch "guitone.pro" # from [2e5081039729328f3e97c94a88c227d889768f1e] # to [fa8a9b837bc6c3f23089fa2c7c960eb43c3954a0] # # patch "src/view/DatabaseWindow.cpp" # from [355bc712383817ec469988c32e8161a8ea6ef1db] # to [279b0a3ffef1b844f50247b8cfce08770c010910] # # patch "src/view/DatabaseWindow.h" # from [4ba5d2d0af75f7731e952719f726d9cf7c5258ad] # to [619c1ab06edb685d2db3381db9ea5bb31481c546] # # patch "src/view/WorkspaceWindow.cpp" # from [257bc2a4ed393057d7761a32025204992758ee30] # to [48a6117f48cccebabbcd7f580cc0be2e3ada05ac] # ============================================================ --- res/forms/db_variables.ui a6fa8671e9b38ce67507fe3fc41ec353425ce531 +++ res/forms/db_variables.ui a6fa8671e9b38ce67507fe3fc41ec353425ce531 @@ -0,0 +1,42 @@ + + DatabaseVariables + + + + 0 + 0 + 457 + 212 + + + + Database variables + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + + + + TreeView + QTreeView +
TreeView.h
+
+
+ + +
============================================================ --- src/view/panels/DatabaseVariables.cpp f6a69a4a3cdb36396813204fc5c9e2601ad909cf +++ src/view/panels/DatabaseVariables.cpp f6a69a4a3cdb36396813204fc5c9e2601ad909cf @@ -0,0 +1,32 @@ +/*************************************************************************** + * Copyright (C) 2008 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 3 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, see . * + ***************************************************************************/ + +#include "DatabaseVariables.h" + +DatabaseVariables::DatabaseVariables(QWidget * parent) : QDockWidget(parent) +{ + QWidget * parentWidget = new QWidget(this); + setupUi(parentWidget); + setWidget(parentWidget); + + setWindowTitle(tr("Database variables")); + setAllowedAreas(Qt::BottomDockWidgetArea); +} + +DatabaseVariables::~DatabaseVariables() {} + ============================================================ --- src/view/panels/DatabaseVariables.h e86e4bb48f04db7f59a9c2927f89d36d3c234321 +++ src/view/panels/DatabaseVariables.h e86e4bb48f04db7f59a9c2927f89d36d3c234321 @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2008 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 3 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, see . * + ***************************************************************************/ + +#ifndef DATABASE_VARIABLES_H +#define DATABASE_VARIABLES_H + +#include + +#include "ui_db_variables.h" + +class DatabaseVariables : public QDockWidget, private Ui::DatabaseVariables +{ + Q_OBJECT +public: + DatabaseVariables(QWidget *); + ~DatabaseVariables(); +}; + +#endif ============================================================ --- guitone.pro 2e5081039729328f3e97c94a88c227d889768f1e +++ guitone.pro fa8a9b837bc6c3f23089fa2c7c960eb43c3954a0 @@ -54,6 +54,7 @@ HEADERS = src/view/TreeView.h \ src/view/dialogs/AddEditAttribute.h \ src/view/dialogs/OpenPrompt.h \ src/view/panels/IconHelp.h \ + src/view/panels/DatabaseVariables.h \ src/monotone/FileExporter.h \ src/monotone/WorkspaceCreator.h \ src/monotone/WorkspaceCommitter.h \ @@ -126,6 +127,7 @@ SOURCES += src/view/TreeView.cpp \ src/view/dialogs/AddEditAttribute.cpp \ src/view/dialogs/OpenPrompt.cpp \ src/view/panels/IconHelp.cpp \ + src/view/panels/DatabaseVariables.cpp \ src/monotone/FileExporter.cpp \ src/monotone/WorkspaceCreator.cpp \ src/monotone/WorkspaceCommitter.cpp \ @@ -184,7 +186,8 @@ FORMS += res/forms/select_revision.ui res/forms/unaccounted_renames.ui \ res/forms/add_edit_attribute.ui \ res/forms/open_prompt.ui \ - res/forms/icon_help.ui + res/forms/icon_help.ui \ + res/forms/db_variables.ui UI_DIR = tmp OBJECTS_DIR = tmp ============================================================ --- src/view/DatabaseWindow.cpp 355bc712383817ec469988c32e8161a8ea6ef1db +++ src/view/DatabaseWindow.cpp 279b0a3ffef1b844f50247b8cfce08770c010910 @@ -25,14 +25,24 @@ #include #include -DatabaseWindow::DatabaseWindow() : MainWindow(), loadedDatabase(0) +DatabaseWindow::DatabaseWindow() : MainWindow(), + loadedDbLabel(0), keyManagement(0), revisionBrowser(0), + checkoutRevision(0), databaseVariables(0) { setObjectName("DatabaseWindow"); } DatabaseWindow::~DatabaseWindow() { - if (loadedDatabase) delete loadedDatabase; + if (loadedDbLabel) delete loadedDbLabel; + if (keyManagement) delete keyManagement; + if (revisionBrowser) delete revisionBrowser; + if (checkoutRevision) delete checkoutRevision; + if (databaseVariables) + { + removeDockWidget(databaseVariables); + delete databaseVariables; + } } void DatabaseWindow::init() @@ -67,20 +77,61 @@ void DatabaseWindow::init() dialogManager, SLOT(showKeyManagement()) ); + databaseVariables = new DatabaseVariables(this); + + dynamic_cast(menuBar) + ->addDockWidgetAction(databaseVariables->toggleViewAction()); + + addDockWidget(Qt::BottomDockWidgetArea, databaseVariables); + MainWindow::init(); } void DatabaseWindow::setup() { + // + // UI stuff + // QWidget * centralWidget = new QWidget(this); - QHBoxLayout * layout = new QHBoxLayout(centralWidget); - loadedDatabase = new QLabel(tr("nothing loaded"), this); - loadedDatabase->setTextFormat(Qt::PlainText); - loadedDatabase->setAlignment(Qt::AlignCenter); + QVBoxLayout * vboxLayout = new QVBoxLayout(centralWidget); + QGroupBox *loadedDbGroup = new QGroupBox(tr("Loaded database"), centralWidget); + vboxLayout->addWidget(loadedDbGroup); - layout->addWidget(loadedDatabase); + QVBoxLayout * vboxLayout1 = new QVBoxLayout(loadedDbGroup); + loadedDbLabel = new QLabel(tr("nothing loaded"), this); + vboxLayout1->addWidget(loadedDbLabel); + QGroupBox * actionGroup = new QGroupBox(tr("Actions"), centralWidget); + QVBoxLayout * vboxLayout2 = new QVBoxLayout(actionGroup); + vboxLayout->addWidget(actionGroup); + + QHBoxLayout * hboxLayout = new QHBoxLayout(); + + keyManagement = new QPushButton(tr("Key management"), actionGroup); + hboxLayout->addWidget(keyManagement); + revisionBrowser = new QPushButton(tr("Revision browser"), actionGroup); + hboxLayout->addWidget(revisionBrowser); + checkoutRevision = new QPushButton(tr("Checkout revision"), actionGroup); + hboxLayout->addWidget(checkoutRevision); + + vboxLayout2->addLayout(hboxLayout); + + connect( + keyManagement, SIGNAL(clicked()), + dialogManager, SLOT(showKeyManagement()) + ); + + connect( + revisionBrowser, SIGNAL(clicked()), + dialogManager, SLOT(showChangesetBrowser()) + ); + + connect( + checkoutRevision, SIGNAL(clicked()), + dialogManager, SLOT(showCheckoutRevision()) + ); + setCentralWidget(centralWidget); } @@ -93,7 +144,7 @@ void DatabaseWindow::load(const QString // initialize the dialog manager reinterpret_cast(dialogManager)->init(path); - loadedDatabase->setText(tr("Loaded database: %1").arg(path)); + loadedDbLabel->setText(path); QFileInfo fi(path); setWindowTitle( ============================================================ --- src/view/DatabaseWindow.h 4ba5d2d0af75f7731e952719f726d9cf7c5258ad +++ src/view/DatabaseWindow.h 619c1ab06edb685d2db3381db9ea5bb31481c546 @@ -19,8 +19,9 @@ #ifndef DATABASEWINDOW_H #define DATABASEWINDOW_H +#include "vocab.h" #include "MainWindow.h" -#include "vocab.h" +#include "DatabaseVariables.h" #include @@ -38,7 +39,12 @@ protected: protected: DatabaseFile databaseFile; - QLabel * loadedDatabase; + + QLabel * loadedDbLabel; + QPushButton * keyManagement; + QPushButton * revisionBrowser; + QPushButton * checkoutRevision; + DatabaseVariables * databaseVariables; }; #endif ============================================================ --- src/view/WorkspaceWindow.cpp 257bc2a4ed393057d7761a32025204992758ee30 +++ src/view/WorkspaceWindow.cpp 48a6117f48cccebabbcd7f580cc0be2e3ada05ac @@ -242,7 +242,7 @@ void WorkspaceWindow::setup() iconHelp = new IconHelp(this); - dynamic_cast(menuBar) + dynamic_cast(menuBar) ->addDockWidgetAction(iconHelp->toggleViewAction()); }