projects
/
secretnotes
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modify Change Password menu action.
[secretnotes]
/
src
/
mainwindow.cpp
diff --git
a/src/mainwindow.cpp
b/src/mainwindow.cpp
index
9d8a7c9
..
8566b73
100644
(file)
--- a/
src/mainwindow.cpp
+++ b/
src/mainwindow.cpp
@@
-47,6
+47,10
@@
MainWindow::MainWindow(QWidget *parent) :
connect(undoEditAction,SIGNAL(triggered()), this, SLOT(undoEdit()));
on_textEdit_undoAvailable(false);
connect(undoEditAction,SIGNAL(triggered()), this, SLOT(undoEdit()));
on_textEdit_undoAvailable(false);
+ changePasswordAction = ui->menuOptions->addAction(tr("Change password"));
+ connect(changePasswordAction, SIGNAL(triggered()), this, SLOT(on_actionChange_password_triggered()));
+ enableChangePasswordAction(false);
+
/* the secret notes file is stored in user home directory */
filePath = QDir::fromNativeSeparators(QDir::homePath());
/* the secret notes file is stored in user home directory */
filePath = QDir::fromNativeSeparators(QDir::homePath());
@@
-172,6
+176,7
@@
void MainWindow::readFile()
plaintext = decoded;
ui->textEdit->setPlainText(plaintext);
enableTextEdit(true);
plaintext = decoded;
ui->textEdit->setPlainText(plaintext);
enableTextEdit(true);
+ enableChangePasswordAction(true);
}
decoded.fill(0);
}
}
decoded.fill(0);
}
@@
-321,6
+326,7
@@
void MainWindow::askNewPassword()
QString pass = dialog.getPassword();
setPassword(pass);
pass.fill(0);
QString pass = dialog.getPassword();
setPassword(pass);
pass.fill(0);
+ enableChangePasswordAction(true);
return;
}
}
return;
}
}
@@
-350,3
+356,8
@@
void MainWindow::enableResetAction(bool b)
{
resetAction->setVisible(b);
}
{
resetAction->setVisible(b);
}
+
+void MainWindow::enableChangePasswordAction(bool b)
+{
+ changePasswordAction->setVisible(b);
+}