summaryrefslogtreecommitdiffstats
path: root/khotkeys/kcontrol/window_trigger_widget.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /khotkeys/kcontrol/window_trigger_widget.cpp
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khotkeys/kcontrol/window_trigger_widget.cpp')
-rw-r--r--khotkeys/kcontrol/window_trigger_widget.cpp84
1 files changed, 84 insertions, 0 deletions
diff --git a/khotkeys/kcontrol/window_trigger_widget.cpp b/khotkeys/kcontrol/window_trigger_widget.cpp
new file mode 100644
index 000000000..882112cce
--- /dev/null
+++ b/khotkeys/kcontrol/window_trigger_widget.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+
+ KHotKeys
+
+ Copyright (C) 1999-2001 Lubos Lunak <[email protected]>
+
+ Distributed under the terms of the GNU General Public License version 2.
+
+****************************************************************************/
+
+#define _WINDOW_TRIGGER_WIDGET_CPP_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "window_trigger_widget.h"
+
+#include <qcheckbox.h>
+
+#include <triggers.h>
+#include <actions.h>
+#include <action_data.h>
+
+#include "windowdef_list_widget.h"
+#include "kcmkhotkeys.h"
+
+namespace KHotKeys
+{
+
+Window_trigger_widget::Window_trigger_widget( QWidget* parent_P, const char* name_P )
+ : Window_trigger_widget_ui( parent_P, name_P )
+ {
+ clear_data();
+ // KHotKeys::Module::changed()
+ connect( window_appears_checkbox, SIGNAL( clicked()),
+ module, SLOT( changed()));
+ connect( window_disappears_checkbox, SIGNAL( clicked()),
+ module, SLOT( changed()));
+ connect( window_activates_checkbox, SIGNAL( clicked()),
+ module, SLOT( changed()));
+ connect( window_deactivates_checkbox, SIGNAL( clicked()),
+ module, SLOT( changed()));
+ }
+
+void Window_trigger_widget::clear_data()
+ {
+ windowdef_list_widget->clear_data();
+ window_appears_checkbox->setChecked( false );
+ window_disappears_checkbox->setChecked( false );
+ window_activates_checkbox->setChecked( false );
+ window_deactivates_checkbox->setChecked( false );
+ }
+
+void Window_trigger_widget::set_data( const Window_trigger* trigger_P )
+ {
+ if( trigger_P == NULL )
+ {
+ clear_data();
+ return;
+ }
+ windowdef_list_widget->set_data( trigger_P->windows());
+ window_appears_checkbox->setChecked(
+ trigger_P->triggers_on( Window_trigger::WINDOW_APPEARS ));
+ window_disappears_checkbox->setChecked(
+ trigger_P->triggers_on( Window_trigger::WINDOW_DISAPPEARS ));
+ window_activates_checkbox->setChecked(
+ trigger_P->triggers_on( Window_trigger::WINDOW_ACTIVATES ));
+ window_deactivates_checkbox->setChecked(
+ trigger_P->triggers_on( Window_trigger::WINDOW_DEACTIVATES ));
+ }
+
+Window_trigger* Window_trigger_widget::get_data( Action_data* data_P ) const
+ {
+ return new Window_trigger( data_P, windowdef_list_widget->get_data(),
+ ( window_appears_checkbox->isChecked() ? Window_trigger::WINDOW_APPEARS : 0 )
+ | ( window_disappears_checkbox->isChecked() ? Window_trigger::WINDOW_DISAPPEARS : 0 )
+ | ( window_activates_checkbox->isChecked() ? Window_trigger::WINDOW_ACTIVATES : 0 )
+ | ( window_deactivates_checkbox->isChecked() ? Window_trigger::WINDOW_DEACTIVATES : 0 ));
+ }
+
+} // namespace KHotKeys
+
+#include "window_trigger_widget.moc"