summaryrefslogtreecommitdiffstats
path: root/styles/phase2/config
diff options
context:
space:
mode:
Diffstat (limited to 'styles/phase2/config')
-rw-r--r--styles/phase2/config/CMakeL10n.txt3
-rw-r--r--styles/phase2/config/CMakeLists.txt36
-rw-r--r--styles/phase2/config/Makefile.am12
-rw-r--r--styles/phase2/config/phase2styleconfig.cpp111
-rw-r--r--styles/phase2/config/phase2styleconfig.h57
-rw-r--r--styles/phase2/config/styledialog.ui70
6 files changed, 289 insertions, 0 deletions
diff --git a/styles/phase2/config/CMakeL10n.txt b/styles/phase2/config/CMakeL10n.txt
new file mode 100644
index 00000000..514740a4
--- /dev/null
+++ b/styles/phase2/config/CMakeL10n.txt
@@ -0,0 +1,3 @@
+##### create translation templates ##############
+
+tde_l10n_create_template( "tdestyle_phase_config" )
diff --git a/styles/phase2/config/CMakeLists.txt b/styles/phase2/config/CMakeLists.txt
new file mode 100644
index 00000000..7a6d2aa6
--- /dev/null
+++ b/styles/phase2/config/CMakeLists.txt
@@ -0,0 +1,36 @@
+#################################################
+#
+# (C) 2021 Vincent Reher
+# tde (AT) 4reher.org
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${TQT_INCLUDE_DIRS}
+ ${TDE_INCLUDE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+##### tdestyle_phase_config ########################
+
+set( target tdestyle_phase2_config )
+
+set( ${target}_SRCS
+ phase2styleconfig.h
+ phase2styleconfig.cpp
+ styledialog.ui
+)
+
+tde_add_kpart( ${target} AUTOMOC
+ SOURCES ${${target}_SRCS}
+ LINK tdeui-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/styles/phase2/config/Makefile.am b/styles/phase2/config/Makefile.am
new file mode 100644
index 00000000..ff5b16b1
--- /dev/null
+++ b/styles/phase2/config/Makefile.am
@@ -0,0 +1,12 @@
+INCLUDES = $(all_includes)
+
+noinst_HEADERS = phase2styleconfig.h
+
+kde_module_LTLIBRARIES = tdestyle_phase2_config.la
+tdestyle_phase_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx
+tdestyle_phase_config_la_LIBADD = $(LIB_TDEUI)
+tdestyle_phase_config_la_SOURCES = phases2tyleconfig.cpp styledialog.ui
+tdestyle_phase_config_la_METASOURCES = AUTO
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/tdestyle_phase2_config.pot
diff --git a/styles/phase2/config/phase2styleconfig.cpp b/styles/phase2/config/phase2styleconfig.cpp
new file mode 100644
index 00000000..4528f47a
--- /dev/null
+++ b/styles/phase2/config/phase2styleconfig.cpp
@@ -0,0 +1,111 @@
+//////////////////////////////////////////////////////////////////////////////
+// phasestyleconfig.cpp
+// -------------------
+// Config dialog for Phase widget style
+// -------------------
+// Copyright (c) 2004 David Johnson <david@usermode.org>
+// Please see the header file for copyright and license information.
+//////////////////////////////////////////////////////////////////////////////
+
+#include <tqsettings.h>
+#include <tqcheckbox.h>
+#include <tqgroupbox.h>
+#include <tqwhatsthis.h>
+#include <tdelocale.h>
+#include <tdeglobal.h>
+
+#include "phase2styleconfig.h"
+#include "styledialog.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// PhaseStyleConfig Class //
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// PhaseStyleConfig()
+// ----------------
+// Constructor
+
+PhaseStyleConfig::PhaseStyleConfig(TQWidget* parent) : StyleDialog(parent)
+{
+ TDEGlobal::locale()->insertCatalogue("tdestyle_phase_config");
+
+ TQSettings settings;
+ oldgradients =
+ settings.readBoolEntry("/phasestyle/Settings/gradients", true);
+ gradients->setChecked(oldgradients);
+ oldhighlights =
+ settings.readBoolEntry("/phasestyle/Settings/highlights", true);
+ highlights->setChecked(oldhighlights);
+
+ // connections
+ connect(gradients, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(updateChanged()));
+ connect(highlights, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(updateChanged()));
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// ~PhaseStyleConfig()
+// -----------------
+// Destructor
+
+PhaseStyleConfig::~PhaseStyleConfig()
+{
+ TDEGlobal::locale()->removeCatalogue("tdestyle_phase_config");
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// selectionChanged()
+// ------------------
+// Selection has changed
+
+void PhaseStyleConfig::updateChanged()
+{
+ bool update = false;
+
+ if ((gradients->isChecked() != oldgradients) ||
+ (highlights->isChecked() != oldhighlights)) {
+ update = true;
+ }
+
+ emit changed(update);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// save()
+// ------
+// Save the settings
+
+void PhaseStyleConfig::save()
+{
+ TQSettings settings;
+ settings.writeEntry("/phasestyle/Settings/gradients",
+ gradients->isChecked());
+ settings.writeEntry("/phasestyle/Settings/highlights",
+ highlights->isChecked());
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// defaults()
+// ----------
+// Set to the defaults
+
+void PhaseStyleConfig::defaults()
+{
+ gradients->setChecked(true);
+ highlights->setChecked(true);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Plugin Stuff //
+//////////////////////////////////////////////////////////////////////////////
+
+extern "C"
+{
+ KDE_EXPORT TQObject* allocate_tdestyle_config(TQWidget* parent) {
+ return(TQT_TQOBJECT(new PhaseStyleConfig(parent)));
+ }
+}
+
+#include "phase2styleconfig.moc"
diff --git a/styles/phase2/config/phase2styleconfig.h b/styles/phase2/config/phase2styleconfig.h
new file mode 100644
index 00000000..0c29a52c
--- /dev/null
+++ b/styles/phase2/config/phase2styleconfig.h
@@ -0,0 +1,57 @@
+//////////////////////////////////////////////////////////////////////////////
+// phasestyleconfig.h
+// -------------------
+// Config dialog for Phase widget style
+// -------------------
+// Copyright (c) 2004 David Johnson <david@usermode.org>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef PHASESTYLECONFIG_H
+#define PHASESTYLECONFIG_H
+
+#include "styledialog.h"
+
+class TDEConfig;
+
+class PhaseStyleConfig : public StyleDialog
+{
+ Q_OBJECT
+
+public:
+ PhaseStyleConfig(TQWidget* parent);
+ ~PhaseStyleConfig();
+
+signals:
+ void changed(bool);
+
+public slots:
+ void save();
+ void defaults();
+
+protected slots:
+ void updateChanged();
+
+private:
+ bool oldgradients;
+ bool oldhighlights;
+};
+
+#endif // PHASESTYLECONFIG_H
diff --git a/styles/phase2/config/styledialog.ui b/styles/phase2/config/styledialog.ui
new file mode 100644
index 00000000..484de58a
--- /dev/null
+++ b/styles/phase2/config/styledialog.ui
@@ -0,0 +1,70 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>StyleDialog</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>StyleDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>217</width>
+ <height>103</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Style Dialog</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>stylebox</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Style Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>gradients</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;gradients</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This option will draw buttons and several other widgets using a gradient texture</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>highlights</cstring>
+ </property>
+ <property name="text">
+ <string>Highlight on &amp;mouse hover</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This option will highlight buttons and several other widgets when the mouse cursor is over them</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+</widget>
+<tabstops>
+ <tabstop>gradients</tabstop>
+ <tabstop>highlights</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>