summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2014-07-31 15:56:59 +0200
committerAnne Jan Brouwer <ajbrouwer@totalactivemedia.nl>2014-07-31 15:56:59 +0200
commit86a6b3ba28919e13ecaa4ff67a602542035a9058 (patch)
tree5d202c64821ae789025ce15b9ec984cf3b8f85f7 /main.cpp
parent2aba44d04c76984f8c96a7c4cff36722f0e5ff76 (diff)
pass less pass
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index 1996b368..96e85e11 100644
--- a/main.cpp
+++ b/main.cpp
@@ -14,11 +14,34 @@ int main(int argc, char *argv[])
testProcess->waitForFinished();
if (testProcess->exitCode() == 0) {
w.setPassExecutable(testProcess->readAllStandardOutput());
- w.show();
- return app.exec();
} else {
- QMessageBox msgBox;
- msgBox.setText("Please install pass from http://www.passwordstore.org/");
- msgBox.exec();
+ w.setPassExecutable("");
+ //QMessageBox msgBox;
+ //msgBox.setText("Please install pass from http://www.passwordstore.org/");
+ //msgBox.exec();
+ testProcess->start("which git");
+ testProcess->waitForFinished();
+ if (testProcess->exitCode() != 0) {
+ QMessageBox msgBox;
+ msgBox.setText("Please install git");
+ msgBox.exec();
+ return 1;
+ }
+ w.setGitExecutable(testProcess->readAllStandardOutput());
+ testProcess->start("which gpg2");
+ testProcess->waitForFinished();
+ if (testProcess->exitCode() != 0) {
+ testProcess->start("which gpg");
+ testProcess->waitForFinished();
+ if (testProcess->exitCode() != 0) {
+ QMessageBox msgBox;
+ msgBox.setText("Please install gpg");
+ msgBox.exec();
+ // return 1;
+ }
+ }
+ w.setGpgExecutable(testProcess->readAllStandardOutput());
}
+ w.show();
+ return app.exec();
}