aboutsummaryrefslogtreecommitdiffstats
path: root/gpgwin.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-02 23:56:59 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-02 23:56:59 +0000
commit0b5c18f24a5f6e3d62c398210313f596a00cb3c1 (patch)
tree21ba37abda05de10270d6ed83c598727cf53c0d1 /gpgwin.cpp
parentset focus to textedit field, when new tab is created (diff)
downloadgpg4usb-0b5c18f24a5f6e3d62c398210313f596a00cb3c1.tar.gz
gpg4usb-0b5c18f24a5f6e3d62c398210313f596a00cb3c1.zip
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
Diffstat (limited to 'gpgwin.cpp')
-rw-r--r--gpgwin.cpp19
1 files changed, 17 insertions, 2 deletions
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()