# # # patch "src/view/dialogs/KeyManagement.cpp" # from [445609b72e2b33032823410e5652602aa350677c] # to [8260150c6e6d65065d01bbb1efb0bb32504454e3] # # patch "src/view/dialogs/Preferences.cpp" # from [4f3d46e215748754366bafc460894a91b6febc34] # to [7e739db6cbaa3d580ae5fd48c50e7ff022b8d64e] # # patch "src/view/dialogs/Preferences.h" # from [98a305269f03ee3cf23aba0388f44f93e8b22b0e] # to [158ed167709f8220efc4d958319c8a60da2eaa45] # ============================================================ --- src/view/dialogs/KeyManagement.cpp 445609b72e2b33032823410e5652602aa350677c +++ src/view/dialogs/KeyManagement.cpp 8260150c6e6d65065d01bbb1efb0bb32504454e3 @@ -21,7 +21,7 @@ #include "KeyManagement.h" #include "GenerateKeypair.h" #include "MonotoneManager.h" -#include "Guitone.h" +#include "Settings.h" #include #include @@ -114,7 +114,7 @@ void KeyManagement::copyPubkeyDataToClip QByteArray output; args << "-d" << databaseFile << "pubkey" << key->name; - if (!APP->manager()->singleRun(args, output)) + if (!MonotoneManager::singleRun(Settings::getMtnBinaryPath(), args, output)) { QMessageBox::critical( this, ============================================================ --- src/view/dialogs/Preferences.cpp 4f3d46e215748754366bafc460894a91b6febc34 +++ src/view/dialogs/Preferences.cpp 7e739db6cbaa3d580ae5fd48c50e7ff022b8d64e @@ -19,33 +19,34 @@ ***************************************************************************/ #include "Preferences.h" -#include "Monotone.h" +#include "MonotoneManager.h" #include "Settings.h" #include "DebugLog.h" +#include "Guitone.h" #include #include #include -Preferences::Preferences(QWidget* parent) : Dialog(parent) +Preferences::Preferences(QWidget * parent) : Dialog(parent) { setupUi(this); Dialog::init(); - + mtnExecutablePath->setText(Settings::getMtnBinaryPath()); - + enableConsoleLog->setCheckState(DebugLog::getConsoleLogEnabled() ? Qt::Checked : Qt::Unchecked); enableFileLog->setCheckState(DebugLog::getFileLogEnabled() ? Qt::Checked : Qt::Unchecked); - + enableFileLog->setText(enableFileLog->text().arg(DebugLog::logFilePath())); - + logLevel->addItem(tr("Very low (only fatal)"), 1); logLevel->addItem(tr("Low (critical)"), 2); logLevel->addItem(tr("Medium (warnings)"), 3); logLevel->addItem(tr("High (info messages)"), 4); - + int lvl = DebugLog::getLogLevel(); #ifndef QT_NO_DEBUG logLevel->addItem(tr("Very high (debug messages)"), 5); @@ -54,12 +55,12 @@ Preferences::Preferences(QWidget* parent #endif logLevel->setCurrentIndex(lvl - 1); - + checkForUpdates->setCheckState( Settings::getBool("CheckForUpdates", true) ? Qt::Checked : Qt::Unchecked ); - + connect( selectMtnExecutable, SIGNAL(clicked()), this, SLOT(openFileBrowser()) @@ -72,53 +73,50 @@ void Preferences::accept() { QString oldPath = Settings::getMtnBinaryPath(); QString newPath = mtnExecutablePath->text(); - + QString installedVersion; + // check if the new executable satisfies our version needs // we'll first check the program's plain version and if this // does not succeed we check for the interface version - if (!Monotone::checkInterfaceVersion(newPath)) + if (!APP->manager()->setMonotoneBinaryPath(newPath, installedVersion)) { QMessageBox::critical( this, tr("Error"), tr("The path to the monotone binary is either invalid " - "or points to a version of monotone with which guitone can't " - "work with. Guitone requires monotone with an interface version " - "between %2 and %3. You can check the interface version of " - "your monotone installation by executing " - "`mtn automate interface_version`.") - .arg(Monotone::MinInterfaceVersion) - .arg(Monotone::MaxInterfaceVersion), + "or points to a version of monotone with which guitone can't " + "work with. Guitone requires monotone with an interface version " + "between '%1' and '%2'. Your installation has the interface " + "version '%3'.") + .arg(MonotoneManager::MinInterfaceVersion) + .arg(MonotoneManager::MaxInterfaceVersion) + .arg(installedVersion), QMessageBox::Ok, 0, 0 ); return; } - - + if (oldPath != newPath) { QMessageBox::information( this, tr("Notice"), - tr("You need to reload your current " - "workspace or restart guitone to use " - "the new monotone binary."), + tr("You need to restart guitone to use the new monotone binary."), QMessageBox::Ok ); - Settings::setMtnBinaryPath(newPath); } - + bool consoleEnabled = enableConsoleLog->isChecked(); bool fileEnabled = enableFileLog->isChecked(); int level = logLevel->itemData(logLevel->currentIndex()).toInt(); - + DebugLog::setConsoleLogEnabled(consoleEnabled); DebugLog::setFileLogEnabled(fileEnabled); DebugLog::setLogLevel(level); Settings::setBool("CheckForUpdates", checkForUpdates->isChecked()); - + done(QDialog::Accepted); } @@ -130,7 +128,7 @@ void Preferences::openFileBrowser() "", tr("Binaries (mtn mtn.exe)") ); - + if (!file.isEmpty()) { mtnExecutablePath->setText(file); ============================================================ --- src/view/dialogs/Preferences.h 98a305269f03ee3cf23aba0388f44f93e8b22b0e +++ src/view/dialogs/Preferences.h 158ed167709f8220efc4d958319c8a60da2eaa45 @@ -26,12 +26,11 @@ class Preferences : public Dialog, priva class Preferences : public Dialog, private Ui::PreferencesDialog { - Q_OBJECT - + Q_OBJECT public: - Preferences(QWidget*); - ~Preferences(); - + Preferences(QWidget *); + ~Preferences(); + private slots: void openFileBrowser(); void accept();