diff src/folderselectdialog.cpp @ 90:c3000fa6ca56

Add back button to subfolder selection dialog
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 19 Jun 2015 14:27:56 +0200
parents 3916cb3c9105
children 0cf81afa82c1
line wrap: on
line diff
--- a/src/folderselectdialog.cpp	Fri Jun 19 14:27:15 2015 +0200
+++ b/src/folderselectdialog.cpp	Fri Jun 19 14:27:56 2015 +0200
@@ -108,6 +108,11 @@
 
         mGoButton = new QPushButton(tr("Go"));
         mGoButton->setEnabled(false);
+
+        QPushButton *backBtn = new QPushButton;
+        backBtn->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowBack));
+        backBtn->setToolTip(tr("Back to exam selection."));
+
         folderChangeArea->addWidget(mGoButton);
         connect(mGoButton, &QPushButton::clicked, this,
                 &FolderSelectDialog::goClicked);
@@ -142,6 +147,16 @@
     connect(mOkButton, &QPushButton::clicked, this,
             &FolderSelectDialog::wantToAccept);
     bottomButtons->addStretch(-1);
+
+    QPushButton *backBtn = NULL;
+    if (!mShowPathSelection) {
+        backBtn = new QPushButton(tr("Back"));
+        backBtn->setToolTip(tr("Back to exam selection."));
+        connect(backBtn, &QPushButton::clicked, this,
+                &FolderSelectDialog::backClicked);
+        bottomButtons->addWidget(backBtn);
+    }
+
     bottomButtons->addWidget(mOkButton);
     setLayout(base);
 }
@@ -149,6 +164,9 @@
 void FolderSelectDialog::selectionChanged (const QItemSelection& selected,
                                            const QItemSelection& deselected) {
     mOkButton->setEnabled(!selected.indexes().isEmpty());
+    if (mOkButton->isEnabled()) {
+        mOkButton->setFocus();
+    }
 }
 
 void FolderSelectDialog::pathLineChanged() {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)