summaryrefslogtreecommitdiffstats
path: root/twin/kcmtwin/twinrules
diff options
context:
space:
mode:
Diffstat (limited to 'twin/kcmtwin/twinrules')
-rw-r--r--twin/kcmtwin/twinrules/CMakeLists.txt56
-rw-r--r--twin/kcmtwin/twinrules/Makefile.am29
-rw-r--r--twin/kcmtwin/twinrules/detectwidget.cpp223
-rw-r--r--twin/kcmtwin/twinrules/detectwidget.h86
-rw-r--r--twin/kcmtwin/twinrules/detectwidgetbase.ui218
-rw-r--r--twin/kcmtwin/twinrules/editshortcutbase.ui164
-rw-r--r--twin/kcmtwin/twinrules/kcm.cpp103
-rw-r--r--twin/kcmtwin/twinrules/kcm.h53
-rw-r--r--twin/kcmtwin/twinrules/main.cpp294
-rw-r--r--twin/kcmtwin/twinrules/ruleslist.cpp200
-rw-r--r--twin/kcmtwin/twinrules/ruleslist.h59
-rw-r--r--twin/kcmtwin/twinrules/ruleslistbase.ui91
-rw-r--r--twin/kcmtwin/twinrules/ruleswidget.cpp803
-rw-r--r--twin/kcmtwin/twinrules/ruleswidget.h148
-rw-r--r--twin/kcmtwin/twinrules/ruleswidgetbase.ui2597
-rw-r--r--twin/kcmtwin/twinrules/twinrules.desktop209
-rw-r--r--twin/kcmtwin/twinrules/twinsrc.cpp8
17 files changed, 5341 insertions, 0 deletions
diff --git a/twin/kcmtwin/twinrules/CMakeLists.txt b/twin/kcmtwin/twinrules/CMakeLists.txt
new file mode 100644
index 000000000..29aa24e4e
--- /dev/null
+++ b/twin/kcmtwin/twinrules/CMakeLists.txt
@@ -0,0 +1,56 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_definitions( -DKCMRULES )
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/twin/lib
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+##### other data ################################
+
+install( FILES twinrules.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+
+
+##### kcm_twinrules (module) ####################
+
+tde_add_kpart( kcm_twinrules AUTOMOC
+ SOURCES kcm.cpp
+ LINK twinrules-static
+ DESTINATION ${PLUGIN_INSTALL_DIR} )
+
+
+##### twin_rules_dialog (tdeinit) ###############
+
+tde_add_tdeinit_executable( twin_rules_dialog
+ SOURCES main.cpp
+ LINK ${TQT_LIBRARIES} twinrules-static )
+
+
+##### twinrules (static) ########################
+
+set( target twinrules )
+
+set( ${target}_SRCS
+ ruleswidget.cpp ruleslist.cpp twinsrc.cpp detectwidget.cpp
+ ruleswidgetbase.ui ruleslistbase.ui detectwidgetbase.ui
+ editshortcutbase.ui )
+
+tde_add_library( ${target} STATIC_PIC AUTOMOC
+ SOURCES ${${target}_SRCS}
+ LINK tdeui-shared )
diff --git a/twin/kcmtwin/twinrules/Makefile.am b/twin/kcmtwin/twinrules/Makefile.am
new file mode 100644
index 000000000..c9e7c7beb
--- /dev/null
+++ b/twin/kcmtwin/twinrules/Makefile.am
@@ -0,0 +1,29 @@
+METASOURCES = AUTO
+AM_CPPFLAGS = $(all_includes) -DKCMRULES
+INCLUDES = -I$(top_srcdir)/twin/lib
+
+bin_PROGRAMS =
+lib_LTLIBRARIES =
+tdeinit_LTLIBRARIES = twin_rules_dialog.la
+kde_module_LTLIBRARIES = kcm_twinrules.la
+noinst_LTLIBRARIES = libtwinrules.la
+
+libtwinrules_la_SOURCES = ruleswidget.cpp ruleslist.cpp twinsrc.cpp detectwidget.cpp \
+ ruleswidgetbase.ui ruleslistbase.ui detectwidgetbase.ui editshortcutbase.ui
+libtwinrules_la_LDFLAGS = $(all_libraries) -no-undefined
+libtwinrules_la_LIBADD = $(LIB_TDEUI)
+
+kcm_twinrules_la_SOURCES = kcm.cpp
+kcm_twinrules_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined
+kcm_twinrules_la_LIBADD = libtwinrules.la
+kcm_twinrules_la_COMPILE_FIRST = ruleslistbase.h ruleswidgetbase.h editshortcutbase.h
+
+twin_rules_dialog_la_SOURCES = main.cpp
+twin_rules_dialog_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined
+twin_rules_dialog_la_LIBADD = libtwinrules.la
+twin_rules_dialog_la_COMPILE_FIRST = ruleslistbase.h ruleswidgetbase.h editshortcutbase.h
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kcmtwinrules.pot
+
+xdg_apps_DATA = twinrules.desktop
diff --git a/twin/kcmtwin/twinrules/detectwidget.cpp b/twin/kcmtwin/twinrules/detectwidget.cpp
new file mode 100644
index 000000000..d82836868
--- /dev/null
+++ b/twin/kcmtwin/twinrules/detectwidget.cpp
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 "detectwidget.h"
+
+#include <kapplication.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <twin.h>
+#include <tqlabel.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include <fixx11h.h>
+
+namespace KWinInternal
+{
+
+DetectWidget::DetectWidget( TQWidget* parent, const char* name )
+: DetectWidgetBase( parent, name )
+ {
+ }
+
+DetectDialog::DetectDialog( TQWidget* parent, const char* name )
+: KDialogBase( parent, name, true, "", Ok | Cancel )
+, grabber( NULL )
+ {
+ widget = new DetectWidget( this );
+ setMainWidget( widget );
+ }
+
+void DetectDialog::detect( WId window )
+ {
+ if( window == 0 )
+ selectWindow();
+ else
+ readWindow( window );
+ }
+
+void DetectDialog::readWindow( WId w )
+ {
+ if( w == 0 )
+ {
+ emit detectionDone( false );
+ return;
+ }
+ info = KWin::windowInfo( w, -1U, -1U ); // read everything
+ if( !info.valid())
+ {
+ emit detectionDone( false );
+ return;
+ }
+ wmclass_class = info.windowClassClass();
+ wmclass_name = info.windowClassName();
+ role = info.windowRole();
+ type = info.windowType( NET::NormalMask | NET::DesktopMask | NET::DockMask
+ | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask
+ | NET::UtilityMask | NET::SplashMask );
+ title = info.name();
+ extrarole = ""; // TODO
+ machine = info.clientMachine();
+ executeDialog();
+ }
+
+void DetectDialog::executeDialog()
+ {
+ static const char* const types[] =
+ {
+ I18N_NOOP( "Normal Window" ),
+ I18N_NOOP( "Desktop" ),
+ I18N_NOOP( "Dock (panel)" ),
+ I18N_NOOP( "Toolbar" ),
+ I18N_NOOP( "Torn-Off Menu" ),
+ I18N_NOOP( "Dialog Window" ),
+ I18N_NOOP( "Override Type" ),
+ I18N_NOOP( "Standalone Menubar" ),
+ I18N_NOOP( "Utility Window" ),
+ I18N_NOOP( "Splash Screen" )
+ };
+ widget->class_label->setText( wmclass_class + " (" + wmclass_name + ' ' + wmclass_class + ")" );
+ widget->role_label->setText( role );
+ widget->use_role->setEnabled( !role.isEmpty());
+ if( widget->use_role->isEnabled())
+ widget->use_role->setChecked( true );
+ else
+ widget->use_whole_class->setChecked( true );
+ if( type == NET::Unknown )
+ widget->type_label->setText( i18n( "Unknown - will be treated as Normal Window" ));
+ else
+ widget->type_label->setText( i18n( types[ type ] ));
+ widget->title_label->setText( title );
+ widget->extrarole_label->setText( extrarole );
+ widget->machine_label->setText( machine );
+ emit detectionDone( exec() == TQDialog::Accepted );
+ }
+
+TQCString DetectDialog::selectedClass() const
+ {
+ if( widget->use_class->isChecked() || widget->use_role->isChecked())
+ return wmclass_class;
+ return wmclass_name + ' ' + wmclass_class;
+ }
+
+bool DetectDialog::selectedWholeClass() const
+ {
+ return widget->use_whole_class->isChecked();
+ }
+
+TQCString DetectDialog::selectedRole() const
+ {
+ if( widget->use_role->isChecked())
+ return role;
+ return "";
+ }
+
+TQString DetectDialog::selectedTitle() const
+ {
+ return title;
+ }
+
+Rules::StringMatch DetectDialog::titleMatch() const
+ {
+ return widget->match_title->isChecked() ? Rules::ExactMatch : Rules::UnimportantMatch;
+ }
+
+bool DetectDialog::selectedWholeApp() const
+ {
+ return widget->use_class->isChecked();
+ }
+
+NET::WindowType DetectDialog::selectedType() const
+ {
+ return type;
+ }
+
+TQCString DetectDialog::selectedMachine() const
+ {
+ return machine;
+ }
+
+void DetectDialog::selectWindow()
+ {
+ // use a dialog, so that all user input is blocked
+ // use WX11BypassWM and moving away so that it's not actually visible
+ // grab only mouse, so that keyboard can be used e.g. for switching windows
+ grabber = new TQDialog( NULL, NULL, true, (WFlags)WX11BypassWM );
+ grabber->move( -1000, -1000 );
+ grabber->show();
+ grabber->grabMouse( tqcrossCursor );
+ grabber->installEventFilter( this );
+ }
+
+bool DetectDialog::eventFilter( TQObject* o, TQEvent* e )
+ {
+ if( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(grabber) )
+ return false;
+ if( e->type() != TQEvent::MouseButtonRelease )
+ return false;
+ delete grabber;
+ grabber = NULL;
+ if( TQT_TQMOUSEEVENT( e )->button() != Qt::LeftButton )
+ {
+ emit detectionDone( false );
+ return true;
+ }
+ readWindow( findWindow());
+ return true;
+ }
+
+WId DetectDialog::findWindow()
+ {
+ Window root;
+ Window child;
+ uint mask;
+ int rootX, rootY, x, y;
+ Window parent = qt_xrootwin();
+ Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False );
+ for( int i = 0;
+ i < 10;
+ ++i )
+ {
+ XQueryPointer( qt_xdisplay(), parent, &root, &child,
+ &rootX, &rootY, &x, &y, &mask );
+ if( child == None )
+ return 0;
+ Atom type;
+ int format;
+ unsigned long nitems, after;
+ unsigned char* prop;
+ if( XGetWindowProperty( qt_xdisplay(), child, wm_state, 0, 0, False, AnyPropertyType,
+ &type, &format, &nitems, &after, &prop ) == Success )
+ {
+ if( prop != NULL )
+ XFree( prop );
+ if( type != None )
+ return child;
+ }
+ parent = child;
+ }
+ return 0;
+ }
+
+} // namespace
+
+#include "detectwidget.moc"
diff --git a/twin/kcmtwin/twinrules/detectwidget.h b/twin/kcmtwin/twinrules/detectwidget.h
new file mode 100644
index 000000000..75e725f5f
--- /dev/null
+++ b/twin/kcmtwin/twinrules/detectwidget.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 __DETECTWIDGET_H__
+#define __DETECTWIDGET_H__
+
+#include "detectwidgetbase.h"
+
+#include <kdialogbase.h>
+#include <twin.h>
+
+#include "../../rules.h"
+
+namespace KWinInternal
+{
+
+class DetectWidget
+ : public DetectWidgetBase
+ {
+ Q_OBJECT
+ public:
+ DetectWidget( TQWidget* parent = NULL, const char* name = NULL );
+ };
+
+class DetectDialog
+ : public KDialogBase
+ {
+ Q_OBJECT
+ public:
+ DetectDialog( TQWidget* parent = NULL, const char* name = NULL );
+ void detect( WId window );
+ TQCString selectedClass() const;
+ bool selectedWholeClass() const;
+ TQCString selectedRole() const;
+ bool selectedWholeApp() const;
+ NET::WindowType selectedType() const;
+ TQString selectedTitle() const;
+ Rules::StringMatch titleMatch() const;
+ TQCString selectedMachine() const;
+ const KWin::WindowInfo& windowInfo() const;
+ signals:
+ void detectionDone( bool );
+ protected:
+ virtual bool eventFilter( TQObject* o, TQEvent* e );
+ private:
+ void selectWindow();
+ void readWindow( WId window );
+ void executeDialog();
+ WId findWindow();
+ TQCString wmclass_class;
+ TQCString wmclass_name;
+ TQCString role;
+ NET::WindowType type;
+ TQString title;
+ TQCString extrarole;
+ TQCString machine;
+ DetectWidget* widget;
+ TQDialog* grabber;
+ KWin::WindowInfo info;
+ };
+
+inline
+const KWin::WindowInfo& DetectDialog::windowInfo() const
+ {
+ return info;
+ }
+
+} // namespace
+
+#endif
diff --git a/twin/kcmtwin/twinrules/detectwidgetbase.ui b/twin/kcmtwin/twinrules/detectwidgetbase.ui
new file mode 100644
index 000000000..af4ca9670
--- /dev/null
+++ b/twin/kcmtwin/twinrules/detectwidgetbase.ui
@@ -0,0 +1,218 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KWinInternal::DetectWidgetBase</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>Form3</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>523</width>
+ <height>325</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer row="9" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="6" column="0">
+ <property name="name">
+ <cstring>textLabel11</cstring>
+ </property>
+ <property name="text">
+ <string>Extra role:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Class:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Role:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="1">
+ <property name="name">
+ <cstring>type_label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0">
+ <property name="name">
+ <cstring>textLabel8</cstring>
+ </property>
+ <property name="text">
+ <string>Title:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="1">
+ <property name="name">
+ <cstring>class_label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="1">
+ <property name="name">
+ <cstring>role_label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="1">
+ <property name="name">
+ <cstring>title_label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="7" column="1">
+ <property name="name">
+ <cstring>machine_label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Type:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="6" column="1">
+ <property name="name">
+ <cstring>extrarole_label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="7" column="0">
+ <property name="name">
+ <cstring>textLabel13</cstring>
+ </property>
+ <property name="text">
+ <string>Machine:</string>
+ </property>
+ </widget>
+ <widget class="Line" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel9</cstring>
+ </property>
+ <property name="text">
+ <string>Information About Selected Window</string>
+ </property>
+ </widget>
+ <widget class="TQButtonGroup" row="8" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>use_class</cstring>
+ </property>
+ <property name="text">
+ <string>Use window &amp;class (whole application)</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>For selecting all windows belonging to a specific application, selecting only window class should usually work.</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>use_role</cstring>
+ </property>
+ <property name="text">
+ <string>Use window class and window &amp;role (specific window)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>For selecting a specific window in an application, both window class and window role should be selected. Window class will determine the application, and window role the specific window in the application; many applications do not provide useful window roles though.</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>use_whole_class</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;whole window class (specific window)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>With some (non-KDE) applications whole window class can be sufficient for selecting a specific window in an application, as they set whole window class to contain both application and window role.</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>match_title</cstring>
+ </property>
+ <property name="text">
+ <string>Match also window &amp;title</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/twin/kcmtwin/twinrules/editshortcutbase.ui b/twin/kcmtwin/twinrules/editshortcutbase.ui
new file mode 100644
index 000000000..af704c0a2
--- /dev/null
+++ b/twin/kcmtwin/twinrules/editshortcutbase.ui
@@ -0,0 +1,164 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>EditShortcutBase</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>EditShortcutBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>587</width>
+ <height>402</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>A single shortcut can be easily assigned or cleared using the two buttons. Only shortcuts with modifiers can be used.&lt;p&gt;
+It is possible to have several possible shortcuts, and the first available shortcut will be used. The shortcuts are specified using space-separated shortcut sets. One set is specified as &lt;i&gt;base&lt;/i&gt;+(&lt;i&gt;list&lt;/i&gt;), where base are modifiers and list is a list of keys.&lt;br&gt;
+For example "&lt;b&gt;Shift+Alt+(123) Shift+Ctrl+(ABC)&lt;/b&gt;" will first try &lt;b&gt;Shift+Alt+1&lt;/b&gt;, then others with &lt;b&gt;Shift+Ctrl+C&lt;/b&gt; as the last one.</string>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>shortcut</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>pushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Single Shortcut</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>pushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;lear</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>pushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>EditShortcutBase</receiver>
+ <slot>editShortcut()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>EditShortcutBase</receiver>
+ <slot>clearShortcut()</slot>
+ </connection>
+</connections>
+<Q_SLOTS>
+ <slot access="protected" specifier="pure virtual">editShortcut()</slot>
+ <slot access="protected" specifier="pure virtual">clearShortcut()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/twin/kcmtwin/twinrules/kcm.cpp b/twin/kcmtwin/twinrules/kcm.cpp
new file mode 100644
index 000000000..c7cdc7587
--- /dev/null
+++ b/twin/kcmtwin/twinrules/kcm.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 "kcm.h"
+
+#include <kglobal.h>
+#include <tqlayout.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <kaboutdata.h>
+
+#include "ruleslist.h"
+
+extern "C"
+ KDE_EXPORT KCModule *create_twinrules( TQWidget *parent, const char *name )
+ {
+ //CT there's need for decision: kwm or twin?
+ KGlobal::locale()->insertCatalogue( "kcmtwinrules" );
+ return new KWinInternal::KCMRules( parent, name );
+ }
+
+namespace KWinInternal
+{
+
+KCMRules::KCMRules( TQWidget *parent, const char *name )
+: KCModule( parent, name )
+, config( "twinrulesrc" )
+ {
+ TQVBoxLayout *layout = new TQVBoxLayout( this );
+ widget = new KCMRulesList( this );
+ layout->addWidget( TQT_TQWIDGET(widget) );
+ connect( widget, TQT_SIGNAL( changed( bool )), TQT_SLOT( moduleChanged( bool )));
+ KAboutData *about = new KAboutData(I18N_NOOP( "kcmtwinrules" ),
+ I18N_NOOP( "Window-Specific Settings Configuration Module" ),
+ 0, 0, KAboutData::License_GPL, I18N_NOOP( "(c) 2004 KWin and KControl Authors" ));
+ about->addAuthor("Lubos Lunak",0,"[email protected]");
+ setAboutData(about);
+ }
+
+void KCMRules::load()
+ {
+ config.reparseConfiguration();
+ widget->load();
+ emit KCModule::changed( false );
+ }
+
+void KCMRules::save()
+ {
+ widget->save();
+ emit KCModule::changed( false );
+ // Send signal to twin
+ config.sync();
+ if( !kapp->dcopClient()->isAttached())
+ kapp->dcopClient()->attach();
+ kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString(""));
+ }
+
+void KCMRules::defaults()
+ {
+ widget->defaults();
+ }
+
+TQString KCMRules::quickHelp() const
+ {
+ return i18n("<h1>Window-specific Settings</h1> Here you can customize window settings specifically only"
+ " for some windows."
+ " <p>Please note that this configuration will not take effect if you do not use"
+ " KWin as your window manager. If you do use a different window manager, please refer to its documentation"
+ " for how to customize window behavior.");
+ }
+
+void KCMRules::moduleChanged( bool state )
+ {
+ emit KCModule::changed( state );
+ }
+
+}
+
+// i18n freeze :-/
+#if 0
+I18N_NOOP("Remember settings separately for every window")
+I18N_NOOP("Show internal settings for remembering")
+I18N_NOOP("Internal setting for remembering")
+#endif
+
+
+#include "kcm.moc"
diff --git a/twin/kcmtwin/twinrules/kcm.h b/twin/kcmtwin/twinrules/kcm.h
new file mode 100644
index 000000000..9fb307458
--- /dev/null
+++ b/twin/kcmtwin/twinrules/kcm.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 __KCM_H__
+#define __KCM_H__
+
+#include <kcmodule.h>
+#include <kconfig.h>
+
+class KConfig;
+class KAboutData;
+
+namespace KWinInternal
+{
+
+class KCMRulesList;
+
+class KCMRules
+ : public KCModule
+ {
+ Q_OBJECT
+ public:
+ KCMRules( TQWidget *parent, const char *name );
+ virtual void load();
+ virtual void save();
+ virtual void defaults();
+ virtual TQString quickHelp() const;
+ protected slots:
+ void moduleChanged( bool state );
+ private:
+ KCMRulesList* widget;
+ KConfig config;
+ };
+
+} // namespace
+
+#endif
diff --git a/twin/kcmtwin/twinrules/main.cpp b/twin/kcmtwin/twinrules/main.cpp
new file mode 100644
index 000000000..db3a9fc48
--- /dev/null
+++ b/twin/kcmtwin/twinrules/main.cpp
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 <kcmdlineargs.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <twin.h>
+
+#include <X11/Xlib.h>
+#include <fixx11h.h>
+
+#include "ruleswidget.h"
+#include "../../rules.h"
+
+namespace KWinInternal
+{
+
+static void loadRules( TQValueList< Rules* >& rules )
+ {
+ KConfig cfg( "twinrulesrc", true );
+ cfg.setGroup( "General" );
+ int count = cfg.readNumEntry( "count" );
+ for( int i = 1;
+ i <= count;
+ ++i )
+ {
+ cfg.setGroup( TQString::number( i ));
+ Rules* rule = new Rules( cfg );
+ rules.append( rule );
+ }
+ }
+
+static void saveRules( const TQValueList< Rules* >& rules )
+ {
+ KConfig cfg( "twinrulesrc" );
+ TQStringList groups = cfg.groupList();
+ for( TQStringList::ConstIterator it = groups.begin();
+ it != groups.end();
+ ++it )
+ cfg.deleteGroup( *it );
+ cfg.setGroup( "General" );
+ cfg.writeEntry( "count", rules.count());
+ int i = 1;
+ for( TQValueList< Rules* >::ConstIterator it = rules.begin();
+ it != rules.end();
+ ++it )
+ {
+ cfg.setGroup( TQString::number( i ));
+ (*it)->write( cfg );
+ ++i;
+ }
+ }
+
+static Rules* findRule( const TQValueList< Rules* >& rules, Window wid, bool whole_app )
+ {
+ KWin::WindowInfo info = KWin::windowInfo( wid,
+ NET::WMName | NET::WMWindowType,
+ NET::WM2WindowClass | NET::WM2WindowRole | NET::WM2ClientMachine );
+ if( !info.valid()) // shouldn't really happen
+ return NULL;
+ TQCString wmclass_class = info.windowClassClass().lower();
+ TQCString wmclass_name = info.windowClassName().lower();
+ TQCString role = info.windowRole().lower();
+ NET::WindowType type = info.windowType( NET::NormalMask | NET::DesktopMask | NET::DockMask
+ | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask
+ | NET::UtilityMask | NET::SplashMask );
+ TQString title = info.name();
+// TQCString extrarole = ""; // TODO
+ TQCString machine = info.clientMachine().lower();
+ Rules* best_match = NULL;
+ int match_quality = 0;
+ for( TQValueList< Rules* >::ConstIterator it = rules.begin();
+ it != rules.end();
+ ++it )
+ {
+ // try to find an exact match, i.e. not a generic rule
+ Rules* rule = *it;
+ int quality = 0;
+ bool generic = true;
+ if( rule->wmclassmatch != Rules::ExactMatch )
+ continue; // too generic
+ if( !rule->matchWMClass( wmclass_class, wmclass_name ))
+ continue;
+ // from now on, it matches the app - now try to match for a specific window
+ if( rule->wmclasscomplete )
+ {
+ quality += 1;
+ generic = false; // this can be considered specific enough (old X apps)
+ }
+ if( !whole_app )
+ {
+ if( rule->windowrolematch != Rules::UnimportantMatch )
+ {
+ quality += rule->windowrolematch == Rules::ExactMatch ? 5 : 1;
+ generic = false;
+ }
+ if( rule->titlematch != Rules::UnimportantMatch )
+ {
+ quality += rule->titlematch == Rules::ExactMatch ? 3 : 1;
+ generic = false;
+ }
+ if( rule->types != NET::AllTypesMask )
+ {
+ int bits = 0;
+ for( unsigned int bit = 1;
+ bit < 1U << 31;
+ bit <<= 1 )
+ if( rule->types & bit )
+ ++bits;
+ if( bits == 1 )
+ quality += 2;
+ }
+ if( generic ) // ignore generic rules, use only the ones that are for this window
+ continue;
+ }
+ else
+ {
+ if( rule->types == NET::AllTypesMask )
+ quality += 2;
+ }
+ if( !rule->matchType( type )
+ || !rule->matchRole( role )
+ || !rule->matchTitle( title )
+ || !rule->matchClientMachine( machine ))
+ continue;
+ if( quality > match_quality )
+ {
+ best_match = rule;
+ match_quality = quality;
+ }
+ }
+ if( best_match != NULL )
+ return best_match;
+ Rules* ret = new Rules;
+ if( whole_app )
+ {
+ ret->description = i18n( "Application settings for %1" ).tqarg( static_cast<const char *>(wmclass_class) );
+ // TODO maybe exclude some types? If yes, then also exclude them above
+ // when searching.
+ ret->types = NET::AllTypesMask;
+ ret->titlematch = Rules::UnimportantMatch;
+ ret->clientmachine = machine; // set, but make unimportant
+ ret->clientmachinematch = Rules::UnimportantMatch;
+ ret->extrarolematch = Rules::UnimportantMatch;
+ ret->windowrolematch = Rules::UnimportantMatch;
+ if( wmclass_name == wmclass_class )
+ {
+ ret->wmclasscomplete = false;
+ ret->wmclass = wmclass_class;
+ ret->wmclassmatch = Rules::ExactMatch;
+ }
+ else
+ {
+ // WM_CLASS components differ - perhaps the app got -name argument
+ ret->wmclasscomplete = true;
+ ret->wmclass = wmclass_name + ' ' + wmclass_class;
+ ret->wmclassmatch = Rules::ExactMatch;
+ }
+ return ret;
+ }
+ ret->description = i18n( "Window settings for %1" ).tqarg( static_cast<const char *>(wmclass_class) );
+ if( type == NET::Unknown )
+ ret->types = NET::NormalMask;
+ else
+ ret->types = 1 << type; // convert type to its mask
+ ret->title = title; // set, but make unimportant
+ ret->titlematch = Rules::UnimportantMatch;
+ ret->clientmachine = machine; // set, but make unimportant
+ ret->clientmachinematch = Rules::UnimportantMatch;
+// ret->extrarole = extra; TODO
+ ret->extrarolematch = Rules::UnimportantMatch;
+ if( !role.isEmpty()
+ && role != "unknown" && role != "unnamed" ) // Qt sets this if not specified
+ {
+ ret->windowrole = role;
+ ret->windowrolematch = Rules::ExactMatch;
+ if( wmclass_name == wmclass_class )
+ {
+ ret->wmclasscomplete = false;
+ ret->wmclass = wmclass_class;
+ ret->wmclassmatch = Rules::ExactMatch;
+ }
+ else
+ {
+ // WM_CLASS components differ - perhaps the app got -name argument
+ ret->wmclasscomplete = true;
+ ret->wmclass = wmclass_name + ' ' + wmclass_class;
+ ret->wmclassmatch = Rules::ExactMatch;
+ }
+ }
+ else // no role set
+ {
+ if( wmclass_name != wmclass_class )
+ {
+ ret->wmclasscomplete = true;
+ ret->wmclass = wmclass_name + ' ' + wmclass_class;
+ ret->wmclassmatch = Rules::ExactMatch;
+ }
+ else
+ {
+ // This is a window that has no role set, and both components of WM_CLASS
+ // match (possibly only differing in case), which most likely means either
+ // the application doesn't give a damn about distinguishing its various
+ // windows, or it's an app that uses role for that, but this window
+ // lacks it for some reason. Use non-complete WM_CLASS matching, also
+ // include window title in the matching, and pray it causes many more positive
+ // matches than negative matches.
+ ret->titlematch = Rules::ExactMatch;
+ ret->wmclasscomplete = false;
+ ret->wmclass = wmclass_class;
+ ret->wmclassmatch = Rules::ExactMatch;
+ }
+ }
+ return ret;
+ }
+
+static int edit( Window wid, bool whole_app )
+ {
+ TQValueList< Rules* > rules;
+ loadRules( rules );
+ Rules* orig_rule = findRule( rules, wid, whole_app );
+ RulesDialog dlg;
+ // dlg.edit() creates new Rules instance if edited
+ Rules* edited_rule = dlg.edit( orig_rule, wid, true );
+ if( edited_rule == NULL || edited_rule->isEmpty())
+ {
+ rules.remove( orig_rule );
+ delete orig_rule;
+ if( orig_rule != edited_rule )
+ delete edited_rule;
+ }
+ else if( edited_rule != orig_rule )
+ {
+ TQValueList< Rules* >::Iterator pos = rules.find( orig_rule );
+ if( pos != rules.end())
+ *pos = edited_rule;
+ else
+ rules.prepend( edited_rule );
+ delete orig_rule;
+ }
+ saveRules( rules );
+ if( !kapp->dcopClient()->isAttached())
+ kapp->dcopClient()->attach();
+ kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString(""));
+ return 0;
+ }
+
+} // namespace
+
+static const KCmdLineOptions options[] =
+ {
+ // no need for I18N_NOOP(), this is not supposed to be used directly
+ { "wid <wid>", "WId of the window for special window settings.", 0 },
+ { "whole-app", "Whether the settings should affect all windows of the application.", 0 },
+ KCmdLineLastOption
+ };
+
+extern "C"
+KDE_EXPORT int kdemain( int argc, char* argv[] )
+ {
+ KLocale::setMainCatalogue( "kcmtwinrules" );
+ KCmdLineArgs::init( argc, argv, "twin_rules_dialog", I18N_NOOP( "KWin" ),
+ I18N_NOOP( "KWin helper utility" ), "1.0" );
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+ KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+ bool id_ok = false;
+ Window id = args->getOption( "wid" ).toULong( &id_ok );
+ bool whole_app = args->isSet( "whole-app" );
+ args->clear();
+ if( !id_ok || id == None )
+ {
+ KCmdLineArgs::usage( i18n( "This helper utility is not supposed to be called directly." ));
+ return 1;
+ }
+ return KWinInternal::edit( id, whole_app );
+ }
diff --git a/twin/kcmtwin/twinrules/ruleslist.cpp b/twin/kcmtwin/twinrules/ruleslist.cpp
new file mode 100644
index 000000000..29e02549d
--- /dev/null
+++ b/twin/kcmtwin/twinrules/ruleslist.cpp
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 "ruleslist.h"
+
+#include <klistbox.h>
+#include <kpushbutton.h>
+#include <assert.h>
+#include <kdebug.h>
+#include <kconfig.h>
+
+#include "ruleswidget.h"
+
+namespace KWinInternal
+{
+
+KCMRulesList::KCMRulesList( TQWidget* parent, const char* name )
+: KCMRulesListBase( parent, name )
+ {
+ // connect both current/selected, so that current==selected (stupid TQListBox :( )
+ connect( rules_listbox, TQT_SIGNAL( currentChanged( TQListBoxItem* )),
+ TQT_SLOT( activeChanged( TQListBoxItem*)));
+ connect( rules_listbox, TQT_SIGNAL( selectionChanged( TQListBoxItem* )),
+ TQT_SLOT( activeChanged( TQListBoxItem*)));
+ connect( new_button, TQT_SIGNAL( clicked()),
+ TQT_SLOT( newClicked()));
+ connect( modify_button, TQT_SIGNAL( clicked()),
+ TQT_SLOT( modifyClicked()));
+ connect( delete_button, TQT_SIGNAL( clicked()),
+ TQT_SLOT( deleteClicked()));
+ connect( moveup_button, TQT_SIGNAL( clicked()),
+ TQT_SLOT( moveupClicked()));
+ connect( movedown_button, TQT_SIGNAL( clicked()),
+ TQT_SLOT( movedownClicked()));
+ connect( rules_listbox, TQT_SIGNAL( doubleClicked ( TQListBoxItem * ) ),
+ TQT_SLOT( modifyClicked()));
+ load();
+ }
+
+KCMRulesList::~KCMRulesList()
+ {
+ for( TQValueVector< Rules* >::Iterator it = rules.begin();
+ it != rules.end();
+ ++it )
+ delete *it;
+ rules.clear();
+ }
+
+void KCMRulesList::activeChanged( TQListBoxItem* item )
+ {
+ if( item != NULL )
+ rules_listbox->setSelected( item, true ); // make current==selected
+ modify_button->setEnabled( item != NULL );
+ delete_button->setEnabled( item != NULL );
+ moveup_button->setEnabled( item != NULL && item->prev() != NULL );
+ movedown_button->setEnabled( item != NULL && item->next() != NULL );
+ }
+
+void KCMRulesList::newClicked()
+ {
+ RulesDialog dlg;
+ Rules* rule = dlg.edit( NULL, 0, false );
+ if( rule == NULL )
+ return;
+ int pos = rules_listbox->currentItem() + 1;
+ rules_listbox->insertItem( rule->description, pos );
+ rules_listbox->setSelected( pos, true );
+ rules.insert( rules.begin() + pos, rule );
+ emit changed( true );
+ }
+
+void KCMRulesList::modifyClicked()
+ {
+ int pos = rules_listbox->currentItem();
+ if ( pos == -1 )
+ return;
+ RulesDialog dlg;
+ Rules* rule = dlg.edit( rules[ pos ], 0, false );
+ if( rule == rules[ pos ] )
+ return;
+ delete rules[ pos ];
+ rules[ pos ] = rule;
+ rules_listbox->changeItem( rule->description, pos );
+ emit changed( true );
+ }
+
+void KCMRulesList::deleteClicked()
+ {
+ int pos = rules_listbox->currentItem();
+ assert( pos != -1 );
+ rules_listbox->removeItem( pos );
+ rules.erase( rules.begin() + pos );
+ emit changed( true );
+ }
+
+void KCMRulesList::moveupClicked()
+ {
+ int pos = rules_listbox->currentItem();
+ assert( pos != -1 );
+ if( pos > 0 )
+ {
+ TQString txt = rules_listbox->text( pos );
+ rules_listbox->removeItem( pos );
+ rules_listbox->insertItem( txt, pos - 1 );
+ rules_listbox->setSelected( pos - 1, true );
+ Rules* rule = rules[ pos ];
+ rules[ pos ] = rules[ pos - 1 ];
+ rules[ pos - 1 ] = rule;
+ }
+ emit changed( true );
+ }
+
+void KCMRulesList::movedownClicked()
+ {
+ int pos = rules_listbox->currentItem();
+ assert( pos != -1 );
+ if( pos < int( rules_listbox->count()) - 1 )
+ {
+ TQString txt = rules_listbox->text( pos );
+ rules_listbox->removeItem( pos );
+ rules_listbox->insertItem( txt, pos + 1 );
+ rules_listbox->setSelected( pos + 1, true );
+ Rules* rule = rules[ pos ];
+ rules[ pos ] = rules[ pos + 1 ];
+ rules[ pos + 1 ] = rule;
+ }
+ emit changed( true );
+ }
+
+void KCMRulesList::load()
+ {
+ rules_listbox->clear();
+ for( TQValueVector< Rules* >::Iterator it = rules.begin();
+ it != rules.end();
+ ++it )
+ delete *it;
+ rules.clear();
+ KConfig cfg( "twinrulesrc", true );
+ cfg.setGroup( "General" );
+ int count = cfg.readNumEntry( "count" );
+ rules.reserve( count );
+ for( int i = 1;
+ i <= count;
+ ++i )
+ {
+ cfg.setGroup( TQString::number( i ));
+ Rules* rule = new Rules( cfg );
+ rules.append( rule );
+ rules_listbox->insertItem( rule->description );
+ }
+ if( rules.count() > 0 )
+ rules_listbox->setSelected( 0, true );
+ else
+ activeChanged( NULL );
+ }
+
+void KCMRulesList::save()
+ {
+ KConfig cfg( "twinrulesrc" );
+ TQStringList groups = cfg.groupList();
+ for( TQStringList::ConstIterator it = groups.begin();
+ it != groups.end();
+ ++it )
+ cfg.deleteGroup( *it );
+ cfg.setGroup( "General" );
+ cfg.writeEntry( "count", rules.count());
+ int i = 1;
+ for( TQValueVector< Rules* >::ConstIterator it = rules.begin();
+ it != rules.end();
+ ++it )
+ {
+ cfg.setGroup( TQString::number( i ));
+ (*it)->write( cfg );
+ ++i;
+ }
+ }
+
+void KCMRulesList::defaults()
+ {
+ load();
+ }
+
+} // namespace
+
+#include "ruleslist.moc"
diff --git a/twin/kcmtwin/twinrules/ruleslist.h b/twin/kcmtwin/twinrules/ruleslist.h
new file mode 100644
index 000000000..f7e7fb541
--- /dev/null
+++ b/twin/kcmtwin/twinrules/ruleslist.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 __RULESLIST_H__
+#define __RULESLIST_H__
+
+#include "ruleslistbase.h"
+
+#include <tqvaluevector.h>
+
+#include "../../rules.h"
+
+class TQListBoxItem;
+
+namespace KWinInternal
+{
+
+class KCMRulesList
+ : public KCMRulesListBase
+ {
+ Q_OBJECT
+ public:
+ KCMRulesList( TQWidget* parent = NULL, const char* name = NULL );
+ virtual ~KCMRulesList();
+ void load();
+ void save();
+ void defaults();
+ signals:
+ void changed( bool );
+ private slots:
+ void newClicked();
+ void modifyClicked();
+ void deleteClicked();
+ void moveupClicked();
+ void movedownClicked();
+ void activeChanged( TQListBoxItem* );
+ private:
+ TQValueVector< Rules* > rules;
+ };
+
+} // namespace
+
+#endif
diff --git a/twin/kcmtwin/twinrules/ruleslistbase.ui b/twin/kcmtwin/twinrules/ruleslistbase.ui
new file mode 100644
index 000000000..5fc5fd6ed
--- /dev/null
+++ b/twin/kcmtwin/twinrules/ruleslistbase.ui
@@ -0,0 +1,91 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KWinInternal::KCMRulesListBase</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KListBox" row="0" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>rules_listbox</cstring>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>new_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>modify_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Modify...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>delete_button</cstring>
+ </property>
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>moveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>movedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ </widget>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>294</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/twin/kcmtwin/twinrules/ruleswidget.cpp b/twin/kcmtwin/twinrules/ruleswidget.cpp
new file mode 100644
index 000000000..cfe96458e
--- /dev/null
+++ b/twin/kcmtwin/twinrules/ruleswidget.cpp
@@ -0,0 +1,803 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 "ruleswidget.h"
+
+#include <klineedit.h>
+#include <krestrictedline.h>
+#include <kcombobox.h>
+#include <tqcheckbox.h>
+#include <kpushbutton.h>
+#include <tqlabel.h>
+#include <twinmodule.h>
+#include <klocale.h>
+#include <tqregexp.h>
+#include <tqwhatsthis.h>
+#include <assert.h>
+#include <kmessagebox.h>
+#include <tqtabwidget.h>
+#include <tqtimer.h>
+
+#include "../../rules.h"
+
+#include "detectwidget.h"
+
+namespace KWinInternal
+{
+
+#define SETUP( var, type ) \
+ connect( enable_##var, TQT_SIGNAL( toggled( bool )), rule_##var, TQT_SLOT( setEnabled( bool ))); \
+ connect( enable_##var, TQT_SIGNAL( toggled( bool )), this, TQT_SLOT( updateEnable##var())); \
+ connect( rule_##var, TQT_SIGNAL( activated( int )), this, TQT_SLOT( updateEnable##var())); \
+ TQWhatsThis::add( enable_##var, enableDesc ); \
+ TQWhatsThis::add( rule_##var, type##RuleDesc );
+
+RulesWidget::RulesWidget( TQWidget* parent, const char* name )
+: RulesWidgetBase( parent, name )
+, detect_dlg( NULL )
+ {
+ TQString enableDesc =
+ i18n( "Enable this checkbox to alter this window property for the specified window(s)." );
+ TQString setRuleDesc =
+ i18n( "Specify how the window property should be affected:<ul>"
+ "<li><em>Do Not Affect:</em> The window property will not be affected and therefore"
+ " the default handling for it will be used. Specifying this will block more generic"
+ " window settings from taking effect.</li>"
+ "<li><em>Apply Initially:</em> The window property will be only set to the given value"
+ " after the window is created. No further changes will be affected.</li>"
+ "<li><em>Remember:</em> The value of the window property will be remembered and every time"
+ " time the window is created, the last remembered value will be applied.</li>"
+ "<li><em>Force:</em> The window property will be always forced to the given value.</li>"
+ "<li><em>Apply Now:</em> The window property will be set to the given value immediately"
+ " and will not be affected later (this action will be deleted afterwards).</li>"
+ "<li><em>Force temporarily:</em> The window property will be forced to the given value"
+ " until it is hidden (this action will be deleted after the window is hidden).</li>"
+ "</ul>" );
+ TQString forceRuleDesc =
+ i18n( "Specify how the window property should be affected:<ul>"
+ "<li><em>Do Not Affect:</em> The window property will not be affected and therefore"
+ " the default handling for it will be used. Specifying this will block more generic"
+ " window settings from taking effect.</li>"
+ "<li><em>Force:</em> The window property will be always forced to the given value.</li>"
+ "<li><em>Force temporarily:</em> The window property will be forced to the given value"
+ " until it is hidden (this action will be deleted after the window is hidden).</li>"
+ "</ul>" );
+ // window tabs have enable signals done in designer
+ // geometry tab
+ SETUP( position, set );
+ SETUP( size, set );
+ SETUP( desktop, set );
+ SETUP( maximizehoriz, set );
+ SETUP( maximizevert, set );
+ SETUP( minimize, set );
+ SETUP( shade, set );
+ SETUP( fullscreen, set );
+ SETUP( placement, force );
+ // preferences tab
+ SETUP( above, set );
+ SETUP( below, set );
+ SETUP( noborder, set );
+ SETUP( skiptaskbar, set );
+ SETUP( skippager, set );
+ SETUP( acceptfocus, force );
+ SETUP( closeable, force );
+ SETUP( opacityactive, force );
+ SETUP( opacityinactive, force );
+ SETUP( shortcut, force );
+ // workarounds tab
+ SETUP( fsplevel, force );
+ SETUP( moveresizemode, force );
+ SETUP( type, force );
+ SETUP( ignoreposition, force );
+ SETUP( minsize, force );
+ SETUP( maxsize, force );
+ SETUP( strictgeometry, force );
+ SETUP( disableglobalshortcuts, force );
+ KWinModule module;
+ int i;
+ for( i = 1;
+ i <= module.numberOfDesktops();
+ ++i )
+ desktop->insertItem( TQString::number( i ).rightJustify( 2 ) + ":" + module.desktopName( i ));
+ desktop->insertItem( i18n( "All Desktops" ));
+ }
+
+#undef SETUP
+
+#define UPDATE_ENABLE_SLOT( var ) \
+void RulesWidget::updateEnable##var() \
+ { \
+ /* leave the label readable label_##var->setEnabled( enable_##var->isChecked() && rule_##var->currentItem() != 0 );*/ \
+ var->setEnabled( enable_##var->isChecked() && rule_##var->currentItem() != 0 ); \
+ }
+
+// geometry tab
+UPDATE_ENABLE_SLOT( position )
+UPDATE_ENABLE_SLOT( size )
+UPDATE_ENABLE_SLOT( desktop )
+UPDATE_ENABLE_SLOT( maximizehoriz )
+UPDATE_ENABLE_SLOT( maximizevert )
+UPDATE_ENABLE_SLOT( minimize )
+UPDATE_ENABLE_SLOT( shade )
+UPDATE_ENABLE_SLOT( fullscreen )
+UPDATE_ENABLE_SLOT( placement )
+// preferences tab
+UPDATE_ENABLE_SLOT( above )
+UPDATE_ENABLE_SLOT( below )
+UPDATE_ENABLE_SLOT( noborder )
+UPDATE_ENABLE_SLOT( skiptaskbar )
+UPDATE_ENABLE_SLOT( skippager )
+UPDATE_ENABLE_SLOT( acceptfocus )
+UPDATE_ENABLE_SLOT( closeable )
+UPDATE_ENABLE_SLOT( opacityactive )
+UPDATE_ENABLE_SLOT( opacityinactive )
+void RulesWidget::updateEnableshortcut()
+ {
+ shortcut->setEnabled( enable_shortcut->isChecked() && rule_shortcut->currentItem() != 0 );
+ shortcut_edit->setEnabled( enable_shortcut->isChecked() && rule_shortcut->currentItem() != 0 );
+ }
+// workarounds tab
+UPDATE_ENABLE_SLOT( fsplevel )
+UPDATE_ENABLE_SLOT( moveresizemode )
+UPDATE_ENABLE_SLOT( type )
+UPDATE_ENABLE_SLOT( ignoreposition )
+UPDATE_ENABLE_SLOT( minsize )
+UPDATE_ENABLE_SLOT( maxsize )
+UPDATE_ENABLE_SLOT( strictgeometry )
+UPDATE_ENABLE_SLOT( disableglobalshortcuts )
+
+#undef UPDATE_ENABLE_SLOT
+
+static const int set_rule_to_combo[] =
+ {
+ 0, // Unused
+ 0, // Don't Affect
+ 3, // Force
+ 1, // Apply
+ 2, // Remember
+ 4, // ApplyNow
+ 5 // ForceTemporarily
+ };
+
+static const Rules::SetRule combo_to_set_rule[] =
+ {
+ ( Rules::SetRule )Rules::DontAffect,
+ ( Rules::SetRule )Rules::Apply,
+ ( Rules::SetRule )Rules::Remember,
+ ( Rules::SetRule )Rules::Force,
+ ( Rules::SetRule )Rules::ApplyNow,
+ ( Rules::SetRule )Rules::ForceTemporarily
+ };
+
+static const int force_rule_to_combo[] =
+ {
+ 0, // Unused
+ 0, // Don't Affect
+ 1, // Force
+ 0, // Apply
+ 0, // Remember
+ 0, // ApplyNow
+ 2 // ForceTemporarily
+ };
+
+static const Rules::ForceRule combo_to_force_rule[] =
+ {
+ ( Rules::ForceRule )Rules::DontAffect,
+ ( Rules::ForceRule )Rules::Force,
+ ( Rules::ForceRule )Rules::ForceTemporarily
+ };
+
+static TQString positionToStr( const TQPoint& p )
+ {
+ if( p == invalidPoint )
+ return TQString::null;
+ return TQString::number( p.x()) + "," + TQString::number( p.y());
+ }
+
+static TQPoint strToPosition( const TQString& str )
+ { // two numbers, with + or -, separated by any of , x X :
+ TQRegExp reg( "\\s*([+-]?[0-9]*)\\s*[,xX:]\\s*([+-]?[0-9]*)\\s*" );
+ if( !reg.exactMatch( str ))
+ return invalidPoint;
+ return TQPoint( reg.cap( 1 ).toInt(), reg.cap( 2 ).toInt());
+ }
+
+static TQString sizeToStr( const TQSize& s )
+ {
+ if( !s.isValid())
+ return TQString::null;
+ return TQString::number( s.width()) + "," + TQString::number( s.height());
+ }
+
+static TQSize strToSize( const TQString& str )
+ { // two numbers, with + or -, separated by any of , x X :
+ TQRegExp reg( "\\s*([+-]?[0-9]*)\\s*[,xX:]\\s*([+-]?[0-9]*)\\s*" );
+ if( !reg.exactMatch( str ))
+ return TQSize();
+ return TQSize( reg.cap( 1 ).toInt(), reg.cap( 2 ).toInt());
+ }
+
+//used for opacity settings
+static TQString intToStr( const int& s )
+ {
+ if( s < 1 || s > 100 )
+ return TQString::null;
+ return TQString::number(s);
+ }
+
+static int strToInt( const TQString& str )
+ {
+ int tmp = str.toInt();
+ if( tmp < 1 || tmp > 100 )
+ return 100;
+ return tmp;
+ }
+
+int RulesWidget::desktopToCombo( int d ) const
+ {
+ if( d >= 1 && d < desktop->count())
+ return d - 1;
+ return desktop->count() - 1; // on all desktops
+ }
+
+int RulesWidget::comboToDesktop( int val ) const
+ {
+ if( val == desktop->count() - 1 )
+ return NET::OnAllDesktops;
+ return val + 1;
+ }
+
+static int placementToCombo( Placement::Policy placement )
+ {
+ static const int conv[] =
+ {
+ 1, // NoPlacement
+ 0, // Default
+ 0, // Unknown
+ 6, // Random
+ 2, // Smart
+ 4, // Cascade
+ 5, // Centered
+ 7, // ZeroCornered
+ 8, // UnderMouse
+ 9, // OnMainWindow
+ 3 // Maximizing
+ };
+ return conv[ placement ];
+ }
+
+static Placement::Policy comboToPlacement( int val )
+ {
+ static const Placement::Policy conv[] =
+ {
+ Placement::Default,
+ Placement::NoPlacement,
+ Placement::Smart,
+ Placement::Maximizing,
+ Placement::Cascade,
+ Placement::Centered,
+ Placement::Random,
+ Placement::ZeroCornered,
+ Placement::UnderMouse,
+ Placement::OnMainWindow
+ // no Placement::Unknown
+ };
+ return conv[ val ];
+ }
+
+static int moveresizeToCombo( Options::MoveResizeMode mode )
+ {
+ return mode == Options::Opaque ? 0 : 1;
+ }
+
+static Options::MoveResizeMode comboToMoveResize( int val )
+ {
+ return val == 0 ? Options::Opaque : Options::Transparent;
+ }
+
+static int typeToCombo( NET::WindowType type )
+ {
+ if( type < NET::Normal || type > NET::Splash )
+ return 0; // Normal
+ static const int conv[] =
+ {
+ 0, // Normal
+ 7, // Desktop
+ 3, // Dock
+ 4, // Toolbar
+ 5, // Menu
+ 1, // Dialog
+ 8, // Override
+ 9, // TopMenu
+ 2, // Utility
+ 6 // Splash
+ };
+ return conv[ type ];
+ }
+
+static NET::WindowType comboToType( int val )
+ {
+ static const NET::WindowType conv[] =
+ {
+ NET::Normal,
+ NET::Dialog,
+ NET::Utility,
+ NET::Dock,
+ NET::Toolbar,
+ NET::Menu,
+ NET::Splash,
+ NET::Desktop,
+ NET::Override,
+ NET::TopMenu
+ };
+ return conv[ val ];
+ }
+
+#define GENERIC_RULE( var, func, Type, type, uimethod, uimethod0 ) \
+ if( rules->var##rule == Rules::Unused##Type##Rule ) \
+ { \
+ enable_##var->setChecked( false ); \
+ rule_##var->setCurrentItem( 0 ); \
+ var->uimethod0; \
+ updateEnable##var(); \
+ } \
+ else \
+ { \
+ enable_##var->setChecked( true ); \
+ rule_##var->setCurrentItem( type##_rule_to_combo[ rules->var##rule ] ); \
+ var->uimethod( func( rules->var )); \
+ updateEnable##var(); \
+ }
+
+#define CHECKBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setChecked, setChecked( false ))
+#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setText, setText( "" ))
+#define COMBOBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setCurrentItem, setCurrentItem( 0 ))
+#define CHECKBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setChecked, setChecked( false ))
+#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setText, setText( "" ))
+#define COMBOBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setCurrentItem, setCurrentItem( 0 ))
+
+void RulesWidget::setRules( Rules* rules )
+ {
+ Rules tmp;
+ if( rules == NULL )
+ rules = &tmp; // empty
+ description->setText( rules->description );
+ wmclass->setText( rules->wmclass );
+ whole_wmclass->setChecked( rules->wmclasscomplete );
+ wmclass_match->setCurrentItem( rules->wmclassmatch );
+ wmclassMatchChanged();
+ role->setText( rules->windowrole );
+ role_match->setCurrentItem( rules->windowrolematch );
+ roleMatchChanged();
+ types->setSelected( 0, rules->types & NET::NormalMask );
+ types->setSelected( 1, rules->types & NET::DialogMask );
+ types->setSelected( 2, rules->types & NET::UtilityMask );
+ types->setSelected( 3, rules->types & NET::DockMask );
+ types->setSelected( 4, rules->types & NET::ToolbarMask );
+ types->setSelected( 5, rules->types & NET::MenuMask );
+ types->setSelected( 6, rules->types & NET::SplashMask );
+ types->setSelected( 7, rules->types & NET::DesktopMask );
+ types->setSelected( 8, rules->types & NET::OverrideMask );
+ types->setSelected( 9, rules->types & NET::TopMenuMask );
+ title->setText( rules->title );
+ title_match->setCurrentItem( rules->titlematch );
+ titleMatchChanged();
+ extra->setText( rules->extrarole );
+ extra_match->setCurrentItem( rules->extrarolematch );
+ extraMatchChanged();
+ machine->setText( rules->clientmachine );
+ machine_match->setCurrentItem( rules->clientmachinematch );
+ machineMatchChanged();
+ LINEEDIT_SET_RULE( position, positionToStr );
+ LINEEDIT_SET_RULE( size, sizeToStr );
+ COMBOBOX_SET_RULE( desktop, desktopToCombo );
+ CHECKBOX_SET_RULE( maximizehoriz, );
+ CHECKBOX_SET_RULE( maximizevert, );
+ CHECKBOX_SET_RULE( minimize, );
+ CHECKBOX_SET_RULE( shade, );
+ CHECKBOX_SET_RULE( fullscreen, );
+ COMBOBOX_FORCE_RULE( placement, placementToCombo );
+ CHECKBOX_SET_RULE( above, );
+ CHECKBOX_SET_RULE( below, );
+ CHECKBOX_SET_RULE( noborder, );
+ CHECKBOX_SET_RULE( skiptaskbar, );
+ CHECKBOX_SET_RULE( skippager, );
+ CHECKBOX_FORCE_RULE( acceptfocus, );
+ CHECKBOX_FORCE_RULE( closeable, );
+ LINEEDIT_FORCE_RULE( opacityactive, intToStr );
+ LINEEDIT_FORCE_RULE( opacityinactive, intToStr );
+ LINEEDIT_SET_RULE( shortcut, );
+ COMBOBOX_FORCE_RULE( fsplevel, );
+ COMBOBOX_FORCE_RULE( moveresizemode, moveresizeToCombo );
+ COMBOBOX_FORCE_RULE( type, typeToCombo );
+ CHECKBOX_FORCE_RULE( ignoreposition, );
+ LINEEDIT_FORCE_RULE( minsize, sizeToStr );
+ LINEEDIT_FORCE_RULE( maxsize, sizeToStr );
+ CHECKBOX_FORCE_RULE( strictgeometry, );
+ CHECKBOX_FORCE_RULE( disableglobalshortcuts, );
+ }
+
+#undef GENERIC_RULE
+#undef CHECKBOX_SET_RULE
+#undef LINEEDIT_SET_RULE
+#undef COMBOBOX_SET_RULE
+#undef CHECKBOX_FORCE_RULE
+#undef LINEEDIT_FORCE_RULE
+#undef COMBOBOX_FORCE_RULE
+
+#define GENERIC_RULE( var, func, Type, type, uimethod ) \
+ if( enable_##var->isChecked()) \
+ { \
+ rules->var##rule = combo_to_##type##_rule[ rule_##var->currentItem() ]; \
+ rules->var = func( var->uimethod()); \
+ } \
+ else \
+ rules->var##rule = Rules::Unused##Type##Rule;
+
+#define CHECKBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, isChecked )
+#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, text )
+#define COMBOBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, currentItem )
+#define CHECKBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, isChecked )
+#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, text )
+#define COMBOBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, currentItem )
+
+Rules* RulesWidget::rules() const
+ {
+ Rules* rules = new Rules();
+ rules->description = description->text();
+ rules->wmclass = wmclass->text().utf8();
+ rules->wmclasscomplete = whole_wmclass->isChecked();
+ rules->wmclassmatch = static_cast< Rules::StringMatch >( wmclass_match->currentItem());
+ rules->windowrole = role->text().utf8();
+ rules->windowrolematch = static_cast< Rules::StringMatch >( role_match->currentItem());
+ rules->types = 0;
+ bool all_types = true;
+ for( unsigned int i = 0;
+ i < types->count();
+ ++i )
+ if( !types->isSelected( i ))
+ all_types = false;
+ if( all_types ) // if all types are selected, use AllTypesMask (for future expansion)
+ rules->types = NET::AllTypesMask;
+ else
+ {
+ rules->types |= types->isSelected( 0 ) ? NET::NormalMask : 0;
+ rules->types |= types->isSelected( 1 ) ? NET::DialogMask : 0;
+ rules->types |= types->isSelected( 2 ) ? NET::UtilityMask : 0;
+ rules->types |= types->isSelected( 3 ) ? NET::DockMask : 0;
+ rules->types |= types->isSelected( 4 ) ? NET::ToolbarMask : 0;
+ rules->types |= types->isSelected( 5 ) ? NET::MenuMask : 0;
+ rules->types |= types->isSelected( 6 ) ? NET::SplashMask : 0;
+ rules->types |= types->isSelected( 7 ) ? NET::DesktopMask : 0;
+ rules->types |= types->isSelected( 8 ) ? NET::OverrideMask : 0;
+ rules->types |= types->isSelected( 9 ) ? NET::TopMenuMask : 0;
+ }
+ rules->title = title->text();
+ rules->titlematch = static_cast< Rules::StringMatch >( title_match->currentItem());
+ rules->extrarole = extra->text().utf8();
+ rules->extrarolematch = static_cast< Rules::StringMatch >( extra_match->currentItem());
+ rules->clientmachine = machine->text().utf8();
+ rules->clientmachinematch = static_cast< Rules::StringMatch >( machine_match->currentItem());
+ LINEEDIT_SET_RULE( position, strToPosition );
+ LINEEDIT_SET_RULE( size, strToSize );
+ COMBOBOX_SET_RULE( desktop, comboToDesktop );
+ CHECKBOX_SET_RULE( maximizehoriz, );
+ CHECKBOX_SET_RULE( maximizevert, );
+ CHECKBOX_SET_RULE( minimize, );
+ CHECKBOX_SET_RULE( shade, );
+ CHECKBOX_SET_RULE( fullscreen, );
+ COMBOBOX_FORCE_RULE( placement, comboToPlacement );
+ CHECKBOX_SET_RULE( above, );
+ CHECKBOX_SET_RULE( below, );
+ CHECKBOX_SET_RULE( noborder, );
+ CHECKBOX_SET_RULE( skiptaskbar, );
+ CHECKBOX_SET_RULE( skippager, );
+ CHECKBOX_FORCE_RULE( acceptfocus, );
+ CHECKBOX_FORCE_RULE( closeable, );
+ LINEEDIT_FORCE_RULE( opacityactive, strToInt );
+ LINEEDIT_FORCE_RULE( opacityinactive, strToInt );
+ LINEEDIT_SET_RULE( shortcut, );
+ COMBOBOX_FORCE_RULE( fsplevel, );
+ COMBOBOX_FORCE_RULE( moveresizemode, comboToMoveResize );
+ COMBOBOX_FORCE_RULE( type, comboToType );
+ CHECKBOX_FORCE_RULE( ignoreposition, );
+ LINEEDIT_FORCE_RULE( minsize, strToSize );
+ LINEEDIT_FORCE_RULE( maxsize, strToSize );
+ CHECKBOX_FORCE_RULE( strictgeometry, );
+ CHECKBOX_FORCE_RULE( disableglobalshortcuts, );
+ return rules;
+ }
+
+#undef GENERIC_RULE
+#undef CHECKBOX_SET_RULE
+#undef LINEEDIT_SET_RULE
+#undef COMBOBOX_SET_RULE
+#undef CHECKBOX_FORCE_RULE
+#undef LINEEDIT_FORCE_RULE
+#undef COMBOBOX_FORCE_RULE
+
+#define STRING_MATCH_COMBO( type ) \
+void RulesWidget::type##MatchChanged() \
+ { \
+ edit_reg_##type->setEnabled( type##_match->currentItem() == Rules::RegExpMatch ); \
+ type->setEnabled( type##_match->currentItem() != Rules::UnimportantMatch ); \
+ }
+
+STRING_MATCH_COMBO( wmclass )
+STRING_MATCH_COMBO( role )
+STRING_MATCH_COMBO( title )
+STRING_MATCH_COMBO( extra )
+STRING_MATCH_COMBO( machine )
+
+#undef STRING_MATCH_COMBO
+
+void RulesWidget::detectClicked()
+ {
+ assert( detect_dlg == NULL );
+ detect_dlg = new DetectDialog;
+ connect( detect_dlg, TQT_SIGNAL( detectionDone( bool )), this, TQT_SLOT( detected( bool )));
+ detect_dlg->detect( 0 );
+ }
+
+void RulesWidget::detected( bool ok )
+ {
+ if( ok )
+ {
+ wmclass->setText( detect_dlg->selectedClass());
+ wmclass_match->setCurrentItem( Rules::ExactMatch );
+ wmclassMatchChanged(); // grrr
+ whole_wmclass->setChecked( detect_dlg->selectedWholeClass());
+ role->setText( detect_dlg->selectedRole());
+ role_match->setCurrentItem( detect_dlg->selectedRole().isEmpty()
+ ? Rules::UnimportantMatch : Rules::ExactMatch );
+ roleMatchChanged();
+ if( detect_dlg->selectedWholeApp())
+ {
+ for( unsigned int i = 0;
+ i < types->count();
+ ++i )
+ types->setSelected( i, true );
+ }
+ else
+ {
+ NET::WindowType type = detect_dlg->selectedType();
+ for( unsigned int i = 0;
+ i < types->count();
+ ++i )
+ types->setSelected( i, false );
+ types->setSelected( typeToCombo( type ), true );
+ }
+ title->setText( detect_dlg->selectedTitle());
+ title_match->setCurrentItem( detect_dlg->titleMatch());
+ titleMatchChanged();
+ machine->setText( detect_dlg->selectedMachine());
+ machine_match->setCurrentItem( Rules::UnimportantMatch );
+ machineMatchChanged();
+ // prefill values from to window to settings which already set
+ const KWin::WindowInfo& info = detect_dlg->windowInfo();
+ prefillUnusedValues( info );
+ }
+ delete detect_dlg;
+ detect_dlg = NULL;
+ detect_dlg_ok = ok;
+ }
+
+#define GENERIC_PREFILL( var, func, info, uimethod ) \
+ if( !enable_##var->isChecked()) \
+ { \
+ var->uimethod( func( info )); \
+ }
+
+#define CHECKBOX_PREFILL( var, func, info ) GENERIC_PREFILL( var, func, info, setChecked )
+#define LINEEDIT_PREFILL( var, func, info ) GENERIC_PREFILL( var, func, info, setText )
+#define COMBOBOX_PREFILL( var, func, info ) GENERIC_PREFILL( var, func, info, setCurrentItem )
+
+void RulesWidget::prefillUnusedValues( const KWin::WindowInfo& info )
+ {
+ LINEEDIT_PREFILL( position, positionToStr, info.frameGeometry().topLeft() );
+ LINEEDIT_PREFILL( size, sizeToStr, info.frameGeometry().size() );
+ COMBOBOX_PREFILL( desktop, desktopToCombo, info.desktop() );
+ CHECKBOX_PREFILL( maximizehoriz,, info.state() & NET::MaxHoriz );
+ CHECKBOX_PREFILL( maximizevert,, info.state() & NET::MaxVert );
+ CHECKBOX_PREFILL( minimize,, info.isMinimized() );
+ CHECKBOX_PREFILL( shade,, info.state() & NET::Shaded );
+ CHECKBOX_PREFILL( fullscreen,, info.state() & NET::FullScreen );
+ //COMBOBOX_PREFILL( placement, placementToCombo );
+ CHECKBOX_PREFILL( above,, info.state() & NET::KeepAbove );
+ CHECKBOX_PREFILL( below,, info.state() & NET::KeepBelow );
+ // noborder is only internal KWin information, so let's guess
+ CHECKBOX_PREFILL( noborder,, info.frameGeometry() == info.geometry() );
+ CHECKBOX_PREFILL( skiptaskbar,, info.state() & NET::SkipTaskbar );
+ CHECKBOX_PREFILL( skippager,, info.state() & NET::SkipPager );
+ //CHECKBOX_PREFILL( acceptfocus, );
+ //CHECKBOX_PREFILL( closeable, );
+ LINEEDIT_PREFILL( opacityactive, intToStr, 100 /*get the actual opacity somehow*/);
+ LINEEDIT_PREFILL( opacityinactive, intToStr, 100 /*get the actual opacity somehow*/);
+ //LINEEDIT_PREFILL( shortcut, );
+ //COMBOBOX_PREFILL( fsplevel, );
+ //COMBOBOX_PREFILL( moveresizemode, moveresizeToCombo );
+ COMBOBOX_PREFILL( type, typeToCombo, info.windowType( SUPPORTED_WINDOW_TYPES_MASK ) );
+ //CHECKBOX_PREFILL( ignoreposition, );
+ LINEEDIT_PREFILL( minsize, sizeToStr, info.frameGeometry().size() );
+ LINEEDIT_PREFILL( maxsize, sizeToStr, info.frameGeometry().size() );
+ //CHECKBOX_PREFILL( strictgeometry, );
+ //CHECKBOX_PREFILL( disableglobalshortcuts, );
+ }
+
+#undef GENERIC_PREFILL
+#undef CHECKBOX_PREFILL
+#undef LINEEDIT_PREFILL
+#undef COMBOBOX_PREFILL
+
+bool RulesWidget::finalCheck()
+ {
+ if( description->text().isEmpty())
+ {
+ if( !wmclass->text().isEmpty())
+ description->setText( i18n( "Settings for %1" ).arg( wmclass->text()));
+ else
+ description->setText( i18n( "Unnamed entry" ));
+ }
+ bool all_types = true;
+ for( unsigned int i = 0;
+ i < types->count();
+ ++i )
+ if( !types->isSelected( i ))
+ all_types = false;
+ if( wmclass_match->currentItem() == Rules::UnimportantMatch && all_types )
+ {
+ if( KMessageBox::warningContinueCancel( tqtopLevelWidget(),
+ i18n( "You have specified the window class as unimportant.\n"
+ "This means the settings will possibly apply to windows from all applications. "
+ "If you really want to create a generic setting, it is recommended you at least "
+ "limit the window types to avoid special window types." )) != KMessageBox::Continue )
+ return false;
+ }
+ return true;
+ }
+
+void RulesWidget::prepareWindowSpecific( WId window )
+ {
+ tabs->setCurrentPage( 2 ); // geometry tab, skip tabs for window identification
+ KWin::WindowInfo info( window, -1U, -1U ); // read everything
+ prefillUnusedValues( info );
+ }
+
+void RulesWidget::shortcutEditClicked()
+ {
+ EditShortcutDialog dlg( tqtopLevelWidget());
+ dlg.setShortcut( shortcut->text());
+ if( dlg.exec() == TQDialog::Accepted )
+ shortcut->setText( dlg.shortcut());
+ }
+
+RulesDialog::RulesDialog( TQWidget* parent, const char* name )
+: KDialogBase( parent, name, true, i18n( "Edit Window-Specific Settings" ), Ok | Cancel )
+ {
+ widget = new RulesWidget( this );
+ setMainWidget( widget );
+ }
+
+// window is set only for Alt+F3/Window-specific settings, because the dialog
+// is then related to one specific window
+Rules* RulesDialog::edit( Rules* r, WId window, bool show_hints )
+ {
+ rules = r;
+ widget->setRules( rules );
+ if( window != 0 )
+ widget->prepareWindowSpecific( window );
+ if( show_hints )
+ TQTimer::singleShot( 0, this, TQT_SLOT( displayHints()));
+ exec();
+ return rules;
+ }
+
+void RulesDialog::displayHints()
+ {
+ TQString str = "<qt><p>";
+ str += i18n( "This configuration dialog allows altering settings only for the selected window"
+ " or application. Find the setting you want to affect, enable the setting using the checkbox,"
+ " select in what way the setting should be affected and to which value." );
+#if 0 // maybe later
+ str += "</p><p>" + i18n( "Consult the documentation for more details." );
+#endif
+ str += "</p></qt>";
+ KMessageBox::information( this, str, TQString::null, "displayhints" );
+ }
+
+void RulesDialog::accept()
+ {
+ if( !widget->finalCheck())
+ return;
+ rules = widget->rules();
+ KDialogBase::accept();
+ }
+
+EditShortcut::EditShortcut( TQWidget* parent, const char* name )
+: EditShortcutBase( parent, name )
+ {
+ }
+
+void EditShortcut::editShortcut()
+ {
+ ShortcutDialog dlg( KShortcut( shortcut->text()), tqtopLevelWidget());
+ if( dlg.exec() == TQDialog::Accepted )
+ shortcut->setText( dlg.shortcut().toString());
+ }
+
+void EditShortcut::clearShortcut()
+ {
+ shortcut->setText( "" );
+ }
+
+EditShortcutDialog::EditShortcutDialog( TQWidget* parent, const char* name )
+: KDialogBase( parent, name, true, i18n( "Edit Shortcut" ), Ok | Cancel )
+ {
+ widget = new EditShortcut( this );
+ setMainWidget( widget );
+ }
+
+void EditShortcutDialog::setShortcut( const TQString& cut )
+ {
+ widget->shortcut->setText( cut );
+ }
+
+TQString EditShortcutDialog::shortcut() const
+ {
+ return widget->shortcut->text();
+ }
+
+ShortcutDialog::ShortcutDialog( const KShortcut& cut, TQWidget* parent, const char* name )
+ : KShortcutDialog( cut, false /*TODO???*/, parent, name )
+ {
+ }
+
+void ShortcutDialog::accept()
+ {
+ for( int i = 0;
+ ;
+ ++i )
+ {
+ KKeySequence seq = shortcut().seq( i );
+ if( seq.isNull())
+ break;
+ if( seq.key( 0 ) == Key_Escape )
+ {
+ reject();
+ return;
+ }
+ if( seq.key( 0 ) == Key_Space )
+ { // clear
+ setShortcut( KShortcut());
+ KShortcutDialog::accept();
+ return;
+ }
+ if( seq.key( 0 ).modFlags() == 0 )
+ { // no shortcuts without modifiers
+ KShortcut cut = shortcut();
+ cut.setSeq( i, KKeySequence());
+ setShortcut( cut );
+ return;
+ }
+ }
+ KShortcutDialog::accept();
+ }
+
+} // namespace
+
+#include "ruleswidget.moc"
diff --git a/twin/kcmtwin/twinrules/ruleswidget.h b/twin/kcmtwin/twinrules/ruleswidget.h
new file mode 100644
index 000000000..2a9b0d036
--- /dev/null
+++ b/twin/kcmtwin/twinrules/ruleswidget.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2004 Lubos Lunak <[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 __RULESWIDGET_H__
+#define __RULESWIDGET_H__
+
+#include <kdialogbase.h>
+#include <twin.h>
+#include <kshortcutdialog.h>
+
+#include "ruleswidgetbase.h"
+#include "editshortcutbase.h"
+
+namespace KWinInternal
+{
+
+class Rules;
+class DetectDialog;
+
+class RulesWidget
+ : public RulesWidgetBase
+ {
+ Q_OBJECT
+ public:
+ RulesWidget( TQWidget* parent = NULL, const char* name = NULL );
+ void setRules( Rules* r );
+ Rules* rules() const;
+ bool finalCheck();
+ void prepareWindowSpecific( WId window );
+ signals:
+ void changed( bool state );
+ protected slots:
+ virtual void detectClicked();
+ virtual void wmclassMatchChanged();
+ virtual void roleMatchChanged();
+ virtual void titleMatchChanged();
+ virtual void extraMatchChanged();
+ virtual void machineMatchChanged();
+ virtual void shortcutEditClicked();
+ private slots:
+ // geometry tab
+ void updateEnableposition();
+ void updateEnablesize();
+ void updateEnabledesktop();
+ void updateEnablemaximizehoriz();
+ void updateEnablemaximizevert();
+ void updateEnableminimize();
+ void updateEnableshade();
+ void updateEnablefullscreen();
+ void updateEnableplacement();
+ // preferences tab
+ void updateEnableabove();
+ void updateEnablebelow();
+ void updateEnablenoborder();
+ void updateEnableskiptaskbar();
+ void updateEnableskippager();
+ void updateEnableacceptfocus();
+ void updateEnablecloseable();
+ void updateEnableopacityactive();
+ void updateEnableopacityinactive();
+ // workarounds tab
+ void updateEnablefsplevel();
+ void updateEnablemoveresizemode();
+ void updateEnabletype();
+ void updateEnableignoreposition();
+ void updateEnableminsize();
+ void updateEnablemaxsize();
+ void updateEnablestrictgeometry();
+ void updateEnableshortcut();
+ void updateEnabledisableglobalshortcuts();
+ // internal
+ void detected( bool );
+ private:
+ int desktopToCombo( int d ) const;
+ int comboToDesktop( int val ) const;
+ void prefillUnusedValues( const KWin::WindowInfo& info );
+ DetectDialog* detect_dlg;
+ bool detect_dlg_ok;
+ };
+
+class RulesDialog
+ : public KDialogBase
+ {
+ Q_OBJECT
+ public:
+ RulesDialog( TQWidget* parent = NULL, const char* name = NULL );
+ Rules* edit( Rules* r, WId window, bool show_hints );
+ protected:
+ virtual void accept();
+ private slots:
+ void displayHints();
+ private:
+ RulesWidget* widget;
+ Rules* rules;
+ };
+
+class EditShortcut
+ : public EditShortcutBase
+ {
+ Q_OBJECT
+ public:
+ EditShortcut( TQWidget* parent = NULL, const char* name = NULL );
+ protected:
+ void editShortcut();
+ void clearShortcut();
+ };
+
+class EditShortcutDialog
+ : public KDialogBase
+ {
+ Q_OBJECT
+ public:
+ EditShortcutDialog( TQWidget* parent = NULL, const char* name = NULL );
+ void setShortcut( const TQString& cut );
+ TQString shortcut() const;
+ private:
+ EditShortcut* widget;
+ };
+
+// slightly duped from utils.cpp
+class ShortcutDialog
+ : public KShortcutDialog
+ {
+ Q_OBJECT
+ public:
+ ShortcutDialog( const KShortcut& cut, TQWidget* parent = NULL, const char* name = NULL );
+ virtual void accept();
+ };
+
+} // namespace
+
+#endif
diff --git a/twin/kcmtwin/twinrules/ruleswidgetbase.ui b/twin/kcmtwin/twinrules/ruleswidgetbase.ui
new file mode 100644
index 000000000..5a5640ca2
--- /dev/null
+++ b/twin/kcmtwin/twinrules/ruleswidgetbase.ui
@@ -0,0 +1,2597 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KWinInternal::RulesWidgetBase</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>Form2</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>630</width>
+ <height>503</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>tabs</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Window</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>De&amp;scription:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>description</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>description</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Window &amp;class (application type):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>wmclass</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Window &amp;role:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>role</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="6" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>role</cstring>
+ </property>
+ </widget>
+ <spacer row="9" column="1">
+ <property name="name">
+ <cstring>spacer29</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KComboBox" row="7" column="0">
+ <item>
+ <property name="text">
+ <string>Unimportant</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Exact Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Substring Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Regular Expression</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>role_match</cstring>
+ </property>
+ </widget>
+ <spacer row="7" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>212</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="7" column="2">
+ <property name="name">
+ <cstring>edit_reg_role</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </widget>
+ <spacer row="7" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>211</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KComboBox" row="4" column="0">
+ <item>
+ <property name="text">
+ <string>Unimportant</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Exact Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Substring Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Regular Expression</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>wmclass_match</cstring>
+ </property>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>212</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="4" column="2">
+ <property name="name">
+ <cstring>edit_reg_wmclass</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="4" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>211</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KLineEdit" row="3" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>wmclass</cstring>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="4">
+ <property name="name">
+ <cstring>whole_wmclass</cstring>
+ </property>
+ <property name="text">
+ <string>Match w&amp;hole window class</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox" row="8" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Detect Window Properties</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer27</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>270</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>detect1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Detect</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer28</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>269</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Window &amp;Extra</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Window &amp;types:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>types</cstring>
+ </property>
+ </widget>
+ <widget class="KListBox" row="1" column="0" rowspan="1" colspan="4">
+ <item>
+ <property name="text">
+ <string>Normal Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dialog Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Utility Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dock (panel)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Toolbar</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Torn-Off Menu</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Splash Screen</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Desktop</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Override Type</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Standalone Menubar</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>types</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Multi</enum>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Window t&amp;itle:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>title</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>title</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel6</cstring>
+ </property>
+ <property name="text">
+ <string>Extra role:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>extra</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="6" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>extra</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="8" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel7</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Machine (hostname):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>machine</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="9" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>machine</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="4" column="0">
+ <item>
+ <property name="text">
+ <string>Unimportant</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Exact Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Substring Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Regular Expression</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>title_match</cstring>
+ </property>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>spacer2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>199</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="4" column="2">
+ <property name="name">
+ <cstring>edit_reg_title</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="4" column="3">
+ <property name="name">
+ <cstring>spacer5_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>199</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KComboBox" row="7" column="0">
+ <item>
+ <property name="text">
+ <string>Unimportant</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Exact Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Substring Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Regular Expression</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>extra_match</cstring>
+ </property>
+ </widget>
+ <spacer row="7" column="1">
+ <property name="name">
+ <cstring>spacer2_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>199</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="7" column="2">
+ <property name="name">
+ <cstring>edit_reg_extra</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="7" column="3">
+ <property name="name">
+ <cstring>spacer5_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>199</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KComboBox" row="10" column="0">
+ <item>
+ <property name="text">
+ <string>Unimportant</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Exact Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Substring Match</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Regular Expression</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>machine_match</cstring>
+ </property>
+ </widget>
+ <spacer row="10" column="1">
+ <property name="name">
+ <cstring>spacer2_2_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>199</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="10" column="2">
+ <property name="name">
+ <cstring>edit_reg_machine</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="10" column="3">
+ <property name="name">
+ <cstring>spacer5_2_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>199</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Geometry</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_size</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="1" column="2">
+ <property name="name">
+ <cstring>size</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="validChars">
+ <string>0123456789-+,xX:</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>enable_size</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Size</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>enable_position</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Position</string>
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="0" column="2">
+ <property name="name">
+ <cstring>position</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="validChars">
+ <string>0123456789-+,xX:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_position</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="2">
+ <property name="name">
+ <cstring>maximizevert</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="2" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_maximizehoriz</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="4" column="2">
+ <property name="name">
+ <cstring>fullscreen</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>enable_maximizehoriz</cstring>
+ </property>
+ <property name="text">
+ <string>Maximized &amp;horizontally</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="2">
+ <property name="name">
+ <cstring>maximizehoriz</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="4" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_fullscreen</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>enable_fullscreen</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Fullscreen</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="3" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_maximizevert</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>enable_maximizevert</cstring>
+ </property>
+ <property name="text">
+ <string>Maximized &amp;vertically</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="5" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_desktop</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="5" column="2">
+ <property name="name">
+ <cstring>desktop</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="5" column="0">
+ <property name="name">
+ <cstring>enable_desktop</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Desktop</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="7" column="0">
+ <property name="name">
+ <cstring>enable_shade</cstring>
+ </property>
+ <property name="text">
+ <string>Sh&amp;aded</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="7" column="2">
+ <property name="name">
+ <cstring>shade</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="6" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_minimize</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="6" column="2">
+ <property name="name">
+ <cstring>minimize</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="6" column="0">
+ <property name="name">
+ <cstring>enable_minimize</cstring>
+ </property>
+ <property name="text">
+ <string>M&amp;inimized</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="8" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_placement</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="8" column="2">
+ <item>
+ <property name="text">
+ <string>Default</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>No Placement</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Smart</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximizing</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Cascade</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Centered</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Random</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Top-Left Corner</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Under Mouse</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>On Main Window</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>placement</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="8" column="0">
+ <property name="name">
+ <cstring>enable_placement</cstring>
+ </property>
+ <property name="text">
+ <string>P&amp;lacement</string>
+ </property>
+ </widget>
+ <spacer row="9" column="1">
+ <property name="name">
+ <cstring>spacer31</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KComboBox" row="7" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_shade</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Preferences</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>enable_above</cstring>
+ </property>
+ <property name="text">
+ <string>Keep &amp;above</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>enable_below</cstring>
+ </property>
+ <property name="text">
+ <string>Keep &amp;below</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>enable_skippager</cstring>
+ </property>
+ <property name="text">
+ <string>Skip pa&amp;ger</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>enable_skiptaskbar</cstring>
+ </property>
+ <property name="text">
+ <string>Skip &amp;taskbar</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>enable_noborder</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;No border</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="5" column="0">
+ <property name="name">
+ <cstring>enable_acceptfocus</cstring>
+ </property>
+ <property name="text">
+ <string>Accept &amp;focus</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="6" column="0">
+ <property name="name">
+ <cstring>enable_closeable</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Closeable</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="7" column="0">
+ <property name="name">
+ <cstring>enable_opacityactive</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;ctive opacity in %</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="7" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_opacityactive</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="7" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>opacityactive</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="validChars">
+ <string>0123456789</string>
+ </property>
+ </widget>
+ <spacer row="7" column="4" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer24</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>171</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="6" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer36_7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>290</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="5" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer36_6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>290</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="4" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer36_5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>290</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="3" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer36_4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>290</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="2" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer36_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>290</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer36_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>290</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="0" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer36</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>290</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="0" column="2">
+ <property name="name">
+ <cstring>above</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="2">
+ <property name="name">
+ <cstring>below</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="2">
+ <property name="name">
+ <cstring>noborder</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="2">
+ <property name="name">
+ <cstring>skiptaskbar</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="4" column="2">
+ <property name="name">
+ <cstring>skippager</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="5" column="2">
+ <property name="name">
+ <cstring>acceptfocus</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="6" column="2">
+ <property name="name">
+ <cstring>closeable</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="6" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_closeable</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="5" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_acceptfocus</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="4" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_skippager</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="3" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_skiptaskbar</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="2" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_noborder</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_below</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_above</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer row="10" column="1">
+ <property name="name">
+ <cstring>spacer33</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>80</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KComboBox" row="8" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_opacityinactive</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="8" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>opacityinactive</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="validChars">
+ <string>0123456789</string>
+ </property>
+ </widget>
+ <spacer row="8" column="4" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer25</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>181</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="8" column="0">
+ <property name="name">
+ <cstring>enable_opacityinactive</cstring>
+ </property>
+ <property name="text">
+ <string>I&amp;nactive opacity in %</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="9" column="0">
+ <property name="name">
+ <cstring>enable_shortcut</cstring>
+ </property>
+ <property name="text">
+ <string>Shortcut</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="9" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Initially</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Remember</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Apply Now</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_shortcut</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="9" column="5">
+ <property name="name">
+ <cstring>shortcut_edit</cstring>
+ </property>
+ <property name="text">
+ <string>Edit...</string>
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="9" column="2" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>shortcut</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>W&amp;orkarounds</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>enable_fsplevel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Focus stealing prevention</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="2" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_type</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="2" column="3">
+ <item>
+ <property name="text">
+ <string>Normal Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dialog Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Utility Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dock (panel)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Toolbar</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Torn-Off Menu</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Splash Screen</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Desktop</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Override Type</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Standalone Menubar</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>type</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="3">
+ <item>
+ <property name="text">
+ <string>Opaque</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Transparent</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>moveresizemode</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>enable_type</cstring>
+ </property>
+ <property name="text">
+ <string>Window &amp;type</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>enable_moveresizemode</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Moving/resizing</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_fsplevel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_moveresizemode</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="3">
+ <item>
+ <property name="text">
+ <string>None</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Low</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Normal</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>High</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Extreme</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>fsplevel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="5" column="3">
+ <property name="name">
+ <cstring>maxsize</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="validChars">
+ <string>0123456789-+,xX:</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>enable_minsize</cstring>
+ </property>
+ <property name="text">
+ <string>M&amp;inimum size</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="4" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_minsize</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="5" column="0">
+ <property name="name">
+ <cstring>enable_maxsize</cstring>
+ </property>
+ <property name="text">
+ <string>M&amp;aximum size</string>
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="4" column="3">
+ <property name="name">
+ <cstring>minsize</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="validChars">
+ <string>0123456789-+,xX:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="5" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_maxsize</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>enable_ignoreposition</cstring>
+ </property>
+ <property name="text">
+ <string>Ignore requested &amp;geometry</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="3" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_ignoreposition</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="3">
+ <property name="name">
+ <cstring>ignoreposition</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="8" column="2">
+ <property name="name">
+ <cstring>spacer35</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>160</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="6" column="0">
+ <property name="name">
+ <cstring>enable_strictgeometry</cstring>
+ </property>
+ <property name="text">
+ <string>Strictly obey geometry</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="6" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_strictgeometry</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="6" column="3">
+ <property name="name">
+ <cstring>strictgeometry</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="7" column="3">
+ <property name="name">
+ <cstring>disableglobalshortcuts</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="7" column="0">
+ <property name="name">
+ <cstring>enable_disableglobalshortcuts</cstring>
+ </property>
+ <property name="text">
+ <string>Block global shortcuts</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="7" column="1">
+ <item>
+ <property name="text">
+ <string>Do Not Affect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Temporarily</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>rule_disableglobalshortcuts</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>detect1</sender>
+ <signal>clicked()</signal>
+ <receiver>Form2</receiver>
+ <slot>detectClicked()</slot>
+ </connection>
+ <connection>
+ <sender>wmclass_match</sender>
+ <signal>activated(int)</signal>
+ <receiver>Form2</receiver>
+ <slot>wmclassMatchChanged()</slot>
+ </connection>
+ <connection>
+ <sender>role_match</sender>
+ <signal>activated(int)</signal>
+ <receiver>Form2</receiver>
+ <slot>roleMatchChanged()</slot>
+ </connection>
+ <connection>
+ <sender>title_match</sender>
+ <signal>activated(int)</signal>
+ <receiver>Form2</receiver>
+ <slot>titleMatchChanged()</slot>
+ </connection>
+ <connection>
+ <sender>extra_match</sender>
+ <signal>activated(int)</signal>
+ <receiver>Form2</receiver>
+ <slot>extraMatchChanged()</slot>
+ </connection>
+ <connection>
+ <sender>machine_match</sender>
+ <signal>activated(int)</signal>
+ <receiver>Form2</receiver>
+ <slot>machineMatchChanged()</slot>
+ </connection>
+ <connection>
+ <sender>shortcut_edit</sender>
+ <signal>clicked()</signal>
+ <receiver>Form2</receiver>
+ <slot>shortcutEditClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>tabs</tabstop>
+ <tabstop>description</tabstop>
+ <tabstop>wmclass</tabstop>
+ <tabstop>whole_wmclass</tabstop>
+ <tabstop>wmclass_match</tabstop>
+ <tabstop>edit_reg_wmclass</tabstop>
+ <tabstop>role</tabstop>
+ <tabstop>role_match</tabstop>
+ <tabstop>edit_reg_role</tabstop>
+ <tabstop>detect1</tabstop>
+ <tabstop>types</tabstop>
+ <tabstop>title</tabstop>
+ <tabstop>title_match</tabstop>
+ <tabstop>edit_reg_title</tabstop>
+ <tabstop>extra</tabstop>
+ <tabstop>extra_match</tabstop>
+ <tabstop>edit_reg_extra</tabstop>
+ <tabstop>machine</tabstop>
+ <tabstop>machine_match</tabstop>
+ <tabstop>edit_reg_machine</tabstop>
+ <tabstop>enable_position</tabstop>
+ <tabstop>rule_position</tabstop>
+ <tabstop>position</tabstop>
+ <tabstop>enable_size</tabstop>
+ <tabstop>rule_size</tabstop>
+ <tabstop>size</tabstop>
+ <tabstop>enable_maximizehoriz</tabstop>
+ <tabstop>rule_maximizehoriz</tabstop>
+ <tabstop>maximizehoriz</tabstop>
+ <tabstop>enable_maximizevert</tabstop>
+ <tabstop>rule_maximizevert</tabstop>
+ <tabstop>maximizevert</tabstop>
+ <tabstop>enable_fullscreen</tabstop>
+ <tabstop>rule_fullscreen</tabstop>
+ <tabstop>fullscreen</tabstop>
+ <tabstop>enable_desktop</tabstop>
+ <tabstop>rule_desktop</tabstop>
+ <tabstop>desktop</tabstop>
+ <tabstop>enable_minimize</tabstop>
+ <tabstop>rule_minimize</tabstop>
+ <tabstop>minimize</tabstop>
+ <tabstop>enable_shade</tabstop>
+ <tabstop>rule_shade</tabstop>
+ <tabstop>shade</tabstop>
+ <tabstop>enable_placement</tabstop>
+ <tabstop>rule_placement</tabstop>
+ <tabstop>placement</tabstop>
+ <tabstop>enable_above</tabstop>
+ <tabstop>rule_above</tabstop>
+ <tabstop>above</tabstop>
+ <tabstop>enable_below</tabstop>
+ <tabstop>rule_below</tabstop>
+ <tabstop>below</tabstop>
+ <tabstop>enable_noborder</tabstop>
+ <tabstop>rule_noborder</tabstop>
+ <tabstop>noborder</tabstop>
+ <tabstop>enable_skiptaskbar</tabstop>
+ <tabstop>rule_skiptaskbar</tabstop>
+ <tabstop>skiptaskbar</tabstop>
+ <tabstop>enable_skippager</tabstop>
+ <tabstop>rule_skippager</tabstop>
+ <tabstop>skippager</tabstop>
+ <tabstop>enable_acceptfocus</tabstop>
+ <tabstop>rule_acceptfocus</tabstop>
+ <tabstop>acceptfocus</tabstop>
+ <tabstop>enable_closeable</tabstop>
+ <tabstop>rule_closeable</tabstop>
+ <tabstop>closeable</tabstop>
+ <tabstop>enable_opacityactive</tabstop>
+ <tabstop>rule_opacityactive</tabstop>
+ <tabstop>opacityactive</tabstop>
+ <tabstop>enable_opacityinactive</tabstop>
+ <tabstop>rule_opacityinactive</tabstop>
+ <tabstop>opacityinactive</tabstop>
+ <tabstop>enable_shortcut</tabstop>
+ <tabstop>rule_shortcut</tabstop>
+ <tabstop>shortcut</tabstop>
+ <tabstop>shortcut_edit</tabstop>
+ <tabstop>enable_fsplevel</tabstop>
+ <tabstop>rule_fsplevel</tabstop>
+ <tabstop>fsplevel</tabstop>
+ <tabstop>enable_moveresizemode</tabstop>
+ <tabstop>rule_moveresizemode</tabstop>
+ <tabstop>moveresizemode</tabstop>
+ <tabstop>enable_type</tabstop>
+ <tabstop>rule_type</tabstop>
+ <tabstop>type</tabstop>
+ <tabstop>enable_ignoreposition</tabstop>
+ <tabstop>rule_ignoreposition</tabstop>
+ <tabstop>ignoreposition</tabstop>
+ <tabstop>enable_minsize</tabstop>
+ <tabstop>rule_minsize</tabstop>
+ <tabstop>minsize</tabstop>
+ <tabstop>enable_maxsize</tabstop>
+ <tabstop>rule_maxsize</tabstop>
+ <tabstop>maxsize</tabstop>
+ <tabstop>enable_strictgeometry</tabstop>
+ <tabstop>rule_strictgeometry</tabstop>
+ <tabstop>strictgeometry</tabstop>
+ <tabstop>enable_disableglobalshortcuts</tabstop>
+ <tabstop>rule_disableglobalshortcuts</tabstop>
+ <tabstop>disableglobalshortcuts</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected" specifier="pure virtual">detectClicked()</slot>
+ <slot access="protected" specifier="pure virtual">wmclassMatchChanged()</slot>
+ <slot access="protected" specifier="pure virtual">roleMatchChanged()</slot>
+ <slot access="protected" specifier="pure virtual">titleMatchChanged()</slot>
+ <slot access="protected" specifier="pure virtual">extraMatchChanged()</slot>
+ <slot access="protected" specifier="pure virtual">machineMatchChanged()</slot>
+ <slot access="protected" specifier="pure virtual">shortcutEditClicked()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>krestrictedline.h</includehint>
+ <includehint>krestrictedline.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>krestrictedline.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>krestrictedline.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>krestrictedline.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>krestrictedline.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>krestrictedline.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/twin/kcmtwin/twinrules/twinrules.desktop b/twin/kcmtwin/twinrules/twinrules.desktop
new file mode 100644
index 000000000..9d82ea38a
--- /dev/null
+++ b/twin/kcmtwin/twinrules/twinrules.desktop
@@ -0,0 +1,209 @@
+[Desktop Entry]
+Icon=kcmkwm
+Type=Application
+Exec=kcmshell twinrules
+DocPath=kcontrol/windowmanagement/index.html
+
+X-KDE-ModuleType=Library
+X-KDE-Library=twinrules
+X-KDE-FactoryName=twinrules
+
+Name=Window-Specific Settings
+Name[af]=Venser spesifike Instellings
+Name[ar]=تعيينات خاصة بالنوافذ
+Name[be]=Настаўленні для асобных вокнаў
+Name[bg]=Специфични прозорци
+Name[bn]=উইণ্ডো-প্রতি সেটিংস
+Name[bs]=Postavke specifične za ovaj prozor
+Name[ca]=Arranjament específic de finestra
+Name[cs]=Specifická nastavení oken
+Name[csb]=Nastôw specyficzny dlô òkna
+Name[cy]=Gosodiadau sy'n Benodol i'r Ffenestr
+Name[da]=Vinduesspecifik opsætning
+Name[de]=Fensterspezifische Einstellungen
+Name[el]=Ρυθμίσεις σχετικές με παράθυρα
+Name[eo]=Apartafenestraj Agordoj
+Name[es]=Preferencias específicas de la ventana
+Name[et]=Akende seadistused
+Name[eu]=Leihoen ezarpen espezifikoak
+Name[fa]=تنظیمات مشخص پنجره
+Name[fi]=Ikkunakohtaiset asetukset
+Name[fr]=Paramètres spécifiques à la fenêtre
+Name[fy]=Finsterspesifike ynstellings
+Name[gl]=Opcións específicas da fiestra
+Name[he]=הגדרות חלונות ספציפיות
+Name[hi]=विशिष्ट-विंडो विन्यास
+Name[hr]=Postavke za prozor
+Name[hu]=Egyedi ablakbeállítások
+Name[is]=Stillingar einstakra glugga
+Name[it]=Impostazioni specifiche della finestra
+Name[ja]=ウィンドウ固有の設定
+Name[ka]=ფანჯრის განსაკუთრებული პარამეტრები
+Name[kk]=Терезенің ерекше параметрлері
+Name[km]=ការ​កំណត់​សម្រាប់​បង្អួច
+Name[ko]=창 지정
+Name[lt]=Nuo lango priklausantys nustatymai
+Name[lv]=Specifiski logu parametri
+Name[mk]=Поставувања по прозорец
+Name[nb]=Innstillinger for vinduer
+Name[nds]=Instellen för enkelte Finstern
+Name[ne]=सञ्झ्याल निर्दिष्ट सेटिङ
+Name[nl]=Vensterspecifieke instellingen
+Name[nn]=Instillingar for vindauge
+Name[pa]=ਝਰੋਖਾ-ਖਾਸ ਸਥਾਪਨ
+Name[pl]=Ustawienia danego okna
+Name[pt]=Opções Específicas da Janela
+Name[pt_BR]=Configurações Específicas da Janela
+Name[ro]=Setări specifice fereastră
+Name[ru]=Особые параметры окна
+Name[rw]=Amagenamiterere y'Idirishya-Ryihariye
+Name[se]=Láseheivehusat
+Name[sk]=Špecifické nastavenia okna
+Name[sl]=Nastavitve glede na okno
+Name[sr]=Посебне поставке за прозоре
+Name[sr@Latn]=Posebne postavke za prozore
+Name[sv]=Fönsterspecifika inställningar
+Name[ta]=சாளர-குறிப்பிடும் அமைப்புகள்
+Name[th]=ตั้งค่าเกี่ยวกับหน้าต่างโดยเฉพาะ
+Name[tr]=Pencereye Özel Seçenekler
+Name[tt]=Täräzägä-Bäyle Caylawlar
+Name[uk]=Параметри для окремих вікон
+Name[uz]=Oynaga oid moslamalar
+Name[uz@cyrillic]=Ойнага оид мосламалар
+Name[vi]=Thiết lập Danh riêng cho Cửa sổ
+Name[wa]=Apontiaedjes specifikes a-z on purnea
+Name[zh_CN]=特定窗口的设置
+Name[zh_TW]=特定視窗設定
+
+Comment=Configure settings specifically for a window
+Comment[af]=Stel spesifieke venster instellings op
+Comment[ar]=إعداد التعيينات الخاصة بنافذة
+Comment[be]=Настаўленні для кожнага вакна асабіста
+Comment[bg]=Настройване на специфични особености за отделните прозорци
+Comment[bn]=শুধুমাত্র এই বিশেষ উইণ্ডো-টির সেটিংস কনফিগার করুন
+Comment[bs]=Podesite postavke specifične za ovaj prozor
+Comment[ca]=Configura l'arranjament específicament per a una finestra
+Comment[cs]=Nastavení specifická pro okno
+Comment[csb]=Kònfigùracëjô nastôwów specyficznëch dlô wëbrónegò òkna
+Comment[cy]=Ffurfweddu gosodiadau yn benodol ar gyfer ffenestr
+Comment[da]=Indstil opsætning specifikt for et vindue
+Comment[de]=Einstellungen für einzelne Fenster vornehmen
+Comment[el]=Ρυθμίσεις σχετικές ειδικά με Ένα Παράθυρο
+Comment[eo]=Agordi nur por tiu fenestro
+Comment[es]=Configurar parámetros específicos de una ventana
+Comment[et]=Spetsiaalselt akendega seotud seadistused
+Comment[eu]=Konfiguratu leiho jakin baten ezarpenak
+Comment[fa]=پیکربندی تنظیمات برای پنجره به طور ‌ویژه
+Comment[fi]=Muokkaa ikkunakohtaisia asetuksia
+Comment[fr]=Configuration de paramètres spécifiques à une fenêtre
+Comment[fy]=Hjir kinne jo ynstellings kieze spesifyk foar ien finster
+Comment[ga]=Cumraigh na socruithe le haghaidh fuinneoige ar leith
+Comment[gl]=Configuración das opcións específicas para unha fiestra
+Comment[he]=קבע הגדרות לחלון מסוים
+Comment[hi]=किसी खास विंडो के लिए विन्यास कॉन्फ़िगर करें
+Comment[hr]=Konfiguriranje određenih postavki za prozor
+Comment[hu]=Egy adott ablak beállításai
+Comment[is]=Stillingar sem varða tiltekinn glugga
+Comment[it]=Configura le impostazioni specifiche di una finestra
+Comment[ja]=特定のウィンドウに固有の設定を行います
+Comment[ka]=ფანჯრის განსაკუთრებული პარამეტრების კონფიგურაცია
+Comment[kk]=Терезенің ерекше параметрлерін баптау
+Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ការ​កំណត់​ពិសេស​សម្រាប់​បង្អួច​មួយ
+Comment[ko]=창마다의 개별 설정
+Comment[lt]=Čia galite konfigūruoti konkretaus lango nustatymus
+Comment[lv]=Konfigurē parametrus priekš speciāla loga
+Comment[mk]=Конфигурирајте ги поставувањата за поодделни прозорци
+Comment[mt]=Ikkonfigura setings li jistgħu itejbu l-veloċità ta' KDE
+Comment[nb]=Innstillinger som er knyttet til et spesielt vindu
+Comment[nds]=Instellen för enkelte Finstern
+Comment[ne]=सञ्झ्यालका लागि निर्दिष्ट तरिकाले सेटिङ कन्फिगर गर्नुहोस्
+Comment[nl]=Hier kunt u instellingen kiezen specifiek voor één venster
+Comment[nn]=Innstillingar som er knytte til eitt særskilt vindauge
+Comment[pa]=ਇੱਕ ਝਰੋਖੇ ਲਈ ਖਾਸ ਸਥਾਪਨ ਸੰਰਚਨਾ
+Comment[pl]=Konfiguracja ustawień wybranego okna
+Comment[pt]=Configura as opções especificamente para uma janela
+Comment[pt_BR]=Configurações específicas para uma janela
+Comment[ro]=Configurează setări specifice anumitor ferestre
+Comment[ru]=Настройка особых параметров окна
+Comment[rw]=Kuboneza Amagenamiterere mu buryo bwihariye bw'idirishya
+Comment[se]=Heivehusat erenoamáš láse várás
+Comment[sk]=Nastavenie pre jednotlivé okná
+Comment[sl]=Nastavite možnosti glede na posamezno okno
+Comment[sr]=Подешавање поставки посебно за прозор
+Comment[sr@Latn]=Podešavanje postavki posebno za prozor
+Comment[sv]=Anpassa inställningar specifikt för ett fönster
+Comment[ta]=KDE செயல்திறனை அதிகப்படுத்தும் அமைப்புகளை அமை
+Comment[th]=ปรับแต่งค่าต่างๆ ที่เกี่ยวกับหน้าต่างโดยเฉพาะ
+Comment[tr]=Bir pencere için özel olan seçenekleri yapılandır
+Comment[tt]=Täräzä öçen ayırım caylawlar
+Comment[uk]=Налаштування параметрів для окремого типу вікон
+Comment[uz]=Oynaga oid boʻlgan moslamalarni moslash
+Comment[uz@cyrillic]=Ойнага оид бўлган мосламаларни мослаш
+Comment[vi]=Thiết lập cài đặt dành riêng cho cửa sổ
+Comment[wa]=Apontiaedjes specifikes po-z on purnea
+Comment[zh_CN]=配置一个窗口的设置
+Comment[zh_TW]=設定特定視窗設定值
+
+Keywords=size,position,state,window behavior,windows,specific,workarounds,remember,rules
+Keywords[ar]=القياس,الموضع,الحالة,سلوك النافذة,نوافذ,خاص,تدكر,قواعد,معاملات
+Keywords[be]=Памер,Пазіцыя,Стан,Паводзіны акна,Вокны,Акно,Спецыфічныя,Запомніць,Правілы,size,position,state,window behavior,windows,specific,workarounds,remember,rules
+Keywords[bg]=размер, позиция, състояние, прозорец, поведение,правила, запомняне,size,position,state,window behavior,windows,specific,workarounds,remember,rules
+Keywords[bs]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,ponašanje prozora,prozori,specifično,pravila
+Keywords[ca]=mida,posició,estat,comportament de finestra,finestres,específic,reparacions,recorda,regles
+Keywords[cs]=velikost,pozice,umístění,stav,chování oken,pravidla
+Keywords[csb]=miara,pòłożenié,stón,ùchòwanié òknół,òkna,spamiãtanié nastôwów,zapamiãtanié nastôwów,regle
+Keywords[cy]=maint,lleoliad,cyflwr,ffenestr,ymddygiad,ffenestri,penodol,ffyrdd osgoi,cofio,rheolau
+Keywords[da]=størrelse,position,tilstand,vinduesopførsel,vinduer,specifik, omgåelse,husk,regler
+Keywords[de]=Größe,Position,Status,Fensterverhalten,Fenster,Regeln
+Keywords[el]=μέγεθος,θέση,κατάσταση,συμπεριφορά παραθύρου,παράθυρα,ειδικές,λύσεις,αποθήκευση,κανόνων
+Keywords[en_GB]=size,position,state,window behaviour,windows,specific,workarounds,remember,rules
+Keywords[eo]=grandeco,pozicio,stato,fenestra konduto,fenestroj,reguloj
+Keywords[es]=tamaño,posición,estado,comportamiento de la ventana,ventanas,específico,soluciones,recordar,reglas
+Keywords[et]=suurus,asend,olek,akna käitumine,aknad,spetsiaalne,kohandamine,reeglid
+Keywords[eu]=neurria,kokapena,egoera,leihoaren portaera,leihoak,espezifikoa,konponbideak,gogoratu,arauak
+Keywords[fa]=اندازه، موقعیت، وضعیت، رفتار پنجره، پنجره‌ها، مشخص، workarounds، یادآوری، قواعد
+Keywords[fi]=koko,sijainti,tila,ikkunan käyttäytyminen,ikkunat,ikkunakohtainen,säännöt
+Keywords[fr]=taille,position,état,comportement de fenêtre,fenêtres,spécifique,astuces,souvenir,règles
+Keywords[fy]=grootte,grutte,positie,posysje,venstergedrag,finstergedrach,vensters,finsters,specifiek,spesifyk,alternatieven,alternativen,onthouden,ûnthâlde,regels
+Keywords[ga]=méid,ionad,staid,oibriú na bhfuinneog,fuinneoga,sainiúil,réitigh seiftithe,meabhraigh,rialacha
+Keywords[gl]=tamaño,posición,estado,comportamento da fiestra,fiestras,específico,lembrar,reglas
+Keywords[he]=גודל, מיקום, מצב, חלון, התנהגות, חלונות, אישית, זכור, חוקים, size,position,state,window behavior,windows,specific,workarounds,remember,rules
+Keywords[hi]=आकार,स्थान,स्थिति,विंडो व्यवहार,विंडोज़,विशिष्ट,कार्य-विकल्प,याददाश्त,नियम
+Keywords[hr]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,smještaj,stanje,ponašanje prozora,prozori,rješenja,zapamti,upamti,pravila
+Keywords[hu]=méret,pozíció,állapot,ablakműködés,ablakok,specifikus,megjegyzés,szabályok
+Keywords[id]=ukuran,posisi,status,perilaku jendela,jendela, spesifik,solusi,remember,aturan
+Keywords[it]=dimensione,posizione,stato,comportamento finestra,finestre,specifico,ricorda,regole
+Keywords[ja]=サイズ,位置,状態,ウィンドウの挙動,windows,特定,ワークアラウンド,記憶,ルール
+Keywords[km]=ទំហំ,ទីតាំង,សភាព,ឥរិយាបថ​បង្អួច បង្អួចs ជាក់លាក់c ចងចាំr ច្បាប់s
+Keywords[lt]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,dydis,pozicija,būsena,lango eelgesys,langai,atsiminti,taisyklės
+Keywords[lv]=izmērs,novietojums,statuss,loga izturēšanās,logi,specifisks,apjājiens,atcerēties,noteikumi
+Keywords[mk]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,големина,позиција,состојба,однесување на прозорец,специфично,заобиколни
+Keywords[mt]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,daqs
+Keywords[nb]=størrelse,posisjon,status,vindusoppførsel,vinduer,spesifikk,jukseløsninger,husk,regler
+Keywords[nds]=Grött,Positschoon,Status,Finsterbedregen,Finstern,enkel,enkelte,Regeln,behollen,workaround
+Keywords[ne]=साइज, स्थिति, अवस्था, सञ्झ्याल व्यवहार, सञ्झ्यालहरू, निर्दिष्ट, कार्यक्षेत्र, याद गर्नुहोस्, नियम
+Keywords[nl]=grootte,positie,venstergedrag,vensters,specifiek,alternatieven,onthouden,regels
+Keywords[nn]=storleik,plassering,tilstand,vindaugsåtferd,vindauge,spesifikk,jukseløysingar,hugs,reglar
+Keywords[pa]=ਅਕਾਰ,ਸਥਿਤੀ,ਝਰੋਖਾ ਵਿਵਹਾਰ,ਝਰੋਖੇ,ਖਾਸ,ਯਾਦ ਰੱਖੋ,ਨਿਯਮ
+Keywords[pl]=rozmiar,położenie,stan,zachowanie okien,okna,zapamiętywanie ustawień,reguły
+Keywords[pt]=tamanho,posição,estado,comportamento da janela,janelas,específico,recordar,regras
+Keywords[pt_BR]=tamanho,posição, estado, comportamento da janela, janelas, específica, elementos, lembrar, regras
+Keywords[ro]=mărime,poziție,stare,comportament fereastră,ferestre,specific,reguli
+Keywords[rw]=Ingano,Ibirindiro,leta, imyitwarire y'idirishya,amadirishya,byihariye, amakorahafi,kwibuka,amategeko
+Keywords[se]=sturrodat,sajádat,dilli,láseláhtten,láset,erenoamáš,fillenčovdosat,muitte,njuolggadusat
+Keywords[sk]=veľkosť,pozícia,stav,správanie okna,okná,špecifické,jedno okno,opravy,pravidlá
+Keywords[sl]=velikost,položaj,stanje,obnašanje okna,okna,posebno,obvoz,zapomni,pravila
+Keywords[sr]=величина,позиција,стање,понашање прозора,прозори,запамти,правила
+Keywords[sr@Latn]=veličina,pozicija,stanje,ponašanje prozora,prozori,zapamti,pravila
+Keywords[sv]=storlek,position,tillstånd,fönsterbeteende,fönster,specifik,komma runt,komma ihåg,regler
+Keywords[ta]=அளவு,நிலை,மாநிலம்,சாளர நடத்தை,சாளரங்கள்,குறிப்பிட்ட,பணிவட்டாரங்கள்,விதிகள்
+Keywords[th]=ขนาด,ตำแหน่ง,สถานะ,พฤติกรรมหน้าต่าง,หน้าต่าง,โดยเฉพาะ,หารอบๆ,จำ,กฎ
+Keywords[tr]=boyut,yer,pozisyon,durum,pencere davranışı,pencereler,özel,çalışma alanı,hatırla,kurallar
+Keywords[uk]=розмір,позиція,стан,поведінка вікна,вікна,окремі,підігнати,запам'ятати,правила
+Keywords[uz]=oʻlcham,joy,holat,oynaning xususiyatlari,oynalar,maxsus,eslab qolish,qoidalar
+Keywords[uz@cyrillic]=ўлчам,жой,ҳолат,ойнанинг хусусиятлари,ойналар,махсус,эслаб қолиш,қоидалар
+Keywords[vi]=kích cỡ,vị trí,trạng thái,ứng xử cửa sổ,cửa sổ,dành riêng,cách chữa chạy,nhớ,quy tắc
+Keywords[wa]=grandeu,plaece,estat,estance,dujhance des purneas,purneas,specifike,workarounds,remember,rîles,sovni,sovnance
+Keywords[zh_CN]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,大小,位置,状态,窗口行为,窗口,特定,工作区,记住,规则
+Keywords[zh_TW]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,大小,位置,狀態,視窗行為,視窗,指定,記憶,規則
+Categories=Qt;KDE;X-KDE-settings-desktop;
diff --git a/twin/kcmtwin/twinrules/twinsrc.cpp b/twin/kcmtwin/twinrules/twinsrc.cpp
new file mode 100644
index 000000000..fb901efb6
--- /dev/null
+++ b/twin/kcmtwin/twinrules/twinsrc.cpp
@@ -0,0 +1,8 @@
+// Include some code from twin core in order to avoid
+// double implementation.
+
+#include "ruleslist.h"
+#include "../../rules.cpp"
+#include "../../placement.cpp"
+#include "../../options.cpp"
+#include "../../utils.cpp"