aboutsummaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-09-19 21:53:25 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-09-19 21:53:25 +0000
commit51c24e1b53245a1fb05b9a6f47eab3e07386a710 (patch)
tree65c1e7c01e1d7ae392d395dc4968d0d76dee142c /mainwindow.cpp
parentadded two missing icons and updated TODO (diff)
downloadgpg4usb-51c24e1b53245a1fb05b9a6f47eab3e07386a710.tar.gz
gpg4usb-51c24e1b53245a1fb05b9a6f47eab3e07386a710.zip
added find action (but has to be improved)
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@960 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp22
1 files changed, 21 insertions, 1 deletions
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()
{