# # # patch "README" # from [7335a349c35d06bcac2e41924d4a16801203d86b] # to [f37daeff38add26a4a05accb433a0c5af7c84924] # # patch "guitone/res/i18n/guitone_de.ts" # from [466778e4a4cdaaf9faa38bcfc5544fe1a76cb74c] # to [a0c30faa571aafe55113adc34e84c2de48a4e3bc] # # patch "guitone/src/main.cpp" # from [3f2c4768e3ad2aec14b588ab1d91178fc238af5c] # to [79bdbb088c2e5bb9eabeaf174d86589beb16e439] # # patch "guitone/src/view/Guitone.cpp" # from [b99995d4a55005ac23cecbc349e04e87259f7c62] # to [c6305b59f96b6d3db7974445d4037ad5ebb6fcd9] # # patch "guitone/src/view/Guitone.h" # from [da337e9ca2767bc6458a7933a8c4786b712fcb22] # to [62ebb4dae534c33e63d59ff6000f3a71ff4b75ab] # # patch "guitone/src/view/dialogs/Preferences.cpp" # from [2e6f7cad2f61b8a74f6c545288efd2ce81ed0921] # to [af5362667100fcffceeb18ef8834226c601281eb] # ============================================================ --- README 7335a349c35d06bcac2e41924d4a16801203d86b +++ README f37daeff38add26a4a05accb433a0c5af7c84924 @@ -6,10 +6,11 @@ to browse through the workspace contents just like a normal file browser, but by displaying additional file status information. -You need Qt >= 4.2 and monotone >= 0.30 (0.29 works as well but has a bug -in the attributes display) to build and later run monotone. +You need Qt >= 4.2 to build and monotone >= 0.32 to run guitone. Earlier +versions do not have all teh infrastructure for certain functionalities +available, but might still work in some areas. -Under Linux / MacOS X just do +To build under Linux / MacOS X just do $ cd /path/to/guitone $ ./build.sh ============================================================ --- guitone/res/i18n/guitone_de.ts 466778e4a4cdaaf9faa38bcfc5544fe1a76cb74c +++ guitone/res/i18n/guitone_de.ts a0c30faa571aafe55113adc34e84c2de48a4e3bc @@ -241,12 +241,12 @@ Guitone - + guitone - a frontend for monotone guitone - ein Frontend für monotone - + &File &Datei @@ -256,7 +256,7 @@ Arbeitsbereich &importieren - + &Quit &Beenden @@ -266,17 +266,17 @@ Bereit - + Select your workspace... Wählen Sie Ihren Arbeitsbereich aus... - + Loading aborted Laden abgebrochen - + Invalid workspace Ungültiger Arbeitsbereich @@ -296,7 +296,7 @@ Das Inventar konnte nicht gelesen werden. Vielleicht läuft noch ein anderer Prozess? - + Loading workspace... Lade Arbeitsbereich... @@ -313,7 +313,7 @@ STRG+Q - + The chosen directory is no monotone workspace! Das gewählte Verzeichnis ist kein monotone-Arbeitsverzeichnis! @@ -323,7 +323,7 @@ &Importiere Arbeitsbereich - + Critical Monotone Error Kritischer monotone-Fehler @@ -334,47 +334,47 @@ STRG+I - + &View &Ansicht - + &Hide ignored files Ignorierte Dateien &verstecken - + &Show ignored files Ignorierte Dateien a&nzeigen - + &Recent Workspaces &Vorherige Arbeitsbereiche - + &Open Workspace Arbeitsbereich &öffnen - + &%1 %2 &%1 %2 - + No previous workspaces available. Keine vorherigen Arbeitsbereiche verfügbar. - + &Workspace &Arbeitsbereich - + &Switch revision Auf andere &Revision aktualisieren @@ -389,45 +389,55 @@ &Schlüsselverwaltung - + About &Qt Über &Qt - + &Help &Hilfe - + &Database &Datenbank - + &Show ancestry graph &Historiengraph anzeigen - + &Preferences... &Einstellungen... - + &Key Management &Schlüsselverwaltung - + 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? + + + 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 later. + Der Pfad zur ausführbaren Datei von monotone ist entweder ungültig oder zeigt auf eine ältere Version von monotone. Guitone benötigt Version %1 oder neuer. + Inventory @@ -853,7 +863,7 @@ korrekt installiert? The entered path is either invalid or points to an older version of monotone. Guitone requires monotone version %1 or later. - Der eingegebene Pfad ist entweder ungültig oder zeigt auf eine ältere Version von monotone. Guitone benötigt Version %1 oder neuer. + Der eingegebene Pfad ist entweder ungültig oder zeigt auf eine ältere Version von monotone. Guitone benötigt Version %1 oder neuer. @@ -875,6 +885,11 @@ korrekt installiert? Binaries (mtn mtn.exe) Ausführbare Dateien (mtn mtn.exe) + + + The path to the monotone binary is either invalid or points to an older version of monotone. Guitone requires monotone version %1 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 Version %1 oder neuer. + PreferencesDialog ============================================================ --- guitone/src/main.cpp 3f2c4768e3ad2aec14b588ab1d91178fc238af5c +++ guitone/src/main.cpp 79bdbb088c2e5bb9eabeaf174d86589beb16e439 @@ -40,6 +40,13 @@ int main(int argc, char** argv) // create and show the main window Guitone *mainWnd = new Guitone(); + + // try initialize the main window + if (!mainWnd->init()) + { + return 1; + } + mainWnd->show(); app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); ============================================================ --- guitone/src/view/Guitone.cpp b99995d4a55005ac23cecbc349e04e87259f7c62 +++ guitone/src/view/Guitone.cpp c6305b59f96b6d3db7974445d4037ad5ebb6fcd9 @@ -42,25 +42,63 @@ Guitone::Guitone() Guitone::Guitone() : QMainWindow() { - gotError = false; - setWindowTitle(tr("guitone - a frontend for monotone")); + gotError = false; +} - // create Inventory model - invModel = new Inventory(this); +bool Guitone::init() +{ + setWindowTitle(tr("guitone - a frontend for monotone")); - // create Attributes model and connect it with the workspace model - attrModel = new Attributes(this); - - // connect to Monotone and catch critical errors - connect( + // catch critical errors from the Monotone class + connect( Monotone::singleton(this), 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 (!Monotone::checkBinaryVersion(Settings::getMtnExePath())) + { + 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 later.") + .arg(Monotone::RequiredVersion), + QMessageBox::Ok, 0, 0 + ); + + Preferences dialog(this); + if (dialog.exec() == QDialog::Rejected) + { + return false; + } + } + + // build the UI and all dependent objects + buildMenu(); + buildModelView(); + buildConnections(); + + // FIXME: doesn't really work... + resize(Settings::getStartupSize()); - // - // Menubar - // - menu = menuBar()->addMenu(tr("&File")); + // load the most recent previous workspace, if there is any + QStringList list = Settings::getItemList("RecentWorkspaceList"); + if (list.size() > 0) + { + loadWorkspace(list[0]); + } + + return true; +} + +Guitone::~Guitone() {} + +void Guitone::buildMenu() +{ + menu = menuBar()->addMenu(tr("&File")); menu->addAction( tr("&Open Workspace"), this, @@ -69,9 +107,7 @@ Guitone::Guitone() ); - // // load recent workspace list - // wsSubMenu = menu->addMenu(tr("&Recent Workspaces")); updatePreviousWorkspacesMenu(); @@ -130,24 +166,24 @@ Guitone::Guitone() qApp, SLOT(aboutQt()) ); +} - - // +void Guitone::buildModelView() +{ + // create the main models + invModel = new Inventory(this); + attrModel = new Attributes(this); + // Main view - // Splitter *mainSplitter = new Splitter(this, "mainSplitter"); - // // ProxyModels - // proxyModelFolderTree = new InventoryProxyModel(this, true); proxyModelFileList = new InventoryProxyModel(this, false); proxyModelFolderTree->setSourceModel(invModel); proxyModelFileList->setSourceModel(invModel); - // // folder tree - // treeView = new InventoryView( mainSplitter, InventoryView::FolderTree, @@ -155,21 +191,8 @@ Guitone::Guitone() ); treeView->setModel(proxyModelFolderTree); - connect( - treeView, SIGNAL(clicked(const QModelIndex &)), - this, SLOT(slotMapFolderTreeToFileList(const QModelIndex &)) - ); - - // the attributes are read every time a file/folder object is selected - connect( - treeView, SIGNAL(clicked(const QModelIndex &)), - attrModel, SLOT(readAttributes(const QModelIndex &)) - ); - - // - // file list view and properties window - // - Splitter *listSplitter = new Splitter(mainSplitter, "listSplitter"); + // file list view and properties window + Splitter *listSplitter = new Splitter(mainSplitter, "listSplitter"); listSplitter->setOrientation(Qt::Vertical); listView = new InventoryView( @@ -179,39 +202,39 @@ Guitone::Guitone() ); listView->setModel(proxyModelFileList); - connect( - listView, SIGNAL(doubleClicked(const QModelIndex &)), - this, SLOT(slotMapFileListToFolderTree(const QModelIndex &)) - ); - - // the attributes are read every time a file/folder object is selected - connect( - listView, SIGNAL(clicked(const QModelIndex &)), - attrModel, SLOT(readAttributes(const QModelIndex &)) - ); - attrView = new AttributesView(listSplitter, "attributesView"); attrView->setModel(attrModel); setCentralWidget(mainSplitter); - - resize(Settings::getStartupSize()); - - // load the most recent previous workspace, if there is any - QStringList list = Settings::getItemList("RecentWorkspaceList"); - if (list.size() > 0) - { - loadWorkspace(list[0]); - } // after laying out everything, restore the splitter views mainSplitter->restoreState(); listSplitter->restoreState(); } +void Guitone::buildConnections() +{ + // the attributes are read every time a file/folder object is selected + connect( + treeView, SIGNAL(clicked(const QModelIndex &)), + attrModel, SLOT(readAttributes(const QModelIndex &)) + ); + connect( + listView, SIGNAL(clicked(const QModelIndex &)), + attrModel, SLOT(readAttributes(const QModelIndex &)) + ); + + // double-click actions on list items (i.e. chdir, file diff, etc.) + connect( + treeView, SIGNAL(clicked(const QModelIndex &)), + this, SLOT(slotMapFolderTreeToFileList(const QModelIndex &)) + ); + connect( + listView, SIGNAL(doubleClicked(const QModelIndex &)), + this, SLOT(slotMapFileListToFolderTree(const QModelIndex &)) + ); +} -Guitone::~Guitone() {} - void Guitone::slotMapFolderTreeToFileList(const QModelIndex &proxyIndex) { QModelIndex index = proxyModelFolderTree->mapToSource(proxyIndex); ============================================================ --- guitone/src/view/Guitone.h da337e9ca2767bc6458a7933a8c4786b712fcb22 +++ guitone/src/view/Guitone.h 62ebb4dae534c33e63d59ff6000f3a71ff4b75ab @@ -39,6 +39,8 @@ public: public: Guitone(); ~Guitone(); + bool init(); + private slots: void chooseWorkspace(); void openRecentWorkspace(); @@ -52,6 +54,9 @@ private: void openKeyManagementDialog(); private: + void buildMenu(); + void buildModelView(); + void buildConnections(); void closeEvent(QCloseEvent *); void loadWorkspace(QString); void updatePreviousWorkspacesMenu(); ============================================================ --- guitone/src/view/dialogs/Preferences.cpp 2e6f7cad2f61b8a74f6c545288efd2ce81ed0921 +++ guitone/src/view/dialogs/Preferences.cpp af5362667100fcffceeb18ef8834226c601281eb @@ -55,8 +55,8 @@ void Preferences::accept() QMessageBox::critical( this, tr("Error"), - tr("The entered path is either invalid " - "or points to an older version of monotone. " + tr("The path to the monotone binary is either invalid " + "or points to an older version of monotone. " "Guitone requires monotone version %1 or later.") .arg(Monotone::RequiredVersion), QMessageBox::Ok, 0, 0