diff options
author | nils <[email protected]> | 2016-02-07 13:04:17 +0000 |
---|---|---|
committer | nils <[email protected]> | 2016-02-07 13:04:17 +0000 |
commit | f94e3f2b3cd982f825d5e485834ea9389060adaa (patch) | |
tree | f99d95c9164aef16e05164aa1ac7fb10bcbc1f5e | |
parent | encrypt to self (diff) | |
download | gpg4usb-f94e3f2b3cd982f825d5e485834ea9389060adaa.tar.gz gpg4usb-f94e3f2b3cd982f825d5e485834ea9389060adaa.zip |
refactored slots and signals
-rw-r--r-- | attachments.cpp | 4 | ||||
-rw-r--r-- | attachments.h | 2 | ||||
-rw-r--r-- | editorpage.cpp | 2 | ||||
-rw-r--r-- | editorpage.h | 2 | ||||
-rwxr-xr-x | fileencryptiondialog.cpp | 22 | ||||
-rwxr-xr-x | fileencryptiondialog.h | 10 | ||||
-rw-r--r-- | gpgcontext.cpp | 12 | ||||
-rw-r--r-- | gpgcontext.h | 4 | ||||
-rw-r--r-- | helppage.cpp | 4 | ||||
-rw-r--r-- | helppage.h | 2 | ||||
-rw-r--r-- | keydetailsdialog.cpp | 8 | ||||
-rw-r--r-- | keydetailsdialog.h | 4 | ||||
-rw-r--r-- | keygendialog.cpp | 12 | ||||
-rw-r--r-- | keygendialog.h | 6 | ||||
-rw-r--r-- | keygenthread.h | 2 | ||||
-rw-r--r-- | keylist.cpp | 6 | ||||
-rw-r--r-- | keylist.h | 2 | ||||
-rwxr-xr-x | keymgmt.cpp | 46 | ||||
-rwxr-xr-x | keymgmt.h | 22 | ||||
-rw-r--r-- | keyserverimportdialog.cpp | 28 | ||||
-rw-r--r-- | keyserverimportdialog.h | 13 | ||||
-rw-r--r-- | mainwindow.cpp | 176 | ||||
-rw-r--r-- | mainwindow.h | 50 | ||||
-rwxr-xr-x | quitdialog.cpp | 4 | ||||
-rwxr-xr-x | quitdialog.h | 2 | ||||
-rw-r--r-- | textedit.cpp | 68 | ||||
-rw-r--r-- | textedit.h | 42 | ||||
-rw-r--r-- | verifydetailsdialog.cpp | 6 | ||||
-rw-r--r-- | verifydetailsdialog.h | 2 | ||||
-rw-r--r-- | verifykeydetailbox.cpp | 6 | ||||
-rw-r--r-- | verifykeydetailbox.h | 2 | ||||
-rw-r--r-- | verifynotification.cpp | 14 | ||||
-rw-r--r-- | verifynotification.h | 6 | ||||
-rw-r--r-- | wizard.cpp | 38 | ||||
-rw-r--r-- | wizard.h | 16 |
35 files changed, 322 insertions, 323 deletions
diff --git a/attachments.cpp b/attachments.cpp index 8158da6..a30f33e 100644 --- a/attachments.cpp +++ b/attachments.cpp @@ -78,7 +78,7 @@ void Attachments::createActions() saveFileAct = new QAction(tr("Save File"), this); saveFileAct->setToolTip(tr("Save this file")); saveFileAct->setIcon(QIcon(":filesave.png")); - connect(saveFileAct, SIGNAL(triggered()), this, SLOT(saveFile())); + connect(saveFileAct, SIGNAL(triggered()), this, SLOT(slotSaveFile())); openFileAct = new QAction(tr("Open File"), this); openFileAct->setToolTip(tr("Open this file")); @@ -87,7 +87,7 @@ void Attachments::createActions() } -void Attachments::saveFile() +void Attachments::slotSaveFile() { QModelIndexList indexes = tableView->selectionModel()->selection().indexes(); diff --git a/attachments.h b/attachments.h index 895c592..7b07634 100644 --- a/attachments.h +++ b/attachments.h @@ -45,7 +45,7 @@ class Attachments : public QWidget Q_OBJECT public slots: - void saveFile(); + void slotSaveFile(); void openFile(); public: diff --git a/editorpage.cpp b/editorpage.cpp index b057f8b..28926a9 100644 --- a/editorpage.cpp +++ b/editorpage.cpp @@ -73,7 +73,7 @@ void EditorPage::closeNoteByClass(const char *className) } } -void EditorPage::formatGpgHeader() { +void EditorPage::slotFormatGpgHeader() { QString content = textPage->toPlainText(); diff --git a/editorpage.h b/editorpage.h index 0a1fb55..d5222cf 100644 --- a/editorpage.h +++ b/editorpage.h @@ -95,7 +95,7 @@ private slots: /** * @details Format the gpg header in another font-style */ - void formatGpgHeader(); + void slotFormatGpgHeader(); }; #endif // __TEXTPAGE_H__ diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp index ded8335..2e3a844 100755 --- a/fileencryptiondialog.cpp +++ b/fileencryptiondialog.cpp @@ -40,7 +40,7 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k setModal(true); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(executeAction())); + connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotExecuteAction())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QGroupBox *groupBox1 = new QGroupBox(tr("File")); @@ -49,13 +49,13 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k /* Setup input & Outputfileselection*/ inputFileEdit = new QLineEdit(); QPushButton *fb1 = new QPushButton("..."); - connect(fb1, SIGNAL(clicked()), this, SLOT(selectInputFile())); + connect(fb1, SIGNAL(clicked()), this, SLOT(slotSelectInputFile())); QLabel *fl1 = new QLabel(tr("Input")); fl1->setBuddy(inputFileEdit); outputFileEdit = new QLineEdit(); QPushButton *fb2 = new QPushButton("..."); - connect(fb2, SIGNAL(clicked()), this, SLOT(selectOutputFile())); + connect(fb2, SIGNAL(clicked()), this, SLOT(slotSelectOutputFile())); QLabel *fl2 = new QLabel(tr("Output")); fl2->setBuddy(outputFileEdit); @@ -76,9 +76,9 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k /* Setup Action */ radioEnc = new QRadioButton(tr("&Encrypt")); - connect(radioEnc, SIGNAL(clicked()), this, SLOT(showKeyList())); + connect(radioEnc, SIGNAL(clicked()), this, SLOT(slotShowKeyList())); radioDec = new QRadioButton(tr("&Decrypt")); - connect(radioDec, SIGNAL(clicked()), this, SLOT(hideKeyList())); + connect(radioDec, SIGNAL(clicked()), this, SLOT(slotHideKeyList())); radioDec->setChecked(true); QHBoxLayout *hbox1 = new QHBoxLayout(); @@ -99,13 +99,13 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k setLayout(vbox2); if(action == Encrypt) { - showKeyList(); + slotShowKeyList(); } exec(); } -void FileEncryptionDialog::selectInputFile() +void FileEncryptionDialog::slotSelectInputFile() { QString path = ""; if (inputFileEdit->text().size() > 0) { @@ -132,7 +132,7 @@ void FileEncryptionDialog::selectInputFile() } } -void FileEncryptionDialog::selectOutputFile() +void FileEncryptionDialog::slotSelectOutputFile() { QString path = ""; if (outputFileEdit->text().size() > 0) { @@ -144,7 +144,7 @@ void FileEncryptionDialog::selectOutputFile() } -void FileEncryptionDialog::executeAction() +void FileEncryptionDialog::slotExecuteAction() { QFile infile; @@ -191,12 +191,12 @@ void FileEncryptionDialog::executeAction() accept(); } -void FileEncryptionDialog::showKeyList() +void FileEncryptionDialog::slotShowKeyList() { mKeyList->show(); } -void FileEncryptionDialog::hideKeyList() +void FileEncryptionDialog::slotHideKeyList() { mKeyList->hide(); } diff --git a/fileencryptiondialog.h b/fileencryptiondialog.h index bc5d9a0..dfe97ee 100755 --- a/fileencryptiondialog.h +++ b/fileencryptiondialog.h @@ -72,31 +72,31 @@ public slots: * * @fn selectInputFile */ - void selectInputFile(); + void slotSelectInputFile(); /** * @brief * * @fn selectOutputFile */ - void selectOutputFile(); + void slotSelectOutputFile(); /** * @brief * * @fn executeAction */ - void executeAction(); + void slotExecuteAction(); /** * @brief * * @fn hideKeyList */ - void hideKeyList(); + void slotHideKeyList(); /** * @brief * * @fn showKeyList */ - void showKeyList(); + void slotShowKeyList(); private: QLineEdit *outputFileEdit; /**< TODO */ diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 4ada1f7..1810a9a 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -93,8 +93,8 @@ GpgContext::GpgContext() debug = false; } - connect(this,SIGNAL(keyDBChanged()),this,SLOT(refreshKeyList())); - refreshKeyList(); + connect(this,SIGNAL(signalKeyDBChanged()),this,SLOT(slotRefreshKeyList())); + slotRefreshKeyList(); } /** Destructor @@ -169,7 +169,7 @@ GpgImportInformation GpgContext::importKey(QByteArray inBuffer) status=status->next; } checkErr(err); - emit keyDBChanged(); + emit signalKeyDBChanged(); gpgme_data_release(in); return *importInformation; } @@ -181,7 +181,7 @@ void GpgContext::generateKey(QString *params) { err = gpgme_op_genkey(mCtx, params->toAscii().data(), NULL, NULL); checkErr(err); - emit keyDBChanged(); + emit signalKeyDBChanged(); } /** Export Key to QByteArray @@ -293,7 +293,7 @@ void GpgContext::deleteKeys(QStringList *uidList) gpgme_op_keylist_end(mCtx); gpgme_op_delete(mCtx, key, 1); } - emit keyDBChanged(); + emit signalKeyDBChanged(); } /** Encrypt inBuffer for reciepients-uids, write @@ -754,7 +754,7 @@ QString GpgContext::beautifyFingerprint(QString fingerprint) return fingerprint; } -void GpgContext::refreshKeyList() { +void GpgContext::slotRefreshKeyList() { mKeyList = this->listKeys(); } diff --git a/gpgcontext.h b/gpgcontext.h index 5d739a0..76f753e 100644 --- a/gpgcontext.h +++ b/gpgcontext.h @@ -148,10 +148,10 @@ public: QString beautifyFingerprint(QString fingerprint); signals: - void keyDBChanged(); + void signalKeyDBChanged(); private slots: - void refreshKeyList(); + void slotRefreshKeyList(); private: gpgme_ctx_t mCtx; diff --git a/helppage.cpp b/helppage.cpp index 9fd3d34..ace8c92 100644 --- a/helppage.cpp +++ b/helppage.cpp @@ -34,14 +34,14 @@ HelpPage::HelpPage(const QString path, QWidget *parent) : //setAttribute(Qt::WA_DeleteOnClose); //browser->setSource(QUrl::fromLocalFile(path)); - connect(browser, SIGNAL(anchorClicked(QUrl)), this, SLOT(openUrl(QUrl))); + connect(browser, SIGNAL(anchorClicked(QUrl)), this, SLOT(slotOpenUrl(QUrl))); browser->setOpenLinks(false); browser->setSource(localizedHelp(QUrl(path))); browser->setFocus(); } -void HelpPage::openUrl(QUrl url) { +void HelpPage::slotOpenUrl(QUrl url) { browser->setSource(localizedHelp(url)); }; @@ -39,7 +39,7 @@ public: signals: public slots: - void openUrl(QUrl url); + void slotOpenUrl(QUrl url); private: QTextBrowser *browser; /** The textbrowser of the tab */ diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp index b16a2e4..36f2e4a 100644 --- a/keydetailsdialog.cpp +++ b/keydetailsdialog.cpp @@ -114,7 +114,7 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWid //copyFingerprintButton.setStyleSheet("QPushButton {border: 0px; } QPushButton:Pressed {} "); copyFingerprintButton.setFlat(true); copyFingerprintButton.setToolTip(tr("copy fingerprint to clipboard")); - connect(©FingerprintButton, SIGNAL(clicked()), this, SLOT(copyFingerprint())); + connect(©FingerprintButton, SIGNAL(clicked()), this, SLOT(slotCopyFingerprint())); hboxFP->addWidget(©FingerprintButton); @@ -141,7 +141,7 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWid QPushButton *exportButton = new QPushButton(tr("Export Private Key")); vboxPK->addWidget(exportButton); - connect(exportButton, SIGNAL(clicked()), this, SLOT(exportPrivateKey())); + connect(exportButton, SIGNAL(clicked()), this, SLOT(slotExportPrivateKey())); privKeyBox->setLayout(vboxPK); mvbox->addWidget(privKeyBox); @@ -180,7 +180,7 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWid exec(); } -void KeyDetailsDialog::exportPrivateKey() +void KeyDetailsDialog::slotExportPrivateKey() { // Show a information box with explanation about private key int ret = QMessageBox::information(this, tr("Exporting private Key"), @@ -218,7 +218,7 @@ QString KeyDetailsDialog::beautifyFingerprint(QString fingerprint) return fingerprint; } -void KeyDetailsDialog::copyFingerprint() { +void KeyDetailsDialog::slotCopyFingerprint() { QString fpr = fingerPrintVarLabel->text().trimmed().replace(" ", ""); QClipboard *cb = QApplication::clipboard(); cb->setText(fpr); diff --git a/keydetailsdialog.h b/keydetailsdialog.h index 37edd43..2774fe2 100644 --- a/keydetailsdialog.h +++ b/keydetailsdialog.h @@ -55,12 +55,12 @@ private slots: /** * @details Export the key to a file, which is choosen in a file dialog */ - void exportPrivateKey(); + void slotExportPrivateKey(); /** * @details Copy the fingerprint to clipboard */ - void copyFingerprint(); + void slotCopyFingerprint(); private: QString *keyid; /** The id of the key the details should be shown for */ diff --git a/keygendialog.cpp b/keygendialog.cpp index a0f4f40..1254b78 100644 --- a/keygendialog.cpp +++ b/keygendialog.cpp @@ -98,15 +98,15 @@ void KeyGenDialog::generateKeyDialog() vbox2->addWidget(errorLabel); vbox2->addWidget(buttonBox); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(keyGenAccept())); + connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotKeyGenAccept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(expireBoxChanged())); - connect(passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(passwordEditChanged())); + connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotExpireBoxChanged())); + connect(passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(slotPasswordEditChanged())); this->setLayout(vbox2); } -void KeyGenDialog::keyGenAccept() +void KeyGenDialog::slotKeyGenAccept() { QString errorString = ""; QString keyGenParams = ""; @@ -189,7 +189,7 @@ void KeyGenDialog::keyGenAccept() } } -void KeyGenDialog::expireBoxChanged() +void KeyGenDialog::slotExpireBoxChanged() { if (expireCheckBox->checkState()) { dateEdit->setEnabled(false); @@ -198,7 +198,7 @@ void KeyGenDialog::expireBoxChanged() } } -void KeyGenDialog::passwordEditChanged() +void KeyGenDialog::slotPasswordEditChanged() { pwStrengthSlider->setValue(checkPassWordStrength()); update(); diff --git a/keygendialog.h b/keygendialog.h index f2de274..8455387 100644 --- a/keygendialog.h +++ b/keygendialog.h @@ -69,17 +69,17 @@ private slots: /** * @details when expirebox was checked/unchecked, enable/disable the expiration date box */ - void expireBoxChanged(); + void slotExpireBoxChanged(); /** * @details When passwordedit changed, set new value for password strength slider */ - void passwordEditChanged(); + void slotPasswordEditChanged(); /** * @details check all lineedits for false entries. Show error, when there is one, otherwise generate the key */ - void keyGenAccept(); + void slotKeyGenAccept(); }; #endif // __KEYGENDIALOG_H__ diff --git a/keygenthread.h b/keygenthread.h index 358989c..6fc61e9 100644 --- a/keygenthread.h +++ b/keygenthread.h @@ -41,7 +41,7 @@ public: KeyGenThread(QString keyGenParams, GpgME::GpgContext *ctx); signals: - void keyGenerated(); + void signalKeyGenerated(); private: QString keyGenParams; diff --git a/keylist.cpp b/keylist.cpp index ff39678..c89b4d8 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -58,12 +58,12 @@ KeyList::KeyList(GpgME::GpgContext *ctx, QWidget *parent) setLayout(layout); popupMenu = new QMenu(this); - connect(mCtx, SIGNAL(keyDBChanged()), this, SLOT(refresh())); + connect(mCtx, SIGNAL(signalKeyDBChanged()), this, SLOT(slotRefresh())); setAcceptDrops(true); - refresh(); + slotRefresh(); } -void KeyList::refresh() +void KeyList::slotRefresh() { QStringList *keyList; keyList = getChecked(); @@ -53,7 +53,7 @@ public: bool containsPrivateKeys(); public slots: - void refresh(); + void slotRefresh(); private: void importKeys(QByteArray inBuffer); diff --git a/keymgmt.cpp b/keymgmt.cpp index e8b7d94..bfade79 100755 --- a/keymgmt.cpp +++ b/keymgmt.cpp @@ -35,7 +35,7 @@ KeyMgmt::KeyMgmt(GpgME::GpgContext *ctx, QWidget *parent ) : QMainWindow(parent createActions(); createMenus(); createToolBars(); - connect(this,SIGNAL(statusBarChanged(QString)),this->parent(),SLOT(setStatusBarText(QString))); + connect(this,SIGNAL(signalStatusBarChanged(QString)),this->parent(),SLOT(slotSetStatusBarText(QString))); /* Restore the iconstyle */ QSettings settings; @@ -74,45 +74,45 @@ void KeyMgmt::createActions() importKeyFromFileAct = new QAction(tr("&File"), this); importKeyFromFileAct->setIcon(QIcon(":import_key_from_file.png")); importKeyFromFileAct->setToolTip(tr("Import New Key From File")); - connect(importKeyFromFileAct, SIGNAL(triggered()), this, SLOT(importKeyFromFile())); + connect(importKeyFromFileAct, SIGNAL(triggered()), this, SLOT(slotImportKeyFromFile())); importKeyFromClipboardAct = new QAction(tr("&Clipboard"), this); importKeyFromClipboardAct->setIcon(QIcon(":import_key_from_clipboard.png")); importKeyFromClipboardAct->setToolTip(tr("Import New Key From Clipboard")); - connect(importKeyFromClipboardAct, SIGNAL(triggered()), this, SLOT(importKeyFromClipboard())); + connect(importKeyFromClipboardAct, SIGNAL(triggered()), this, SLOT(slotImportKeyFromClipboard())); importKeyFromKeyServerAct = new QAction(tr("&Keyserver"), this); importKeyFromKeyServerAct->setIcon(QIcon(":import_key_from_server.png")); importKeyFromKeyServerAct->setToolTip(tr("Import New Key From Keyserver")); - connect(importKeyFromKeyServerAct, SIGNAL(triggered()), this, SLOT(importKeyFromKeyServer())); + connect(importKeyFromKeyServerAct, SIGNAL(triggered()), this, SLOT(slotImportKeyFromKeyServer())); exportKeyToClipboardAct = new QAction(tr("Export To &Clipboard"), this); exportKeyToClipboardAct->setIcon(QIcon(":export_key_to_clipboard.png")); exportKeyToClipboardAct->setToolTip(tr("Export Selected Key(s) To Clipboard")); - connect(exportKeyToClipboardAct, SIGNAL(triggered()), this, SLOT(exportKeyToClipboard())); + connect(exportKeyToClipboardAct, SIGNAL(triggered()), this, SLOT(slotExportKeyToClipboard())); exportKeyToFileAct = new QAction(tr("Export To &File"), this); exportKeyToFileAct->setIcon(QIcon(":export_key_to_file.png")); exportKeyToFileAct->setToolTip(tr("Export Selected Key(s) To File")); - connect(exportKeyToFileAct, SIGNAL(triggered()), this, SLOT(exportKeyToFile())); + connect(exportKeyToFileAct, SIGNAL(triggered()), this, SLOT(slotExportKeyToFile())); deleteSelectedKeysAct = new QAction(tr("Delete Selected Key(s)"), this); deleteSelectedKeysAct->setToolTip(tr("Delete the Selected keys")); - connect(deleteSelectedKeysAct, SIGNAL(triggered()), this, SLOT(deleteSelectedKeys())); + connect(deleteSelectedKeysAct, SIGNAL(triggered()), this, SLOT(slotDeleteSelectedKeys())); deleteCheckedKeysAct = new QAction(tr("Delete Checked Key(s)"), this); deleteCheckedKeysAct->setToolTip(tr("Delete the Checked keys")); deleteCheckedKeysAct->setIcon(QIcon(":button_cancel.png")); - connect(deleteCheckedKeysAct, SIGNAL(triggered()), this, SLOT(deleteCheckedKeys())); + connect(deleteCheckedKeysAct, SIGNAL(triggered()), this, SLOT(slotDeleteCheckedKeys())); generateKeyDialogAct = new QAction(tr("Generate Key"), this); generateKeyDialogAct->setToolTip(tr("Generate New Key")); generateKeyDialogAct->setIcon(QIcon(":key_generate.png")); - connect(generateKeyDialogAct, SIGNAL(triggered()), this, SLOT(generateKeyDialog())); + connect(generateKeyDialogAct, SIGNAL(triggered()), this, SLOT(slotGenerateKeyDialog())); showKeyDetailsAct = new QAction(tr("Show Keydetails"), this); showKeyDetailsAct->setToolTip(tr("Show Details for this Key")); - connect(showKeyDetailsAct, SIGNAL(triggered()), this, SLOT(showKeyDetails())); + connect(showKeyDetailsAct, SIGNAL(triggered()), this, SLOT(slotShowKeyDetails())); } void KeyMgmt::createMenus() @@ -155,14 +155,14 @@ void KeyMgmt::createToolBars() } -void KeyMgmt::importKeys(QByteArray inBuffer) +void KeyMgmt::slotImportKeys(QByteArray inBuffer) { GpgImportInformation result = mCtx->importKey(inBuffer); new KeyImportDetailDialog(mCtx, result, this); } -void KeyMgmt::importKeyFromFile() +void KeyMgmt::slotImportKeyFromFile() { QString fileName = QFileDialog::getOpenFileName(this, tr("Open Key"), "", tr("Key Files") + " (*.asc *.txt);;"+tr("Keyring files")+" (*.gpg);;All Files (*)"); if (! fileName.isNull()) { @@ -173,29 +173,29 @@ void KeyMgmt::importKeyFromFile() return; } QByteArray inBuffer = file.readAll(); - importKeys(inBuffer); + slotImportKeys(inBuffer); file.close(); } } -void KeyMgmt::importKeyFromKeyServer() +void KeyMgmt::slotImportKeyFromKeyServer() { importDialog = new KeyServerImportDialog(mCtx, mKeyList, this); importDialog->show(); } -void KeyMgmt::importKeyFromClipboard() +void KeyMgmt::slotImportKeyFromClipboard() { QClipboard *cb = QApplication::clipboard(); - importKeys(cb->text(QClipboard::Clipboard).toAscii()); + slotImportKeys(cb->text(QClipboard::Clipboard).toAscii()); } -void KeyMgmt::deleteSelectedKeys() +void KeyMgmt::slotDeleteSelectedKeys() { deleteKeysWithWarning(mKeyList->getSelected()); } -void KeyMgmt::deleteCheckedKeys() +void KeyMgmt::slotDeleteCheckedKeys() { deleteKeysWithWarning(mKeyList->getChecked()); } @@ -228,7 +228,7 @@ void KeyMgmt::deleteKeysWithWarning(QStringList *uidList) } } -void KeyMgmt::showKeyDetails() +void KeyMgmt::slotShowKeyDetails() { if (mKeyList->getSelected()->isEmpty()) { return; @@ -240,7 +240,7 @@ void KeyMgmt::showKeyDetails() new KeyDetailsDialog(mCtx, key); } -void KeyMgmt::exportKeyToFile() +void KeyMgmt::slotExportKeyToFile() { QByteArray *keyArray = new QByteArray(); if (!mCtx->exportKeys(mKeyList->getChecked(), keyArray)) { @@ -257,10 +257,10 @@ void KeyMgmt::exportKeyToFile() stream << *keyArray; file.close(); delete keyArray; - emit statusBarChanged(QString(tr("key(s) exported"))); + emit signalStatusBarChanged(QString(tr("key(s) exported"))); } -void KeyMgmt::exportKeyToClipboard() +void KeyMgmt::slotExportKeyToClipboard() { QByteArray *keyArray = new QByteArray(); QClipboard *cb = QApplication::clipboard(); @@ -271,7 +271,7 @@ void KeyMgmt::exportKeyToClipboard() delete keyArray; } -void KeyMgmt::generateKeyDialog() +void KeyMgmt::slotGenerateKeyDialog() { KeyGenDialog *keyGenDialog = new KeyGenDialog(mCtx,this); keyGenDialog->show(); @@ -50,19 +50,19 @@ public: QAction *importKeyFromKeyServerAct; public slots: - void importKeyFromFile(); - void importKeyFromClipboard(); - void importKeyFromKeyServer(); - void importKeys(QByteArray inBuffer); - void exportKeyToFile(); - void exportKeyToClipboard(); - void deleteSelectedKeys(); - void deleteCheckedKeys(); - void generateKeyDialog(); - void showKeyDetails(); + void slotImportKeyFromFile(); + void slotImportKeyFromClipboard(); + void slotImportKeyFromKeyServer(); + void slotImportKeys(QByteArray inBuffer); + void slotExportKeyToFile(); + void slotExportKeyToClipboard(); + void slotDeleteSelectedKeys(); + void slotDeleteCheckedKeys(); + void slotGenerateKeyDialog(); + void slotShowKeyDetails(); signals: - void statusBarChanged(QString); + void signalStatusBarChanged(QString); private: void createMenus(); diff --git a/keyserverimportdialog.cpp b/keyserverimportdialog.cpp index 7118676..819dfc0 100644 --- a/keyserverimportdialog.cpp +++ b/keyserverimportdialog.cpp @@ -29,8 +29,8 @@ KeyServerImportDialog::KeyServerImportDialog(GpgME::GpgContext *ctx, KeyList *ke mKeyList = keyList; // Buttons closeButton = createButton(tr("&Close"), SLOT(close())); - importButton = createButton(tr("&Import"), SLOT(import())); - searchButton = createButton(tr("&Search"), SLOT(search())); + importButton = createButton(tr("&Import"), SLOT(slotImport())); + searchButton = createButton(tr("&Search"), SLOT(slotSearch())); // Line edit for search string searchLabel = new QLabel(tr("Search string:")); @@ -115,7 +115,7 @@ void KeyServerImportDialog::createKeysTable() keysTable->verticalHeader()->hide(); connect(keysTable, SIGNAL(cellActivated(int,int)), - this, SLOT(import())); + this, SLOT(slotImport())); } void KeyServerImportDialog::setMessage(const QString &text, bool error) @@ -132,16 +132,16 @@ void KeyServerImportDialog::setMessage(const QString &text, bool error) } } -void KeyServerImportDialog::search() +void KeyServerImportDialog::slotSearch() { QUrl url = keyServerComboBox->currentText()+":11371/pks/lookup?search="+searchLineEdit->text()+"&op=index&options=mr"; qnam = new QNetworkAccessManager(this); QNetworkReply* reply = qnam->get(QNetworkRequest(url)); connect(reply, SIGNAL(finished()), - this, SLOT(searchFinished())); + this, SLOT(slotSearchFinished())); } -void KeyServerImportDialog::searchFinished() +void KeyServerImportDialog::slotSearchFinished() { QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender()); @@ -167,7 +167,7 @@ void KeyServerImportDialog::searchFinished() if (rx.exactMatch(query)) { setMessage(tr("No keys found, input may be kexId, retrying search with 0x."),true); searchLineEdit->setText(query.prepend("0x")); - this->search(); + this->slotSearch(); } else { setMessage(tr("No keys found containing the search string!"),true); } @@ -250,25 +250,25 @@ void KeyServerImportDialog::searchFinished() reply = 0; } -void KeyServerImportDialog::import() +void KeyServerImportDialog::slotImport() { if ( keysTable->currentRow() > -1 ) { QString keyid = keysTable->item(keysTable->currentRow(),2)->text(); QUrl url = keyServerComboBox->currentText(); - import(QStringList(keyid), url); + slotImport(QStringList(keyid), url); } } -void KeyServerImportDialog::import(QStringList keyIds) +void KeyServerImportDialog::slotImport(QStringList keyIds) { QSettings settings; QString keyserver=settings.value("keyserver/defaultKeyServer").toString(); QUrl url(keyserver); - import(keyIds, url); + slotImport(keyIds, url); } -void KeyServerImportDialog::import(QStringList keyIds, QUrl keyServerUrl) +void KeyServerImportDialog::slotImport(QStringList keyIds, QUrl keyServerUrl) { foreach(QString keyId, keyIds) { QUrl reqUrl(keyServerUrl.scheme() + "://" + keyServerUrl.host() + ":11371/pks/lookup?op=get&search=0x"+keyId+"&options=mr"); @@ -276,11 +276,11 @@ void KeyServerImportDialog::import(QStringList keyIds, QUrl keyServerUrl) qnam = new QNetworkAccessManager(this); QNetworkReply *reply = qnam->get(QNetworkRequest(reqUrl)); connect(reply, SIGNAL(finished()), - this, SLOT(importFinished())); + this, SLOT(slotImportFinished())); } } -void KeyServerImportDialog::importFinished() +void KeyServerImportDialog::slotImportFinished() { QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender()); diff --git a/keyserverimportdialog.h b/keyserverimportdialog.h index 5f98d8f..b33af57 100644 --- a/keyserverimportdialog.h +++ b/keyserverimportdialog.h @@ -53,15 +53,14 @@ class KeyServerImportDialog : public QDialog public: KeyServerImportDialog(GpgME::GpgContext *ctx, KeyList *keyList, QWidget *parent = 0); - void import(QStringList keyIds); - void import(QStringList keyIds, QUrl keyserverUrl); + void slotImport(QStringList keyIds); + void slotImport(QStringList keyIds, QUrl keyserverUrl); private slots: - void import(); - - void searchFinished(); - void importFinished(); - void search(); + void slotImport(); + void slotSearchFinished(); + void slotImportFinished(); + void slotSearch(); private: void createKeysTable(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 3b17e39..0b13aa2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -45,7 +45,7 @@ MainWindow::MainWindow() keyMgmt->hide(); /* test attachmentdir for files alll 15s */ QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(checkAttachmentFolder())); + connect(timer, SIGNAL(timeout()), this, SLOT(slotCheckAttachmentFolder())); timer->start(5000); createActions(); @@ -54,7 +54,7 @@ MainWindow::MainWindow() createStatusBar(); createDockWindows(); - connect(edit->tabWidget,SIGNAL(currentChanged(int)),this,SLOT(disableTabActions(int))); + connect(edit->tabWidget,SIGNAL(currentChanged(int)),this,SLOT(slotDisableTabActions(int))); mKeyList->addMenuAction(appendSelectedKeysAct); mKeyList->addMenuAction(copyMailAddressToClipboardAct); @@ -78,7 +78,7 @@ MainWindow::MainWindow() // and keylist doesn't contain a private key QSettings settings; if (settings.value("wizard/showWizard",true).toBool() || !settings.value("wizard/nextPage").isNull()) { - startWizard(); + slotStartWizard(); } } @@ -159,36 +159,36 @@ void MainWindow::createActions() newTabActShortcutList.append(QKeySequence (Qt::CTRL + Qt::Key_T)); newTabAct->setShortcuts(newTabActShortcutList); newTabAct->setToolTip(tr("Open a new file")); - connect(newTabAct, SIGNAL(triggered()), edit, SLOT(newTab())); + connect(newTabAct, SIGNAL(triggered()), edit, SLOT(slotNewTab())); openAct = new QAction(tr("&Open..."), this); openAct->setIcon(QIcon(":fileopen.png")); openAct->setShortcut(QKeySequence::Open); openAct->setToolTip(tr("Open an existing file")); - connect(openAct, SIGNAL(triggered()), edit, SLOT(open())); + connect(openAct, SIGNAL(triggered()), edit, SLOT(slotOpen())); saveAct = new QAction(tr("&Save"), this); saveAct->setIcon(QIcon(":filesave.png")); saveAct->setShortcut(QKeySequence::Save); saveAct->setToolTip(tr("Save the current File")); - connect(saveAct, SIGNAL(triggered()), edit, SLOT(save())); + connect(saveAct, SIGNAL(triggered()), edit, SLOT(slotSave())); saveAsAct = new QAction(tr("Save &As")+"...", this); saveAsAct->setIcon(QIcon(":filesaveas.png")); saveAsAct->setShortcut(QKeySequence::SaveAs); saveAsAct->setToolTip(tr("Save the current File as...")); - connect(saveAsAct, SIGNAL(triggered()), edit, SLOT(saveAs())); + connect(saveAsAct, SIGNAL(triggered()), edit, SLOT(slotSaveAs())); printAct = new QAction(tr("&Print"), this); printAct->setIcon(QIcon(":fileprint.png")); printAct->setShortcut(QKeySequence::Print); printAct->setToolTip(tr("Print Document")); - connect(printAct, SIGNAL(triggered()), edit, SLOT(print())); + connect(printAct, SIGNAL(triggered()), edit, SLOT(slotPrint())); closeTabAct = new QAction(tr("&Close"), this); closeTabAct->setShortcut(QKeySequence::Close); closeTabAct->setToolTip(tr("Close file")); - connect(closeTabAct, SIGNAL(triggered()), edit, SLOT(closeTab())); + connect(closeTabAct, SIGNAL(triggered()), edit, SLOT(slotCloseTab())); quitAct = new QAction(tr("&Quit"), this); quitAct->setShortcut(QKeySequence::Quit); @@ -201,62 +201,62 @@ void MainWindow::createActions() undoAct = new QAction(tr("&Undo"), this); undoAct->setShortcut(QKeySequence::Undo); undoAct->setToolTip(tr("Undo Last Edit Action")); - connect(undoAct, SIGNAL(triggered()), edit, SLOT(undo())); + connect(undoAct, SIGNAL(triggered()), edit, SLOT(slotUndo())); redoAct = new QAction(tr("&Redo"), this); redoAct->setShortcut(QKeySequence::Redo); redoAct->setToolTip(tr("Redo Last Edit Action")); - connect(redoAct, SIGNAL(triggered()), edit, SLOT(redo())); + connect(redoAct, SIGNAL(triggered()), edit, SLOT(slotRedo())); zoomInAct = new QAction(tr("Zoom In"), this); zoomInAct->setShortcut(QKeySequence::ZoomIn); - connect(zoomInAct, SIGNAL(triggered()), edit, SLOT(zoomIn())); + connect(zoomInAct, SIGNAL(triggered()), edit, SLOT(slotZoomIn())); zoomOutAct = new QAction(tr("Zoom Out"), this); zoomOutAct->setShortcut(QKeySequence::ZoomOut); - connect(zoomOutAct, SIGNAL(triggered()), edit, SLOT(zoomOut())); + connect(zoomOutAct, SIGNAL(triggered()), edit, SLOT(slotZoomOut())); pasteAct = new QAction(tr("&Paste"), this); pasteAct->setIcon(QIcon(":button_paste.png")); pasteAct->setShortcut(QKeySequence::Paste); pasteAct->setToolTip(tr("Paste Text From Clipboard")); - connect(pasteAct, SIGNAL(triggered()), edit, SLOT(paste())); + connect(pasteAct, SIGNAL(triggered()), edit, SLOT(slotPaste())); cutAct = new QAction(tr("Cu&t"), this); cutAct->setIcon(QIcon(":button_cut.png")); cutAct->setShortcut(QKeySequence::Cut); cutAct->setToolTip(tr("Cut the current selection's contents to the " "clipboard")); - connect(cutAct, SIGNAL(triggered()), edit, SLOT(cut())); + connect(cutAct, SIGNAL(triggered()), edit, SLOT(slotCut())); copyAct = new QAction(tr("&Copy"), this); copyAct->setIcon(QIcon(":button_copy.png")); copyAct->setShortcut(QKeySequence::Copy); copyAct->setToolTip(tr("Copy the current selection's contents to the " "clipboard")); - connect(copyAct, SIGNAL(triggered()), edit, SLOT(copy())); + connect(copyAct, SIGNAL(triggered()), edit, SLOT(slotCopy())); quoteAct = new QAction(tr("&Quote"), this); quoteAct->setIcon(QIcon(":quote.png")); quoteAct->setToolTip(tr("Quote whole text")); - connect(quoteAct, SIGNAL(triggered()), edit, SLOT(quote())); + connect(quoteAct, SIGNAL(triggered()), edit, SLOT(slotQuote())); selectallAct = new QAction(tr("Select &All"), this); selectallAct->setIcon(QIcon(":edit.png")); selectallAct->setShortcut(QKeySequence::SelectAll); selectallAct->setToolTip(tr("Select the whole text")); - connect(selectallAct, SIGNAL(triggered()), edit, SLOT(selectAll())); + connect(selectallAct, SIGNAL(triggered()), edit, SLOT(slotSelectAll())); cleanDoubleLinebreaksAct = new QAction(tr("Remove &spacing"), this); cleanDoubleLinebreaksAct->setIcon(QIcon(":format-line-spacing-triple.png")); //cleanDoubleLineBreaksAct->setShortcut(QKeySequence::SelectAll); cleanDoubleLinebreaksAct->setToolTip(tr("Remove double linebreaks, e.g. in pasted text from webmailer")); - connect(cleanDoubleLinebreaksAct, SIGNAL(triggered()), this, SLOT(cleanDoubleLinebreaks())); + connect(cleanDoubleLinebreaksAct, SIGNAL(triggered()), this, SLOT(slotCleanDoubleLinebreaks())); openSettingsAct = new QAction(tr("Se&ttings"), this); openSettingsAct->setToolTip(tr("Open settings dialog")); openSettingsAct->setShortcut(QKeySequence::Preferences); - connect(openSettingsAct, SIGNAL(triggered()), this, SLOT(openSettingsDialog())); + connect(openSettingsAct, SIGNAL(triggered()), this, SLOT(slotOpenSettingsDialog())); /* Crypt Menu */ @@ -264,18 +264,18 @@ void MainWindow::createActions() encryptAct->setIcon(QIcon(":encrypted.png")); encryptAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); encryptAct->setToolTip(tr("Encrypt Message")); - connect(encryptAct, SIGNAL(triggered()), this, SLOT(encrypt())); + connect(encryptAct, SIGNAL(triggered()), this, SLOT(slotEncrypt())); decryptAct = new QAction(tr("&Decrypt"), this); decryptAct->setIcon(QIcon(":decrypted.png")); decryptAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D)); decryptAct->setToolTip(tr("Decrypt Message")); - connect(decryptAct, SIGNAL(triggered()), this, SLOT(decrypt())); + connect(decryptAct, SIGNAL(triggered()), this, SLOT(slotDecrypt())); fileEncryptionAct = new QAction(tr("&File Encryption"), this); fileEncryptionAct->setIcon(QIcon(":fileencrytion.png")); fileEncryptionAct->setToolTip(tr("Encrypt/Decrypt File")); - connect(fileEncryptionAct, SIGNAL(triggered()), this, SLOT(fileEncryption())); + connect(fileEncryptionAct, SIGNAL(triggered()), this, SLOT(slotFileEncryption())); /* * File encryption submenu @@ -283,24 +283,24 @@ void MainWindow::createActions() fileEncryptAct = new QAction(tr("&Encrypt File"), this); //fileEncryptAct->setIcon(QIcon(":fileencrytion.png")); fileEncryptAct->setToolTip(tr("Encrypt File")); - connect(fileEncryptAct, SIGNAL(triggered()), this, SLOT(fileEncrypt())); + connect(fileEncryptAct, SIGNAL(triggered()), this, SLOT(slotFileEncrypt())); fileDecryptAct = new QAction(tr("&Decrypt File"), this); //fileDecryptAct->setIcon(QIcon(":fileencrytion.png")); fileDecryptAct->setToolTip(tr("Decrypt File")); - connect(fileDecryptAct, SIGNAL(triggered()), this, SLOT(fileDecrypt())); + connect(fileDecryptAct, SIGNAL(triggered()), this, SLOT(slotFileDecrypt())); signAct = new QAction(tr("&Sign"), this); signAct->setIcon(QIcon(":signature.png")); signAct->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I)); signAct->setToolTip(tr("Sign Message")); - connect(signAct, SIGNAL(triggered()), this, SLOT(sign())); + connect(signAct, SIGNAL(triggered()), this, SLOT(slotSign())); verifyAct = new QAction(tr("&Verify"), this); verifyAct->setIcon(QIcon(":verify.png")); verifyAct->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_V)); verifyAct->setToolTip(tr("Verify Message")); - connect(verifyAct, SIGNAL(triggered()), this, SLOT(verify())); + connect(verifyAct, SIGNAL(triggered()), this, SLOT(slotVerify())); /* Key Menu */ @@ -308,71 +308,71 @@ void MainWindow::createActions() importKeyFromEditAct = new QAction(tr("&Editor"), this); importKeyFromEditAct->setIcon(QIcon(":txt.png")); importKeyFromEditAct->setToolTip(tr("Import New Key From Editor")); - connect(importKeyFromEditAct, SIGNAL(triggered()), this, SLOT(importKeyFromEdit())); + connect(importKeyFromEditAct, SIGNAL(triggered()), this, SLOT(slotImportKeyFromEdit())); openKeyManagementAct = new QAction(tr("Manage &keys"), this); openKeyManagementAct->setIcon(QIcon(":keymgmt.png")); openKeyManagementAct->setToolTip(tr("Open Keymanagement")); - connect(openKeyManagementAct, SIGNAL(triggered()), this, SLOT(openKeyManagement())); + connect(openKeyManagementAct, SIGNAL(triggered()), this, SLOT(slotOpenKeyManagement())); /* About Menu */ aboutAct = new QAction(tr("&About"), this); aboutAct->setIcon(QIcon(":help.png")); aboutAct->setToolTip(tr("Show the application's About box")); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); + connect(aboutAct, SIGNAL(triggered()), this, SLOT(slotAbout())); openHelpAct = new QAction(tr("Integrated Help"), this); openHelpAct->setToolTip(tr("Open integrated Help")); - connect(openHelpAct, SIGNAL(triggered()), this, SLOT(openHelp())); + connect(openHelpAct, SIGNAL(triggered()), this, SLOT(slotOpenHelp())); openTutorialAct = new QAction(tr("Online &Tutorials"), this); openTutorialAct->setToolTip(tr("Open Online Tutorials")); - connect(openTutorialAct, SIGNAL(triggered()), this, SLOT(openTutorial())); + connect(openTutorialAct, SIGNAL(triggered()), this, SLOT(slotOpenTutorial())); openTranslateAct = new QAction(tr("Translate gpg4usb"), this); openTranslateAct->setToolTip(tr("Translate gpg4usb yourself")); - connect(openTranslateAct, SIGNAL(triggered()), this, SLOT(openTranslate())); + connect(openTranslateAct, SIGNAL(triggered()), this, SLOT(slotOpenTranslate())); startWizardAct= new QAction(tr("Open &Wizard"), this); startWizardAct->setToolTip(tr("Open the wizard")); - connect(startWizardAct, SIGNAL(triggered()), this, SLOT(startWizard())); + connect(startWizardAct, SIGNAL(triggered()), this, SLOT(slotStartWizard())); /* Popup-Menu-Action for KeyList */ appendSelectedKeysAct = new QAction(tr("Append Selected Key(s) To Text"), this); appendSelectedKeysAct->setToolTip(tr("Append The Selected Keys To Text in Editor")); - connect(appendSelectedKeysAct, SIGNAL(triggered()), this, SLOT(appendSelectedKeys())); + connect(appendSelectedKeysAct, SIGNAL(triggered()), this, SLOT(slotAppendSelectedKeys())); copyMailAddressToClipboardAct = new QAction(tr("Copy EMail-address"), this); copyMailAddressToClipboardAct->setToolTip(tr("Copy selected EMailaddress to clipboard")); - connect(copyMailAddressToClipboardAct, SIGNAL(triggered()), this, SLOT(copyMailAddressToClipboard())); + connect(copyMailAddressToClipboardAct, SIGNAL(triggered()), this, SLOT(slotCopyMailAddressToClipboard())); // TODO: find central place for shared actions, to avoid code-duplication with keymgmt.cpp showKeyDetailsAct = new QAction(tr("Show Keydetails"), this); showKeyDetailsAct->setToolTip(tr("Show Details for this Key")); - connect(showKeyDetailsAct, SIGNAL(triggered()), this, SLOT(showKeyDetails())); + connect(showKeyDetailsAct, SIGNAL(triggered()), this, SLOT(slotShowKeyDetails())); /* Key-Shortcuts for Tab-Switchung-Action */ switchTabUpAct = new QAction(this); switchTabUpAct->setShortcut(QKeySequence::NextChild); - connect(switchTabUpAct, SIGNAL(triggered()), edit, SLOT(switchTabUp())); + connect(switchTabUpAct, SIGNAL(triggered()), edit, SLOT(slotSwitchTabUp())); this->addAction(switchTabUpAct); switchTabDownAct = new QAction(this); switchTabDownAct->setShortcut(QKeySequence::PreviousChild); - connect(switchTabDownAct, SIGNAL(triggered()), edit, SLOT(switchTabDown())); + connect(switchTabDownAct, SIGNAL(triggered()), edit, SLOT(slotSwitchTabDown())); this->addAction(switchTabDownAct); cutPgpHeaderAct = new QAction(tr("Remove PGP Header"), this); - connect(cutPgpHeaderAct, SIGNAL(triggered()), this, SLOT(cutPgpHeader())); + connect(cutPgpHeaderAct, SIGNAL(triggered()), this, SLOT(slotCutPgpHeader())); addPgpHeaderAct = new QAction(tr("Add PGP Header"), this); - connect(addPgpHeaderAct, SIGNAL(triggered()), this, SLOT(addPgpHeader())); + connect(addPgpHeaderAct, SIGNAL(triggered()), this, SLOT(slotAddPgpHeader())); } -void MainWindow::disableTabActions(int number) +void MainWindow::slotDisableTabActions(int number) { bool disable; @@ -617,7 +617,7 @@ void MainWindow::closeEvent(QCloseEvent *event) mCtx->clearPasswordCache(); } -void MainWindow::about() +void MainWindow::slotAbout() { QPixmap *pixmap = new QPixmap(":gpg4usb-logo.png"); QString *title = new QString(tr("About") +" "+ qApp->applicationName()); @@ -660,31 +660,31 @@ void MainWindow::about() dialog->exec(); } -void MainWindow::openTranslate() +void MainWindow::slotOpenTranslate() { QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu_translate.html")); } -void MainWindow::openTutorial() +void MainWindow::slotOpenTutorial() { QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu.html")); } -void MainWindow::openHelp() { - openHelp("docu.html"); +void MainWindow::slotOpenHelp() { + slotOpenHelp("docu.html"); } -void MainWindow::openHelp(const QString page) +void MainWindow::slotOpenHelp(const QString page) { - edit->newHelpTab("help", "file:" + qApp->applicationDirPath() + "/help/" + page); + edit->slotNewHelpTab("help", "file:" + qApp->applicationDirPath() + "/help/" + page); } -void MainWindow::setStatusBarText(QString text) +void MainWindow::slotSetStatusBarText(QString text) { statusBar()->showMessage(text,20000); } -void MainWindow::startWizard() +void MainWindow::slotStartWizard() { Wizard *wizard = new Wizard(mCtx,keyMgmt,this); wizard->show(); @@ -729,7 +729,7 @@ void MainWindow::parseMime(QByteArray *message) } } -void MainWindow::checkAttachmentFolder() { +void MainWindow::slotCheckAttachmentFolder() { // TODO: always check? if(!settings.value("mime/parseMime").toBool()) { return; @@ -752,25 +752,25 @@ void MainWindow::checkAttachmentFolder() { } } -void MainWindow::importKeyFromEdit() +void MainWindow::slotImportKeyFromEdit() { - if (edit->tabCount()==0 || edit->curPage() == 0) { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } - keyMgmt->importKeys(edit->curTextPage()->toPlainText().toAscii()); + keyMgmt->slotImportKeys(edit->curTextPage()->toPlainText().toAscii()); } -void MainWindow::openKeyManagement() +void MainWindow::slotOpenKeyManagement() { keyMgmt->show(); keyMgmt->raise(); keyMgmt->activateWindow(); } -void MainWindow::encrypt() +void MainWindow::slotEncrypt() { - if (edit->tabCount()==0 || edit->curPage() == 0) { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } @@ -779,13 +779,13 @@ void MainWindow::encrypt() QByteArray *tmp = new QByteArray(); if (mCtx->encrypt(uidList, edit->curTextPage()->toPlainText().toUtf8(), tmp)) { QString *tmp2 = new QString(*tmp); - edit->fillTextEditWithText(*tmp2); + edit->slotFillTextEditWithText(*tmp2); } } -void MainWindow::sign() +void MainWindow::slotSign() { - if (edit->tabCount()==0 || edit->curPage() == 0) { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } @@ -794,13 +794,13 @@ void MainWindow::sign() QByteArray *tmp = new QByteArray(); if (mCtx->sign(uidList, edit->curTextPage()->toPlainText().toUtf8(), tmp)) { - edit->fillTextEditWithText(QString::fromUtf8(*tmp)); + edit->slotFillTextEditWithText(QString::fromUtf8(*tmp)); } } -void MainWindow::decrypt() +void MainWindow::slotDecrypt() { - if (edit->tabCount()== 0 || edit->curPage() == 0) { + if (edit->tabCount()== 0 || edit->slotCurPage() == 0) { return; } @@ -834,24 +834,24 @@ void MainWindow::decrypt() } } } - edit->fillTextEditWithText(QString::fromUtf8(*decrypted)); + edit->slotFillTextEditWithText(QString::fromUtf8(*decrypted)); } -void MainWindow::verify() +void MainWindow::slotVerify() { - if (edit->tabCount()==0 || edit->curPage() == 0) { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } // At first close verifynotification, if existing - edit->curPage()->closeNoteByClass("verifyNotification"); + edit->slotCurPage()->closeNoteByClass("verifyNotification"); // create new verfiy notification VerifyNotification *vn = new VerifyNotification(this, mCtx, mKeyList, edit->curTextPage()); // if signing information is found, show the notification, otherwise close it - if (vn->refresh()) { - edit->curPage()->showNotificationWidget(vn, "verifyNotification"); + if (vn->slotRefresh()) { + edit->slotCurPage()->showNotificationWidget(vn, "verifyNotification"); } else { vn->close(); } @@ -860,9 +860,9 @@ void MainWindow::verify() /* * Append the selected (not checked!) Key(s) To Textedit */ -void MainWindow::appendSelectedKeys() +void MainWindow::slotAppendSelectedKeys() { - if (edit->tabCount()==0 || edit->curPage() == 0) { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } @@ -871,7 +871,7 @@ void MainWindow::appendSelectedKeys() edit->curTextPage()->append(*keyArray); } -void MainWindow::copyMailAddressToClipboard() +void MainWindow::slotCopyMailAddressToClipboard() { if (mKeyList->getSelected()->isEmpty()) { return; @@ -883,7 +883,7 @@ void MainWindow::copyMailAddressToClipboard() cb->setText(mail); } -void MainWindow::showKeyDetails() +void MainWindow::slotShowKeyDetails() { if (mKeyList->getSelected()->isEmpty()) { return; @@ -895,28 +895,28 @@ void MainWindow::showKeyDetails() } } -void MainWindow::fileEncryption() +void MainWindow::slotFileEncryption() { QStringList *keyList; keyList = mKeyList->getChecked(); new FileEncryptionDialog(mCtx, *keyList, this); } -void MainWindow::fileEncrypt() +void MainWindow::slotFileEncrypt() { QStringList *keyList; keyList = mKeyList->getChecked(); new FileEncryptionDialog(mCtx, *keyList, this, FileEncryptionDialog::Encrypt); } -void MainWindow::fileDecrypt() +void MainWindow::slotFileDecrypt() { QStringList *keyList; keyList = mKeyList->getChecked(); new FileEncryptionDialog(mCtx, *keyList, this, FileEncryptionDialog::Decrypt); } -void MainWindow::openSettingsDialog() +void MainWindow::slotOpenSettingsDialog() { QString preLang = settings.value("int/lang").toString(); @@ -956,19 +956,19 @@ void MainWindow::openSettingsDialog() } -void MainWindow::cleanDoubleLinebreaks() +void MainWindow::slotCleanDoubleLinebreaks() { - if (edit->tabCount()==0 || edit->curPage() == 0) { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } QString content = edit->curTextPage()->toPlainText(); content.replace("\n\n", "\n"); - edit->fillTextEditWithText(content); + edit->slotFillTextEditWithText(content); } -void MainWindow::addPgpHeader() { - if (edit->tabCount()==0 || edit->curPage() == 0) { +void MainWindow::slotAddPgpHeader() { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } @@ -977,12 +977,12 @@ void MainWindow::addPgpHeader() { content.prepend("\n\n").prepend(GpgConstants::PGP_CRYPT_BEGIN); content.append("\n").append(GpgConstants::PGP_CRYPT_END); - edit->fillTextEditWithText(content); + edit->slotFillTextEditWithText(content); } -void MainWindow::cutPgpHeader() { +void MainWindow::slotCutPgpHeader() { - if (edit->tabCount()==0 || edit->curPage() == 0) { + if (edit->tabCount()==0 || edit->slotCurPage() == 0) { return; } @@ -1002,7 +1002,7 @@ void MainWindow::cutPgpHeader() { end = content.indexOf(GpgConstants::PGP_CRYPT_END); content.remove(end, QString(GpgConstants::PGP_CRYPT_END).size()); - edit->fillTextEditWithText(content.trimmed()); + edit->slotFillTextEditWithText(content.trimmed()); } void MainWindow::slotSetRestartNeeded(bool needed) @@ -1013,4 +1013,4 @@ void MainWindow::slotSetRestartNeeded(bool needed) bool MainWindow::getRestartNeeded() { return this->restartNeeded; -}
\ No newline at end of file +} diff --git a/mainwindow.h b/mainwindow.h index c282f21..9e699d3 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -71,7 +71,7 @@ public: */ MainWindow(); public slots: - void setStatusBarText(QString text); + void slotSetStatusBarText(QString text); protected: /** @@ -85,115 +85,115 @@ private slots: * @details encrypt the text of currently active textedit-page * with the currently checked keys */ - void encrypt(); + void slotEncrypt(); /** * @details Show a passphrase dialog and decrypt the text of currently active tab. */ - void decrypt(); + void slotDecrypt(); /** * @details Sign the text of currently active tab with the checked private keys */ - void sign(); + void slotSign(); /** * @details Verify the text of currently active tab and show verify information. * If document is signed with a key, which is not in keylist, show import missing * key from keyserver in Menu of verifynotification. */ - void verify(); + void slotVerify(); - void showKeyDetails(); + void slotShowKeyDetails(); - void startWizard(); + void slotStartWizard(); /** * @details Import keys from currently active tab to keylist if possible. */ - void importKeyFromEdit(); + void slotImportKeyFromEdit(); /** * @details Append the selected keys to currently active textedit. */ - void appendSelectedKeys(); + void slotAppendSelectedKeys(); /** * @details Copy the mailaddress of selected key to clipboard. * Method for keylists contextmenu. */ - void copyMailAddressToClipboard(); + void slotCopyMailAddressToClipboard(); /** * @details Open key management dialog. */ - void openKeyManagement(); + void slotOpenKeyManagement(); /** * @details Open about-dialog. */ - void about(); + void slotAbout(); /** * @details Open fileencrytion dialog. */ - void fileEncryption(); + void slotFileEncryption(); /** * @details Open dialog for encrypting file. */ - void fileEncrypt(); + void slotFileEncrypt(); /** * @details Open dialog for decrypting file. */ - void fileDecrypt(); + void slotFileDecrypt(); /** * @details Open settings-dialog. */ - void openSettingsDialog(); + void slotOpenSettingsDialog(); /** * @details Open online-tutorial in default browser. */ - void openTutorial(); + void slotOpenTutorial(); /** * @details Open integrated help in new tab. */ - void openHelp(); + void slotOpenHelp(); /** * @details Open integrated help in new tab with the specified page. */ - void openHelp(const QString page); + void slotOpenHelp(const QString page); /** * @details Show a warn message in status bar, if there are files in attachment folder. */ - void checkAttachmentFolder(); + void slotCheckAttachmentFolder(); /** * @details Open online translation tutorial in default browser. */ - void openTranslate(); + void slotOpenTranslate(); /** * @details Replace double linebreaks by single linebreaks in currently active tab. */ - void cleanDoubleLinebreaks(); + void slotCleanDoubleLinebreaks(); /** * @details Cut the existing PGP header and footer from current tab. */ - void cutPgpHeader(); + void slotCutPgpHeader(); /** * @details Add PGP header and footer to current tab. */ - void addPgpHeader(); + void slotAddPgpHeader(); // void dropEvent(QDropEvent *event); @@ -201,7 +201,7 @@ private slots: * @details Disable tab related actions, if number of tabs is 0. * @param number number of the opened tabs and -1, if no tab is opened */ - void disableTabActions(int number); + void slotDisableTabActions(int number); /** * @details get value of member restartNeeded to needed. diff --git a/quitdialog.cpp b/quitdialog.cpp index ecfb486..e32369b 100755 --- a/quitdialog.cpp +++ b/quitdialog.cpp @@ -92,7 +92,7 @@ QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs) connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QPushButton* btnNoKey = buttonBox->button(QDialogButtonBox::Discard); - connect(btnNoKey, SIGNAL(clicked()), SLOT(myDiscard())); + connect(btnNoKey, SIGNAL(clicked()), SLOT(slotMyDiscard())); /* * Set the layout @@ -107,7 +107,7 @@ QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs) } -void QuitDialog::myDiscard() +void QuitDialog::slotMyDiscard() { discarded =true; reject(); diff --git a/quitdialog.h b/quitdialog.h index eec9b63..bc24712 100755 --- a/quitdialog.h +++ b/quitdialog.h @@ -38,7 +38,7 @@ public: QList <int> getTabIdsToSave(); private slots: - void myDiscard(); + void slotMyDiscard(); private: QAction *closeAct; diff --git a/textedit.cpp b/textedit.cpp index 39039f2..e28304d 100644 --- a/textedit.cpp +++ b/textedit.cpp @@ -36,11 +36,11 @@ TextEdit::TextEdit() setLayout(layout); connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(removeTab(int))); - newTab(); + slotNewTab(); setAcceptDrops(false); } -void TextEdit::newTab() +void TextEdit::slotNewTab() { QString header = tr("untitled") + QString::number(++countPage)+".txt"; @@ -49,10 +49,10 @@ void TextEdit::newTab() tabWidget->addTab(page, header); tabWidget->setCurrentIndex(tabWidget->count() - 1); page->getTextPage()->setFocus(); - connect(page->getTextPage()->document(), SIGNAL(modificationChanged(bool)), this, SLOT(showModified())); + connect(page->getTextPage()->document(), SIGNAL(modificationChanged(bool)), this, SLOT(slotShowModified())); } -void TextEdit::newHelpTab(QString title, QString path) +void TextEdit::slotNewHelpTab(QString title, QString path) { HelpPage *page = new HelpPage(path); @@ -61,7 +61,7 @@ void TextEdit::newHelpTab(QString title, QString path) } -void TextEdit::open() +void TextEdit::slotOpen() { QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open file"), QDir::currentPath()); @@ -83,7 +83,7 @@ void TextEdit::open() tabWidget->setCurrentIndex(tabWidget->count() - 1); QApplication::restoreOverrideCursor(); page->getTextPage()->setFocus(); - connect(page->getTextPage()->document(), SIGNAL(modificationChanged(bool)), this, SLOT(showModified())); + connect(page->getTextPage()->document(), SIGNAL(modificationChanged(bool)), this, SLOT(slotShowModified())); //enableAction(true) file.close(); } else { @@ -96,18 +96,18 @@ void TextEdit::open() } } -void TextEdit::save() +void TextEdit::slotSave() { - if (tabWidget->count() == 0 || curPage() == 0) { + if (tabWidget->count() == 0 || slotCurPage() == 0) { return; } - QString fileName = curPage()->getFilePath(); + QString fileName = slotCurPage()->getFilePath(); if (fileName.isEmpty()) { //QString docname = tabWidget->tabText(tabWidget->currentIndex()); //docname.remove(0,2); - saveAs(); + slotSaveAs(); } else { saveFile(fileName); } @@ -122,7 +122,7 @@ bool TextEdit::saveFile(const QString &fileName) QFile file(fileName); if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { - EditorPage *page = curPage(); + EditorPage *page = slotCurPage(); QTextStream outputStream(&file); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -148,13 +148,13 @@ bool TextEdit::saveFile(const QString &fileName) } -bool TextEdit::saveAs() +bool TextEdit::slotSaveAs() { - if (tabWidget->count() == 0 || curPage() == 0) { + if (tabWidget->count() == 0 || slotCurPage() == 0) { return true; } - EditorPage *page = curPage(); + EditorPage *page = slotCurPage(); QString path; if(page->getFilePath() != "") { path = page->getFilePath(); @@ -167,11 +167,11 @@ bool TextEdit::saveAs() return saveFile(fileName); } -void TextEdit::closeTab() +void TextEdit::slotCloseTab() { removeTab(tabWidget->currentIndex()); if (tabWidget->count() != 0) { - curPage()->getTextPage()->setFocus(); + slotCurPage()->getTextPage()->setFocus(); } } @@ -212,7 +212,7 @@ void TextEdit::removeTab(int index) */ bool TextEdit::maybeSaveCurrentTab(bool askToSave) { - EditorPage *page = curPage(); + EditorPage *page = slotCurPage(); // if this page is no textedit, there should be nothing to save if(page == 0) { return true; @@ -237,7 +237,7 @@ bool TextEdit::maybeSaveCurrentTab(bool askToSave) { if (filePath == "") { //QString docname = tabWidget->tabText(tabWidget->currentIndex()); //docname.remove(0,2); - return saveAs(); + return slotSaveAs(); } else { return saveFile(filePath); } @@ -335,13 +335,13 @@ int TextEdit::tabCount() return tabWidget->count(); } -EditorPage* TextEdit::curPage() +EditorPage* TextEdit::slotCurPage() { EditorPage *curPage = qobject_cast<EditorPage *>(tabWidget->currentWidget()); return curPage; } -void TextEdit::quote() +void TextEdit::slotQuote() { if (tabWidget->count() == 0 || curTextPage() == 0) { return; @@ -363,7 +363,7 @@ void TextEdit::quote() cursor.endEditBlock(); } -void TextEdit::fillTextEditWithText(QString text) { +void TextEdit::slotFillTextEditWithText(QString text) { QTextCursor cursor(curTextPage()->document()); cursor.beginEditBlock(); this->curTextPage()->selectAll(); @@ -385,7 +385,7 @@ void TextEdit::loadFile(const QString &fileName) QApplication::setOverrideCursor(Qt::WaitCursor); curTextPage()->setPlainText(in.readAll()); QApplication::restoreOverrideCursor(); - curPage()->setFilePath(fileName); + slotCurPage()->setFilePath(fileName); tabWidget->setTabText(tabWidget->currentIndex(), strippedName(fileName)); file.close(); // statusBar()->showMessage(tr("File loaded"), 2000); @@ -396,7 +396,7 @@ QString TextEdit::strippedName(const QString &fullFileName) return QFileInfo(fullFileName).fileName(); } -void TextEdit::print() +void TextEdit::slotPrint() { if (tabWidget->count() == 0) { return; @@ -421,7 +421,7 @@ void TextEdit::print() #endif } -void TextEdit::showModified() { +void TextEdit::slotShowModified() { int index=tabWidget->currentIndex(); QString title= tabWidget->tabText(index); // if doc is modified now, add leading * to title, @@ -433,14 +433,14 @@ void TextEdit::showModified() { } } -void TextEdit::switchTabUp() { +void TextEdit::slotSwitchTabUp() { if (tabWidget->count() > 1) { int newindex=(tabWidget->currentIndex()+1)%(tabWidget->count()); tabWidget->setCurrentIndex(newindex); } } -void TextEdit::switchTabDown() { +void TextEdit::slotSwitchTabDown() { if (tabWidget->count() > 1) { int newindex=(tabWidget->currentIndex()-1+tabWidget->count())%tabWidget->count(); tabWidget->setCurrentIndex(newindex); @@ -465,7 +465,7 @@ QHash<int, QString> TextEdit::unsavedDocuments() { return unsavedDocs; } -void TextEdit::cut() +void TextEdit::slotCut() { if (tabWidget->count() == 0 || curTextPage() == 0) { return; @@ -474,7 +474,7 @@ void TextEdit::cut() curTextPage()->cut(); } -void TextEdit::copy() +void TextEdit::slotCopy() { if (tabWidget->count() == 0) { return; @@ -489,7 +489,7 @@ void TextEdit::copy() } -void TextEdit::paste() +void TextEdit::slotPaste() { if (tabWidget->count() == 0 || curTextPage() == 0) { return; @@ -498,7 +498,7 @@ void TextEdit::paste() curTextPage()->paste(); } -void TextEdit::undo() +void TextEdit::slotUndo() { if (tabWidget->count() == 0 || curTextPage() == 0) { return; @@ -507,7 +507,7 @@ void TextEdit::undo() curTextPage()->undo(); } -void TextEdit::redo() +void TextEdit::slotRedo() { if (tabWidget->count() == 0 || curTextPage() == 0) { return; @@ -516,7 +516,7 @@ void TextEdit::redo() curTextPage()->redo(); } -void TextEdit::zoomIn() +void TextEdit::slotZoomIn() { if (tabWidget->count() == 0 ) { return; @@ -530,7 +530,7 @@ void TextEdit::zoomIn() } -void TextEdit::zoomOut() +void TextEdit::slotZoomOut() { if (tabWidget->count() == 0 ) { return; @@ -543,7 +543,7 @@ void TextEdit::zoomOut() } } -void TextEdit::selectAll() +void TextEdit::slotSelectAll() { if (tabWidget->count() == 0 || curTextPage() == 0) { return; @@ -94,44 +94,44 @@ public slots: /** * @details Insert a ">" at the begining of every line of current textedit. */ - void quote(); + void slotQuote(); /** * @details replace the text of currently active textedit with given text. * @param text to fill on. */ - void fillTextEditWithText(QString text); + void slotFillTextEditWithText(QString text); /** * @details Saves the content of the current tab, if it has a filepath * otherwise it calls saveAs for the current tab */ - void save(); + void slotSave(); /** * @details Opens a savefiledialog and calls saveFile with the choosen filename. * * @return Return the return value of the savefile method */ - bool saveAs(); + bool slotSaveAs(); /** * @details Show an OpenFileDoalog and open the file in a new tab. * Shows an error dialog, if the open fails. * Set the focus to the tab of the opened file. */ - void open(); + void slotOpen(); /** * @details Open a print-dialog for the current tab */ - void print(); + void slotPrint(); /** * @details Adds a new tab with the title "untitled"+countpage+".txt" * Sets the focus to the new tab. Increase Tab-Count by one */ - void newTab(); + void slotNewTab(); /** * @details Adds a new tab with the given title and opens given html file. @@ -139,36 +139,36 @@ public slots: * @param title title for the tab * @param path path for html file to show */ - void newHelpTab(QString title, QString path); + void slotNewHelpTab(QString title, QString path); /** * @details put a * in front of current tabs title, if current textedit is modified */ - void showModified(); + void slotShowModified(); /** * @details close the current tab and decrease TabWidget->count by \a 1 * */ - void closeTab(); + void slotCloseTab(); /** * @details Switch to the next tab. * */ - void switchTabUp(); + void slotSwitchTabUp(); /** * @details Switch to the previous tab. * */ - void switchTabDown(); + void slotSwitchTabDown(); /** * @details Return pointer to the currently activated tabpage. * */ - EditorPage *curPage(); + EditorPage *slotCurPage(); private: /** @@ -209,23 +209,23 @@ private slots: /** * @details Cut selected text in current textpage. */ - void cut(); + void slotCut(); /** * @details Copy selected text of current textpage to clipboard. */ - void copy(); + void slotCopy(); /** * @details Paste text from clipboard to current textpage. */ - void paste(); + void slotPaste(); /** * @details Undo last change in current textpage. * */ - void undo(); + void slotUndo(); /**************************************************************************************** * Name: redo * Description: redo last change in current textpage @@ -237,10 +237,10 @@ private slots: * @brief * */ - void redo(); + void slotRedo(); - void zoomIn(); - void zoomOut(); + void slotZoomIn(); + void slotZoomOut(); /**************************************************************************************** * Name: selectAll * Description: select all in current textpage @@ -252,7 +252,7 @@ private slots: * @brief * */ - void selectAll(); + void slotSelectAll(); protected: // void dragEnterEvent(QDragEnterEvent *event); diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp index a8e53e6..ef02b26 100644 --- a/verifydetailsdialog.cpp +++ b/verifydetailsdialog.cpp @@ -29,17 +29,17 @@ VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx mTextpage = edit; this->setWindowTitle(tr("Signaturedetails")); - connect(mCtx, SIGNAL(keyDBChanged()), this, SLOT(refresh())); + connect(mCtx, SIGNAL(keyDBChanged()), this, SLOT(slotRefresh())); mainLayout = new QHBoxLayout(); this->setLayout(mainLayout); mVbox = new QWidget(); - refresh(); + slotRefresh(); this->exec(); } -void VerifyDetailsDialog::refresh() +void VerifyDetailsDialog::slotRefresh() { mVbox->close(); diff --git a/verifydetailsdialog.h b/verifydetailsdialog.h index 4feee35..c71afda 100644 --- a/verifydetailsdialog.h +++ b/verifydetailsdialog.h @@ -33,7 +33,7 @@ public: explicit VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, QTextEdit *edit); private slots: - void refresh(); + void slotRefresh(); private: GpgME::GpgContext *mCtx; diff --git a/verifykeydetailbox.cpp b/verifykeydetailbox.cpp index 62574da..b040d4f 100644 --- a/verifykeydetailbox.cpp +++ b/verifykeydetailbox.cpp @@ -35,7 +35,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx, case GPG_ERR_NO_PUBKEY: { QPushButton *importButton = new QPushButton(tr("Import from keyserver")); - connect(importButton, SIGNAL(clicked()), this, SLOT(importFormKeyserver())); + connect(importButton, SIGNAL(clicked()), this, SLOT(slotImportFormKeyserver())); this->setTitle(tr("Key not present with id 0x") + signature->fpr); @@ -83,10 +83,10 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx, this->setLayout(grid); } -void VerifyKeyDetailBox::importFormKeyserver() +void VerifyKeyDetailBox::slotImportFormKeyserver() { KeyServerImportDialog *importDialog =new KeyServerImportDialog(mCtx,mKeyList,this); - importDialog->import(QStringList(fpr)); + importDialog->slotImport(QStringList(fpr)); } QString VerifyKeyDetailBox::beautifyFingerprint(QString fingerprint) diff --git a/verifykeydetailbox.h b/verifykeydetailbox.h index 1c31ae0..29d198e 100644 --- a/verifykeydetailbox.h +++ b/verifykeydetailbox.h @@ -34,7 +34,7 @@ public: explicit VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, gpgme_signature_t signature); private slots: - void importFormKeyserver(); + void slotImportFormKeyserver(); private: GpgME::GpgContext* mCtx; diff --git a/verifynotification.cpp b/verifynotification.cpp index 3e056b9..344cbab 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -29,14 +29,14 @@ VerifyNotification::VerifyNotification(QWidget *parent, GpgME::GpgContext *ctx, mTextpage = edit; verifyLabel = new QLabel(this); - connect(mCtx, SIGNAL(keyDBChanged()), this, SLOT(refresh())); + connect(mCtx, SIGNAL(keyDBChanged()), this, SLOT(slotRefresh())); connect(edit, SIGNAL(textChanged()), this, SLOT(close())); importFromKeyserverAct = new QAction(tr("Import missing key from Keyserver"), this); - connect(importFromKeyserverAct, SIGNAL(triggered()), this, SLOT(importFromKeyserver())); + connect(importFromKeyserverAct, SIGNAL(triggered()), this, SLOT(slotImportFromKeyserver())); showVerifyDetailsAct = new QAction(tr("Show detailed verify information"), this); - connect(showVerifyDetailsAct, SIGNAL(triggered()), this, SLOT(showVerifyDetails())); + connect(showVerifyDetailsAct, SIGNAL(triggered()), this, SLOT(slotShowVerifyDetails())); detailMenu = new QMenu(this); detailMenu->addAction(showVerifyDetailsAct); @@ -53,10 +53,10 @@ VerifyNotification::VerifyNotification(QWidget *parent, GpgME::GpgContext *ctx, this->setLayout(notificationWidgetLayout); } -void VerifyNotification::importFromKeyserver() +void VerifyNotification::slotImportFromKeyserver() { KeyServerImportDialog *importDialog =new KeyServerImportDialog(mCtx,mKeyList, this); - importDialog->import(*keysNotInList); + importDialog->slotImport(*keysNotInList); } void VerifyNotification::setVerifyLabel(QString text, verify_label_status verifyLabelStatus) @@ -85,12 +85,12 @@ void VerifyNotification::showImportAction(bool visible) importFromKeyserverAct->setVisible(visible); } -void VerifyNotification::showVerifyDetails() +void VerifyNotification::slotShowVerifyDetails() { new VerifyDetailsDialog(this, mCtx, mKeyList, mTextpage); } -bool VerifyNotification::refresh() +bool VerifyNotification::slotRefresh() { verify_label_status verifyStatus=VERIFY_ERROR_OK; diff --git a/verifynotification.h b/verifynotification.h index e1b4f1b..60e55f9 100644 --- a/verifynotification.h +++ b/verifynotification.h @@ -81,17 +81,17 @@ public slots: * @details Import the keys contained in keysNotInList from keyserver * */ - void importFromKeyserver(); + void slotImportFromKeyserver(); /** * @details Show a dialog with signing details. */ - void showVerifyDetails(); + void slotShowVerifyDetails(); /** * @details Refresh the contents of dialog. */ - bool refresh(); + bool slotRefresh(); private: QMenu *detailMenu; /** Menu for te Button in verfiyNotification */ @@ -52,18 +52,18 @@ Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) setStartId(settings.value("wizard/nextPage", -1).toInt()); settings.remove("wizard/nextPage"); - connect(this, SIGNAL(accepted()), this, SLOT(wizardAccepted())); - connect(this, SIGNAL(openHelp(QString)), parentWidget(), SLOT(openHelp(QString))); + connect(this, SIGNAL(accepted()), this, SLOT(slotWizardAccepted())); + connect(this, SIGNAL(signalOpenHelp(QString)), parentWidget(), SLOT(signalOpenHelp(QString))); } -void Wizard::wizardAccepted() { +void Wizard::slotWizardAccepted() { QSettings settings; // Don't show is mapped to show -> negation settings.setValue("wizard/showWizard", !field("showWizard").toBool()); if(field("openHelp").toBool()) { - emit openHelp("docu.html#content"); + emit signalOpenHelp("docu.html#content"); } } @@ -98,7 +98,7 @@ bool Wizard::importPubAndSecKeysFromDir(const QString dir, KeyMgmt *keyMgmt) inBuffer.append(pubRingFile.readAll()); pubRingFile.close(); } - keyMgmt->importKeys(inBuffer); + keyMgmt->slotImportKeys(inBuffer); inBuffer.clear(); return true; @@ -136,7 +136,7 @@ IntroPage::IntroPage(QWidget *parent) langSelectBox->setCurrentIndex(langSelectBox->findText(langValue)); } - connect(langSelectBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(langChange(QString))); + connect(langSelectBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotLangChange(QString))); // set layout and add widgets QVBoxLayout *layout = new QVBoxLayout; @@ -146,7 +146,7 @@ IntroPage::IntroPage(QWidget *parent) setLayout(layout); } -void IntroPage::langChange(QString lang) { +void IntroPage::slotLangChange(QString lang) { QSettings settings; settings.setValue("int/lang", languages.key(lang)); settings.setValue("wizard/nextPage", this->wizard()->currentId()); @@ -167,19 +167,19 @@ ChoosePage::ChoosePage(QWidget *parent) "may possibly want to ")+"<a href=""Wizard::Page_GenKey"">" +tr("create a new keypair")+"</a><hr>"); keygenLabel->setWordWrap(true); - connect(keygenLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(jumpPage(const QString&))); + connect(keygenLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(slotJumpPage(const QString&))); QLabel *importGpg4usbLabel = new QLabel(tr("If you upgrade from an older version of gpg4usb you may want to ") +"<a href=""Wizard::Page_ImportFromGpg4usb"">" +tr("import settings and/or keys from gpg4usb")+"</a>"); importGpg4usbLabel->setWordWrap(true); - connect(importGpg4usbLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(jumpPage(const QString&))); + connect(importGpg4usbLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(slotJumpPage(const QString&))); QLabel *importGnupgLabel = new QLabel(tr("If you are already using GnuPG you may want to ") +"<a href=""Wizard::Page_ImportFromGnupg"">" +tr("import keys from GnuPG")+"</a><hr>"); importGnupgLabel->setWordWrap(true); - connect(importGnupgLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(jumpPage(const QString&))); + connect(importGnupgLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(slotJumpPage(const QString&))); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(keygenLabel); @@ -194,7 +194,7 @@ int ChoosePage::nextId() const return nextPage; } -void ChoosePage::jumpPage(const QString& page) +void ChoosePage::slotJumpPage(const QString& page) { QMetaObject qmo = Wizard::staticMetaObject; int index = qmo.indexOfEnumerator("WizardPages"); @@ -226,7 +226,7 @@ ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *ke QLabel *configLabel = new QLabel(tr("Configuration")); QPushButton *importFromGpg4usbButton = new QPushButton(tr("Import from gpg4usb")); - connect(importFromGpg4usbButton, SIGNAL(clicked()), this, SLOT(importFromOlderGpg4usb())); + connect(importFromGpg4usbButton, SIGNAL(clicked()), this, SLOT(slotImportFromOlderGpg4usb())); QGridLayout *gpg4usbLayout = new QGridLayout(); gpg4usbLayout->addWidget(topLabel,1,1,1,2); @@ -239,7 +239,7 @@ ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *ke this->setLayout(gpg4usbLayout); } -void ImportFromGpg4usbPage::importFromOlderGpg4usb() +void ImportFromGpg4usbPage::slotImportFromOlderGpg4usb() { QString dir = QFileDialog::getExistingDirectory(this,tr("Other gpg4usb directory")); @@ -257,7 +257,7 @@ void ImportFromGpg4usbPage::importFromOlderGpg4usb() // try to import config, if appropriate box is checked if (gpg4usbConfigCheckBox->isChecked()) { - importConfFromGpg4usb(dir); + slotImportConfFromGpg4usb(dir); QSettings settings; settings.setValue("wizard/nextPage", this->nextId()); @@ -269,7 +269,7 @@ void ImportFromGpg4usbPage::importFromOlderGpg4usb() wizard()->next(); } -bool ImportFromGpg4usbPage::importConfFromGpg4usb(QString dir) { +bool ImportFromGpg4usbPage::slotImportConfFromGpg4usb(QString dir) { QString path = dir+"/conf/gpg4usb.ini"; QSettings oldconf(path, QSettings::IniFormat, this); QSettings actualConf; @@ -297,7 +297,7 @@ ImportFromGnupgPage::ImportFromGnupgPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgm gnupgLabel->setWordWrap(true); importFromGnupgButton = new QPushButton(tr("Import keys from GnuPG")); - connect(importFromGnupgButton, SIGNAL(clicked()), this, SLOT(importKeysFromGnupg())); + connect(importFromGnupgButton, SIGNAL(clicked()), this, SLOT(slotrImportKeysFromGnupg())); QGridLayout *layout = new QGridLayout(); layout->addWidget(gnupgLabel); @@ -306,7 +306,7 @@ ImportFromGnupgPage::ImportFromGnupgPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgm this->setLayout(layout); } -void ImportFromGnupgPage::importKeysFromGnupg() +void ImportFromGnupgPage::slotrImportKeysFromGnupg() { // first get gnupghomedir and check, if it exists QString gnuPGHome = getGnuPGHome(); @@ -380,7 +380,7 @@ KeyGenPage::KeyGenPage(GpgME::GpgContext *ctx, QWidget *parent) layout->addWidget(topLabel); layout->addWidget(linkLabel); layout->addWidget(createKeyButtonBox); - connect(createKeyButton, SIGNAL(clicked()), this, SLOT(generateKeyDialog())); + connect(createKeyButton, SIGNAL(clicked()), this, SLOT(slotGenerateKeyDialog())); setLayout(layout); } @@ -390,7 +390,7 @@ int KeyGenPage::nextId() const return Wizard::Page_Conclusion; } -void KeyGenPage::generateKeyDialog() +void KeyGenPage::slotGenerateKeyDialog() { KeyGenDialog *keyGenDialog = new KeyGenDialog(mCtx, this); keyGenDialog->exec(); @@ -51,10 +51,10 @@ private: KeyMgmt *mKeyMgmt; private slots: - void wizardAccepted(); + void slotWizardAccepted(); signals: - void openHelp(QString page); + void signalOpenHelp(QString page); }; class IntroPage : public QWizardPage @@ -67,7 +67,7 @@ public: int nextId() const; private slots: - void langChange(QString lang); + void slotLangChange(QString lang); }; class ChoosePage : public QWizardPage @@ -78,7 +78,7 @@ public: ChoosePage(QWidget *parent = 0); private slots: - void jumpPage(const QString& page); + void slotJumpPage(const QString& page); private: int nextId() const; @@ -96,8 +96,8 @@ private slots: /** * @details Import keys from gnupg-homedir, private or/and public depend on the checked boxes */ - void importFromOlderGpg4usb(); - bool importConfFromGpg4usb(QString dir); + void slotImportFromOlderGpg4usb(); + bool slotImportConfFromGpg4usb(QString dir); private: int nextId() const; @@ -119,7 +119,7 @@ private slots: /** * @details Import keys from gnupg-homedir, private or/and public depend on the checked boxes */ - void importKeysFromGnupg(); + void slotrImportKeysFromGnupg(); private: KeyMgmt *mKeyMgmt; @@ -145,7 +145,7 @@ public: int nextId() const; private slots: - void generateKeyDialog(); + void slotGenerateKeyDialog(); private: GpgME::GpgContext *mCtx; |