]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Let the user chose whether view properties should be remembered for each directory...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 20 Dec 2006 19:10:39 +0000 (19:10 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 20 Dec 2006 19:10:39 +0000 (19:10 +0000)
svn path=/trunk/playground/utils/dolphin/; revision=615232

16 files changed:
src/CMakeLists.txt
src/dolphinsettings.cpp
src/dolphinsettings.h
src/dolphinview.cpp
src/generalsettings.kcfg
src/generalsettingspage.cpp
src/generalsettingspage.h
src/generalviewsettingspage.cpp [new file with mode: 0644]
src/generalviewsettingspage.h [new file with mode: 0644]
src/iconsmodesettings.kcfg
src/iconsviewsettingspage.cpp
src/iconsviewsettingspage.h
src/viewpropertiesdialog.cpp
src/viewpropertiesdialog.h
src/viewsettingspage.cpp
src/viewsettingspage.h

index 569e178c19896e54556549294a4517e33cac71d8..8955ccb21e60c20c0beb17a2298d10d2cd2f0fb3 100644 (file)
@@ -8,44 +8,45 @@ include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES}  )
 ########### next target ###############
 
 set(dolphin_SRCS
-   main.cpp
+   applyviewpropsjob.cpp
+   bookmarkselector.cpp
+   bookmarkssettingspage.cpp
+   bookmarkssidebarpage.cpp
+   detailsviewsettingspage.cpp
    dolphinapplication.cpp
    dolphinmainwindow.cpp
    dolphinview.cpp
-   urlnavigator.cpp
-   urlnavigatorbutton.cpp
-   viewpropertiesdialog.cpp
    dolphinstatusbar.cpp
    dolphindirlister.cpp
-   viewproperties.cpp
    dolphindetailsview.cpp
    dolphiniconsview.cpp
    dolphinsettings.cpp
-   bookmarkselector.cpp
-   urlbutton.cpp
    dolphincontextmenu.cpp
    dolphinsortfilterproxymodel.cpp
-   undomanager.cpp
-   progressindicator.cpp
-   iconsviewsettingspage.cpp
-   pixmapviewer.cpp
    dolphinsettingsdialog.cpp
-   viewsettingspage.cpp
-   detailsviewsettingspage.cpp
-   statusbarmessagelabel.cpp
-   generalsettingspage.cpp
-   bookmarkssettingspage.cpp
    editbookmarkdialog.cpp
+   filterbar.cpp
+   generalsettingspage.cpp
+   generalviewsettingspage.cpp
+   iconsviewsettingspage.cpp
+   infosidebarpage.cpp
+   main.cpp
+   progressindicator.cpp
+   protocolcombo.cpp
+   pixmapviewer.cpp
+   renamedialog.cpp
    settingspagebase.cpp
    sidebarpage.cpp
-   bookmarkssidebarpage.cpp
-   infosidebarpage.cpp
    statusbarspaceinfo.cpp
-   renamedialog.cpp
-   filterbar.cpp
-   protocolcombo.cpp
-   viewpropsprogressinfo.cpp
-   applyviewpropsjob.cpp )
+   statusbarmessagelabel.cpp
+   undomanager.cpp
+   urlbutton.cpp
+   urlnavigator.cpp
+   urlnavigatorbutton.cpp
+   viewpropertiesdialog.cpp
+   viewproperties.cpp
+   viewsettingspage.cpp
+   viewpropsprogressinfo.cpp )
 
 kde4_automoc(${dolphin_SRCS})
 
index f60bf0189254deae58964b6bb2ad372e2a9603bf..c3dc5fbeebd34f19979639f3d9ee0a4ac854b78f 100644 (file)
@@ -84,75 +84,6 @@ void DolphinSettings::save()
     manager->save(false);
 }
 
-void DolphinSettings::calculateGridSize(int hint)
-{
-    // TODO: remove in KDE4
-    const int previewSize = m_iconsModeSettings->previewSize();
-    const int iconSize = m_iconsModeSettings->iconSize();
-    const int maxSize = (previewSize > iconSize) ? previewSize : iconSize;
-    const Q3IconView::Arrangement arrangement = (m_iconsModeSettings->arrangement() == "LeftToRight") ?
-                                               Q3IconView::LeftToRight : Q3IconView::TopToBottom;
-
-    int gridWidth = 0;
-    int gridHeight = 0;
-    if (arrangement == Q3IconView::LeftToRight) {
-        int widthUnit = maxSize + (maxSize / 2);
-        if (widthUnit < K3Icon::SizeLarge) {
-            widthUnit = K3Icon::SizeLarge;
-        }
-
-        gridWidth = widthUnit + hint * K3Icon::SizeLarge;
-
-        gridHeight = iconSize;
-        if (gridHeight <= K3Icon::SizeMedium) {
-            gridHeight = gridHeight * 2;
-        }
-        else {
-            gridHeight += maxSize / 2;
-        }
-    }
-    else {
-        assert(arrangement == Q3IconView::TopToBottom);
-        gridWidth = maxSize + (hint + 1) * (8 * m_iconsModeSettings->fontSize());
-
-        // The height-setting is ignored yet by KFileIconView if the TopToBottom
-        // arrangement is active. Anyway write the setting to have a defined value.
-        gridHeight = maxSize;
-    }
-
-    m_iconsModeSettings->setGridWidth(gridWidth);
-    m_iconsModeSettings->setGridHeight(gridHeight);
-}
-
-int DolphinSettings::textWidthHint() const
-{
-    // TODO: remove in KDE4
-    const int previewSize = m_iconsModeSettings->previewSize();
-    const int iconSize = m_iconsModeSettings->iconSize();
-    const Q3IconView::Arrangement arrangement = (m_iconsModeSettings->arrangement() == "LeftToRight") ?
-                                               Q3IconView::LeftToRight : Q3IconView::TopToBottom;
-
-    const int gridWidth = m_iconsModeSettings->gridWidth();
-
-    const int maxSize = (previewSize > iconSize) ? previewSize : iconSize;
-    int hint = 0;
-    if (arrangement == Q3IconView::LeftToRight) {
-        int widthUnit = maxSize + (maxSize / 2);
-        if (widthUnit < K3Icon::SizeLarge) {
-            widthUnit = K3Icon::SizeLarge;
-        }
-        hint = (gridWidth - widthUnit) / K3Icon::SizeLarge;
-    }
-    else {
-        assert(arrangement == Q3IconView::TopToBottom);
-        hint = (gridWidth - maxSize) / (8 * m_iconsModeSettings->fontSize()) - 1;
-        if (hint > 2) {
-            hint = 2;
-        }
-    }
-    return hint;
-}
-
 DolphinSettings::DolphinSettings()
 {
     m_generalSettings = new GeneralSettings();
index fac7894cd6f458afbcd49d0664bb2e96bb03e95e..b4aaa6371bbad422c000a1d135c6f96a255e13fa 100644 (file)
@@ -56,34 +56,6 @@ public:
     /** @see DolphinSettingsBase::save */
     virtual void save();
 
-    /**
-     * TODO: just temporary until the port to KDE4 has been done
-     *
-     * Calculates the width and the height of the grid dependant from \a hint and
-     * the current settings. The hint gives information about the wanted text
-     * width, where a lower value indicates a smaller text width. Currently
-     * in Dolphin the values 0, 1 and 2 are used. See also
-     * DolhinIconsViewSettings::textWidthHint.
-     *
-     * The calculation of the grid width and grid height is a little bit tricky,
-     * as the user model does not fit to the implementation model of QIconView. The user model
-     * allows to specify icon-, preview- and text width sizes, whereas the implementation
-     * model expects only a grid width and height. The nasty thing is that the specified
-     * width and height varies dependant from the arrangement (e. g. the height is totally
-     * ignored for the top-to-bottom arrangement inside QIconView).
-     */
-    void calculateGridSize(int hint);
-
-    /**
-     * TODO: just temporary until the port to KDE4 has been done
-     *
-     * Returns the text width hint dependant from the given settings.
-     * A lower value indicates a smaller text width. Currently
-     * in Dolphin the values 0, 1 and 2 are used. The text width hint can
-     * be used later for DolphinIconsViewSettings::calculateGridSize().
-     */
-    int textWidthHint() const;
-
 protected:
     DolphinSettings();
     virtual ~DolphinSettings();
index 1a02ddea08349b131a2f120045006c7dd6e03b38..35737e41b71cef4a879aa38a5c049ec2df59c665 100644 (file)
@@ -109,9 +109,10 @@ DolphinView::DolphinView(DolphinMainWindow *mainWindow,
     m_proxyModel = new DolphinSortFilterProxyModel(this);
     m_proxyModel->setSourceModel(m_dirModel);
 
-    m_iconsView->setModel(m_dirModel);   // TODO: using m_proxyModel crashed when clicking on an item
+    m_iconsView->setModel(m_dirModel);   // TODO: using m_proxyModel crashes when clicking on an item
 
     KFileItemDelegate* delegate = new KFileItemDelegate(this);
+    delegate->setAdditionalInformation(KFileItemDelegate::FriendlyMimeType);
     m_iconsView->setItemDelegate(delegate);
 
     m_dirLister->setDelayedMimeTypes(true);
@@ -985,19 +986,22 @@ void DolphinView::slotChangeNameFilter(const QString& nameFilter)
 
 void DolphinView::applyModeToView()
 {
-    //m_iconsView->setAlternatingRowColors(true);
     m_iconsView->setSelectionMode(QAbstractItemView::ExtendedSelection);
 
     // TODO: the following code just tries to test some QListView capabilities
     switch (m_mode) {
         case IconsView:
             m_iconsView->setViewMode(QListView::IconMode);
-            m_iconsView->setGridSize(QSize(128, 64));
+            m_iconsView->setSpacing(32);
+            // m_iconsView->setAlternatingRowColors(false);
+            // m_iconsView->setGridSize(QSize(128, 64));
             break;
 
         case DetailsView:
             m_iconsView->setViewMode(QListView::ListMode);
-            m_iconsView->setGridSize(QSize(256, 24));
+            m_iconsView->setSpacing(0);
+            // m_iconsView->setAlternatingRowColors(true);
+            // m_iconsView->setGridSize(QSize(256, 24));
             break;
     }
 }
index d53892d35c5783a3fda678b387533c5a73afdc34..5fc190a297cb075ac3006bdca3b2d578cdfaa3dc 100644 (file)
@@ -3,10 +3,6 @@
 <kcfg>
     <kcfgfile name="dolphinrc"/>
     <group name="General">
-        <entry name="DefaultViewMode" type="Int">
-            <label>Default view mode</label>
-            <default>0</default>
-        </entry>
         <entry name="EditableUrl" type="Bool">
             <label>Should the URL be editable for the user</label>
             <default>false</default>
@@ -23,5 +19,9 @@
             <label>Split the view into two panes</label>
             <default>false</default>
         </entry>
+        <entry name="globalViewProps" type="Bool">
+            <label>Should the view properties used for all directories</label>
+            <default>false</default>
+        </entry>
     </group>
 </kcfg>
\ No newline at end of file
index 5efed4424f4d68e40834cbaa2c8b2ef5f024aeb7..1c0965c66f2eacf093fdc79421d929cb73c1d18a 100644 (file)
@@ -64,7 +64,7 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par
     vBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
 
     // create 'Home Url' editor
-    Q3GroupBox* homeGroup = new Q3GroupBox(1, Qt::Horizontal, i18n("Home Url"), vBox);
+    Q3GroupBox* homeGroup = new Q3GroupBox(1, Qt::Horizontal, i18n("Home Folder"), vBox);
     homeGroup->setSizePolicy(sizePolicy);
     homeGroup->setMargin(margin);
 
@@ -89,27 +89,20 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par
     connect(useDefaultButton, SIGNAL(clicked()),
             this, SLOT(useDefaulLocation()));
 
-    // create 'Default View Mode' group
-    Q3ButtonGroup* buttonGroup = new Q3ButtonGroup(3, Qt::Vertical, i18n("Default View Mode"), vBox);
-    buttonGroup->setSizePolicy(sizePolicy);
-    buttonGroup->setMargin(margin);
-
-    m_iconsView = new QRadioButton(i18n("Icons"), buttonGroup);
-    m_detailsView = new QRadioButton(i18n("Details"), buttonGroup);
-
-    switch (settings->defaultViewMode()) {
-        case DolphinView::IconsView:    m_iconsView->setChecked(true); break;
-        case DolphinView::DetailsView:  m_detailsView->setChecked(true); break;
-    }
+    QGroupBox* startBox = new QGroupBox(i18n("Start"), vBox);
 
     // create 'Start with split view' checkbox
-    m_startSplit = new QCheckBox(i18n("Start with split view"), vBox);
+    m_startSplit = new QCheckBox(i18n("Start with split view"), startBox);
     m_startSplit->setChecked(settings->splitView());
 
     // create 'Start with editable navigation bar' checkbox
-    m_startEditable = new QCheckBox(i18n("Start with editable navigation bar"), vBox);
+    m_startEditable = new QCheckBox(i18n("Start with editable navigation bar"), startBox);
     m_startEditable->setChecked(settings->editableUrl());
 
+    QVBoxLayout* startBoxLayout = new QVBoxLayout(startBox);
+    startBoxLayout->addWidget(m_startSplit);
+    startBoxLayout->addWidget(m_startEditable);
+
     // Add a dummy widget with no restriction regarding
     // a vertical resizing. This assures that the dialog layout
     // is not stretched vertically.
@@ -133,11 +126,6 @@ void GeneralSettingsPage::applySettings()
         settings->setHomeUrl(url.prettyUrl());
     }
 
-    const DolphinView::Mode viewMode = m_detailsView->isChecked() ?
-                                       DolphinView::DetailsView :
-                                       DolphinView::IconsView;
-    settings->setDefaultViewMode(viewMode);
-
     settings->setSplitView(m_startSplit->isChecked());
     settings->setEditableUrl(m_startEditable->isChecked());
 }
index 932e752e082f1e227ee46679d387ce8350204c7f..99ec4960040ae3983be5ed6df92afc802f04ef80 100644 (file)
@@ -54,8 +54,6 @@ private slots:
 private:
     DolphinMainWindow *m_mainWindow;
     QLineEdit* m_homeUrl;
-    QRadioButton* m_iconsView;
-    QRadioButton* m_detailsView;
     QCheckBox* m_startSplit;
     QCheckBox* m_startEditable;
 };
diff --git a/src/generalviewsettingspage.cpp b/src/generalviewsettingspage.cpp
new file mode 100644 (file)
index 0000000..97a8af9
--- /dev/null
@@ -0,0 +1,85 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by Peter Penz                                      *
+ *   peter.penz@gmx.at                                                     *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
+ ***************************************************************************/
+
+#include "generalviewsettingspage.h"
+#include "dolphinsettings.h"
+#include "generalsettings.h"
+
+#include <assert.h>
+
+#include <QGroupBox>
+#include <QRadioButton>
+#include <QVBoxLayout>
+
+#include <kdialog.h>
+#include <klocale.h>
+#include <kvbox.h>
+
+GeneralViewSettingsPage::GeneralViewSettingsPage(QWidget* parent) :
+    KVBox(parent),
+    m_localProps(0),
+    m_globalProps(0)
+{
+    GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+    assert(settings != 0);
+
+    const int spacing = KDialog::spacingHint();
+    const int margin = KDialog::marginHint();
+    const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+
+    setSpacing(spacing);
+    setMargin(margin);
+
+    QGroupBox* propsBox = new QGroupBox(i18n("View Properties"), this);
+
+    m_localProps = new QRadioButton(i18n("Remember view properties for each folder."), propsBox);
+    m_globalProps = new QRadioButton(i18n("Use common view properties for all folders."), propsBox);
+    if (settings->globalViewProps()) {
+        m_globalProps->setChecked(true);
+    }
+    else {
+        m_localProps->setChecked(true);
+    }
+
+    QVBoxLayout* propsBoxLayout = new QVBoxLayout(propsBox);
+    propsBoxLayout->addWidget(m_localProps);
+    propsBoxLayout->addWidget(m_globalProps);
+
+    QGroupBox* previewBox = new QGroupBox(i18n("File Previews"), this);
+
+    // Add a dummy widget with no restriction regarding
+    // a vertical resizing. This assures that the dialog layout
+    // is not stretched vertically.
+    new QWidget(this);
+}
+
+
+GeneralViewSettingsPage::~GeneralViewSettingsPage()
+{
+}
+
+void GeneralViewSettingsPage::applySettings()
+{
+    GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+    assert(settings != 0);
+    settings->setGlobalViewProps(m_globalProps->isChecked());
+}
+
+#include "generalviewsettingspage.moc"
diff --git a/src/generalviewsettingspage.h b/src/generalviewsettingspage.h
new file mode 100644 (file)
index 0000000..8f6f7ad
--- /dev/null
@@ -0,0 +1,54 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by Peter Penz                                      *
+ *   peter.penz@gmx.at                                                     *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
+ ***************************************************************************/
+
+#ifndef GENERALVIEWSETTINGSPAGE_H
+#define GENERALVIEWSETTINGSPAGE_H
+
+#include <kvbox.h>
+
+class QRadioButton;
+
+/**
+ * @brief Represents the page from the Dolphin Settings which allows
+ * to modify general settings for the view modes.
+ *
+ *  @author Peter Penz <peter.penz@gmx.at>
+ */
+class GeneralViewSettingsPage : public KVBox
+{
+    Q_OBJECT
+
+public:
+    GeneralViewSettingsPage(QWidget* parent);
+    virtual ~GeneralViewSettingsPage();
+
+    /**
+     * Applies the general settings for the view modes
+     * The settings are persisted automatically when
+     * closing Dolphin.
+     */
+    void applySettings();
+
+private:
+    QRadioButton* m_localProps;
+    QRadioButton* m_globalProps;
+};
+
+#endif
index 574aa07a922b4c4939ab0ddf52cb14c71f0c9be3..0d024d8a2ed0018ba05c4abec3cfcb1dd5386786 100644 (file)
@@ -43,5 +43,9 @@
             <label>Preview size</label>
             <default code="true">K3Icon::SizeMedium</default>
         </entry>
+        <entry name="AdditionalInfo" type="Int">
+            <label>Additional information</label>
+            <default>0</default>
+        </entry>
     </group>
 </kcfg>
\ No newline at end of file
index 8442872a5d8429361ceb1cdaf889c4409cfee91a..ab2befd938da2ac96344b2181dbe03431b8dd136 100644 (file)
@@ -44,11 +44,12 @@ IconsViewSettingsPage::IconsViewSettingsPage(QWidget* parent) :
     m_iconSizeSlider(0),
     m_previewSizeSlider(0),
     m_textWidthBox(0),
-    m_gridSpacingBox(0),
     m_fontFamilyBox(0),
     m_fontSizeBox(0),
     m_textlinesCountBox(0),
-    m_arrangementBox(0)
+    m_additionalInfo(0),
+    m_arrangementBox(0),
+    m_gridSpacingBox(0)
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
@@ -131,6 +132,14 @@ IconsViewSettingsPage::IconsViewSettingsPage(QWidget* parent) :
     m_textWidthBox->addItem(i18n("Medium"));
     m_textWidthBox->addItem(i18n("Large"));
 
+    new QLabel(i18n("Additional information:"), textGroup);
+    m_additionalInfo = new QComboBox(textGroup);
+    m_additionalInfo->addItem(i18n("No Information"));
+    m_additionalInfo->addItem(i18n("MIME Type"));
+    m_additionalInfo->addItem(i18n("Size"));
+    m_additionalInfo->addItem(i18n("Date"));
+    m_additionalInfo->setCurrentIndex(settings->additionalInfo());
+
     Q3GroupBox* gridGroup = new Q3GroupBox(2, Qt::Horizontal, i18n("Grid"), this);
     gridGroup->setSizePolicy(sizePolicy);
     gridGroup->setMargin(margin);
@@ -184,7 +193,7 @@ void IconsViewSettingsPage::applySettings()
                           "LeftToRight" :
                           "TopToBottom";
     settings->setArrangement(arrangement);
-    DolphinSettings::instance().calculateGridSize(m_textWidthBox->currentIndex());
+    //DolphinSettings::instance().calculateGridSize(m_textWidthBox->currentIndex());
 
     settings->setFontFamily(m_fontFamilyBox->currentFont().family());
     settings->setFontSize(fontSize);
@@ -253,7 +262,7 @@ void IconsViewSettingsPage::adjustTextWidthSelection()
 {
     IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
     assert(settings != 0);
-    m_textWidthBox->setCurrentIndex(DolphinSettings::instance().textWidthHint());
+    //m_textWidthBox->setCurrentIndex(DolphinSettings::instance().textWidthHint());
 }
 
 #include "iconsviewsettingspage.moc"
index 5aa89c86e45b5a4fd28c225578e4a1cd69afa10a..7d67bc79c244137b15e51f46b6ec2fa8dacbb021 100644 (file)
@@ -75,11 +75,13 @@ private:
     QSlider* m_previewSizeSlider;
     PixmapViewer* m_previewSizeViewer;
     QComboBox* m_textWidthBox;
-    QComboBox* m_gridSpacingBox;
     QFontComboBox* m_fontFamilyBox;
     QSpinBox* m_fontSizeBox;
     QSpinBox* m_textlinesCountBox;
+    QComboBox* m_additionalInfo;
+
     QComboBox* m_arrangementBox;
+    QComboBox* m_gridSpacingBox;
 
     /** Returns the icon size for the given slider value. */
     int iconSize(int sliderValue) const;
index 8393401c763bde4c70050865a9414a5b53d43afd..3f440633f17b1dd30a9a1d3cdb2e80157fef97e7 100644 (file)
@@ -47,7 +47,8 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     m_sortOrder(0),
     m_showPreview(0),
     m_showHiddenFiles(0),
-    m_applyToSubFolders(0)
+    m_applyToSubFolders(0),
+    m_useAsDefault(0)
 {
     assert(dolphinView != 0);
 
@@ -110,8 +111,11 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     propsBoxLayout->addWidget(m_showHiddenFiles, 4, 0);
 
     m_applyToSubFolders = new QCheckBox(i18n("Apply changes to all sub folders"), main);
+    m_useAsDefault = new QCheckBox(i18n("Use as default"), main);
+
     topLayout->addWidget(propsBox);
     topLayout->addWidget(m_applyToSubFolders);
+    topLayout->addWidget(m_useAsDefault);
 
     connect(m_viewMode, SIGNAL(activated(int)),
             this, SLOT(slotViewModeChanged(int)));
@@ -124,6 +128,8 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     connect(m_showHiddenFiles, SIGNAL(clicked()),
             this, SLOT(slotShowHiddenFilesChanged()));
 
+    connect(m_applyToSubFolders, SIGNAL(clicked()),
+            this, SLOT(markAsDirty()));
     connect(m_applyToSubFolders, SIGNAL(clicked()),
             this, SLOT(markAsDirty()));
 
@@ -215,6 +221,8 @@ void ViewPropertiesDialog::applyViewProperties()
     m_viewProps->save();
     m_dolphinView->setViewProperties(*m_viewProps);
     m_isDirty = false;
+
+    // TODO: handle m_useAsDefault setting
 }
 
 #include "viewpropertiesdialog.moc"
index f6da4561aea9f4d3cecb42322d7625a31e423863..6cbae0fe7ccd3cf6e4088d7ae49d5197ffd1afb9 100644 (file)
@@ -64,6 +64,7 @@ private:
     QCheckBox* m_showPreview;
     QCheckBox* m_showHiddenFiles;
     QCheckBox* m_applyToSubFolders;
+    QCheckBox* m_useAsDefault;
 
     void applyViewProperties();
 };
index a052d84f653ffd611e47cab3ddea2234dc000e94..837aed835f8727dedce03d9be23f3a278b5d6e75 100644 (file)
  ***************************************************************************/
 
 #include "viewsettingspage.h"
-#include <qtabwidget.h>
-#include <qlayout.h>
-#include <qlabel.h>
-//Added by qt3to4:
+#include "generalviewsettingspage.h"
+#include "iconsviewsettingspage.h"
+#include "detailsviewsettingspage.h"
+
 #include <Q3VBoxLayout>
+#include <QTabWidget>
+#include <QLayout>
+#include <QLabel>
+
 #include <kdialog.h>
 #include <klocale.h>
 #include <kiconloader.h>
-#include "iconsviewsettingspage.h"
-#include "detailsviewsettingspage.h"
 
 ViewSettingsPage::ViewSettingsPage(QWidget *parent) :
     SettingsPageBase(parent),
+    m_generalPage(0),
     m_iconsPage(0),
     m_detailsPage(0)
 {
@@ -39,6 +42,10 @@ ViewSettingsPage::ViewSettingsPage(QWidget *parent) :
 
     QTabWidget* tabWidget = new QTabWidget(this);
 
+    // initialize 'General' tab
+    m_generalPage = new GeneralViewSettingsPage(tabWidget);
+    tabWidget->addTab(m_generalPage, SmallIcon("view_choose"), i18n("General"));
+
     // initialize 'Icons' tab
     m_iconsPage = new IconsViewSettingsPage(tabWidget);
     tabWidget->addTab(m_iconsPage, SmallIcon("view_icon"), i18n("Icons"));
@@ -56,6 +63,7 @@ ViewSettingsPage::~ViewSettingsPage()
 
 void ViewSettingsPage::applySettings()
 {
+    m_generalPage->applySettings();
     m_iconsPage->applySettings();
     m_detailsPage->applySettings();
 }
index baec5296e3053421259ec0c4d470182cadb9e01e..f41238733a689853afc1e04c28330dc2c24e42cc 100644 (file)
 #include <qwidget.h>
 #include <settingspagebase.h>
 
+class GeneralViewSettingsPage;
 class IconsViewSettingsPage;
 class DetailsViewSettingsPage;
 
 /**
  * @brief Page for the 'View' settings of the Dolphin settings dialog.
  *
- * The views settings allow to set the properties for the icons mode,
- * the details mode and the previews mode.
+ * The views settings allow to set the properties for the icons mode and
+ * the details mode.
  *
  *  @author Peter Penz <peter.penz@gmx.at>
  */
@@ -47,6 +48,7 @@ public:
     virtual void applySettings();
 
 private:
+    GeneralViewSettingsPage* m_generalPage;
     IconsViewSettingsPage* m_iconsPage;
     DetailsViewSettingsPage* m_detailsPage;
 };