diff options
author | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-05-27 01:50:53 +0200 |
---|---|---|
committer | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-05-27 01:50:53 +0200 |
commit | cbb502768a28642de2458603cf79e70d4cc078ca (patch) | |
tree | 950eb7d135dfa2325c7fb765f114158443e08c6c | |
parent | 65a383257ef3aa615d613a799b9057adbc2f563c (diff) |
more wizardly things
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | dialog.cpp | 11 | ||||
-rw-r--r-- | mainwindow.cpp | 11 | ||||
-rw-r--r-- | mainwindow.h | 2 |
4 files changed, 23 insertions, 4 deletions
@@ -52,9 +52,10 @@ Known issues Planned features ---------------- +* Re-encryption after users-change (optional ofcourse) * Showing path in Add and Edit screen (currently sometimes confusing where I'm adding this password) * Right click handlers for file/folder and content -* First use wizards to set up password-store (and decryption key, currently always the gpg default key) +* ~~first use wizards to set up password-store (and decryption key, currently always the gpg default key)~~ * Profiles (to allow use of multiple password stores and decryption keys) with dropdown in main screen * Password generation with options for what kind you'd like * Templates (username, url etc) in Add / Edit screen (configurable templates) @@ -210,7 +210,7 @@ void Dialog::on_toolButtonPass_clicked() void Dialog::on_toolButtonStore_clicked() { QString store = selectFolder(); - if (store != "") { + if (store != "") { // TODO call check ui->storePath->setText(store); } } @@ -384,7 +384,14 @@ void Dialog::wizard() if(!QFile(passStore + ".gpg-id").exists()){ QMessageBox::critical(this, tr("Password store not initialised"), tr("The folder %1 doesn't seem to be a password store or is not yet initialised.").arg(passStore)); - // TODO REST + while(!QFile(passStore).exists()) { + on_toolButtonStore_clicked(); + } + if (!QFile(passStore + ".gpg-id").exists()) { + // apears not to be store + // init yes / no ? + mainWindow->userDialog(passStore); + } } // Can you use the store? diff --git a/mainwindow.cpp b/mainwindow.cpp index 341fe829..edb2a976 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -340,6 +340,7 @@ QString MainWindow::getFile(const QModelIndex &index, bool forPass) */ void MainWindow::on_treeView_clicked(const QModelIndex &index) { + currentDir = getDir(ui->treeView->currentIndex(), false); lastDecrypt = "Could not decrypt"; QString file = getFile(index, usePass); if (!file.isEmpty()){ @@ -826,6 +827,14 @@ QList<UserInfo> MainWindow::listKeys(QString keystring, bool secret) return users; } +void MainWindow::userDialog(QString dir) +{ + if (!dir.isEmpty()) { + currentDir = dir; + } + on_usersButton_clicked(); +} + void MainWindow::on_usersButton_clicked() { QList<UserInfo> users = listKeys(); @@ -841,7 +850,7 @@ void MainWindow::on_usersButton_clicked() } } QList<UserInfo> selected_users; - QString dir = getDir(ui->treeView->currentIndex(), false); + QString dir = currentDir.isEmpty()?getDir(ui->treeView->currentIndex(), false):currentDir; int count = 0; QString recipients = getRecipientString(dir.isEmpty() ? "" : dir, " ", &count); if (!recipients.isEmpty()) { diff --git a/mainwindow.h b/mainwindow.h index ddae9202..e5b8b337 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -44,6 +44,7 @@ public: void setText(QString); QStringList getSecretKeys(); void genKey(QString, QDialog *); + void userDialog(QString = ""); private slots: void on_updateButton_clicked(); @@ -96,6 +97,7 @@ private: QQueue<execQueueItem> *execQueue; bool firstRun; QDialog *keygen = 0; + QString currentDir; void updateText(); void executePass(QString, QString = QString()); void executeWrapper(QString, QString, QString = QString()); |