diff options
author | Timothy Pearson <[email protected]> | 2011-11-07 21:50:33 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-11-07 21:50:33 -0600 |
commit | 0b6057404f65218182ab27a9483a21065ef61fca (patch) | |
tree | b8b06dfa2deb965bebfbe131a772124e3e693a96 /twin/clients/quartz/config | |
parent | 43d99cc2477266cb9072e179137f0e8485370b3d (diff) | |
download | tdebase-0b6057404f65218182ab27a9483a21065ef61fca.tar.gz tdebase-0b6057404f65218182ab27a9483a21065ef61fca.zip |
Rename kwin to twin (Part 2 of 2)
Diffstat (limited to 'twin/clients/quartz/config')
-rw-r--r-- | twin/clients/quartz/config/CMakeLists.txt | 29 | ||||
-rw-r--r-- | twin/clients/quartz/config/Makefile.am | 16 | ||||
-rw-r--r-- | twin/clients/quartz/config/config.cpp | 104 | ||||
-rw-r--r-- | twin/clients/quartz/config/config.h | 47 |
4 files changed, 196 insertions, 0 deletions
diff --git a/twin/clients/quartz/config/CMakeLists.txt b/twin/clients/quartz/config/CMakeLists.txt new file mode 100644 index 000000000..e5554bb40 --- /dev/null +++ b/twin/clients/quartz/config/CMakeLists.txt @@ -0,0 +1,29 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### twin_quartz_config (module) ############### + +tde_add_kpart( twin_quartz_config AUTOMOC + SOURCES config.cpp + LINK tdeui-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/twin/clients/quartz/config/Makefile.am b/twin/clients/quartz/config/Makefile.am new file mode 100644 index 000000000..8a96e85a3 --- /dev/null +++ b/twin/clients/quartz/config/Makefile.am @@ -0,0 +1,16 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = twin_quartz_config.la + +twin_quartz_config_la_SOURCES = config.cpp +twin_quartz_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_quartz_config_la_LIBADD = $(LIB_TDEUI) + +METASOURCES = AUTO +noinst_HEADERS = config.h + +lnkdir = $(kde_datadir)/twin/ + +###KMAKE-start (don't edit or delete this block) + +###KMAKE-end diff --git a/twin/clients/quartz/config/config.cpp b/twin/clients/quartz/config/config.cpp new file mode 100644 index 000000000..c4c8e5cba --- /dev/null +++ b/twin/clients/quartz/config/config.cpp @@ -0,0 +1,104 @@ +/* + * + * This file contains the quartz configuration widget + * + * Copyright (c) 2001 + * Karol Szwed <[email protected]> + * http://gallium.n3.net/ + */ + +#include "config.h" +#include <kglobal.h> +#include <tqwhatsthis.h> +#include <klocale.h> + + +extern "C" +{ + KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) + { + return(new QuartzConfig(conf, parent)); + } +} + + +/* NOTE: + * 'conf' is a pointer to the twindecoration modules open twin config, + * and is by default set to the "Style" group. + * + * 'parent' is the parent of the TQObject, which is a VBox inside the + * Configure tab in twindecoration + */ + +QuartzConfig::QuartzConfig( KConfig* conf, TQWidget* parent ) + : TQObject( parent ) +{ + quartzConfig = new KConfig("twinquartzrc"); + KGlobal::locale()->insertCatalogue("twin_clients"); + gb = new TQVBox( parent ); + cbColorBorder = new TQCheckBox( + i18n("Draw window frames using &titlebar colors"), gb ); + TQWhatsThis::add( cbColorBorder, + i18n("When selected, the window decoration borders " + "are drawn using the titlebar colors; otherwise, they are " + "drawn using normal border colors instead.") ); + cbExtraSmall = new TQCheckBox( i18n("Quartz &extra slim"), gb ); + TQWhatsThis::add( cbExtraSmall, + i18n("Quartz window decorations with extra-small title bar.") ); + // Load configuration options + load( conf ); + + // Ensure we track user changes properly + connect( cbColorBorder, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged()) ); + connect( cbExtraSmall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged()) ); + + // Make the widgets visible in twindecoration + gb->show(); +} + + +QuartzConfig::~QuartzConfig() +{ + delete gb; + delete quartzConfig; +} + + +void QuartzConfig::slotSelectionChanged() +{ + emit changed(); +} + + +// Loads the configurable options from the twinrc config file +// It is passed the open config from twindecoration to improve efficiency +void QuartzConfig::load( KConfig* /*conf*/ ) +{ + quartzConfig->setGroup("General"); + bool override = quartzConfig->readBoolEntry( "UseTitleBarBorderColors", true ); + cbColorBorder->setChecked( override ); + override = quartzConfig->readBoolEntry( "UseQuartzExtraSlim", false ); + cbExtraSmall->setChecked( override ); +} + + +// Saves the configurable options to the twinrc config file +void QuartzConfig::save( KConfig* /*conf*/ ) +{ + quartzConfig->setGroup("General"); + quartzConfig->writeEntry( "UseTitleBarBorderColors", cbColorBorder->isChecked() ); + quartzConfig->writeEntry( "UseQuartzExtraSlim", cbExtraSmall->isChecked() ); + // Ensure others trying to read this config get updated + quartzConfig->sync(); +} + + +// Sets UI widget defaults which must correspond to style defaults +void QuartzConfig::defaults() +{ + cbColorBorder->setChecked( true ); + cbExtraSmall->setChecked( false ); +} + +#include "config.moc" +// vim: ts=4 diff --git a/twin/clients/quartz/config/config.h b/twin/clients/quartz/config/config.h new file mode 100644 index 000000000..6bd1ba384 --- /dev/null +++ b/twin/clients/quartz/config/config.h @@ -0,0 +1,47 @@ +/* + * + * This file contains the quartz configuration widget + * + * Copyright (c) 2001 + * Karol Szwed <[email protected]> + * http://gallium.n3.net/ + */ + +#ifndef __KDE_QUARTZCONFIG_H +#define __KDE_QUARTZCONFIG_H + +#include <tqcheckbox.h> +#include <tqvbox.h> +#include <kconfig.h> + +class QuartzConfig: public TQObject +{ + Q_OBJECT + + public: + QuartzConfig( KConfig* conf, TQWidget* parent ); + ~QuartzConfig(); + + // These public signals/slots work similar to KCM modules + signals: + void changed(); + + public slots: + void load( KConfig* conf ); + void save( KConfig* conf ); + void defaults(); + + protected slots: + void slotSelectionChanged(); // Internal use + + private: + KConfig* quartzConfig; + TQCheckBox* cbColorBorder; + TQCheckBox* cbExtraSmall; + TQVBox* gb; +}; + + +#endif + +// vim: ts=4 |