# # # patch "guitone/res/forms/main_window.ui" # from [ca62158d2f56feb368e19f922bfbd8918ecdf17d] # to [ef1a9dfbacb7e4167ad4180dc8f41274599f975b] # # patch "guitone/res/i18n/guitone_de.ts" # from [a2b57a5346de0c8b0c2839034b50997b93feba2b] # to [2cad7c417c61753edd7b571a949f7672c59589df] # # patch "guitone/src/view/MainWindow.cpp" # from [f2ac93f431c109b163a220a93dbefbb0edee235f] # to [75ef0a8f30ec67021ede4dc87daaa4c9f8b3d9e8] # # patch "guitone/src/view/MainWindow.h" # from [d319300af10d673c50304bee327ec16085dde236] # to [1aad25f68bbe311510475ef28c6650cc4dfff64f] # ============================================================ --- guitone/res/forms/main_window.ui ca62158d2f56feb368e19f922bfbd8918ecdf17d +++ guitone/res/forms/main_window.ui ef1a9dfbacb7e4167ad4180dc8f41274599f975b @@ -5,8 +5,8 @@ 0 0 - 800 - 600 + 924 + 682 @@ -21,19 +21,46 @@ 6 - - - Qt::Horizontal + + + 0 - - - - Qt::Vertical - - - - - + + 6 + + + + + Qt::Horizontal + + + + + Qt::Vertical + + + + + + + + + + <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; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">guitone is in <span style=" font-weight:600;">database mode</span>. This means that only parts of the functionality are available. </p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You can switch back to the <span style=" font-weight:600;">workspace mode</span> at any time by loading a workspace.</p></body></html> + + + Qt::RichText + + + Qt::AlignCenter + + + + @@ -42,7 +69,7 @@ 0 0 - 800 + 924 22 @@ -53,23 +80,6 @@ - - - File - - - - Recent Workspaces - - - - - - - - - - Workspace @@ -103,6 +113,32 @@ + + + File + + + + Recent Databases + + + + + + Recent Workspaces + + + + + + + + + + + + + @@ -270,6 +306,16 @@ I + + + Open Database + + + + + No previous databases available. + + @@ -278,15 +324,15 @@
../AttributesView.h
- InventoryView - QTreeView -
../InventoryView.h
-
- Splitter QSplitter
../Splitter.h
+ + InventoryView + QTreeView +
../InventoryView.h
+
@@ -297,8 +343,8 @@ close() - 399 - 299 + -1 + -1 399 ============================================================ --- guitone/res/i18n/guitone_de.ts a2b57a5346de0c8b0c2839034b50997b93feba2b +++ guitone/res/i18n/guitone_de.ts 2cad7c417c61753edd7b571a949f7672c59589df @@ -529,207 +529,207 @@ MainWindow - + View Ansicht - + Help Hilfe - + Workspace Arbeitsbereich - + File Datei - + Recent Workspaces Vorherige Arbeitsbereiche - + Open Workspace Arbeitsbereich öffnen - + Ctrl+O Strg+O - + No previous workspaces available. Keine vorherigen Arbeitsbereiche verfügbar. - + Preferences.... Einstellungen... - + Ctrl+P Strg+P - + Quit Beenden - + Ctrl+Q Strg+Q - + Hide ignored files Ignorierte Dateien verstecken - + Ctrl+H Strg+H - + All files Alle Dateien - + A A - + All changed files Alle geänderten Dateien - + C G - + Patched files Inhaltlich geänderte Dateien - + P P - + Added files Hinzugefügte Dateien - + N H - + Removed files Entfernte Dateien - + D E - + Renamed files Umbenannte Dateien - + R U - + Missing files Fehlende Dateien - + M F - + Unknown files Unbekannte Dateien - + U K - + Ignored files Ignorierte Dateien - + I I - + Expand tree Baum aufklappen - + Ctrl+T Strg+T - + Switch revision Revision wechseln - + Ctrl+R Strg+R - + Key management Schlüsselverwaltung - + Ctrl+K Strg+K - + About Qt Über Qt - + About guitone Über guitone - + Show Zeige @@ -739,70 +739,94 @@ guitone - ein Frontend für monotone - + Error Fehler - + Critical Monotone Error Kritischer monotone-Fehler - + Select your workspace... Wählen Sie Ihren Arbeitsbereich aus... - + Loading aborted Laden abgebrochen - + Invalid workspace Ungültiger Arbeitsbereich - + The chosen directory is no monotone workspace! Das gewählte Verzeichnis ist kein monotone-Arbeitsverzeichnis! - + Unable to execute command Konnte Kommando nicht ausführen - + Unable to execute '%1' - maybe another command is still running? Konnte '%1' nicht ausführen - eventuell läuft noch ein anderes Kommando? - + Loading workspace... Lade Arbeitsbereich... - + Show ignored files Zeige ignorierte Dateien - + Collapse tree Baum zuklappen - + &%1 %2 &%1 %2 - + The path to the monotone binary is either invalid or points to an older version of monotone. Guitone requires monotone version %1 or a monotone with interface version %2 or later. Der Pfad zur ausführbaren Datei von monotone ist entweder ungültig oder zeigt auf eine ältere Version von monotone. Guitone benötigt monotone Version %1 oder ein monotone mit einer Interface-Version %2 oder neuer. + + + <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; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">guitone is in <span style=" font-weight:600;">database mode</span>. This means that only parts of the functionality are available. </p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You can switch back to the <span style=" font-weight:600;">workspace mode</span> at any time by loading a workspace.</p></body></html> + + + + + Recent Databases + + + + + Open Database + + + + + No previous databases available. + + Monotone ============================================================ --- guitone/src/view/MainWindow.cpp f2ac93f431c109b163a220a93dbefbb0edee235f +++ guitone/src/view/MainWindow.cpp 75ef0a8f30ec67021ede4dc87daaa4c9f8b3d9e8 @@ -43,12 +43,15 @@ MainWindow::MainWindow() : QMainWindow() { gotError = false; + mode = Workspace; } bool MainWindow::init() { setupUi(this); + switchMode(mode); + // catch critical errors from the Monotone class connect( Monotone::singleton(this), SIGNAL(criticalError(const QString &)), @@ -208,6 +211,8 @@ void MainWindow::loadWorkspace(QString f return; } + switchMode(Workspace); + // add the workspace to the recent workspace list // FIXME: the amount of recent workspaces should be made configurable Settings::addItemToList("RecentWorkspaceList", invModel->getNormalizedWorkspaceDir(), 5); @@ -216,6 +221,31 @@ void MainWindow::loadWorkspace(QString f statusBar()->showMessage(tr("Loading workspace..."), 2000 ); } +void MainWindow::on_actionOpen_Database_triggered() +{ + switchMode(Database); +} + +void MainWindow::switchMode(Mode m) +{ + mode = m; + if (mode == Database) + { + modeLabel->setVisible(true); + mainSplitter->setVisible(false); + menuView->setVisible(false); + menuWorkspace->setVisible(false); + } + else + { + modeLabel->setVisible(false); + mainSplitter->setVisible(true); + menuView->setVisible(true); + menuWorkspace->setVisible(true); + } + emit modeChanged(mode); +} + void MainWindow::closeEvent(QCloseEvent *event) { // Do some cleanup before closing down the application ============================================================ --- guitone/src/view/MainWindow.h d319300af10d673c50304bee327ec16085dde236 +++ guitone/src/view/MainWindow.h 1aad25f68bbe311510475ef28c6650cc4dfff64f @@ -36,12 +36,18 @@ public: Q_OBJECT public: + enum Mode { Database, Workspace }; MainWindow(); ~MainWindow(); bool init(); + void switchMode(Mode); + +signals: + void modeChanged(Mode); private slots: void on_actionOpen_Workspace_triggered(); + void on_actionOpen_Database_triggered(); void on_actionHide_ignored_files_triggered(); void on_menuShow_triggered(QAction *); void on_actionExpand_tree_triggered(); @@ -64,6 +70,7 @@ private: InventoryProxyModel *proxyModelFileList; bool gotError; + Mode mode; };