diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-19 21:47:03 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-19 21:47:03 +0000 |
commit | bed975413d03d7a3ad1b6e5b0793c98f1a89e271 (patch) | |
tree | fa369451996e1de275a77f8e4e8529608429249b | |
parent | added all icons to gpg4usb.qrc (diff) | |
download | gpg4usb-bed975413d03d7a3ad1b6e5b0793c98f1a89e271.tar.gz gpg4usb-bed975413d03d7a3ad1b6e5b0793c98f1a89e271.zip |
use ressource file for all icons and remove iconpath
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@766 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | attachments.cpp | 11 | ||||
-rw-r--r-- | attachments.h | 4 | ||||
-rw-r--r-- | attachmenttablemodel.cpp | 12 | ||||
-rw-r--r-- | attachmenttablemodel.h | 3 | ||||
-rwxr-xr-x | fileencryptiondialog.cpp | 4 | ||||
-rwxr-xr-x | fileencryptiondialog.h | 3 | ||||
-rw-r--r-- | gpg4usb.qrc | 6 | ||||
-rw-r--r-- | keydetailsdialog.cpp | 2 | ||||
-rw-r--r-- | keylist.cpp | 5 | ||||
-rw-r--r-- | keylist.h | 3 | ||||
-rwxr-xr-x | keymgmt.cpp | 23 | ||||
-rwxr-xr-x | keymgmt.h | 3 | ||||
-rw-r--r-- | mainwindow.cpp | 69 | ||||
-rw-r--r-- | mainwindow.h | 1 | ||||
-rwxr-xr-x | quitdialog.cpp | 4 | ||||
-rwxr-xr-x | quitdialog.h | 2 | ||||
-rw-r--r-- | textedit.cpp | 5 | ||||
-rw-r--r-- | textedit.h | 5 |
18 files changed, 72 insertions, 93 deletions
diff --git a/attachments.cpp b/attachments.cpp index abe1b71..82c2e6a 100644 --- a/attachments.cpp +++ b/attachments.cpp @@ -36,13 +36,10 @@ #include "attachments.h" -Attachments::Attachments(QString iconpath, QWidget *parent) +Attachments::Attachments(QWidget *parent) : QWidget(parent) { - - this->iconPath = iconpath; - - table = new AttachmentTableModel(iconpath, this); + table = new AttachmentTableModel(this); tableView = new QTableView; tableView->setModel(table); @@ -80,12 +77,12 @@ void Attachments::createActions() { saveFileAct = new QAction(tr("Save File"), this); saveFileAct->setToolTip(tr("Save this file")); - saveFileAct->setIcon(QIcon(iconPath + "filesave.png")); + saveFileAct->setIcon(QIcon(":filesave.png")); connect(saveFileAct, SIGNAL(triggered()), this, SLOT(saveFile())); openFileAct = new QAction(tr("Open File"), this); openFileAct->setToolTip(tr("Open this file")); - openFileAct->setIcon(QIcon(iconPath + "fileopen.png")); + openFileAct->setIcon(QIcon(":fileopen.png")); connect(openFileAct, SIGNAL(triggered()), this, SLOT(openFile())); } diff --git a/attachments.h b/attachments.h index 1f93a41..895c592 100644 --- a/attachments.h +++ b/attachments.h @@ -49,7 +49,7 @@ public slots: void openFile(); public: - Attachments(QString iconpath, QWidget *parent = 0); + Attachments(QWidget *parent = 0); void addMimePart(MimePart *mp); private: @@ -57,14 +57,12 @@ private: void saveByteArrayToFile(QByteArray outBuffer, QString filename); QAction *saveFileAct; QAction *openFileAct; - QString iconPath; AttachmentTableModel *table; QTableView *tableView; QSettings settings; protected: void contextMenuEvent(QContextMenuEvent *event); - }; #endif // __ATTACHMENTS_H__ diff --git a/attachmenttablemodel.cpp b/attachmenttablemodel.cpp index fbeb50b..f0eadfc 100644 --- a/attachmenttablemodel.cpp +++ b/attachmenttablemodel.cpp @@ -35,12 +35,6 @@ AttachmentTableModel::AttachmentTableModel(QList<MimePart> mimeparts, QObject *p listOfMimeparts = mimeparts; } -AttachmentTableModel::AttachmentTableModel(QString iconpath, QObject *parent) : - QAbstractTableModel(parent) -{ - iconPath = iconpath; -} - void AttachmentTableModel::add(MimePart mp) { @@ -110,12 +104,12 @@ QVariant AttachmentTableModel::data(const QModelIndex &index, int role) const MimePart mp = listOfMimeparts.at(index.row()); QString icon; if (mp.header.getValue("Content-Type").startsWith("image")) { - icon = iconPath + "/mimetypes/image-x-generic.png"; + icon = ":mimetypes/image-x-generic.png"; } else { icon = mp.header.getValue("Content-Type").replace("/", "-"); - icon = iconPath + "/mimetypes/" + icon + ".png"; + icon = ":mimetypes/" + icon + ".png"; } - if (!QFile::exists(icon)) icon = iconPath + "/mimetypes/unknown.png"; + if (!QFile::exists(icon)) icon = ":mimetypes/unknown.png"; return QIcon(icon); } diff --git a/attachmenttablemodel.h b/attachmenttablemodel.h index 27aa278..bb019de 100644 --- a/attachmenttablemodel.h +++ b/attachmenttablemodel.h @@ -37,7 +37,6 @@ class AttachmentTableModel : public QAbstractTableModel public: AttachmentTableModel(QObject *parent = 0); - AttachmentTableModel(QString iconpath, QObject *parent = 0); AttachmentTableModel(QList<MimePart> mimeparts, QObject *parent = 0); int rowCount(const QModelIndex &parent) const; @@ -52,8 +51,6 @@ public: private: QList<MimePart> listOfMimeparts; - QString iconPath; - }; #endif // __ATTACHMENTTABLEMODEL_H__ diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp index 69ea7c9..94ed540 100755 --- a/fileencryptiondialog.cpp +++ b/fileencryptiondialog.cpp @@ -21,7 +21,7 @@ #include "fileencryptiondialog.h" -FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconPath, QStringList keyList, QWidget *parent, DialogAction action) +FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList keyList, QWidget *parent, DialogAction action) : QDialog(parent) { @@ -69,7 +69,7 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconP gLayout->addWidget(fb2, 1, 2); /*Setup KeyList*/ - mKeyList = new KeyList(mCtx, iconPath); + mKeyList = new KeyList(mCtx); mKeyList->hide(); mKeyList->setColumnWidth(2, 150); mKeyList->setColumnWidth(3, 150); diff --git a/fileencryptiondialog.h b/fileencryptiondialog.h index 9150401..bc5d9a0 100755 --- a/fileencryptiondialog.h +++ b/fileencryptiondialog.h @@ -61,11 +61,10 @@ public: * * @fn FileEncryptionDialog * @param ctx - * @param iconPath * @param keyList * @param parent */ - FileEncryptionDialog(GpgME::GpgContext *ctx, QString iconPath, QStringList keyList, QWidget *parent = 0, DialogAction action = Both); + FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList keyList, QWidget *parent = 0, DialogAction action = Both); public slots: /** diff --git a/gpg4usb.qrc b/gpg4usb.qrc index 7823017..5065139 100644 --- a/gpg4usb.qrc +++ b/gpg4usb.qrc @@ -1,6 +1,6 @@ <RCC> <qresource prefix="/"> - <file alias="tray.png">release/icons/keymgmt.png</file> + <file alias="keymgmt.png">release/icons/keymgmt.png</file> <file alias="help.png">release/icons/help.png</file> <file alias="button_copy.png">release/icons/button_copy.png</file> <file alias="logo.png">release/icons/gpg4usb-logo.png</file> @@ -44,5 +44,9 @@ <file alias="undo.png">release/icons/undo.png</file> <file alias="verify.png">release/icons/verify.png</file> <file alias="export_key_to_clipboard.png">release/icons/export_key_to_clipboard.png</file> + <file alias="mimetypes/application-pdf.png">release/icons/mimetypes/application-pdf.png</file> + <file alias="mimetypes/image-x-generic.png">release/icons/mimetypes/image-x-generic.png</file> + <file alias="mimetypes/text-plain.png">release/icons/mimetypes/text-plain.png</file> + <file alias="mimetypes/unknown.png">release/icons/mimetypes/unknown.png</file> </qresource> </RCC> diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp index a4ede02..8cff661 100644 --- a/keydetailsdialog.cpp +++ b/keydetailsdialog.cpp @@ -120,7 +120,7 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWid QHBoxLayout *hboxFP = new QHBoxLayout(); hboxFP->addWidget(fingerPrintVarLabel); - QIcon ico(":/button_copy.png"); + QIcon ico(":button_copy.png"); QPushButton copyFingerprintButton(QIcon(ico.pixmap(12, 12)), ""); //copyFingerprintButton.setStyleSheet("QPushButton {border: 0px; } QPushButton:Pressed {} "); diff --git a/keylist.cpp b/keylist.cpp index 8dc5281..791bd0b 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -21,11 +21,10 @@ #include "keylist.h" -KeyList::KeyList(GpgME::GpgContext *ctx, QString iconpath, QWidget *parent) +KeyList::KeyList(GpgME::GpgContext *ctx, QWidget *parent) : QWidget(parent) { mCtx = ctx; - this->iconPath = iconpath; mKeyList = new QTableWidget(this); mKeyList->setColumnCount(6); @@ -85,7 +84,7 @@ void KeyList::refresh() mKeyList->setItem(row, 0, tmp0); if (it->privkey) { - QTableWidgetItem *tmp1 = new QTableWidgetItem(QIcon(iconPath + "kgpg_key2.png"), ""); + QTableWidgetItem *tmp1 = new QTableWidgetItem(QIcon(":kgpg_key2.png"), ""); mKeyList->setItem(row, 1, tmp1); } QTableWidgetItem *tmp2 = new QTableWidgetItem(it->name); @@ -38,7 +38,7 @@ class KeyList : public QWidget Q_OBJECT public: - KeyList(GpgME::GpgContext *ctx, QString iconpath, QWidget *parent = 0); + KeyList(GpgME::GpgContext *ctx, QWidget *parent = 0); void setColumnWidth(int row, int size); void addMenuAction(QAction *act); @@ -58,7 +58,6 @@ private: void importKeys(QByteArray inBuffer); GpgME::GpgContext *mCtx; QTableWidget *mKeyList; - QString iconPath; QMenu *popupMenu; protected: diff --git a/keymgmt.cpp b/keymgmt.cpp index ac1529d..fe5c521 100755 --- a/keymgmt.cpp +++ b/keymgmt.cpp @@ -22,13 +22,12 @@ #include "keymgmt.h" -KeyMgmt::KeyMgmt(GpgME::GpgContext *ctx, QString iconpath, QWidget *parent ) : QMainWindow(parent) +KeyMgmt::KeyMgmt(GpgME::GpgContext *ctx, QWidget *parent ) : QMainWindow(parent) { mCtx = ctx; - mIconPath = iconpath; /* the list of Keys available*/ - mKeyList = new KeyList(mCtx, mIconPath); + mKeyList = new KeyList(mCtx); mKeyList->setColumnWidth(2, 250); mKeyList->setColumnWidth(3, 250); setCentralWidget(mKeyList); @@ -68,32 +67,32 @@ void KeyMgmt::createActions() { closeAct = new QAction(tr("&Close Key Management"), this); closeAct->setShortcut(tr("Ctrl+Q")); - closeAct->setIcon(QIcon(mIconPath + "exit.png")); + closeAct->setIcon(QIcon(":exit.png")); closeAct->setToolTip(tr("Close Key Management")); connect(closeAct, SIGNAL(triggered()), this, SLOT(close())); importKeyFromFileAct = new QAction(tr("&File"), this); - importKeyFromFileAct->setIcon(QIcon(mIconPath + "import_key_from_file.png")); + importKeyFromFileAct->setIcon(QIcon(":import_key_from_file.png")); importKeyFromFileAct->setToolTip(tr("Import New Key From File")); connect(importKeyFromFileAct, SIGNAL(triggered()), this, SLOT(importKeyFromFile())); importKeyFromClipboardAct = new QAction(tr("&Clipboard"), this); - importKeyFromClipboardAct->setIcon(QIcon(mIconPath + "import_key_from_clipboard.png")); + importKeyFromClipboardAct->setIcon(QIcon(":import_key_from_clipboard.png")); importKeyFromClipboardAct->setToolTip(tr("Import New Key From Clipboard")); connect(importKeyFromClipboardAct, SIGNAL(triggered()), this, SLOT(importKeyFromClipboard())); importKeyFromKeyServerAct = new QAction(tr("&Keyserver"), this); - importKeyFromKeyServerAct->setIcon(QIcon(mIconPath + "import_key_from_server.png")); + importKeyFromKeyServerAct->setIcon(QIcon(":import_key_from_server.png")); importKeyFromKeyServerAct->setToolTip(tr("Import New Key From Keyserver")); connect(importKeyFromKeyServerAct, SIGNAL(triggered()), this, SLOT(importKeyFromKeyServer())); exportKeyToClipboardAct = new QAction(tr("Export To &Clipboard"), this); - exportKeyToClipboardAct->setIcon(QIcon(mIconPath + "export_key_to_clipboard.png")); + exportKeyToClipboardAct->setIcon(QIcon(":export_key_to_clipboard.png")); exportKeyToClipboardAct->setToolTip(tr("Export Selected Key(s) To Clipboard")); connect(exportKeyToClipboardAct, SIGNAL(triggered()), this, SLOT(exportKeyToClipboard())); exportKeyToFileAct = new QAction(tr("Export To &File"), this); - exportKeyToFileAct->setIcon(QIcon(mIconPath + "export_key_to_file.png")); + exportKeyToFileAct->setIcon(QIcon(":export_key_to_file.png")); exportKeyToFileAct->setToolTip(tr("Export Selected Key(s) To File")); connect(exportKeyToFileAct, SIGNAL(triggered()), this, SLOT(exportKeyToFile())); @@ -103,12 +102,12 @@ void KeyMgmt::createActions() deleteCheckedKeysAct = new QAction(tr("Delete Checked Key(s)"), this); deleteCheckedKeysAct->setToolTip(tr("Delete the Checked keys")); - deleteCheckedKeysAct->setIcon(QIcon(mIconPath + "button_cancel.png")); + deleteCheckedKeysAct->setIcon(QIcon(":button_cancel.png")); connect(deleteCheckedKeysAct, SIGNAL(triggered()), this, SLOT(deleteCheckedKeys())); generateKeyDialogAct = new QAction(tr("Generate Key"), this); generateKeyDialogAct->setToolTip(tr("Generate New Key")); - generateKeyDialogAct->setIcon(QIcon(mIconPath + "key_generate.png")); + generateKeyDialogAct->setIcon(QIcon(":key_generate.png")); connect(generateKeyDialogAct, SIGNAL(triggered()), this, SLOT(generateKeyDialog())); showKeyDetailsAct = new QAction(tr("Show Keydetails"), this); @@ -142,7 +141,7 @@ void KeyMgmt::createToolBars() QToolButton* toolButton = new QToolButton(this); toolButton->setMenu(importKeyMenu); toolButton->setPopupMode(QToolButton::InstantPopup); - toolButton->setIcon(QIcon(mIconPath + "key_import.png")); + toolButton->setIcon(QIcon(":key_import.png")); toolButton->setToolTip("Import key"); toolButton->setText("Import key from"); toolButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); @@ -44,7 +44,7 @@ class KeyMgmt : public QMainWindow Q_OBJECT public: - KeyMgmt(GpgME::GpgContext* ctx, QString iconpath, QWidget *parent = 0); + KeyMgmt(GpgME::GpgContext* ctx, QWidget *parent = 0); QAction *importKeyFromClipboardAct; QAction *importKeyFromFileAct; QAction *importKeyFromKeyServerAct; @@ -71,7 +71,6 @@ private: void deleteKeysWithWarning(QStringList *uidList); KeyList *mKeyList; - QString mIconPath; GpgME::GpgContext *mCtx; QMenu *fileMenu; QMenu *keyMenu; diff --git a/mainwindow.cpp b/mainwindow.cpp index 611ec25..cf5ba0d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -27,21 +27,20 @@ MainWindow::MainWindow() /* get path were app was started */ QString appPath = qApp->applicationDirPath(); - iconPath = appPath + "/icons/"; setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); - edit = new TextEdit(iconPath); + edit = new TextEdit(); setCentralWidget(edit); /* the list of Keys available*/ - mKeyList = new KeyList(mCtx, iconPath); + mKeyList = new KeyList(mCtx); /* List of binary Attachments */ attachmentDockCreated = false; - keyMgmt = new KeyMgmt(mCtx, iconPath, this); + keyMgmt = new KeyMgmt(mCtx, this); keyMgmt->hide(); /* test attachmentdir for files alll 15s */ QTimer *timer = new QTimer(this); @@ -152,7 +151,7 @@ void MainWindow::createActions() /* Main Menu */ newTabAct = new QAction(tr("&New"), this); - newTabAct->setIcon(QIcon(iconPath + "misc_doc.png")); + newTabAct->setIcon(QIcon(":misc_doc.png")); QList<QKeySequence> newTabActShortcutList; newTabActShortcutList.append(QKeySequence (Qt::CTRL + Qt::Key_N)); newTabActShortcutList.append(QKeySequence (Qt::CTRL + Qt::Key_T)); @@ -161,25 +160,25 @@ void MainWindow::createActions() connect(newTabAct, SIGNAL(triggered()), edit, SLOT(newTab())); openAct = new QAction(tr("&Open..."), this); - openAct->setIcon(QIcon(iconPath + "fileopen.png")); + openAct->setIcon(QIcon(":fileopen.png")); openAct->setShortcut(QKeySequence::Open); openAct->setToolTip(tr("Open an existing file")); connect(openAct, SIGNAL(triggered()), edit, SLOT(open())); saveAct = new QAction(tr("&Save"), this); - saveAct->setIcon(QIcon(iconPath + "filesave.png")); + saveAct->setIcon(QIcon(":filesave.png")); saveAct->setShortcut(QKeySequence::Save); saveAct->setToolTip(tr("Save the current File")); connect(saveAct, SIGNAL(triggered()), edit, SLOT(save())); saveAsAct = new QAction(tr("Save &As")+"...", this); - saveAsAct->setIcon(QIcon(iconPath + "filesaveas.png")); + saveAsAct->setIcon(QIcon(":filesaveas.png")); saveAsAct->setShortcut(QKeySequence::SaveAs); saveAsAct->setToolTip(tr("Save the current File as...")); connect(saveAsAct, SIGNAL(triggered()), edit, SLOT(saveAs())); printAct = new QAction(tr("&Print"), this); - printAct->setIcon(QIcon(iconPath + "fileprint.png")); + printAct->setIcon(QIcon(":fileprint.png")); printAct->setShortcut(QKeySequence::Print); printAct->setToolTip(tr("Print Document")); connect(printAct, SIGNAL(triggered()), edit, SLOT(print())); @@ -191,7 +190,7 @@ void MainWindow::createActions() quitAct = new QAction(tr("&Quit"), this); quitAct->setShortcut(QKeySequence::Quit); - quitAct->setIcon(QIcon(iconPath + "exit.png")); + quitAct->setIcon(QIcon(":exit.png")); quitAct->setToolTip(tr("Quit Program")); connect(quitAct, SIGNAL(triggered()), this, SLOT(close())); @@ -216,38 +215,38 @@ void MainWindow::createActions() connect(zoomOutAct, SIGNAL(triggered()), edit, SLOT(zoomOut())); pasteAct = new QAction(tr("&Paste"), this); - pasteAct->setIcon(QIcon(iconPath + "button_paste.png")); + pasteAct->setIcon(QIcon(":button_paste.png")); pasteAct->setShortcut(QKeySequence::Paste); pasteAct->setToolTip(tr("Paste Text From Clipboard")); connect(pasteAct, SIGNAL(triggered()), edit, SLOT(paste())); cutAct = new QAction(tr("Cu&t"), this); - cutAct->setIcon(QIcon(iconPath + "button_cut.png")); + 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())); copyAct = new QAction(tr("&Copy"), this); - copyAct->setIcon(QIcon(iconPath + "button_copy.png")); + 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())); quoteAct = new QAction(tr("&Quote"), this); - quoteAct->setIcon(QIcon(iconPath + "quote.png")); + quoteAct->setIcon(QIcon(":quote.png")); quoteAct->setToolTip(tr("Quote whole text")); connect(quoteAct, SIGNAL(triggered()), edit, SLOT(quote())); selectallAct = new QAction(tr("Select &All"), this); - selectallAct->setIcon(QIcon(iconPath + "edit.png")); + selectallAct->setIcon(QIcon(":edit.png")); selectallAct->setShortcut(QKeySequence::SelectAll); selectallAct->setToolTip(tr("Select the whole text")); connect(selectallAct, SIGNAL(triggered()), edit, SLOT(selectAll())); cleanDoubleLinebreaksAct = new QAction(tr("Remove &spacing"), this); - cleanDoubleLinebreaksAct->setIcon(QIcon(iconPath + "format-line-spacing-triple.png")); + 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())); @@ -260,19 +259,19 @@ void MainWindow::createActions() /* Crypt Menu */ encryptAct = new QAction(tr("&Encrypt"), this); - encryptAct->setIcon(QIcon(iconPath + "encrypted.png")); + 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())); decryptAct = new QAction(tr("&Decrypt"), this); - decryptAct->setIcon(QIcon(iconPath + "decrypted.png")); + 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())); fileEncryptionAct = new QAction(tr("&File Encryption"), this); - fileEncryptionAct->setIcon(QIcon(iconPath + "fileencrytion.png")); + fileEncryptionAct->setIcon(QIcon(":fileencrytion.png")); fileEncryptionAct->setToolTip(tr("Encrypt/Decrypt File")); connect(fileEncryptionAct, SIGNAL(triggered()), this, SLOT(fileEncryption())); @@ -280,23 +279,23 @@ void MainWindow::createActions() * File encryption submenu */ fileEncryptAct = new QAction(tr("&Encrypt File"), this); - //fileEncryptAct->setIcon(QIcon(iconPath + "fileencrytion.png")); + //fileEncryptAct->setIcon(QIcon(":fileencrytion.png")); fileEncryptAct->setToolTip(tr("Encrypt File")); connect(fileEncryptAct, SIGNAL(triggered()), this, SLOT(fileEncrypt())); fileDecryptAct = new QAction(tr("&Decrypt File"), this); - //fileDecryptAct->setIcon(QIcon(iconPath + "fileencrytion.png")); + //fileDecryptAct->setIcon(QIcon(":fileencrytion.png")); fileDecryptAct->setToolTip(tr("Decrypt File")); connect(fileDecryptAct, SIGNAL(triggered()), this, SLOT(fileDecrypt())); signAct = new QAction(tr("&Sign"), this); - signAct->setIcon(QIcon(iconPath + "signature.png")); + 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())); verifyAct = new QAction(tr("&Verify"), this); - verifyAct->setIcon(QIcon(iconPath + "verify.png")); + 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())); @@ -305,19 +304,19 @@ void MainWindow::createActions() */ importKeyFromEditAct = new QAction(tr("&Editor"), this); - importKeyFromEditAct->setIcon(QIcon(iconPath + "txt.png")); + importKeyFromEditAct->setIcon(QIcon(":txt.png")); importKeyFromEditAct->setToolTip(tr("Import New Key From Editor")); connect(importKeyFromEditAct, SIGNAL(triggered()), this, SLOT(importKeyFromEdit())); openKeyManagementAct = new QAction(tr("Manage &keys"), this); - openKeyManagementAct->setIcon(QIcon(iconPath + "keymgmt.png")); + openKeyManagementAct->setIcon(QIcon(":keymgmt.png")); openKeyManagementAct->setToolTip(tr("Open Keymanagement")); connect(openKeyManagementAct, SIGNAL(triggered()), this, SLOT(openKeyManagement())); /* About Menu */ aboutAct = new QAction(tr("&About"), this); - aboutAct->setIcon(QIcon(iconPath + "help.png")); + aboutAct->setIcon(QIcon(":help.png")); aboutAct->setToolTip(tr("Show the application's About box")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); @@ -407,7 +406,7 @@ void MainWindow::createMenus() keyMenu = menuBar()->addMenu(tr("&Keys")); importKeyMenu = keyMenu->addMenu(tr("&Import Key From...")); - importKeyMenu->setIcon(QIcon(iconPath + "key_import.png")); + importKeyMenu->setIcon(QIcon(":key_import.png")); importKeyMenu->addAction(keyMgmt->importKeyFromFileAct); importKeyMenu->addAction(importKeyFromEditAct); importKeyMenu->addAction(keyMgmt->importKeyFromClipboardAct); @@ -479,7 +478,7 @@ void MainWindow::createToolBars() QToolButton* importButton = new QToolButton(); importButton->setMenu(importKeyMenu); importButton->setPopupMode(QToolButton::InstantPopup); - importButton->setIcon(QIcon(iconPath + "key_import.png")); + importButton->setIcon(QIcon(":key_import.png")); importButton->setToolTip("Import key"); importButton->setText("Import key.."); importButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); @@ -492,7 +491,7 @@ void MainWindow::createToolBars() fileEncMenu->addAction(fileDecryptAct); fileEncButton->setMenu(fileEncMenu); fileEncButton->setPopupMode(QToolButton::InstantPopup); - fileEncButton->setIcon(QIcon(iconPath + "fileencrytion.png")); + fileEncButton->setIcon(QIcon(":fileencryption.png")); fileEncButton->setToolTip("Encrypt or decrypt File"); fileEncButton->setText("File.."); fileEncButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); @@ -508,7 +507,7 @@ void MainWindow::createStatusBar() QPixmap *pixmap; // icon which should be shown if there are files in attachments-folder - pixmap = new QPixmap(iconPath + "statusbar_icon.png"); + pixmap = new QPixmap(":statusbar_icon.png"); statusBarIcon = new QLabel(statusBar()); statusBarIcon->setPixmap(*pixmap); statusBar()->insertPermanentWidget(0,statusBarIcon,0); @@ -539,7 +538,7 @@ void MainWindow::createAttachmentDock() { if (attachmentDockCreated) { return; } - mAttachments = new Attachments(iconPath); + mAttachments = new Attachments(); attachmentDock = new QDockWidget(tr("Attached files:"), this); attachmentDock->setObjectName("AttachmentDock"); attachmentDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); @@ -580,7 +579,7 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::about() { - QPixmap *pixmap = new QPixmap(iconPath + "gpg4usb-logo.png"); + QPixmap *pixmap = new QPixmap(":gpg4usb-logo.png"); QString *title = new QString(tr("About ") + qApp->applicationName()); QString *text = new QString("<center><h2>" + qApp->applicationName() + " " + qApp->applicationVersion() + "</h2></center>" @@ -860,21 +859,21 @@ void MainWindow::fileEncryption() { QStringList *keyList; keyList = mKeyList->getChecked(); - new FileEncryptionDialog(mCtx, iconPath, *keyList, this); + new FileEncryptionDialog(mCtx, *keyList, this); } void MainWindow::fileEncrypt() { QStringList *keyList; keyList = mKeyList->getChecked(); - new FileEncryptionDialog(mCtx, iconPath, *keyList, this, FileEncryptionDialog::Encrypt); + new FileEncryptionDialog(mCtx, *keyList, this, FileEncryptionDialog::Encrypt); } void MainWindow::fileDecrypt() { QStringList *keyList; keyList = mKeyList->getChecked(); - new FileEncryptionDialog(mCtx, iconPath, *keyList, this, FileEncryptionDialog::Decrypt); + new FileEncryptionDialog(mCtx, *keyList, this, FileEncryptionDialog::Decrypt); } void MainWindow::openSettingsDialog() diff --git a/mainwindow.h b/mainwindow.h index 1921e08..e84b7be 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -315,7 +315,6 @@ private: KeyList *mKeyList; /**< TODO */ Attachments *mAttachments; /**< TODO */ GpgME::GpgContext *mCtx; /**< TODO */ - QString iconPath; /**< TODO */ KeyMgmt *keyMgmt; /**< TODO */ KeyServerImportDialog *importDialog; /**< TODO */ bool attachmentDockCreated; diff --git a/quitdialog.cpp b/quitdialog.cpp index a04ca31..ecfb486 100755 --- a/quitdialog.cpp +++ b/quitdialog.cpp @@ -22,7 +22,7 @@ #include "quitdialog.h" -QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs, QString iconPath) +QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs) : QDialog(parent) { setWindowTitle(tr("Unsaved files")); @@ -68,7 +68,7 @@ QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs, QString /* * Warnbox with icon and text */ - QPixmap *pixmap = new QPixmap(iconPath + "error.png"); + QPixmap *pixmap = new QPixmap(":error.png"); QLabel *warnicon = new QLabel(); warnicon->setPixmap(*pixmap); QLabel *warnlabel = new QLabel(tr("<h3>%1 files contain unsaved information.<br/>Save the changes before closing?</h3>").arg(row)); diff --git a/quitdialog.h b/quitdialog.h index 3b88550..eec9b63 100755 --- a/quitdialog.h +++ b/quitdialog.h @@ -33,7 +33,7 @@ class QuitDialog : public QDialog Q_OBJECT public: - QuitDialog(QWidget *parent,QHash<int, QString> unsavedDocs, QString iconPath); + QuitDialog(QWidget *parent,QHash<int, QString> unsavedDocs); bool isDiscarded(); QList <int> getTabIdsToSave(); diff --git a/textedit.cpp b/textedit.cpp index de7f54c..d847998 100644 --- a/textedit.cpp +++ b/textedit.cpp @@ -21,9 +21,8 @@ #include "textedit.h" -TextEdit::TextEdit(QString iconPath) +TextEdit::TextEdit() { - mIconPath = iconPath; countPage = 0; tabWidget = new QTabWidget(this); tabWidget->setMovable(true); @@ -278,7 +277,7 @@ bool TextEdit::maybeSaveAnyTab() QHashIterator<int, QString> i (unsavedDocs); QuitDialog *dialog; - dialog=new QuitDialog(this, unsavedDocs, mIconPath); + dialog=new QuitDialog(this, unsavedDocs); int result = dialog->exec(); // if result is QDialog::Rejected, discard or cancel was clicked @@ -51,10 +51,8 @@ class TextEdit : public QWidget public: /** * @brief - * - * @param iconPath */ - TextEdit(QString iconPath); + TextEdit(); /** * @details Load the content of file into the current textpage @@ -192,7 +190,6 @@ private: */ bool maybeSaveCurrentTab(bool askToSave); - QString mIconPath; /** Path to the apps icons */ /**************************************************************************************** * Name: countPage * Description: int cotaining the number of added tabs |