diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-12-30 13:39:18 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-12-30 13:39:18 +0000 |
commit | ee90eb54f7c3d72c8666644ebc97ea0a3e69e299 (patch) | |
tree | bd8975139ec20175ce79513620df4a0f3979d5db | |
parent | added confirmation box for import keys through drop in keylist. Also added th... (diff) | |
download | gpg4usb-ee90eb54f7c3d72c8666644ebc97ea0a3e69e299.tar.gz gpg4usb-ee90eb54f7c3d72c8666644ebc97ea0a3e69e299.zip |
corrected behaviour of confirmation dialog on key import
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@413 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | keylist.cpp | 25 | ||||
-rw-r--r-- | keylist.h | 1 |
2 files changed, 8 insertions, 18 deletions
diff --git a/keylist.cpp b/keylist.cpp index 23bc10a..3b1348d 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -170,7 +170,6 @@ void KeyList::dropEvent(QDropEvent* event) QDialog *dialog = new QDialog(); dialog->setWindowTitle(tr("Import Keys")); - dialog->setModal(true); QLabel *label; label = new QLabel(tr("Import keys from dropped files, if possible?")); @@ -193,17 +192,17 @@ void KeyList::dropEvent(QDropEvent* event) if (settings.value("general/confirmImportKeys",Qt::Checked).toBool()) { dialog->exec(); - } + if (dialog->result() == QDialog::Rejected) { + return; + } + if (checkBox->isChecked()){ + settings.setValue("general/confirmImportKeys", false); + } else { + settings.setValue("general/confirmImportKeys", true); - if (dialog->result() == QDialog::Rejected) { - return; + } } - if (checkBox->isChecked()){ - settings.setValue("general/confirmImportKeys", Qt::Unchecked); - } else { - settings.setValue("general/confirmImportKeys", Qt::Checked); - } if (event->mimeData()->hasUrls()) { @@ -216,14 +215,10 @@ void KeyList::dropEvent(QDropEvent* event) } QByteArray inBuffer = file.readAll(); mCtx->importKey(inBuffer); - - qDebug() << tmp.toString(); } } else { QByteArray inBuffer(event->mimeData()->text().toUtf8()); mCtx->importKey(inBuffer); - - qDebug() << event->mimeData()->text(); } @@ -235,7 +230,3 @@ void KeyList::dragEnterEvent(QDragEnterEvent *event) event->acceptProposedAction(); } -void KeyList::dropAction() -{ - qDebug() << "own action"; -} @@ -57,7 +57,6 @@ private: QTableWidget *mKeyList; QString iconPath; QMenu *popupMenu; - void dropAction(); protected: void contextMenuEvent(QContextMenuEvent *event); |