diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-05-22 02:06:13 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2015-05-22 02:06:13 +0200 |
commit | 166a24ea0a495d3f4e69b8ea8c1729b01d9f168a (patch) | |
tree | 249dfc7e7c40b136b43919d1548e71d54b1c50fe | |
parent | 2a5b7e26a07bcb53f32c8f4b90ad566a3a3912ff (diff) |
plumbing and some text
-rw-r--r-- | dialog.cpp | 19 | ||||
-rw-r--r-- | mainwindow.cpp | 8 | ||||
-rw-r--r-- | mainwindow.h | 1 |
3 files changed, 24 insertions, 4 deletions
@@ -21,6 +21,9 @@ Dialog::Dialog(MainWindow *parent) : */ Dialog::~Dialog() { + mainWindow->setGitExecutable(ui->gitPath->text()); + mainWindow->setGpgExecutable(ui->gpgPath->text()); + mainWindow->setPassExecutable(ui->passPath->text()); } /** @@ -355,15 +358,20 @@ void Dialog::addGPGId(bool addGPGId) void Dialog::wizard() { - if(!QFile(ui->gpgPath->text()).exists()){ + mainWindow->checkConfig(); + +// QString gpg = ui->gpgPath->text(); + QString gpg = mainWindow->getGpgExecutable(); + if(!QFile(gpg).exists()){ QMessageBox::critical(this, tr("GnuPG not found"), - tr("Please install GnuPG on your system.\nhttps://www.gnupg.org/download/")); - // TODO REST + tr("Please install GnuPG on your system.<br>Install <strong>gpg</strong> using your favorite package manager<br>or <a href=\"https://www.gnupg.org/download/#sec-1-2\">download</a> it from GnuPG.org")); + + // TODO REST ? } QStringList names = mainWindow->getSecretKeys(); //qDebug() << names; - if (names.empty()) { + if (QFile(gpg).exists() && names.empty()) { QMessageBox::critical(this, tr("Secret key not found"), tr("You can not encrypt :(")); // TODO have usable gpg id wizrd :P @@ -377,4 +385,7 @@ void Dialog::wizard() } // Can you use the store? + + + ui->gpgPath->setText(gpg); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 5dfbbaf8..27bcd6e4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -544,6 +544,14 @@ void MainWindow::setGpgExecutable(QString path) { } /** + * @brief MainWindow::getGpgExecutable + * @return + */ +QString MainWindow::getGpgExecutable() { + return gpgExecutable; +} + +/** * @brief MainWindow::on_configButton_clicked */ void MainWindow::on_configButton_clicked() diff --git a/mainwindow.h b/mainwindow.h index db27403b..ef57b6a0 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -38,6 +38,7 @@ public: void setPassExecutable(QString); void setGitExecutable(QString); void setGpgExecutable(QString); + QString getGpgExecutable(); bool checkConfig(); void setApp(SingleApplication* app); void setText(QString); |