# # # add_file "guitone/src/Guitone.cpp" # content [a48983b8fc37521f84ddf65367a198b9d516ede8] # # add_file "guitone/src/Guitone.h" # content [3d3bd25f8214e1781dbd3adbdaa23cee3ad10b4e] # # patch "guitone/guitone.pro" # from [9b20114423976ef087fecfb8d13866aff121a8f6] # to [73540fd82e20d285acdfbc3069b410942b96cf55] # # patch "guitone/res/forms/main_window.ui" # from [b611a237125bf81911e87b6863d35f9c9c6785f5] # to [34f23a7be62f106aa0ff21ed5cc936a6f0e62495] # # patch "guitone/res/i18n/guitone_de.ts" # from [ba2bb18b98b4f3c34893be1658da9e1ae926b51b] # to [83840573c9977cf20324c545c022e06d18ee8d97] # # patch "guitone/src/main.cpp" # from [43f4662e814165beeb2efdf51d1cc61d29e2595c] # to [7d3deba4170d9e0d60b58b8abdd19c253a7eae0c] # # patch "guitone/src/model/Changeset.h" # from [74dcd9bfe67b89a639def7bea232b997ec810f30] # to [ae1c6b68c80772aa211cd4e62ac09424e25827d7] # # patch "guitone/src/model/GetBranchLog.h" # from [9246d87a81b2746aa9e5b8bc87a2f1b0e4037499] # to [1e715cc307663f44788299c62e564d7eb16a101d] # # patch "guitone/src/view/MainWindow.cpp" # from [59056dbbe09d50ff14081d1e7158cae80178da75] # to [aec19809367c4f89bb4dccf524f35dd8ed108c0f] # # patch "guitone/src/view/MainWindow.h" # from [bf1f12efde46c96a0194070d00a9677c8f29e0cd] # to [c56fc1fb9768759a01093105fa03415d98474522] # ============================================================ --- guitone/src/Guitone.cpp a48983b8fc37521f84ddf65367a198b9d516ede8 +++ guitone/src/Guitone.cpp a48983b8fc37521f84ddf65367a198b9d516ede8 @@ -0,0 +1,267 @@ +/*************************************************************************** + * 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 "Guitone.h" +#include "DebugLog.h" +#include "MainWindow.h" +#include "Monotone.h" +#include "Preferences.h" +#include "Settings.h" + +#include +#include +#include +#include +#include + +void guitoneMsgHandler(QtMsgType type, const char *msg) +{ + switch (type) + { + case QtDebugMsg: + DebugLog::debug(msg); + break; + case QtWarningMsg: + DebugLog::warn(msg); + break; + case QtCriticalMsg: + DebugLog::critical(msg); + break; + case QtFatalMsg: + DebugLog::fatal(msg); + abort(); + } +} + +Guitone::Guitone(int argc, char** argv) : QApplication(argc, argv) +{ + qInstallMsgHandler(guitoneMsgHandler); + + setQuitOnLastWindowClosed(false); + + gotError = false; + + setOrganizationName("Thomas Keller"); + setOrganizationDomain("thomaskeller.biz"); + setApplicationName("guitone"); + + // try to find a suitable locale and setup translations + QString locale = QLocale::system().name(); + QTranslator translator; + + QString transFileName("guitone_" + locale); + if (translator.load(transFileName, ":/i18n")) + { + installTranslator(&translator); + } + + Monotone * mtn = Monotone::singleton(this); + + // catch critical errors from the Monotone class + connect( + mtn, SIGNAL(criticalError(const QString &)), + this, SLOT(criticalMtnError(const QString &)) + ); + + // check the current monotone version and prompt the user + // to enter the correct path if there is a problem + if (!mtn->setMtnBinaryPath(Settings::getMtnBinaryPath())) + { + QMessageBox::critical( + NULL, + tr("Error"), + tr("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.") + .arg(Monotone::RequiredProgramVersion) + .arg(Monotone::RequiredInterfaceVersion), + QMessageBox::Ok, 0, 0 + ); + + Preferences dialog(NULL); + if (dialog.exec() == QDialog::Rejected) + { + return; + } + } + + MainWindow * mainWnd = addWindow(); + mainWnd->loadRecent(); + mainWnd->show(); +} + +Guitone::~Guitone() {} + +void Guitone::criticalMtnError(const QString & msg) +{ + if (gotError == false) + { + gotError = true; + + // restore the normal cursor + restoreOverrideCursor(); + + QMessageBox::critical(NULL, tr("Critical Monotone Error"), + msg, QMessageBox::Ok, 0, 0); + + // TODO: we should disable all views now, or what? + } +} + +void Guitone::loadWorkspace(const QString & path) +{ + MainWindow * wnd = addWindow(); + if (!wnd->doLoadWorkspace(path)) + { + removeWindow(wnd); + return; + } + wnd->show(); +} + +void Guitone::loadDatabase(const QString & path) +{ + MainWindow * wnd = addWindow(); + if (!wnd->doLoadDatabase(path)) + { + removeWindow(wnd); + return; + } + wnd->show(); +} + +void Guitone::windowClosed(MainWindow * wnd) +{ + removeWindow(wnd); + if (openWindows.size() == 0) quit(); +} + +MainWindow * Guitone::addWindow() +{ + QMutexLocker locker(&lock); + + MainWindow * wnd = new MainWindow(); + + connect( + wnd, SIGNAL(quitApplication()), + this, SLOT(quit()) + ); + + connect( + wnd, SIGNAL(loadWorkspace(const QString &)), + this, SLOT(loadWorkspace(const QString &)) + ); + + connect( + wnd, SIGNAL(loadDatabase(const QString &)), + this, SLOT(loadDatabase(const QString &)) + ); + + for (int i=0, j=openWindows.size(); i +#include +#include + +class Guitone : public QApplication +{ + Q_OBJECT + +public: + Guitone(int, char**); + ~Guitone(); + +private slots: + void criticalMtnError(const QString &); + void loadWorkspace(const QString &); + void loadDatabase(const QString &); + void windowClosed(MainWindow *); + void quit(); + +private: + MainWindow * addWindow(); + void removeWindow(MainWindow *); + + bool gotError; + QList openWindows; + QMutex lock; +}; + +#endif + ============================================================ --- guitone/guitone.pro 9b20114423976ef087fecfb8d13866aff121a8f6 +++ guitone/guitone.pro 73540fd82e20d285acdfbc3069b410942b96cf55 @@ -57,7 +57,8 @@ HEADERS += src/view/MainWindow.h \ src/util/Platform.h \ src/util/TreeBuilder.h \ src/util/DebugLog.h \ - src/util/StdioParser.h + src/util/StdioParser.h \ + src/Guitone.h SOURCES += src/view/MainWindow.cpp \ src/view/TreeView.cpp \ src/view/Splitter.cpp \ @@ -104,6 +105,7 @@ SOURCES += src/view/MainWindow.cpp \ src/util/TreeBuilder.cpp \ src/util/DebugLog.cpp \ src/util/StdioParser.cpp \ + src/Guitone.cpp \ src/main.cpp FORMS += res/forms/switch_workspace.ui \ ============================================================ --- guitone/res/forms/main_window.ui b611a237125bf81911e87b6863d35f9c9c6785f5 +++ guitone/res/forms/main_window.ui 34f23a7be62f106aa0ff21ed5cc936a6f0e62495 @@ -128,32 +128,6 @@ You can switch back to the workspace mod 22 - - - File - - - - Recent Databases - - - - - - Recent Workspaces - - - - - - - - - - - - - Help @@ -200,6 +174,34 @@ You can switch back to the workspace mod + + + File + + + + Recent Databases + + + + + + Recent Workspaces + + + + + + + + + + + + + + + @@ -244,6 +246,9 @@ You can switch back to the workspace mod Ctrl+Q + + Qt::ApplicationShortcut + QAction::QuitRole @@ -425,19 +430,27 @@ You can switch back to the workspace mod Ctrl+B + + + Close + + + Ctrl+W + + - Splitter - QSplitter -
../Splitter.h
-
- InventoryView QTreeView
../InventoryView.h
+ Splitter + QSplitter +
../Splitter.h
+
+ AttributesView QTreeView
../AttributesView.h
@@ -448,7 +461,7 @@ You can switch back to the workspace mod - actionQuit + actionClose triggered() MainWindow close() ============================================================ --- guitone/res/i18n/guitone_de.ts ba2bb18b98b4f3c34893be1658da9e1ae926b51b +++ guitone/res/i18n/guitone_de.ts 83840573c9977cf20324c545c022e06d18ee8d97 @@ -1,6 +1,14 @@ + @default + + + Critical Monotone Error + Kritischer monotone-Fehler + + + About @@ -159,22 +167,22 @@ ContentDiff - + %1 (binary) %1 (binär) - + %1 (%2 hunks) %1 (%2 Bereiche) - + Line Zeile - + File/Content Datei/Inhalt @@ -324,6 +332,24 @@ + Guitone + + + Error + Fehler + + + + 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. + + + + Critical Monotone Error + Kritischer monotone-Fehler + + + InventoryItem @@ -593,207 +619,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 @@ -805,120 +831,120 @@ Error - Fehler + Fehler - + Critical Monotone Error - Kritischer monotone-Fehler + 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 + 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? + Konnte '%1' nicht ausführen - eventuell läuft noch ein anderes Kommando? Loading workspace... - Lade Arbeitsbereich... + 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. + 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. - + Recent Databases Vorherige Datenbanken - + Open Database Datenbank öffnen - + No previous databases available. Keine vorherigen geöffneten Datenbanken verfügbar. - + Database Datenbank - + Ctrl+Shift+O Strg+Shift+O - + Loaded database: %1 Geladene Datenbank: %1 - + Select your database... Wählen Sie eine Datenbank aus... - + monotone Databases (*.mtn *.db) monotone-Datenbanken (*.mtn *.db) - + No database loaded Keine Datenbank geladen - + Ctrl+B Strg+B - + Changeset browser Änderungen-Browser @@ -929,6 +955,16 @@ Sie können zum Arbeitsbereich-Modus jed guitone befindet sich im Datenbank-Modus. Das bedeutet, dass nur Teile der Funktionalität verfügbar sind. Sie können zum Arbeitsbereich-Modus jederzeit zurückkehren, indem Sie einen Arbeitsbereich laden. + + + Close + Schließen + + + + Ctrl+W + + Manifest @@ -1095,22 +1131,22 @@ monotone gab zurück: QShortcut - + Ctrl Strg - + Shift Umschalt - + Alt Alt - + Meta Meta ============================================================ --- guitone/src/main.cpp 43f4662e814165beeb2efdf51d1cc61d29e2595c +++ guitone/src/main.cpp 7d3deba4170d9e0d60b58b8abdd19c253a7eae0c @@ -18,63 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "MainWindow.h" -#include "DebugLog.h" +#include "Guitone.h" -#include -#include -#include - -void guitoneMsgHandler(QtMsgType type, const char *msg) -{ - switch (type) - { - case QtDebugMsg: - DebugLog::debug(msg); - break; - case QtWarningMsg: - DebugLog::warn(msg); - break; - case QtCriticalMsg: - DebugLog::critical(msg); - break; - case QtFatalMsg: - DebugLog::fatal(msg); - abort(); - } -} - int main(int argc, char** argv) { - qInstallMsgHandler(guitoneMsgHandler); - QApplication app(argc,argv); - - QCoreApplication::setOrganizationName("Thomas Keller"); - QCoreApplication::setOrganizationDomain("thomaskeller.biz"); - QCoreApplication::setApplicationName("guitone"); - - // try to find a suitable locale and setup translations - QString locale = QLocale::system().name(); - QTranslator translator; - - QString transFileName("guitone_" + locale); - if (translator.load(transFileName, ":/i18n")) - { - app.installTranslator(&translator); - } - - // create and show the main window - MainWindow *mainWnd = new MainWindow(); - - // try initialize the main window - if (!mainWnd->init()) - { - return 1; - } - - mainWnd->show(); - - app.connect(&app, SIGNAL(lastWindowClosed()), mainWnd, SLOT(quit())); + Guitone app(argc,argv); return app.exec(); } ============================================================ --- guitone/src/model/Changeset.h 74dcd9bfe67b89a639def7bea232b997ec810f30 +++ guitone/src/model/Changeset.h ae1c6b68c80772aa211cd4e62ac09424e25827d7 ============================================================ --- guitone/src/model/GetBranchLog.h 9246d87a81b2746aa9e5b8bc87a2f1b0e4037499 +++ guitone/src/model/GetBranchLog.h 1e715cc307663f44788299c62e564d7eb16a101d ============================================================ --- guitone/src/view/MainWindow.cpp 59056dbbe09d50ff14081d1e7158cae80178da75 +++ guitone/src/view/MainWindow.cpp aec19809367c4f89bb4dccf524f35dd8ed108c0f @@ -43,13 +43,9 @@ MainWindow::MainWindow() MainWindow::MainWindow() : QMainWindow() { - gotError = false; mode = None; setAttribute(Qt::WA_MacMetalStyle); -} -bool MainWindow::init() -{ // ensure that the shortcut keys are properly recognized by linguist QShortcut::tr("Ctrl"); QShortcut::tr("Alt"); @@ -57,37 +53,6 @@ bool MainWindow::init() QShortcut::tr("Meta"); setupUi(this); - - Monotone * mtn = Monotone::singleton(this); - - // catch critical errors from the Monotone class - connect( - mtn, SIGNAL(criticalError(const QString &)), - this, SLOT(criticalMtnError(const QString &)) - ); - - // check the current monotone version and prompt the user - // to enter the correct path if there is a problem - if (!mtn->setMtnBinaryPath(Settings::getMtnBinaryPath())) - { - QMessageBox::critical( - this, - tr("Error"), - tr("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.") - .arg(Monotone::RequiredProgramVersion) - .arg(Monotone::RequiredInterfaceVersion), - QMessageBox::Ok, 0, 0 - ); - - Preferences dialog(this); - if (dialog.exec() == QDialog::Rejected) - { - return false; - } - } // create the main models invModel = new Inventory(this); @@ -126,7 +91,12 @@ bool MainWindow::init() treeView, SLOT(changeDirectory(const QModelIndex &)) ); - + // rename the appQuit signal + connect( + actionQuit, SIGNAL(triggered()), + this, SIGNAL(quitApplication()) + ); + // load recent workspace and database lists updatePreviousWorkspacesMenu(); updatePreviousDatabasesMenu(); @@ -149,52 +119,29 @@ bool MainWindow::init() listSplitter->init(); restoreGeometry(Settings::getWindowGeometry("MainWindow")); - - // - // try to load the most recent workspace or database, if there are any - // if everything fails, load nothing and hide the appropriate menus - // +} + +MainWindow::~MainWindow() {} + +// try to load the most recent workspace or database, if there are any +// if everything fails, load nothing and hide the appropriate menus +void MainWindow::loadRecent() +{ QStringList workspaces = Settings::getItemList("RecentWorkspaceList"); - bool something_loaded = workspaces.size() > 0 && loadWorkspace(workspaces[0]); + bool something_loaded = workspaces.size() > 0 && doLoadWorkspace(workspaces[0]); if (!something_loaded) { QStringList databases = Settings::getItemList("RecentDatabaseList"); - something_loaded = databases.size() > 0 && loadDatabase(databases[0]); + something_loaded = databases.size() > 0 && doLoadDatabase(databases[0]); } if (!something_loaded) { switchMode(None); } - - return true; } -MainWindow::~MainWindow() {} - -void MainWindow::quit() -{ - delete this; - Settings::sync(); -} - -void MainWindow::criticalMtnError(const QString & msg) -{ - if (gotError == false) - { - gotError = true; - - // restore the normal cursor - qApp->restoreOverrideCursor(); - - QMessageBox::critical(NULL, tr("Critical Monotone Error"), - msg, QMessageBox::Ok, 0, 0); - - switchMode(None); - } -} - void MainWindow::on_actionOpen_Workspace_triggered() { QString fn = QFileDialog::getExistingDirectory(this, tr("Select your workspace...")); @@ -205,60 +152,47 @@ void MainWindow::on_actionOpen_Workspace return; } - loadWorkspace(fn); + emit loadWorkspace(fn); } -bool MainWindow::loadWorkspace(QString fn) +bool MainWindow::doLoadWorkspace(QString fn) { Monotone * mtn = Monotone::singleton(); if (!mtn->loadWorkspace(fn)) { - QMessageBox::information( + QMessageBox::critical( this, tr("Invalid workspace"), tr("The chosen directory is no monotone workspace!"), QMessageBox::Ok ); + // remove the workspace if it was recorded as recent workspace Settings::removeItemFromList("RecentWorkspaceList", fn); - updatePreviousWorkspacesMenu(); + + emit updatePreviousWorkspacesMenu(); + return false; } - if (!invModel->readInventory()) - { - QMessageBox::information( - this, - tr("Unable to execute command"), - tr("Unable to execute '%1' - maybe another command is still running?").arg("inventory"), - QMessageBox::Ok - ); - return false; - } - switchMode(Workspace); // add the workspace to the recent workspace list // FIXME: the amount of recent workspaces should be made configurable Settings::addItemToList("RecentWorkspaceList", mtn->getNormalizedWorkspacePath(), 5); - updatePreviousWorkspacesMenu(); - statusBar()->showMessage(tr("Loading workspace..."), 2000 ); + emit updatePreviousWorkspacesMenu(); + return true; } -void MainWindow::resizeEvent(QResizeEvent * event) -{ - if (windowState() == Qt::WindowNoState) - curSize = size(); - event->accept(); -} - void MainWindow::closeEvent(QCloseEvent *event) { + // the last closed window sets the geometry for the next one which is opened Settings::setWindowGeometry(saveGeometry(), "MainWindow"); event->accept(); + emit windowClosed(this); } void MainWindow::on_actionOpen_Database_triggered() @@ -276,24 +210,31 @@ void MainWindow::on_actionOpen_Database_ return; } - loadDatabase(fn); + emit loadDatabase(fn); } -bool MainWindow::loadDatabase(QString fn) +bool MainWindow::doLoadDatabase(QString fn) { Monotone * mtn = Monotone::singleton(); + // FIXME: currently a database is always loaded, but not checked + // so this condition can actually never be false if (!mtn->loadDatabase(fn)) { qDebug("Could not load database."); // remove the workspace if it was recorded as recent workspace Settings::removeItemFromList("RecentDatabaseList", fn); + + emit updatePreviousDatabasesMenu(); + return false; } switchMode(Database); Settings::addItemToList("RecentDatabaseList", fn, 5); - updatePreviousDatabasesMenu(); + + emit updatePreviousDatabasesMenu(); + return true; } @@ -386,7 +327,7 @@ void MainWindow::openRecentWorkspace() QAction *action = qobject_cast(sender()); if (action) { - loadWorkspace(action->data().toString()); + emit loadWorkspace(action->data().toString()); } } @@ -396,11 +337,11 @@ void MainWindow::openRecentDatabase() QAction *action = qobject_cast(sender()); if (action) { - loadDatabase(action->data().toString()); + emit loadDatabase(action->data().toString()); } } -void MainWindow::updatePreviousWorkspacesMenu() +void MainWindow::doUpdatePreviousWorkspacesMenu() { // clear previous actions menuRecent_Workspaces->clear(); @@ -426,7 +367,7 @@ void MainWindow::updatePreviousWorkspace } } -void MainWindow::updatePreviousDatabasesMenu() +void MainWindow::doUpdatePreviousDatabasesMenu() { // clear previous actions menuRecent_Databases->clear(); @@ -461,12 +402,6 @@ void MainWindow::on_actionSwitch_revisio dialog.execDocumentModal(); } -void MainWindow::on_actionPreferences_triggered() -{ - Preferences dialog(this); - dialog.exec(); -} - void MainWindow::on_actionKey_management_triggered() { KeyManagement dialog(this); @@ -479,6 +414,14 @@ void MainWindow:: on_actionChangeset_bro dialog.execDocumentModal(); } +// FIXME: the next two handlers should probably ensure that the according dialog +// is only opened once per application +void MainWindow::on_actionPreferences_triggered() +{ + Preferences dialog(this); + dialog.exec(); +} + void MainWindow::on_actionAbout_guitone_triggered() { About dialog(this); ============================================================ --- guitone/src/view/MainWindow.h bf1f12efde46c96a0194070d00a9677c8f29e0cd +++ guitone/src/view/MainWindow.h c56fc1fb9768759a01093105fa03415d98474522 @@ -39,12 +39,25 @@ public: enum Mode { Database, Workspace, None }; MainWindow(); ~MainWindow(); - bool init(); + void loadRecent(); void switchMode(Mode); + bool doLoadWorkspace(QString); + bool doLoadDatabase(QString); + +public slots: + void doUpdatePreviousWorkspacesMenu(); + void doUpdatePreviousDatabasesMenu(); + signals: void modeChanged(Mode); - + void windowClosed(MainWindow *); + void quitApplication(); + void updatePreviousWorkspacesMenu(); + void updatePreviousDatabasesMenu(); + void loadDatabase(const QString &); + void loadWorkspace(const QString &); + private slots: void on_actionOpen_Workspace_triggered(); void on_actionOpen_Database_triggered(); @@ -60,25 +73,15 @@ private slots: void openRecentWorkspace(); void openRecentDatabase(); - void criticalMtnError(const QString &); - void quit(); - + private: void closeEvent(QCloseEvent *); - void resizeEvent(QResizeEvent * event); - bool loadWorkspace(QString); - bool loadDatabase(QString); - void updatePreviousWorkspacesMenu(); - void updatePreviousDatabasesMenu(); Inventory *invModel; Attributes *attrModel; InventoryProxyModel *proxyModelFolderTree; InventoryProxyModel *proxyModelFileList; - - Mode mode; - QSize curSize; - bool gotError; + Mode mode; };