diff options
author | Saturneric <[email protected]> | 2021-06-26 18:32:15 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-06-26 18:32:15 +0000 |
commit | 009fa10af30f3f08e7a3ee986c937f82ce00e38a (patch) | |
tree | 2465e9a252c2df481ce5c0e4b172059980d9a001 /src/ui/main_window/MainWindowSlotFunction.cpp | |
parent | Reply work. (diff) | |
download | GpgFrontend-009fa10af30f3f08e7a3ee986c937f82ce00e38a.tar.gz GpgFrontend-009fa10af30f3f08e7a3ee986c937f82ce00e38a.zip |
Develop File Opera Functions
Diffstat (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowSlotFunction.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index dcfac10b..023b3d73 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -84,13 +84,13 @@ void MainWindow::slotSign() { mKeyList->getPrivateCheckedKeys(keys); if (keys.isEmpty()) { - QMessageBox::critical(nullptr, tr("No Key Selected"), tr("No Key Selected")); + QMessageBox::critical(this, tr("No Key Selected"), tr("No Key Selected")); return; } for (const auto &key : keys) { if (!GpgME::GpgContext::checkIfKeyCanSign(key)) { - QMessageBox::information(nullptr, + QMessageBox::information(this, tr("Invalid Operation"), tr("The selected key contains a key that does not actually have a signature usage.<br/>") + tr("<br/>For example the Following Key: <br/>") + key.uids.first().uid); @@ -255,7 +255,7 @@ void MainWindow::slotFileEncrypt() { QFileInfo fileInfo(path); if(!fileInfo.isFile()) { - QMessageBox::critical(this, tr("Error"), tr("Can only encrypt a file.")); + QMessageBox::critical(this, tr("Error"), tr("Select a file before doing it.")); return; } if(!fileInfo.isReadable()) { @@ -276,9 +276,14 @@ void MainWindow::slotFileEncrypt() { mKeyList->getCheckedKeys(keys); + if(keys.empty()) { + QMessageBox::critical(this, tr("No Key Selected"), tr("No Key Selected")); + return; + } + for (const auto &key : keys) { if (!GpgME::GpgContext::checkIfKeyCanEncr(key)) { - QMessageBox::information(nullptr, + QMessageBox::information(this, tr("Invalid Operation"), tr("The selected key contains a key that does not actually have a encrypt usage.<br/>") + tr("<br/>For example the Following Key: <br/>") + key.uids.first().uid); @@ -403,3 +408,7 @@ void MainWindow::slotDecryptVerify() { delete resultAnalyseDecrypt; delete resultAnalyseVerify; } + +void MainWindow::slotOpenFile(QString &path) { + edit->slotOpenFile(path); +} |