]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Improve usability of the viewproperties dialog: use 2 radiobuttons instead of one...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 17 Feb 2007 20:04:06 +0000 (20:04 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 17 Feb 2007 20:04:06 +0000 (20:04 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=634606

src/viewpropertiesdialog.cpp
src/viewpropertiesdialog.h

index 48e565a0910157f800b411eeb3055527f6452af3..8cedb73cbb7e78e8f659664380c514b6be400fa6 100644 (file)
 #include "generalsettings.h"
 #include "viewproperties.h"
 
 #include "generalsettings.h"
 #include "viewproperties.h"
 
+#include <assert.h>
+
 #include <klocale.h>
 #include <kiconloader.h>
 #include <kmessagebox.h>
 #include <klocale.h>
 #include <kiconloader.h>
 #include <kmessagebox.h>
-#include <assert.h>
 
 
+#include <QButtonGroup>
 #include <QCheckBox>
 #include <QComboBox>
 #include <QGridLayout>
 #include <QCheckBox>
 #include <QComboBox>
 #include <QGridLayout>
@@ -49,6 +51,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     m_sortOrder(0),
     m_showPreview(0),
     m_showHiddenFiles(0),
     m_sortOrder(0),
     m_showPreview(0),
     m_showHiddenFiles(0),
+    m_applyToCurrentFolder(0),
     m_applyToSubFolders(0),
     m_useAsDefault(0)
 {
     m_applyToSubFolders(0),
     m_useAsDefault(0)
 {
@@ -127,11 +130,28 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     // Only show the following settings if the view properties are remembered
     // for each directory:
     if (!DolphinSettings::instance().generalSettings()->globalViewProps()) {
     // Only show the following settings if the view properties are remembered
     // for each directory:
     if (!DolphinSettings::instance().generalSettings()->globalViewProps()) {
-        m_applyToSubFolders = new QCheckBox(i18n("Apply changes to all sub folders"), main);
-        m_useAsDefault = new QCheckBox(i18n("Use as default"), main);
-        topLayout->addWidget(m_applyToSubFolders);
+        // create 'Apply view properties to:' group
+        QGroupBox* applyBox = new QGroupBox(i18n("Apply view properties to:"), main);
+
+        m_applyToCurrentFolder = new QRadioButton(i18n("Current folder"), applyBox);
+        m_applyToCurrentFolder->setChecked(true);
+        m_applyToSubFolders = new QRadioButton(i18n("Current folder including all sub folders"), applyBox);
+
+        QButtonGroup* applyGroup = new QButtonGroup(this);
+        applyGroup->addButton(m_applyToCurrentFolder);
+        applyGroup->addButton(m_applyToSubFolders);
+
+        QVBoxLayout* applyBoxLayout = new QVBoxLayout(applyBox);
+        applyBoxLayout->addWidget(m_applyToCurrentFolder);
+        applyBoxLayout->addWidget(m_applyToSubFolders);
+
+        m_useAsDefault = new QCheckBox(i18n("Use as default for new folders"), main);
+
+        topLayout->addWidget(applyBox);
         topLayout->addWidget(m_useAsDefault);
 
         topLayout->addWidget(m_useAsDefault);
 
+        connect(m_applyToCurrentFolder, SIGNAL(clicked()),
+                this, SLOT(markAsDirty()));
         connect(m_applyToSubFolders, SIGNAL(clicked()),
                 this, SLOT(markAsDirty()));
         connect(m_useAsDefault, SIGNAL(clicked()),
         connect(m_applyToSubFolders, SIGNAL(clicked()),
                 this, SLOT(markAsDirty()));
         connect(m_useAsDefault, SIGNAL(clicked()),
index bb8fac9ef9bc7a909025913814764465c8fd313c..827371935e38bdbcb513740c65c12cc4f8584ce7 100644 (file)
@@ -17,6 +17,7 @@
  *   Free Software Foundation, Inc.,                                       *
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
  *   Free Software Foundation, Inc.,                                       *
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
+
 #ifndef VIEWPROPERTIESDIALOG_H
 #define VIEWPROPERTIESDIALOG_H
 
 #ifndef VIEWPROPERTIESDIALOG_H
 #define VIEWPROPERTIESDIALOG_H
 
@@ -31,9 +32,9 @@ class DolphinView;
 /**
  * @brief Dialog for changing the current view properties of a directory.
  *
 /**
  * @brief Dialog for changing the current view properties of a directory.
  *
- * It is possible to specify the view mode and whether hidden files
- * should be shown. The properties can be assigned to the current folder,
- * recursively to all sub folders or to all folders.
+ * It is possible to specify the view mode, the sorting order, whether hidden files
+ * and previews should be shown. The properties can be assigned to the current folder,
+ * or recursively to all sub folders.
  */
 class ViewPropertiesDialog : public KDialog
 {
  */
 class ViewPropertiesDialog : public KDialog
 {
@@ -63,7 +64,8 @@ private:
     QComboBox* m_sortOrder;
     QCheckBox* m_showPreview;
     QCheckBox* m_showHiddenFiles;
     QComboBox* m_sortOrder;
     QCheckBox* m_showPreview;
     QCheckBox* m_showHiddenFiles;
-    QCheckBox* m_applyToSubFolders;
+    QRadioButton* m_applyToCurrentFolder;
+    QRadioButton* m_applyToSubFolders;
     QCheckBox* m_useAsDefault;
 
     void applyViewProperties();
     QCheckBox* m_useAsDefault;
 
     void applyViewProperties();