summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2015-05-22 02:06:13 +0200
committerAnne Jan Brouwer <brouwer@annejan.com>2015-05-22 02:06:13 +0200
commit166a24ea0a495d3f4e69b8ea8c1729b01d9f168a (patch)
tree249dfc7e7c40b136b43919d1548e71d54b1c50fe
parent2a5b7e26a07bcb53f32c8f4b90ad566a3a3912ff (diff)
plumbing and some text
-rw-r--r--dialog.cpp19
-rw-r--r--mainwindow.cpp8
-rw-r--r--mainwindow.h1
3 files changed, 24 insertions, 4 deletions
diff --git a/dialog.cpp b/dialog.cpp
index 850d6d72..2078f5cf 100644
--- a/dialog.cpp
+++ b/dialog.cpp
@@ -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);