diff options
Diffstat (limited to 'twin/kcmtwin/twinoptions/mouse.cpp')
-rw-r--r-- | twin/kcmtwin/twinoptions/mouse.cpp | 134 |
1 files changed, 74 insertions, 60 deletions
diff --git a/twin/kcmtwin/twinoptions/mouse.cpp b/twin/kcmtwin/twinoptions/mouse.cpp index 8778d915e..0e197071c 100644 --- a/twin/kcmtwin/twinoptions/mouse.cpp +++ b/twin/kcmtwin/twinoptions/mouse.cpp @@ -18,7 +18,7 @@ */ #include <tqlabel.h> -#include <tqcombobox.h> +#include <tqcheckbox.h> #include <tqwhatsthis.h> #include <tqlayout.h> #include <tqvgroupbox.h> @@ -164,7 +164,7 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co combo->insertItem(i18n("On All Desktops")); combo->insertItem(i18n("Nothing")); combo->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); hlayout->addWidget(combo); coTiDbl = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>double</em> click into the titlebar.")); @@ -178,23 +178,28 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co hlayoutW->addWidget(label); txtButton4 = i18n("Handle mouse wheel events"); TQWhatsThis::add( label, txtButton4); - - // Titlebar and frame mouse Wheel + + // Titlebar and frame mouse Wheel TQComboBox* comboW = new TQComboBox(this); comboW->insertItem(i18n("Raise/Lower")); comboW->insertItem(i18n("Shade/Unshade")); comboW->insertItem(i18n("Maximize/Restore")); - comboW->insertItem(i18n("Keep Above/Below")); - comboW->insertItem(i18n("Move to Previous/Next Desktop")); - comboW->insertItem(i18n("Change Opacity")); - comboW->insertItem(i18n("Nothing")); + comboW->insertItem(i18n("Keep Above/Below")); + comboW->insertItem(i18n("Move to Previous/Next Desktop")); + comboW->insertItem(i18n("Change Opacity")); + comboW->insertItem(i18n("Nothing")); comboW->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); - connect(comboW, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(comboW, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); hlayoutW->addWidget(comboW); - coTiAct4 = comboW; + coTiW = comboW; TQWhatsThis::add(comboW, txtButton4); label->setBuddy(comboW); - + + cbTiRevW = new TQCheckBox(i18n("Reverse wheel direction"), this); + connect(cbTiRevW, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + TQWhatsThis::add( cbTiRevW, i18n("Use this to reverse the action of the mouse wheel.") ); + hlayoutW->addWidget(cbTiRevW); + /** Titlebar and frame **************/ box = new TQVGroupBox( i18n("Titlebar && Frame"), this, "Titlebar and Frame"); @@ -204,7 +209,7 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co TQWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on the" " titlebar or the frame of a window.") ); - grid = new TQGrid(4, Qt::Vertical, box); + grid = new TQGrid(4, TQt::Vertical, box); new TQLabel(grid); // dummy @@ -239,15 +244,12 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co TQWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar" " or the frame of an active window.") ); - // Titlebar and frame, active, mouse button 1 - combo = new TQComboBox(grid); - combo->insertItem(i18n("Raise")); - combo->insertItem(i18n("Lower")); - combo->insertItem(i18n("Operations Menu")); - combo->insertItem(i18n("Toggle Raise & Lower")); - combo->insertItem(i18n("Nothing")); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); - coTiAct1 = combo; + items << i18n("Raise") + << i18n("Lower") + << i18n("Operations Menu") + << i18n("Toggle Raise & Lower") + << i18n("Nothing") + << i18n("Shade"); txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an " "<em>active</em> window."); @@ -256,29 +258,29 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co "<em>active</em> window."); // Be nice to left handed users - if ( leftHandedMouse ) tqSwap(txtButton1, txtButton3); + if (leftHandedMouse) + { + tqSwap(txtButton1, txtButton3); + } + // Titlebar and frame, active, mouse button 1 + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); + coTiAct1 = combo; TQWhatsThis::add(combo, txtButton1); // Titlebar and frame, active, mouse button 2 - - items << i18n("Raise") - << i18n("Lower") - << i18n("Operations Menu") - << i18n("Toggle Raise & Lower") - << i18n("Nothing") - << i18n("Shade"); - combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiAct2 = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>active</em> window.")); // Titlebar and frame, active, mouse button 3 combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiAct3 = combo; TQWhatsThis::add(combo, txtButton3 ); @@ -308,19 +310,19 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiInAct1 = combo; TQWhatsThis::add(combo, txtButton1); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiInAct2 = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>inactive</em> window.")); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiInAct3 = combo; TQWhatsThis::add(combo, txtButton3); @@ -360,13 +362,13 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co coMax[b] = new ToolTipComboBox(box, tbl_Max); for (int t = 0; t < 3; ++t) coMax[b]->insertItem(maxButtonPixmaps[t]); - connect(coMax[b], TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); - connect(coMax[b], TQT_SIGNAL(activated(int)), coMax[b], TQT_SLOT(changed())); + connect(coMax[b], TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); + connect(coMax[b], TQ_SIGNAL(activated(int)), coMax[b], TQ_SLOT(changed())); TQWhatsThis::add( coMax[b], txtButton[b] ); coMax[b]->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum )); } - connect(kapp, TQT_SIGNAL(tdedisplayPaletteChanged()), TQT_SLOT(paletteChanged())); + connect(kapp, TQ_SIGNAL(tdedisplayPaletteChanged()), TQ_SLOT(paletteChanged())); layout->addStretch(); @@ -491,8 +493,8 @@ void KTitleBarActionsConfig::setComboText( TQComboBox* combo, const char*txt ) combo->setCurrentItem( tbl_txt_lookup( tbl_TiAc, txt )); else if( combo == coTiInAct1 || combo == coTiInAct2 || combo == coTiInAct3 ) combo->setCurrentItem( tbl_txt_lookup( tbl_TiInAc, txt )); - else if( combo == coTiAct4 ) - combo->setCurrentItem( tbl_txt_lookup( tbl_TiWAc, txt )); + else if( combo == coTiW ) + combo->setCurrentItem( tbl_txt_lookup( tbl_TiWAc, txt )); else if( combo == coMax[0] || combo == coMax[1] || combo == coMax[2] ) { combo->setCurrentItem( tbl_txt_lookup( tbl_Max, txt )); @@ -538,10 +540,11 @@ void KTitleBarActionsConfig::load() setComboText(coTiAct1,config->readEntry("CommandActiveTitlebar1","Raise").ascii()); setComboText(coTiAct2,config->readEntry("CommandActiveTitlebar2","Lower").ascii()); setComboText(coTiAct3,config->readEntry("CommandActiveTitlebar3","Operations menu").ascii()); - setComboText(coTiAct4,config->readEntry("CommandTitlebarWheel","Nothing").ascii()); setComboText(coTiInAct1,config->readEntry("CommandInactiveTitlebar1","Activate and raise").ascii()); setComboText(coTiInAct2,config->readEntry("CommandInactiveTitlebar2","Activate and lower").ascii()); setComboText(coTiInAct3,config->readEntry("CommandInactiveTitlebar3","Operations menu").ascii()); + setComboText(coTiW,config->readEntry("CommandTitlebarWheel","Nothing").ascii()); + cbTiRevW->setChecked(config->readBoolEntry("CommandTitlebarReverseWheel", false)); } void KTitleBarActionsConfig::save() @@ -556,10 +559,11 @@ void KTitleBarActionsConfig::save() config->writeEntry("CommandActiveTitlebar2", functionTiAc(coTiAct2->currentItem())); config->writeEntry("CommandActiveTitlebar3", functionTiAc(coTiAct3->currentItem())); config->writeEntry("CommandInactiveTitlebar1", functionTiInAc(coTiInAct1->currentItem())); - config->writeEntry("CommandTitlebarWheel", functionTiWAc(coTiAct4->currentItem())); config->writeEntry("CommandInactiveTitlebar2", functionTiInAc(coTiInAct2->currentItem())); config->writeEntry("CommandInactiveTitlebar3", functionTiInAc(coTiInAct3->currentItem())); - + config->writeEntry("CommandTitlebarWheel", functionTiWAc(coTiW->currentItem())); + config->writeEntry("CommandTitlebarReverseWheel", cbTiRevW->isChecked()); + if (standAlone) { config->sync(); @@ -575,10 +579,11 @@ void KTitleBarActionsConfig::defaults() setComboText(coTiAct1,"Raise"); setComboText(coTiAct2,"Lower"); setComboText(coTiAct3,"Operations menu"); - setComboText(coTiAct4,"Nothing"); setComboText(coTiInAct1,"Activate and raise"); setComboText(coTiInAct2,"Activate and lower"); setComboText(coTiInAct3,"Operations menu"); + setComboText(coTiW,"Nothing"); + cbTiRevW->setChecked(false); for (int t = 0; t < 3; ++t) setComboText(coMax[t], tbl_Max[t]); } @@ -606,7 +611,7 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config TQWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on an inactive" " inner window ('inner' means: not titlebar, not frame).") ); - grid = new TQGrid(3, Qt::Vertical, box); + grid = new TQGrid(3, TQt::Vertical, box); strMouseButton1 = i18n("Left button:"); txtButton1 = i18n("In this row you can customize left click behavior when clicking into" @@ -650,19 +655,19 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config TQComboBox* combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coWin1 = combo; TQWhatsThis::add( combo, strWin1 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coWin2 = combo; TQWhatsThis::add( combo, strWin2 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coWin3 = combo; TQWhatsThis::add( combo, strWin3 ); @@ -676,7 +681,7 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config TQWhatsThis::add( box, i18n("Here you can customize TDE's behavior when clicking somewhere into" " a window while pressing a modifier key.")); - grid = new TQGrid(5, Qt::Vertical, box); + grid = new TQGrid(6, TQt::Vertical, box); // Labels label = new TQLabel(i18n("Modifier key:"), grid); @@ -716,11 +721,13 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config " in a window while pressing the modifier key."); TQWhatsThis::add( label, strAllW); + label = new TQLabel("", grid); // Dummy label to keep grid in order + // Combo's combo = new TQComboBox(grid); combo->insertItem(i18n("Meta")); combo->insertItem(i18n("Alt")); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAllKey = combo; TQWhatsThis::add( combo, strAllKey ); @@ -736,19 +743,19 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAll1 = combo; TQWhatsThis::add( combo, strAll1 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAll2 = combo; TQWhatsThis::add( combo, strAll2 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAll3 = combo; TQWhatsThis::add( combo, strAll3 ); @@ -756,14 +763,18 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config combo->insertItem(i18n("Raise/Lower")); combo->insertItem(i18n("Shade/Unshade")); combo->insertItem(i18n("Maximize/Restore")); - combo->insertItem(i18n("Keep Above/Below")); - combo->insertItem(i18n("Move to Previous/Next Desktop")); - combo->insertItem(i18n("Change Opacity")); - combo->insertItem(i18n("Nothing")); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + combo->insertItem(i18n("Keep Above/Below")); + combo->insertItem(i18n("Move to Previous/Next Desktop")); + combo->insertItem(i18n("Change Opacity")); + combo->insertItem(i18n("Nothing")); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAllW = combo; TQWhatsThis::add( combo, strAllW ); + cbAllRevW = new TQCheckBox(i18n("Reverse wheel direction"), grid); + connect(cbAllRevW, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + TQWhatsThis::add( cbAllRevW, i18n("Use this to reverse the action of the mouse wheel.") ); + layout->addStretch(); load(); @@ -784,7 +795,7 @@ void KWindowActionsConfig::setComboText( TQComboBox* combo, const char*txt ) else if( combo == coAll1 || combo == coAll2 || combo == coAll3 ) combo->setCurrentItem( tbl_txt_lookup( tbl_All, txt )); else if( combo == coAllW ) - combo->setCurrentItem( tbl_txt_lookup( tbl_AllW, txt )); + combo->setCurrentItem( tbl_txt_lookup( tbl_AllW, txt )); else abort(); } @@ -820,6 +831,7 @@ void KWindowActionsConfig::load() setComboText(coAll2,config->readEntry("CommandAll2","Toggle raise and lower").ascii()); setComboText(coAll3,config->readEntry("CommandAll3","Resize").ascii()); setComboText(coAllW,config->readEntry("CommandAllWheel","Nothing").ascii()); + cbAllRevW->setChecked(config->readBoolEntry("CommandAllReverseWheel", false)); } void KWindowActionsConfig::save() @@ -833,7 +845,8 @@ void KWindowActionsConfig::save() config->writeEntry("CommandAll2", functionAll(coAll2->currentItem())); config->writeEntry("CommandAll3", functionAll(coAll3->currentItem())); config->writeEntry("CommandAllWheel", functionAllW(coAllW->currentItem())); - + config->writeEntry("CommandAllReverseWheel", cbAllRevW->isChecked()); + if (standAlone) { config->sync(); @@ -853,4 +866,5 @@ void KWindowActionsConfig::defaults() setComboText(coAll2,"Toggle raise and lower"); setComboText(coAll3,"Resize"); setComboText(coAllW,"Nothing"); + cbAllRevW->setChecked(false); } |