aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-09-30 01:19:16 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-09-30 01:19:16 +0000
commitc3e7a44927335b8f42ce6bfceb96927ff187ffbf (patch)
tree9b70af8e1248827e5824fc57794256886cce9544
parentrefactored slots in fileencryption.* (diff)
downloadgpg4usb-c3e7a44927335b8f42ce6bfceb96927ff187ffbf.tar.gz
gpg4usb-c3e7a44927335b8f42ce6bfceb96927ff187ffbf.zip
refactored slots in findwidget.*, gpgcontext.*,keydetailsdialog.*,keygendialog.*
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@981 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--findwidget.cpp18
-rw-r--r--findwidget.h6
-rw-r--r--gpgcontext.cpp6
-rw-r--r--gpgcontext.h2
-rw-r--r--keydetailsdialog.cpp8
-rw-r--r--keydetailsdialog.h4
-rw-r--r--keygendialog.cpp20
-rw-r--r--keygendialog.h11
8 files changed, 38 insertions, 37 deletions
diff --git a/findwidget.cpp b/findwidget.cpp
index 9481fbd..205b26d 100644
--- a/findwidget.cpp
+++ b/findwidget.cpp
@@ -17,16 +17,16 @@ FindWidget::FindWidget(QWidget *parent, QTextEdit *edit) :
notificationWidgetLayout->addWidget(closeButton);
this->setLayout(notificationWidgetLayout);
- connect(findEdit,SIGNAL(textEdited(QString)),this,SLOT(find()));
- connect(findEdit,SIGNAL(returnPressed()),this,SLOT(findNext()));
- connect(nextButton,SIGNAL(clicked()),this,SLOT(findNext()));
- connect(closeButton,SIGNAL(clicked()),this,SLOT(closeSlot()));
+ connect(findEdit,SIGNAL(textEdited(QString)),this,SLOT(slotFind()));
+ connect(findEdit,SIGNAL(returnPressed()),this,SLOT(slotFindNext()));
+ connect(nextButton,SIGNAL(clicked()),this,SLOT(slotFindNext()));
+ connect(closeButton,SIGNAL(clicked()),this,SLOT(slotClose()));
// The timer is necessary for setting the focus
QTimer::singleShot(0, findEdit, SLOT(setFocus()));
}
-void FindWidget::findNext()
+void FindWidget::slotFindNext()
{
cursor = mTextpage->document()->find(findEdit->text(), cursor, QTextDocument::FindCaseSensitively);
// if end of document is reached, restart search from beginning
@@ -47,7 +47,7 @@ void FindWidget::findNext()
mTextpage->setTextCursor(cursor);
}
-void FindWidget::find()
+void FindWidget::slotFind()
{
if (cursor.anchor() == -1) {
cursor = mTextpage->document()->find(findEdit->text(), cursor, QTextDocument::FindCaseSensitively);
@@ -72,15 +72,15 @@ void FindWidget::keyPressEvent( QKeyEvent* e )
switch ( e->key() )
{
case Qt::Key_Escape:
- this->closeSlot();
+ this->slotClose();
break;
case Qt::Key_F3:
- this->findNext();
+ this->slotFindNext();
break;
}
}
-void FindWidget::closeSlot() {
+void FindWidget::slotClose() {
if ( cursor.position() == -1) {
cursor = mTextpage->textCursor();
cursor.setPosition(0);
diff --git a/findwidget.h b/findwidget.h
index 54d2b83..a623de5 100644
--- a/findwidget.h
+++ b/findwidget.h
@@ -30,8 +30,8 @@ private:
QTextCharFormat cursorFormat;
private slots:
- void findNext();
- void find();
- void closeSlot();
+ void slotFindNext();
+ void slotFind();
+ void slotClose();
};
#endif // FINDWIDGET_H
diff --git a/gpgcontext.cpp b/gpgcontext.cpp
index 259332e..3a38333 100644
--- a/gpgcontext.cpp
+++ b/gpgcontext.cpp
@@ -66,8 +66,8 @@ GpgContext::GpgContext()
QStringList args;
args << "--homedir" << gpgKeys << "--list-keys";
- connect(this,SIGNAL(keyDBChanged()),this,SLOT(refreshKeyList()));
- refreshKeyList();
+ connect(this,SIGNAL(keyDBChanged()),this,SLOT(slotRefreshKeyList()));
+ slotRefreshKeyList();
}
/** Destructor
@@ -256,7 +256,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 358f040..304faa5 100644
--- a/gpgcontext.h
+++ b/gpgcontext.h
@@ -140,7 +140,7 @@ signals:
void keyDBChanged();
private slots:
- void refreshKeyList();
+ void slotRefreshKeyList();
private:
QByteArray mPasswordCache;
diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp
index 2e2e280..ef5aafd 100644
--- a/keydetailsdialog.cpp
+++ b/keydetailsdialog.cpp
@@ -117,7 +117,7 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, KgpgCore::KgpgKey key
//copyFingerprintButton.setStyleSheet("QPushButton {border: 0px; } QPushButton:Pressed {} ");
copyFingerprintButton.setFlat(true);
copyFingerprintButton.setToolTip(tr("copy fingerprint to clipboard"));
- connect(&copyFingerprintButton, SIGNAL(clicked()), this, SLOT(copyFingerprint()));
+ connect(&copyFingerprintButton, SIGNAL(clicked()), this, SLOT(slotCopyFingerprint()));
hboxFP->addWidget(&copyFingerprintButton);
@@ -144,7 +144,7 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, KgpgCore::KgpgKey key
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);
@@ -183,7 +183,7 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, KgpgCore::KgpgKey key
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"),
@@ -244,7 +244,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 08b5d58..19d2fde 100644
--- a/keydetailsdialog.h
+++ b/keydetailsdialog.h
@@ -55,13 +55,13 @@ private slots:
/**
* @details Export the key to a file, which is choosen in a file dialog
*/
- void exportPrivateKey();
+ void slotExportPrivateKey();
void slotExportPrivateKeyDone(int result);
/**
* @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 75116c6..86a0b20 100644
--- a/keygendialog.cpp
+++ b/keygendialog.cpp
@@ -104,17 +104,17 @@ 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(keyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(keyTypeChanged()));
- connect(keySizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(keySizeChanged()));
+ connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotExpireBoxChanged()));
+ connect(passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(slotPasswordEditChanged()));
+ connect(keyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotKeyTypeChanged()));
+ connect(keySizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(slotKeySizeChanged()));
this->setLayout(vbox2);
}
-void KeyGenDialog::keyGenAccept()
+void KeyGenDialog::slotKeyGenAccept()
{
QString errorString = "";
QString keyGenParams = "";
@@ -211,7 +211,7 @@ void KeyGenDialog::keyGenAccept()
}
}
-void KeyGenDialog::expireBoxChanged()
+void KeyGenDialog::slotExpireBoxChanged()
{
if (expireCheckBox->checkState()) {
dateEdit->setEnabled(false);
@@ -220,12 +220,12 @@ void KeyGenDialog::expireBoxChanged()
}
}
-void KeyGenDialog::passwordEditChanged()
+void KeyGenDialog::slotPasswordEditChanged()
{
pwStrengthSlider->setValue(checkPassWordStrength());
update();
}
-void KeyGenDialog::keySizeChanged()
+void KeyGenDialog::slotKeySizeChanged()
{
if (keySizeSpinBox->value() > 2048 && lastKeySize <=2048) {
QMessageBox::warning(this, tr("Key size warning"),
@@ -234,7 +234,7 @@ void KeyGenDialog::keySizeChanged()
lastKeySize=keySizeSpinBox->value();
}
-void KeyGenDialog::keyTypeChanged()
+void KeyGenDialog::slotKeyTypeChanged()
{
if (keyTypeComboBox->currentText() == "RSA") {
keySizeSpinBox->setMaximum(16384);
diff --git a/keygendialog.h b/keygendialog.h
index 72b5c2b..08f9c4c 100644
--- a/keygendialog.h
+++ b/keygendialog.h
@@ -65,31 +65,32 @@ private:
QCheckBox *expireCheckBox; /** Checkbox, if key should expire */
QSlider *pwStrengthSlider; /** Slider showing the password strength */
int lastKeySize; /** integer to remember to last selected keysize (only display warning first tim above 2048)*/
+
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 When keysize changed, show message, when too large
*/
- void keySizeChanged();
+ void slotKeySizeChanged();
/**
* @details When passwordedit changed, set keysize appropriately
*/
- void keyTypeChanged();
+ void slotKeyTypeChanged();
/**
* @details check all lineedits for false entries. Show error, when there is one, otherwise generate the key
*/
- void keyGenAccept();
+ void slotKeyGenAccept();
};
#endif // __KEYGENDIALOG_H__