From 0b5c18f24a5f6e3d62c398210313f596a00cb3c1 Mon Sep 17 00:00:00 2001 From: nils Date: Sun, 2 Jan 2011 23:56:59 +0000 Subject: added shortcuts Ctrl+Tab and Ctrl+Shift+Tab to switch through the tabs git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@424 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'gpgwin.cpp') diff --git a/gpgwin.cpp b/gpgwin.cpp index 35bd30c..8ba9675 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -32,12 +32,12 @@ GpgWin::GpgWin() QString appPath = qApp->applicationDirPath(); iconPath = appPath + "/icons/"; - edit = new TextEdit(); - setCentralWidget(edit); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); + edit = new TextEdit(); + setCentralWidget(edit); /* the list of Keys available*/ mKeyList = new KeyList(mCtx, iconPath); @@ -61,7 +61,9 @@ GpgWin::GpgWin() // open filename if provided as first command line parameter QStringList args = qApp->arguments(); + qDebug() << args.size(); if (args.size() > 1) { + if (!args[1].startsWith("-")) { if (QFile::exists(args[1])) edit->loadFile(args[1]); @@ -288,6 +290,19 @@ void GpgWin::createActions() appendSelectedKeysAct = new QAction(tr("Append Selected Key(s) To Text"), this); appendSelectedKeysAct->setToolTip(tr("Append The Selected Keys To Text in Editor")); connect(appendSelectedKeysAct, SIGNAL(triggered()), this, SLOT(appendSelectedKeys())); + + + /** Key-Shortcuts for Tab-Switchung-Action + */ + switchTabUpAct = new QAction(this); + switchTabUpAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Tab)); + connect(switchTabUpAct, SIGNAL(triggered()), edit, SLOT(switchTabUp())); + this->addAction(switchTabUpAct); + + switchTabDownAct = new QAction(this); + switchTabDownAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Shift+ Qt::Key_Tab)); + connect(switchTabDownAct, SIGNAL(triggered()), edit, SLOT(switchTabDown())); + this->addAction(switchTabDownAct); } void GpgWin::createMenus() -- cgit v1.2.3