diff options
Diffstat (limited to 'src/kcm')
| -rw-r--r-- | src/kcm/kcmdolphinnavigation.cpp | 67 | ||||
| -rw-r--r-- | src/kcm/kcmdolphinnavigation.desktop | 16 | ||||
| -rw-r--r-- | src/kcm/kcmdolphinnavigation.h | 45 | ||||
| -rw-r--r-- | src/kcm/kcmdolphinviewmodes.cpp | 105 | ||||
| -rw-r--r-- | src/kcm/kcmdolphinviewmodes.desktop | 16 | ||||
| -rw-r--r-- | src/kcm/kcmdolphinviewmodes.h | 48 |
6 files changed, 297 insertions, 0 deletions
diff --git a/src/kcm/kcmdolphinnavigation.cpp b/src/kcm/kcmdolphinnavigation.cpp new file mode 100644 index 000000000..1cce6d928 --- /dev/null +++ b/src/kcm/kcmdolphinnavigation.cpp @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz <[email protected]> * + * * + * 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 "kcmdolphinnavigation.h" + +#include "settings/navigationsettingspage.h" + +#include <ktabwidget.h> +#include <kdialog.h> +#include <klocale.h> +#include <kpluginfactory.h> +#include <kpluginloader.h> + +#include <QVBoxLayout> + +K_PLUGIN_FACTORY(KCMDolphinNavigationConfigFactory, registerPlugin<DolphinNavigationConfigModule>("dolphinnavigation");) +K_EXPORT_PLUGIN(KCMDolphinNavigationConfigFactory("kcmdolphinnavigation")) + +DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args) : + KCModule(KCMDolphinNavigationConfigFactory::componentData(), parent), + m_navigation(0) +{ + Q_UNUSED(args); + + KGlobal::locale()->insertCatalog("dolphinnavigation"); + + setButtons(KCModule::Default | KCModule::Help); + + QVBoxLayout* topLayout = new QVBoxLayout(this); + topLayout->setMargin(0); + topLayout->setSpacing(KDialog::spacingHint()); + + m_navigation = new NavigationSettingsPage(this); + topLayout->addWidget(m_navigation, 0, 0); +} + +DolphinNavigationConfigModule::~DolphinNavigationConfigModule() +{ +} + +void DolphinNavigationConfigModule::save() +{ + m_navigation->applySettings(); +} + +void DolphinNavigationConfigModule::defaults() +{ + m_navigation->applySettings(); +} + +#include "kcmdolphinnavigation.moc" diff --git a/src/kcm/kcmdolphinnavigation.desktop b/src/kcm/kcmdolphinnavigation.desktop new file mode 100644 index 000000000..c64cca1a8 --- /dev/null +++ b/src/kcm/kcmdolphinnavigation.desktop @@ -0,0 +1,16 @@ +Name=Dolphin Navigation +Comment=This service allows configuration of the Dolphin navigation. + +[Desktop Entry] +Icon=input-mouse +Type=Service +X-KDE-ServiceTypes=KCModule +Exec=kcmshell4 kcmdolphinnavigation + +X-KDE-Library=kcm_dolphinnavigation +X-KDE-PluginKeyword=dolphinnavigation +X-KDE-ParentApp=kcontrol + +Name=Navigation +Comment=Configure file manager navigation +X-KDE-Keywords=file manager diff --git a/src/kcm/kcmdolphinnavigation.h b/src/kcm/kcmdolphinnavigation.h new file mode 100644 index 000000000..71715bbd3 --- /dev/null +++ b/src/kcm/kcmdolphinnavigation.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz <[email protected]> * + * * + * 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 KCMDOLPHINNAVIGATION_H +#define KCMDOLPHINNAVIGATION_H + +#include <kcmodule.h> + +class NavigationSettingsPage; + +/** + * @brief Allow to configure the Dolphin navigation. + */ +class DolphinNavigationConfigModule : public KCModule +{ + Q_OBJECT + +public: + DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args); + virtual ~DolphinNavigationConfigModule(); + + virtual void save(); + virtual void defaults(); + +private: + NavigationSettingsPage* m_navigation; +}; + +#endif diff --git a/src/kcm/kcmdolphinviewmodes.cpp b/src/kcm/kcmdolphinviewmodes.cpp new file mode 100644 index 000000000..b410708bd --- /dev/null +++ b/src/kcm/kcmdolphinviewmodes.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Penz <[email protected]> * + * * + * 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 "kcmdolphinviewmodes.h" + +#include "settings/columnviewsettingspage.h" +#include "settings/detailsviewsettingspage.h" +#include "settings/iconsviewsettingspage.h" + +#include <ktabwidget.h> +#include <kdialog.h> +#include <klocale.h> +#include <kpluginfactory.h> +#include <kpluginloader.h> + +#include <QDBusConnection> +#include <QDBusMessage> +#include <QDir> +#include <QPushButton> +#include <QVBoxLayout> + +K_PLUGIN_FACTORY(KCMDolphinViewModesConfigFactory, registerPlugin<DolphinViewModesConfigModule>("dolphinviewmodes");) +K_EXPORT_PLUGIN(KCMDolphinViewModesConfigFactory("kcmdolphinviewmodes")) + +DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) : + KCModule(KCMDolphinViewModesConfigFactory::componentData(), parent), + m_pages() +{ + Q_UNUSED(args); + + KGlobal::locale()->insertCatalog("dolphinviewmodes"); + + setButtons(KCModule::Default | KCModule::Help); + + QVBoxLayout* topLayout = new QVBoxLayout(this); + topLayout->setMargin(0); + topLayout->setSpacing(KDialog::spacingHint()); + + KTabWidget* tabWidget = new KTabWidget(this); + + // initialize 'Icons' tab + IconsViewSettingsPage* iconsPage = new IconsViewSettingsPage(tabWidget); + tabWidget->addTab(iconsPage, KIcon("view-list-icons"), i18nc("@title:tab", "Icons")); + connect(iconsPage, SIGNAL(changed()), this, SLOT(changed())); + + // initialize 'Details' tab + DetailsViewSettingsPage* detailsPage = new DetailsViewSettingsPage(tabWidget); + tabWidget->addTab(detailsPage, KIcon("view-list-details"), i18nc("@title:tab", "Details")); + connect(detailsPage, SIGNAL(changed()), this, SLOT(changed())); + + // initialize 'Column' tab + ColumnViewSettingsPage* columnPage = new ColumnViewSettingsPage(tabWidget); + tabWidget->addTab(columnPage, KIcon("view-file-columns"), i18nc("@title:tab", "Column")); + connect(columnPage, SIGNAL(changed()), this, SLOT(changed())); + + m_pages.append(iconsPage); + m_pages.append(detailsPage); + m_pages.append(columnPage); + + topLayout->addWidget(tabWidget, 0, 0); +} + +DolphinViewModesConfigModule::~DolphinViewModesConfigModule() +{ +} + +void DolphinViewModesConfigModule::save() +{ + foreach (ViewSettingsPageBase* page, m_pages) { + page->applySettings(); + } + reparseConfiguration(); +} + +void DolphinViewModesConfigModule::defaults() +{ + foreach (ViewSettingsPageBase* page, m_pages) { + page->restoreDefaults(); + } + reparseConfiguration(); +} + +void DolphinViewModesConfigModule::reparseConfiguration() +{ + QDBusMessage message = QDBusMessage::createSignal("/KonqMain", "org.kde.Konqueror.Main", "reparseConfiguration"); + QDBusConnection::sessionBus().send(message); +} + +#include "kcmdolphinviewmodes.moc" diff --git a/src/kcm/kcmdolphinviewmodes.desktop b/src/kcm/kcmdolphinviewmodes.desktop new file mode 100644 index 000000000..91f0eff9c --- /dev/null +++ b/src/kcm/kcmdolphinviewmodes.desktop @@ -0,0 +1,16 @@ +Name=Dolphin View Modes +Comment=This service allows configuration of the Dolphin view modes. + +[Desktop Entry] +Icon=view-choose +Type=Service +X-KDE-ServiceTypes=KCModule +Exec=kcmshell4 kcmdolphinviewmodes + +X-KDE-Library=kcm_dolphinviewmodes +X-KDE-PluginKeyword=dolphinviewmodes +X-KDE-ParentApp=kcontrol + +Name=View Modes +Comment=Configure file manager view modes +X-KDE-Keywords=file manager diff --git a/src/kcm/kcmdolphinviewmodes.h b/src/kcm/kcmdolphinviewmodes.h new file mode 100644 index 000000000..fb246d0af --- /dev/null +++ b/src/kcm/kcmdolphinviewmodes.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Penz <[email protected]> * + * * + * 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 KCMDOLPHINVIEWMODES_H +#define KCMDOLPHINVIEWMODES_H + +#include <kcmodule.h> + +class ViewSettingsPageBase; + +/** + * @brief Allow to configure the Dolphin views. + */ +class DolphinViewModesConfigModule : public KCModule +{ + Q_OBJECT + +public: + DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args); + virtual ~DolphinViewModesConfigModule(); + + virtual void save(); + virtual void defaults(); + +private: + void reparseConfiguration(); + +private: + QList<ViewSettingsPageBase*> m_pages; +}; + +#endif |
