aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-29 22:29:36 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-29 22:29:36 +0000
commit25db5c0f40379dadd4224cfbd87aad92a49d90ae (patch)
treee940feff28027f9b80397e2cc1b7e82b58df8e41
parentbaeutified icons for sign and verify (diff)
downloadgpg4usb-25db5c0f40379dadd4224cfbd87aad92a49d90ae.tar.gz
gpg4usb-25db5c0f40379dadd4224cfbd87aad92a49d90ae.zip
refactored gpgwin -> mainwindow and context -> gpgcontext
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@588 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to '')
-rw-r--r--TODO8
-rwxr-xr-xfileencryptiondialog.cpp2
-rwxr-xr-xfileencryptiondialog.h6
-rw-r--r--gpg4usb.pro8
-rw-r--r--gpgcontext.cpp (renamed from context.cpp)52
-rw-r--r--gpgcontext.h (renamed from context.h)6
-rw-r--r--keydetailsdialog.cpp2
-rw-r--r--keydetailsdialog.h6
-rw-r--r--keygenthread.cpp2
-rw-r--r--keygenthread.h6
-rw-r--r--keylist.cpp2
-rw-r--r--keylist.h6
-rwxr-xr-xkeymgmt.cpp2
-rwxr-xr-xkeymgmt.h4
-rw-r--r--keyserverimportdialog.cpp2
-rw-r--r--keyserverimportdialog.h6
-rw-r--r--main.cpp4
-rw-r--r--mainwindow.cpp (renamed from gpgwin.cpp)62
-rw-r--r--mainwindow.h (renamed from gpgwin.h)6
-rw-r--r--verifydetailsdialog.cpp2
-rw-r--r--verifydetailsdialog.h4
-rw-r--r--verifykeydetailbox.cpp2
-rw-r--r--verifykeydetailbox.h4
-rw-r--r--verifynotification.cpp2
-rw-r--r--verifynotification.h4
25 files changed, 105 insertions, 105 deletions
diff --git a/TODO b/TODO
index 72d71d9..f5caba4 100644
--- a/TODO
+++ b/TODO
@@ -24,7 +24,7 @@ Release 0.3.1
- cross out expired keys and add warning in key properties [DONE]
- stealth mode for windows (http://www.portablefreeware.com/forums/viewtopic.php?f=4&t=3713) [DONE]
- keyid should be searchable in import from keyserver [DONE]
-- beautify icons for verify and sign
+- beautify icons for verify and sign [DONE]
Release 0.3.2
- set gpgme error language to chosen language (context.cpp:49)
@@ -34,9 +34,9 @@ Release 0.3.2
- understandable message if no matching private key found for decryption
- investigate in adding a offline help system
- investigate in embedding a steganography tool
-- refactoring and cleanup:
- - gpgwin.cpp -> mainwindow.cpp
- - context.cpp -> gpgcontext.cpp
+- refactoring and cleanup: [DONE]
+ - gpgwin.cpp -> mainwindow.cpp [DONE]
+ - context.cpp -> gpgcontext.cpp [DONE]
- optionally open new tab after encryption/decrytion
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp
index 58a3e2d..53bf8f7 100755
--- a/fileencryptiondialog.cpp
+++ b/fileencryptiondialog.cpp
@@ -21,7 +21,7 @@
#include "fileencryptiondialog.h"
-FileEncryptionDialog::FileEncryptionDialog(GpgME::Context *ctx, QString iconPath, QStringList keyList, QWidget *parent)
+FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconPath, QStringList keyList, QWidget *parent)
: QDialog(parent)
{
diff --git a/fileencryptiondialog.h b/fileencryptiondialog.h
index 2fe0c62..7ba380b 100755
--- a/fileencryptiondialog.h
+++ b/fileencryptiondialog.h
@@ -22,7 +22,7 @@
#ifndef __FILEENCRYPTIONDIALOG_H__
#define __FILEENCRYPTIONDIALOG_H__
-#include "context.h"
+#include "gpgcontext.h"
#include "keylist.h"
QT_BEGIN_NAMESPACE
@@ -58,7 +58,7 @@ public:
* @param keyList
* @param parent
*/
- FileEncryptionDialog(GpgME::Context *ctx, QString iconPath, QStringList keyList , QWidget *parent = 0);
+ FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconPath, QStringList keyList , QWidget *parent = 0);
public slots:
/**
@@ -99,7 +99,7 @@ private:
QRadioButton *radioDec; /**< TODO */
protected:
- GpgME::Context *mCtx; /**< TODO */
+ GpgME::GpgContext *mCtx; /**< TODO */
KeyList *mKeyList; /**< TODO */
};
diff --git a/gpg4usb.pro b/gpg4usb.pro
index 0614090..4cce0ca 100644
--- a/gpg4usb.pro
+++ b/gpg4usb.pro
@@ -16,8 +16,8 @@ CONFIG += debug
QT += network
# Input
HEADERS += attachments.h \
- context.h \
- gpgwin.h \
+ gpgcontext.h \
+ mainwindow.h \
keylist.h \
keymgmt.h \
fileencryptiondialog.h \
@@ -34,8 +34,8 @@ HEADERS += attachments.h \
verifydetailsdialog.h \
verifykeydetailbox.h
SOURCES += attachments.cpp \
- context.cpp \
- gpgwin.cpp \
+ gpgcontext.cpp \
+ mainwindow.cpp \
main.cpp \
keylist.cpp \
keymgmt.cpp \
diff --git a/context.cpp b/gpgcontext.cpp
index 654b928..77856f9 100644
--- a/context.cpp
+++ b/gpgcontext.cpp
@@ -19,7 +19,7 @@
* along with gpg4usb. If not, see <http://www.gnu.org/licenses/>
*/
-#include "context.h"
+#include "gpgcontext.h"
#ifdef _WIN32
#include <windows.h>
@@ -33,7 +33,7 @@ namespace GpgME
/** Constructor
* Set up gpgme-context, set paths to app-run path
*/
-Context::Context()
+GpgContext::GpgContext()
{
/** get application path */
@@ -94,7 +94,7 @@ Context::Context()
/** Destructor
* Release gpgme-context
*/
-Context::~Context()
+GpgContext::~GpgContext()
{
if (mCtx) gpgme_release(mCtx);
mCtx = 0;
@@ -103,7 +103,7 @@ Context::~Context()
/** Import Key from QByteArray
*
*/
-void Context::importKey(QByteArray inBuffer)
+void GpgContext::importKey(QByteArray inBuffer)
{
err = gpgme_data_new_from_mem(&in, inBuffer.data(), inBuffer.size(), 1);
checkErr(err);
@@ -116,7 +116,7 @@ void Context::importKey(QByteArray inBuffer)
/** Generate New Key with values params
*
*/
-void Context::generateKey(QString *params)
+void GpgContext::generateKey(QString *params)
{
err = gpgme_op_genkey(mCtx, params->toAscii().data(), NULL, NULL);
checkErr(err);
@@ -126,7 +126,7 @@ void Context::generateKey(QString *params)
/** Export Key to QByteArray
*
*/
-bool Context::exportKeys(QStringList *uidList, QByteArray *outBuffer)
+bool GpgContext::exportKeys(QStringList *uidList, QByteArray *outBuffer)
{
size_t read_bytes;
gpgme_data_t out = 0;
@@ -153,7 +153,7 @@ bool Context::exportKeys(QStringList *uidList, QByteArray *outBuffer)
return true;
}
-gpgme_key_t Context::getKeyDetails(QString uid)
+gpgme_key_t GpgContext::getKeyDetails(QString uid)
{
gpgme_key_t key;
@@ -168,7 +168,7 @@ gpgme_key_t Context::getKeyDetails(QString uid)
/** List all availabe Keys (VERY much like kgpgme)
*/
-GpgKeyList Context::listKeys()
+GpgKeyList GpgContext::listKeys()
{
gpgme_error_t err;
gpgme_key_t key;
@@ -220,7 +220,7 @@ GpgKeyList Context::listKeys()
/** Delete keys
*/
-void Context::deleteKeys(QStringList *uidList)
+void GpgContext::deleteKeys(QStringList *uidList)
{
QString tmp;
gpgme_key_t key;
@@ -237,7 +237,7 @@ void Context::deleteKeys(QStringList *uidList)
/** Encrypt inBuffer for reciepients-uids, write
* result to outBuffer
*/
-bool Context::encrypt(QStringList *uidList, const QByteArray &inBuffer, QByteArray *outBuffer)
+bool GpgContext::encrypt(QStringList *uidList, const QByteArray &inBuffer, QByteArray *outBuffer)
{
gpgme_data_t in = 0, out = 0;
@@ -294,7 +294,7 @@ bool Context::encrypt(QStringList *uidList, const QByteArray &inBuffer, QByteArr
/** Decrypt QByteAarray, return QByteArray
* mainly from http://basket.kde.org/ (kgpgme.cpp)
*/
-bool Context::decrypt(const QByteArray &inBuffer, QByteArray *outBuffer)
+bool GpgContext::decrypt(const QByteArray &inBuffer, QByteArray *outBuffer)
{
gpgme_data_t in = 0, out = 0;
gpgme_decrypt_result_t result = 0;
@@ -343,7 +343,7 @@ bool Context::decrypt(const QByteArray &inBuffer, QByteArray *outBuffer)
* mainly from http://basket.kde.org/ (kgpgme.cpp)
*/
#define BUF_SIZE (32 * 1024)
-gpgme_error_t Context::readToBuffer(gpgme_data_t in, QByteArray *outBuffer)
+gpgme_error_t GpgContext::readToBuffer(gpgme_data_t in, QByteArray *outBuffer)
{
int ret;
gpgme_error_t err = GPG_ERR_NO_ERROR;
@@ -374,15 +374,15 @@ gpgme_error_t Context::readToBuffer(gpgme_data_t in, QByteArray *outBuffer)
/** The Passphrase window, if not provided by env-Var GPG_AGENT_INFO
* originally copied from http://basket.kde.org/ (kgpgme.cpp), but modified
*/
-gpgme_error_t Context::passphraseCb(void *hook, const char *uid_hint,
+gpgme_error_t GpgContext::passphraseCb(void *hook, const char *uid_hint,
const char *passphrase_info,
int last_was_bad, int fd)
{
- Context *gpg = static_cast<Context*>(hook);
+ GpgContext *gpg = static_cast<GpgContext*>(hook);
return gpg->passphrase(uid_hint, passphrase_info, last_was_bad, fd);
}
-gpgme_error_t Context::passphrase(const char *uid_hint,
+gpgme_error_t GpgContext::passphrase(const char *uid_hint,
const char * /*passphrase_info*/,
int last_was_bad, int fd)
{
@@ -440,7 +440,7 @@ gpgme_error_t Context::passphrase(const char *uid_hint,
}
/** also from kgpgme.cpp, seems to clear password from mem */
-void Context::clearPasswordCache()
+void GpgContext::clearPasswordCache()
{
if (mPasswordCache.size() > 0) {
mPasswordCache.fill('\0');
@@ -449,7 +449,7 @@ void Context::clearPasswordCache()
}
// error-handling
-int Context::checkErr(gpgme_error_t err, QString comment) const
+int GpgContext::checkErr(gpgme_error_t err, QString comment) const
{
//if (err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) {
if (err != GPG_ERR_NO_ERROR) {
@@ -458,7 +458,7 @@ int Context::checkErr(gpgme_error_t err, QString comment) const
return err;
}
-int Context::checkErr(gpgme_error_t err) const
+int GpgContext::checkErr(gpgme_error_t err) const
{
//if (err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) {
if (err != GPG_ERR_NO_ERROR) {
@@ -470,7 +470,7 @@ int Context::checkErr(gpgme_error_t err) const
/** export private key, TODO errohandling, e.g. like in seahorse (seahorse-gpg-op.c) **/
-void Context::exportSecretKey(QString uid, QByteArray *outBuffer)
+void GpgContext::exportSecretKey(QString uid, QByteArray *outBuffer)
{
// export private key to outBuffer
QStringList arguments;
@@ -487,7 +487,7 @@ void Context::exportSecretKey(QString uid, QByteArray *outBuffer)
}
/** return type should be gpgme_error_t*/
-void Context::executeGpgCommand(QStringList arguments, QByteArray *stdOut, QByteArray *stdErr)
+void GpgContext::executeGpgCommand(QStringList arguments, QByteArray *stdOut, QByteArray *stdErr)
{
gpgme_engine_info_t engine = gpgme_ctx_get_engine_info(mCtx);
@@ -508,7 +508,7 @@ void Context::executeGpgCommand(QStringList arguments, QByteArray *stdOut, QByte
* -> valid
* -> errors
*/
-gpgme_signature_t Context::verify(QByteArray inBuffer) {
+gpgme_signature_t GpgContext::verify(QByteArray inBuffer) {
int error=0;
gpgme_data_t in;
@@ -537,7 +537,7 @@ gpgme_signature_t Context::verify(QByteArray inBuffer) {
* -> valid
* -> decrypted message
*/
-//void Context::decryptVerify(QByteArray in) {
+//void GpgContext::decryptVerify(QByteArray in) {
/* gpgme_error_t err;
gpgme_data_t in, out;
@@ -552,7 +552,7 @@ gpgme_signature_t Context::verify(QByteArray inBuffer) {
*/
//}
-bool Context::sign(QStringList *uidList, const QByteArray &inBuffer, QByteArray *outBuffer ) {
+bool GpgContext::sign(QStringList *uidList, const QByteArray &inBuffer, QByteArray *outBuffer ) {
gpgme_error_t err;
gpgme_data_t in, out;
@@ -626,7 +626,7 @@ bool Context::sign(QStringList *uidList, const QByteArray &inBuffer, QByteArray
* GPGME doesn't recognise the Message as encrypted. This function adds '\n'
* before the PGP-Begin-Block, if missing.
*/
-void Context::preventNoDataErr(QByteArray *in)
+void GpgContext::preventNoDataErr(QByteArray *in)
{
int block_start = in->indexOf("-----BEGIN PGP MESSAGE-----");
if (block_start > 0 && in->at(block_start - 1) != '\n') {
@@ -644,7 +644,7 @@ void Context::preventNoDataErr(QByteArray *in)
* - 1, if text is partially signed
* - 2, if text is completly signed
*/
-int Context::textIsSigned(const QByteArray &text) {
+int GpgContext::textIsSigned(const QByteArray &text) {
if (text.trimmed().startsWith("-----BEGIN PGP SIGNED MESSAGE-----") && text.trimmed().endsWith("-----END PGP SIGNATURE-----")) {
return 2;
}
@@ -654,7 +654,7 @@ int Context::textIsSigned(const QByteArray &text) {
return 0;
}
-QString Context::beautifyFingerprint(QString fingerprint)
+QString GpgContext::beautifyFingerprint(QString fingerprint)
{
uint len = fingerprint.length();
if ((len > 0) && (len % 4 == 0))
diff --git a/context.h b/gpgcontext.h
index ac53a6c..101dbdf 100644
--- a/context.h
+++ b/gpgcontext.h
@@ -55,13 +55,13 @@ typedef QLinkedList< GpgKey > GpgKeyList;
namespace GpgME
{
-class Context : public QObject
+class GpgContext : public QObject
{
Q_OBJECT
public:
- Context(); // Constructor
- ~Context(); // Destructor
+ GpgContext(); // Constructor
+ ~GpgContext(); // Destructor
void importKey(QByteArray inBuffer);
bool exportKeys(QStringList *uidList, QByteArray *outBuffer);
diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp
index 3570bb6..6911fe1 100644
--- a/keydetailsdialog.cpp
+++ b/keydetailsdialog.cpp
@@ -21,7 +21,7 @@
#include "keydetailsdialog.h"
-KeyDetailsDialog::KeyDetailsDialog(GpgME::Context* ctx, gpgme_key_t key, QWidget *parent)
+KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWidget *parent)
: QDialog(parent)
{
diff --git a/keydetailsdialog.h b/keydetailsdialog.h
index c282749..a655a4b 100644
--- a/keydetailsdialog.h
+++ b/keydetailsdialog.h
@@ -22,7 +22,7 @@
#ifndef __KEYDETAILSDIALOG_H__
#define __KEYDETAILSDIALOG_H__
-#include "context.h"
+#include "gpgcontext.h"
#include <gpgme.h>
QT_BEGIN_NAMESPACE
@@ -42,7 +42,7 @@ class KeyDetailsDialog : public QDialog
Q_OBJECT
public:
- KeyDetailsDialog(GpgME::Context* ctx, gpgme_key_t key, QWidget *parent = 0);
+ KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWidget *parent = 0);
static QString beautifyFingerprint(QString fingerprint);
private slots:
@@ -50,7 +50,7 @@ private slots:
private:
QString *keyid;
- GpgME::Context *mCtx;
+ GpgME::GpgContext *mCtx;
QGroupBox *ownerBox;
QGroupBox *keyBox;
diff --git a/keygenthread.cpp b/keygenthread.cpp
index ecab317..0065ea8 100644
--- a/keygenthread.cpp
+++ b/keygenthread.cpp
@@ -21,7 +21,7 @@
#include "keygenthread.h"
-KeyGenThread::KeyGenThread(QString keyGenParams, GpgME::Context *ctx)
+KeyGenThread::KeyGenThread(QString keyGenParams, GpgME::GpgContext *ctx)
{
this->keyGenParams = keyGenParams;
this->ctx = ctx;
diff --git a/keygenthread.h b/keygenthread.h
index 3a52e7f..5e9c78d 100644
--- a/keygenthread.h
+++ b/keygenthread.h
@@ -22,7 +22,7 @@
#ifndef __KEYGENTHREAD_H__
#define __KEYGENTHREAD_H__
-#include "context.h"
+#include "gpgcontext.h"
#include <qthread.h>
#include <iostream>
#include <string>
@@ -38,14 +38,14 @@ class KeyGenThread : public QThread
Q_OBJECT
public:
- KeyGenThread(QString keyGenParams, GpgME::Context *ctx);
+ KeyGenThread(QString keyGenParams, GpgME::GpgContext *ctx);
signals:
void keyGenerated();
private:
QString keyGenParams;
- GpgME::Context *ctx;
+ GpgME::GpgContext *ctx;
bool abort;
QMutex mutex;
diff --git a/keylist.cpp b/keylist.cpp
index 585c707..c098ba4 100644
--- a/keylist.cpp
+++ b/keylist.cpp
@@ -21,7 +21,7 @@
#include "keylist.h"
-KeyList::KeyList(GpgME::Context *ctx, QString iconpath, QWidget *parent)
+KeyList::KeyList(GpgME::GpgContext *ctx, QString iconpath, QWidget *parent)
: QWidget(parent)
{
mCtx = ctx;
diff --git a/keylist.h b/keylist.h
index 7184441..800e9fc 100644
--- a/keylist.h
+++ b/keylist.h
@@ -22,7 +22,7 @@
#ifndef __KEYLIST_H__
#define __KEYLIST_H__
-#include "context.h"
+#include "gpgcontext.h"
QT_BEGIN_NAMESPACE
class QWidget;
@@ -37,7 +37,7 @@ class KeyList : public QWidget
Q_OBJECT
public:
- KeyList(GpgME::Context *ctx, QString iconpath, QWidget *parent = 0);
+ KeyList(GpgME::GpgContext *ctx, QString iconpath, QWidget *parent = 0);
void setColumnWidth(int row, int size);
void addMenuAction(QAction *act);
@@ -55,7 +55,7 @@ public slots:
void refresh();
private:
- GpgME::Context *mCtx;
+ GpgME::GpgContext *mCtx;
QTableWidget *mKeyList;
QString iconPath;
QMenu *popupMenu;
diff --git a/keymgmt.cpp b/keymgmt.cpp
index 730ecdb..602d8b9 100755
--- a/keymgmt.cpp
+++ b/keymgmt.cpp
@@ -22,7 +22,7 @@
#include "keymgmt.h"
-KeyMgmt::KeyMgmt(GpgME::Context *ctx, QString iconpath)
+KeyMgmt::KeyMgmt(GpgME::GpgContext *ctx, QString iconpath)
{
mCtx = ctx;
mIconPath = iconpath;
diff --git a/keymgmt.h b/keymgmt.h
index a287f21..c4a5122 100755
--- a/keymgmt.h
+++ b/keymgmt.h
@@ -48,7 +48,7 @@ class KeyMgmt : public QMainWindow
Q_OBJECT
public:
- KeyMgmt(GpgME::Context* ctx, QString iconpath);
+ KeyMgmt(GpgME::GpgContext* ctx, QString iconpath);
QAction *importKeyFromClipboardAct;
QAction *importKeyFromFileAct;
QAction *importKeyFromKeyServerAct;
@@ -79,7 +79,7 @@ private:
KeyList *mKeyList;
QString mIconPath;
- GpgME::Context *mCtx;
+ GpgME::GpgContext *mCtx;
QMenu *fileMenu;
QMenu *keyMenu;
QMenu *importKeyMenu;
diff --git a/keyserverimportdialog.cpp b/keyserverimportdialog.cpp
index b545e1b..1e85e69 100644
--- a/keyserverimportdialog.cpp
+++ b/keyserverimportdialog.cpp
@@ -22,7 +22,7 @@
#include "keyserverimportdialog.h"
-KeyServerImportDialog::KeyServerImportDialog(GpgME::Context *ctx, QWidget *parent)
+KeyServerImportDialog::KeyServerImportDialog(GpgME::GpgContext *ctx, QWidget *parent)
: QDialog(parent)
{
mCtx = ctx;
diff --git a/keyserverimportdialog.h b/keyserverimportdialog.h
index 6c92b2c..b42953a 100644
--- a/keyserverimportdialog.h
+++ b/keyserverimportdialog.h
@@ -23,7 +23,7 @@
#ifndef __KEYSERVERIMPORTDIALOG_H__
#define __KEYSERVERIMPORTDIALOG_H__
-#include "context.h"
+#include "gpgcontext.h"
#include <QNetworkAccessManager>
#include <QtNetwork>
@@ -50,7 +50,7 @@ class KeyServerImportDialog : public QDialog
Q_OBJECT
public:
- KeyServerImportDialog(GpgME::Context *ctx, QWidget *parent = 0);
+ KeyServerImportDialog(GpgME::GpgContext *ctx, QWidget *parent = 0);
void import(QStringList keyIds);
void import(QStringList keyIds, QUrl keyserverUrl);
@@ -68,7 +68,7 @@ private:
QPushButton *createButton(const QString &text, const char *member);
QComboBox *createComboBox();
- GpgME::Context *mCtx;
+ GpgME::GpgContext *mCtx;
QLineEdit *searchLineEdit;
QComboBox *keyServerComboBox;
QLabel *searchLabel;
diff --git a/main.cpp b/main.cpp
index a55bd9a..cfe7ae2 100644
--- a/main.cpp
+++ b/main.cpp
@@ -20,7 +20,7 @@
*/
#include <QApplication>
-#include "gpgwin.h"
+#include "mainwindow.h"
int main(int argc, char *argv[])
{
@@ -83,7 +83,7 @@ int main(int argc, char *argv[])
QString styleSheet = QLatin1String(file.readAll());
qApp->setStyleSheet(styleSheet);
- GpgWin *window = new GpgWin();
+ MainWindow *window = new MainWindow();
window->show();
return app.exec();
diff --git a/gpgwin.cpp b/mainwindow.cpp
index dac830d..dd7c63e 100644
--- a/gpgwin.cpp
+++ b/mainwindow.cpp
@@ -19,11 +19,11 @@
* along with gpg4usb. If not, see <http://www.gnu.org/licenses/>
*/
-#include "gpgwin.h"
+#include "mainwindow.h"
-GpgWin::GpgWin()
+MainWindow::MainWindow()
{
- mCtx = new GpgME::Context();
+ mCtx = new GpgME::GpgContext();
/* get path were app was started */
QString appPath = qApp->applicationDirPath();
@@ -73,7 +73,7 @@ GpgWin::GpgWin()
this->setWindowTitle(qApp->applicationName());
}
-void GpgWin::restoreSettings()
+void MainWindow::restoreSettings()
{
// state sets pos & size of dock-widgets
this->restoreState(settings.value("window/windowState").toByteArray());
@@ -118,7 +118,7 @@ void GpgWin::restoreSettings()
}
}
-void GpgWin::saveSettings()
+void MainWindow::saveSettings()
{
// window position and size
settings.setValue("window/windowState", saveState());
@@ -138,7 +138,7 @@ void GpgWin::saveSettings()
}
}
-void GpgWin::createActions()
+void MainWindow::createActions()
{
/* Main Menu
*/
@@ -333,7 +333,7 @@ void GpgWin::createActions()
this->addAction(switchTabDownAct);
}
-void GpgWin::createMenus()
+void MainWindow::createMenus()
{
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(newTabAct);
@@ -387,7 +387,7 @@ void GpgWin::createMenus()
helpMenu->addAction(aboutAct);
}
-void GpgWin::createToolBars()
+void MainWindow::createToolBars()
{
cryptToolBar = addToolBar(tr("Crypt"));
cryptToolBar->setObjectName("cryptToolBar");
@@ -413,7 +413,7 @@ void GpgWin::createToolBars()
viewMenu->addAction(editToolBar->toggleViewAction());
}
-void GpgWin::createStatusBar()
+void MainWindow::createStatusBar()
{
QWidget *statusBarBox = new QWidget();
QHBoxLayout *statusBarBoxLayout = new QHBoxLayout();
@@ -429,7 +429,7 @@ void GpgWin::createStatusBar()
statusBarBox->setLayout(statusBarBoxLayout);
}
-void GpgWin::createDockWindows()
+void MainWindow::createDockWindows()
{
/* KeyList-Dockwindow
*/
@@ -447,7 +447,7 @@ void GpgWin::createDockWindows()
}
}
-void GpgWin::createAttachmentDock() {
+void MainWindow::createAttachmentDock() {
if (attachmentDockCreated) {
return;
}
@@ -463,7 +463,7 @@ void GpgWin::createAttachmentDock() {
attachmentDockCreated = true;
}
-void GpgWin::closeAttachmentDock() {
+void MainWindow::closeAttachmentDock() {
if (!attachmentDockCreated) {
return;
}
@@ -472,7 +472,7 @@ void GpgWin::closeAttachmentDock() {
attachmentDockCreated = false;
}
-void GpgWin::closeEvent(QCloseEvent *event)
+void MainWindow::closeEvent(QCloseEvent *event)
{
/*
* ask to save changes, if there are
@@ -489,7 +489,7 @@ void GpgWin::closeEvent(QCloseEvent *event)
mCtx->clearPasswordCache();
}
-void GpgWin::about()
+void MainWindow::about()
{
QPixmap *pixmap = new QPixmap(iconPath + "gpg4usb-logo.png");
QString *title = new QString(tr("About ") + qApp->applicationName());
@@ -529,11 +529,11 @@ void GpgWin::about()
dialog->exec();
}
-void GpgWin::openTranslate() {
+void MainWindow::openTranslate() {
QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu_translate.html"));
}
-void GpgWin::openTutorial() {
+void MainWindow::openTutorial() {
QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu.html"));
}
@@ -541,7 +541,7 @@ void GpgWin::openTutorial() {
* if this is mime, split text and attachments...
* message contains only text afterwards
*/
-void GpgWin::parseMime(QByteArray *message)
+void MainWindow::parseMime(QByteArray *message)
{
/*if (! Mime::isMultipart(message)) {
qDebug() << "no multipart";
@@ -575,7 +575,7 @@ void GpgWin::parseMime(QByteArray *message)
}
}
-void GpgWin::checkAttachmentFolder() {
+void MainWindow::checkAttachmentFolder() {
// TODO: always check?
if(!settings.value("mime/parseMime").toBool()) {
return;
@@ -598,19 +598,19 @@ void GpgWin::checkAttachmentFolder() {
}
}
-void GpgWin::importKeyFromEdit()
+void MainWindow::importKeyFromEdit()
{
mCtx->importKey(edit->curTextPage()->toPlainText().toAscii());
}
-void GpgWin::openKeyManagement()
+void MainWindow::openKeyManagement()
{
keyMgmt->show();
keyMgmt->raise();
keyMgmt->activateWindow();
}
-void GpgWin::encrypt()
+void MainWindow::encrypt()
{
QStringList *uidList = mKeyList->getChecked();
@@ -621,7 +621,7 @@ void GpgWin::encrypt()
}
}
-void GpgWin::sign()
+void MainWindow::sign()
{
QStringList *uidList = mKeyList->getPrivateChecked();
@@ -633,7 +633,7 @@ void GpgWin::sign()
}
}
-void GpgWin::decrypt()
+void MainWindow::decrypt()
{
QByteArray *decrypted = new QByteArray();
QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here?
@@ -668,7 +668,7 @@ void GpgWin::decrypt()
edit->fillTextEditWithText(QString::fromUtf8(*decrypted));
}
-void GpgWin::verify()
+void MainWindow::verify()
{
// At first close verifynotification, if existing
edit->curPage()->closeNoteByClass("verifyNotification");
@@ -684,7 +684,7 @@ void GpgWin::verify()
}
}
-void GpgWin::importKeyDialog()
+void MainWindow::importKeyDialog()
{
QDialog *dialog = new QDialog();
@@ -726,14 +726,14 @@ void GpgWin::importKeyDialog()
/*
* Append the selected (not checked!) Key(s) To Textedit
*/
-void GpgWin::appendSelectedKeys()
+void MainWindow::appendSelectedKeys()
{
QByteArray *keyArray = new QByteArray();
mCtx->exportKeys(mKeyList->getSelected(), keyArray);
edit->curTextPage()->appendPlainText(*keyArray);
}
-void GpgWin::copyMailAddressToClipboard()
+void MainWindow::copyMailAddressToClipboard()
{
gpgme_key_t key = mCtx->getKeyDetails(mKeyList->getSelected()->first());
QClipboard *cb = QApplication::clipboard();
@@ -741,21 +741,21 @@ void GpgWin::copyMailAddressToClipboard()
cb->setText(mail);
}
-void GpgWin::showKeyDetails()
+void MainWindow::showKeyDetails()
{
// TODO: first...?
gpgme_key_t key = mCtx->getKeyDetails(mKeyList->getSelected()->first());
new KeyDetailsDialog(mCtx, key, this);
}
-void GpgWin::fileEncryption()
+void MainWindow::fileEncryption()
{
QStringList *keyList;
keyList = mKeyList->getChecked();
new FileEncryptionDialog(mCtx, iconPath, *keyList, this);
}
-void GpgWin::openSettingsDialog()
+void MainWindow::openSettingsDialog()
{
new SettingsDialog(this);
// Iconsize
@@ -774,7 +774,7 @@ void GpgWin::openSettingsDialog()
}
-void GpgWin::cleanDoubleLinebreaks()
+void MainWindow::cleanDoubleLinebreaks()
{
QString content = edit->curTextPage()->toPlainText();
content.replace("\n\n", "\n");
diff --git a/gpgwin.h b/mainwindow.h
index a46094a..4aabfd4 100644
--- a/gpgwin.h
+++ b/mainwindow.h
@@ -59,7 +59,7 @@ QT_END_NAMESPACE
* @brief
*
*/
-class GpgWin : public QMainWindow
+class MainWindow : public QMainWindow
{
Q_OBJECT
@@ -68,7 +68,7 @@ public:
* @brief
*
*/
- GpgWin();
+ MainWindow();
protected:
/**
@@ -284,7 +284,7 @@ private:
QSettings settings; /**< TODO */
KeyList *mKeyList; /**< TODO */
Attachments *mAttachments; /**< TODO */
- GpgME::Context *mCtx; /**< TODO */
+ GpgME::GpgContext *mCtx; /**< TODO */
QString iconPath; /**< TODO */
KeyMgmt *keyMgmt; /**< TODO */
KeyServerImportDialog *importDialog; /**< TODO */
diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp
index 945e928..8f160fb 100644
--- a/verifydetailsdialog.cpp
+++ b/verifydetailsdialog.cpp
@@ -21,7 +21,7 @@
#include "verifydetailsdialog.h"
-VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::Context* ctx, KeyList* keyList, QPlainTextEdit *edit) :
+VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* keyList, QPlainTextEdit *edit) :
QDialog(parent)
{
mCtx = ctx;
diff --git a/verifydetailsdialog.h b/verifydetailsdialog.h
index b839695..83519f9 100644
--- a/verifydetailsdialog.h
+++ b/verifydetailsdialog.h
@@ -30,13 +30,13 @@ class VerifyDetailsDialog : public QDialog
{
Q_OBJECT
public:
- explicit VerifyDetailsDialog(QWidget *parent, GpgME::Context* ctx, KeyList* mKeyList, QPlainTextEdit *edit);
+ explicit VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, QPlainTextEdit *edit);
private slots:
void refresh();
private:
- GpgME::Context *mCtx;
+ GpgME::GpgContext *mCtx;
KeyList *mKeyList;
QHBoxLayout *mainLayout;
QVBoxLayout *mVboxLayout;
diff --git a/verifykeydetailbox.cpp b/verifykeydetailbox.cpp
index f71a88f..3d8d538 100644
--- a/verifykeydetailbox.cpp
+++ b/verifykeydetailbox.cpp
@@ -21,7 +21,7 @@
#include "verifykeydetailbox.h"
-VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::Context* ctx, KeyList* keyList, gpgme_signature_t signature) :
+VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx, KeyList* keyList, gpgme_signature_t signature) :
QGroupBox(parent)
{
this->mCtx = ctx;
diff --git a/verifykeydetailbox.h b/verifykeydetailbox.h
index 82f7987..adfea1c 100644
--- a/verifykeydetailbox.h
+++ b/verifykeydetailbox.h
@@ -31,13 +31,13 @@ class VerifyKeyDetailBox: public QGroupBox
{
Q_OBJECT
public:
- explicit VerifyKeyDetailBox(QWidget *parent, GpgME::Context* ctx, KeyList* mKeyList, gpgme_signature_t signature);
+ explicit VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, gpgme_signature_t signature);
private slots:
void importFormKeyserver();
private:
- GpgME::Context* mCtx;
+ GpgME::GpgContext* mCtx;
KeyList* mKeyList;
QString beautifyFingerprint(QString fingerprint);
QString fpr;
diff --git a/verifynotification.cpp b/verifynotification.cpp
index 83d2307..d588007 100644
--- a/verifynotification.cpp
+++ b/verifynotification.cpp
@@ -21,7 +21,7 @@
#include "verifynotification.h"
-VerifyNotification::VerifyNotification(QWidget *parent, GpgME::Context *ctx, KeyList *keyList,QPlainTextEdit *edit) :
+VerifyNotification::VerifyNotification(QWidget *parent, GpgME::GpgContext *ctx, KeyList *keyList,QPlainTextEdit *edit) :
QWidget(parent)
{
mCtx = ctx;
diff --git a/verifynotification.h b/verifynotification.h
index 11abc95..7da445b 100644
--- a/verifynotification.h
+++ b/verifynotification.h
@@ -58,7 +58,7 @@ public:
* @param ctx The GPGme-Context
* @param parent The parent widget
*/
- explicit VerifyNotification(QWidget *parent, GpgME::Context *ctx, KeyList *keyList,QPlainTextEdit *edit);
+ explicit VerifyNotification(QWidget *parent, GpgME::GpgContext *ctx, KeyList *keyList,QPlainTextEdit *edit);
/**
* @details Set the text and background-color of verify notification.
*
@@ -99,7 +99,7 @@ private:
QAction *showVerifyDetailsAct; /** Action for showing verify detail dialog */
QPushButton *detailsButton; /** Button shown in verifynotification */
QLabel *verifyLabel; /** Label holding the text shown in verifyNotification */
- GpgME::Context *mCtx; /** GpgME Context */
+ GpgME::GpgContext *mCtx; /** GpgME Context */
KeyList *mKeyList; /** Table holding the keys */
QPlainTextEdit *mTextpage; /** Textedit associated to the notification */
QHBoxLayout *notificationWidgetLayout; /** Layout for verify-notification */