diff options
-rw-r--r-- | gpg4usb.pro | 2 | ||||
-rw-r--r-- | keydetailsdialog.cpp | 2 | ||||
-rw-r--r-- | mainwindow.cpp | 22 | ||||
-rw-r--r-- | mainwindow.h | 7 | ||||
-rw-r--r-- | verifynotification.h | 11 |
5 files changed, 38 insertions, 6 deletions
diff --git a/gpg4usb.pro b/gpg4usb.pro index 646be19..8443ead 100644 --- a/gpg4usb.pro +++ b/gpg4usb.pro @@ -76,6 +76,7 @@ HEADERS += attachments.h \ kgpg/transactions/kgpgverify.h \ #kgpg/model/kgpgitemmodel.h \ #kgpg/model/kgpgitemnode.h + findwidget.h SOURCES += attachments.cpp \ @@ -134,6 +135,7 @@ SOURCES += attachments.cpp \ kgpg/transactions/kgpgsigntext.cpp \ kgpg/transactions/kgpgverify.cpp \ #kgpg/model/kgpgitemmodel.cpp + findwidget.cpp RC_FILE = gpg4usb.rc diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp index fb6edf6..2e2e280 100644 --- a/keydetailsdialog.cpp +++ b/keydetailsdialog.cpp @@ -54,6 +54,8 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, KgpgCore::KgpgKey key } keyAlgoVal = key.algorithm(); + + qDebug() << key.algorithm(); keyCreatedVal = key.creationDate().toString("dd. MMM. yyyy"); // have el-gamal key? diff --git a/mainwindow.cpp b/mainwindow.cpp index dd5b306..b556dda 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -248,6 +248,11 @@ void MainWindow::createActions() selectallAct->setToolTip(tr("Select the whole text")); connect(selectallAct, SIGNAL(triggered()), edit, SLOT(selectAll())); + findAct = new QAction(tr("&Find"), this); + findAct->setShortcut(QKeySequence::Find); + findAct->setToolTip(tr("Find a word")); + connect(findAct, SIGNAL(triggered()), this, SLOT(find())); + cleanDoubleLinebreaksAct = new QAction(tr("Remove &spacing"), this); cleanDoubleLinebreaksAct->setIcon(QIcon(":format-line-spacing-triple.png")); //cleanDoubleLineBreaksAct->setShortcut(QKeySequence::SelectAll); @@ -292,7 +297,6 @@ void MainWindow::createActions() fileVerifyAct->setToolTip(tr("Verify File")); connect(fileVerifyAct, SIGNAL(triggered()), this, SLOT(fileVerify())); - signAct = new QAction(tr("&Sign"), this); signAct->setIcon(QIcon(":signature.png")); signAct->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I)); @@ -401,6 +405,7 @@ void MainWindow::disableTabActions(int number) pasteAct->setDisabled(disable); closeTabAct->setDisabled(disable); selectallAct->setDisabled(disable); + findAct->setDisabled(disable); verifyAct->setDisabled(disable); signAct->setDisabled(disable); encryptAct->setDisabled(disable); @@ -444,6 +449,8 @@ void MainWindow::createMenus() editMenu->addAction(cutAct); editMenu->addAction(pasteAct); editMenu->addAction(selectallAct); + editMenu->addAction(findAct); + editMenu->addSeparator(); editMenu->addAction(quoteAct); editMenu->addAction(cleanDoubleLinebreaksAct); editMenu->addSeparator(); @@ -976,6 +983,19 @@ void MainWindow::slotDecryptDone(int result) decr->deleteLater(); } +void MainWindow::find() +{ + if (edit->tabCount()==0 || edit->curPage() == 0) { + return; + } + + // At first close verifynotification, if existing + edit->curPage()->closeNoteByClass("findWidget"); + + FindWidget *fw = new FindWidget(this,edit->curTextPage()); + edit->curPage()->showNotificationWidget(fw, "findWidget"); + +} void MainWindow::verify() { diff --git a/mainwindow.h b/mainwindow.h index c17a71e..6dd78b2 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -30,6 +30,7 @@ #include "settingsdialog.h" #include "aboutdialog.h" #include "verifynotification.h" +#include "findwidget.h" #include "wizard.h" //#include "kgpg/kgpgtextinterface.h" #include "kgpg/core/kgpgkey.h" @@ -116,6 +117,11 @@ private slots: void verify(); /** + * @details Open find widget. + */ + void find(); + + /** * @details Show the details of the first of the first of selected keys */ void showKeyDetails(); @@ -342,6 +348,7 @@ private: QAction *cutAct; /** Action to cut text */ QAction *pasteAct; /** Action to paste text */ QAction *selectallAct; /** Action to select whole text */ + QAction *findAct; /** Action to find text */ QAction *undoAct; /** Action to undo last action */ QAction *redoAct; /** Action to redo last action */ QAction *zoomInAct; /** Action to zoom in */ diff --git a/verifynotification.h b/verifynotification.h index 6f34f47..9aad46d 100644 --- a/verifynotification.h +++ b/verifynotification.h @@ -54,12 +54,13 @@ class VerifyNotification : public QWidget Q_OBJECT public: /** - * @brief - * - * @param ctx The GPGme-Context - * @param parent The parent widget - */ + * @brief + * + * @param ctx The GPGme-Context + * @param parent The parent widget + */ explicit VerifyNotification(QWidget *parent, GpgME::GpgContext *ctx, KeyList *keyList,QTextEdit *edit); + /** * @details Set the text and background-color of verify notification. * |