#include "dolphinsettings.h"
#include "dolphin_generalsettings.h"
+// TODO:
+// #include "nepomuk/metadataconfigurationdialog.h"
+
#include <viewproperties.h>
#include <kdialog.h>
#include <QCheckBox>
#include <QGroupBox>
+#include <QHBoxLayout>
#include <QLabel>
#include <QRadioButton>
#include <QVBoxLayout>
m_confirmDelete(0),
m_renameInline(0),
m_showToolTips(0),
+ m_configureToolTips(0),
m_showSelectionToggle(0),
m_naturalSorting(0)
{
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()));
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();
m_showToolTips->setChecked(settings->showToolTips());
m_showSelectionToggle->setChecked(settings->showSelectionToggle());
m_naturalSorting->setChecked(KGlobalSettings::naturalSorting());
+
+ updateConfigureButton();
}
#include "behaviorsettingspage.moc"
#include <kurl.h>
class QCheckBox;
+class QLabel;
class QRadioButton;
/**
/** @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();
QCheckBox* m_renameInline;
QCheckBox* m_showToolTips;
+ QLabel* m_configureToolTips;
QCheckBox* m_showSelectionToggle;
QCheckBox* m_naturalSorting;
};