[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/dolphin/src
From:       Peter Penz <peter.penz () gmx ! at>
Date:       2009-10-16 15:50:31
Message-ID: 1255708231.191762.16823.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1036100 by ppenz:

prepare the behavior-settings dialog to configure the shown meta data for tooltips

 M  +5 -0      panels/information/metadataconfigurationdialog.cpp  
 M  +8 -0      panels/information/metadataconfigurationdialog.h  
 M  +41 -1     settings/behaviorsettingspage.cpp  
 M  +15 -0     settings/behaviorsettingspage.h  


--- trunk/KDE/kdebase/apps/dolphin/src/panels/information/metadataconfigurationdialog.cpp \
#1036099:1036100 @@ -92,6 +92,11 @@
 #ifdef HAVE_NEPOMUK
     // Get all meta information labels that are available for
     // the currently shown file item and add them to the list.
+    if (m_url.isEmpty()) {
+        // TODO: in this case all available meta data from the system
+        // should be added.
+        return;
+    }
     Nepomuk::Resource res(m_url);
     QHash<QUrl, Nepomuk::Variant> properties = res.properties();
     QHash<QUrl, Nepomuk::Variant>::const_iterator it = properties.constBegin();
--- trunk/KDE/kdebase/apps/dolphin/src/panels/information/metadataconfigurationdialog.h \
#1036099:1036100 @@ -30,9 +30,17 @@
     Q_OBJECT
 
 public:
+    /**
+     * @param url    URL for which should be configured what kind of meta data is
+     *               shown. If the URL is empty, the configuration dialog will \
contain +     *               all available meta data from the system.
+     * @param parent Parent widget which opens the dialog.
+     * @param flags  Window flags for the dialog.
+     */
     MetaDataConfigurationDialog(const KUrl& url,
                                 QWidget* parent = 0,
                                 Qt::WFlags flags = 0);
+
     virtual ~MetaDataConfigurationDialog();
 
 protected slots:
--- trunk/KDE/kdebase/apps/dolphin/src/settings/behaviorsettingspage.cpp \
#1036099:1036100 @@ -23,6 +23,9 @@
 #include "dolphinsettings.h"
 #include "dolphin_generalsettings.h"
 
+// TODO:
+// #include "nepomuk/metadataconfigurationdialog.h"
+
 #include <viewproperties.h>
 
 #include <kdialog.h>
@@ -31,6 +34,7 @@
 
 #include <QCheckBox>
 #include <QGroupBox>
+#include <QHBoxLayout>
 #include <QLabel>
 #include <QRadioButton>
 #include <QVBoxLayout>
@@ -47,6 +51,7 @@
     m_confirmDelete(0),
     m_renameInline(0),
     m_showToolTips(0),
+    m_configureToolTips(0),
     m_showSelectionToggle(0),
     m_naturalSorting(0)
 {
@@ -88,15 +93,30 @@
     confirmBoxLayout->addWidget(m_confirmDelete);
     confirmBoxLayout->addWidget(m_confirmClosingMultipleTabs);
 
+    // 'Rename inline'
     m_renameInline = new QCheckBox(i18nc("@option:check", "Rename inline"), vBox);
     connect(m_renameInline, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
 
-    m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"), vBox);
+    // 'Show tooltips'
+    QWidget* toolTipContainer = new QWidget(vBox);
+    QHBoxLayout* toolTipsLayout = new QHBoxLayout(toolTipContainer);
+    toolTipsLayout->setMargin(0);
+    m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"), \
                toolTipContainer);
     connect(m_showToolTips, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+    connect(m_showToolTips, SIGNAL(toggled(bool)), this, \
SLOT(updateConfigureButton()));  
+    m_configureToolTips = new QLabel(toolTipContainer);
+    connect(m_configureToolTips, SIGNAL(linkActivated(const QString&)),
+            this, SLOT(configureToolTips(const QString&)));
+
+    toolTipsLayout->addWidget(m_showToolTips);
+    toolTipsLayout->addWidget(m_configureToolTips, 1, Qt::AlignLeft);
+
+    // 'Show selection marker'
     m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection \
                marker"), vBox);
     connect(m_showSelectionToggle, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
 
+    // 'Natural sorting of items'
     m_naturalSorting = new QCheckBox(i18nc("option:check", "Natural sorting of \
                items"), vBox);
     connect(m_naturalSorting, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
 
@@ -162,6 +182,24 @@
     m_confirmDelete->setChecked(CONFIRM_DELETE);
 }
 
+void BehaviorSettingsPage::updateConfigureButton()
+{
+    if (m_showToolTips->isChecked()) {
+        m_configureToolTips->setText("<a href=\"configure\">" +
+                                     i18nc("@action:button", "Configure...") +
+                                     "</a>");
+    } else {
+        m_configureToolTips->setText(QString());
+    }
+}
+
+void BehaviorSettingsPage::configureToolTips()
+{
+    // TODO:
+    //MetaDataConfigurationDialog dialog(KUrl(), this, Qt::Dialog);
+    //dialog.exec();
+}
+
 void BehaviorSettingsPage::loadSettings()
 {
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
@@ -181,6 +219,8 @@
     m_showToolTips->setChecked(settings->showToolTips());
     m_showSelectionToggle->setChecked(settings->showSelectionToggle());
     m_naturalSorting->setChecked(KGlobalSettings::naturalSorting());
+
+    updateConfigureButton();
 }
 
 #include "behaviorsettingspage.moc"
--- trunk/KDE/kdebase/apps/dolphin/src/settings/behaviorsettingspage.h \
#1036099:1036100 @@ -24,6 +24,7 @@
 #include <kurl.h>
 
 class QCheckBox;
+class QLabel;
 class QRadioButton;
 
 /**
@@ -43,6 +44,19 @@
     /** @see SettingsPageBase::restoreDefaults() */
     virtual void restoreDefaults();
 
+private slots:
+    /**
+     * Updates the visibility state of the configure
+     * button m_configureToolTips.
+     */
+    void updateConfigureButton();
+
+    /**
+     * Opens a dialog which allows the user to specify which
+     * meta data should be shown in the tooltip.
+     */
+    void configureToolTips();
+
 private:
     void loadSettings();
 
@@ -58,6 +72,7 @@
 
     QCheckBox* m_renameInline;
     QCheckBox* m_showToolTips;
+    QLabel* m_configureToolTips;
     QCheckBox* m_showSelectionToggle;
     QCheckBox* m_naturalSorting;
 };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic