Introduce ui-file for inactive window mouse actions in KWin configuration

Thanks to Alexander Jones for creating the ui file.
icc-effect-5.14.5
Martin Gräßlin 2012-09-24 05:02:12 +02:00
parent 142fa54b2b
commit 7c2a0f2188
4 changed files with 611 additions and 280 deletions

View File

@ -1,7 +1,7 @@
########### next target ###############
set(kcm_kwinoptions_PART_SRCS windows.cpp mouse.cpp main.cpp )
kde4_add_ui_files(kcm_kwinoptions_PART_SRCS focus.ui mouse.ui)
kde4_add_ui_files(kcm_kwinoptions_PART_SRCS actions.ui focus.ui mouse.ui)
kde4_add_plugin(kcm_kwinoptions ${kcm_kwinoptions_PART_SRCS})
target_link_libraries(kcm_kwinoptions ${KDE4_KDEUI_LIBS})
install(TARGETS kcm_kwinoptions DESTINATION ${PLUGIN_INSTALL_DIR} )

View File

@ -0,0 +1,552 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KWinActionsConfigForm</class>
<widget class="QWidget" name="KWinActionsConfigForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>556</width>
<height>320</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="whatsThis">
<string>Here you can customize mouse click behavior when clicking on an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
<property name="title">
<string>Inactive Inner Window</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Left button:</string>
</property>
<property name="buddy">
<cstring>coWin1</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="coWin1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>In this row you can customize left click behavior when clicking into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
<item>
<property name="text">
<string>Activate, Raise &amp; Pass Click</string>
</property>
</item>
<item>
<property name="text">
<string>Activate &amp; Pass Click</string>
</property>
</item>
<item>
<property name="text">
<string>Activate</string>
</property>
</item>
<item>
<property name="text">
<string>Activate &amp; Raise</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>M&amp;iddle button:</string>
</property>
<property name="buddy">
<cstring>coWin2</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="coWin2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>In this row you can customize middle click behavior when clicking into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
<item>
<property name="text">
<string>Activate, Raise &amp; Pass Click</string>
</property>
</item>
<item>
<property name="text">
<string>Activate &amp; Pass Click</string>
</property>
</item>
<item>
<property name="text">
<string>Activate</string>
</property>
</item>
<item>
<property name="text">
<string>Activate &amp; Raise</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Right button:</string>
</property>
<property name="buddy">
<cstring>coWin3</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KComboBox" name="coWin3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>In this row you can customize right click behavior when clicking into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
<item>
<property name="text">
<string>Activate, Raise &amp; Pass Click</string>
</property>
</item>
<item>
<property name="text">
<string>Activate &amp; Pass Click</string>
</property>
</item>
<item>
<property name="text">
<string>Activate</string>
</property>
</item>
<item>
<property name="text">
<string>Activate &amp; Raise</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&amp;Wheel</string>
</property>
<property name="buddy">
<cstring>coWinWheel</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KComboBox" name="coWinWheel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>In this row you can customize behavior when scrolling into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
<item>
<property name="text">
<string>Scroll</string>
</property>
</item>
<item>
<property name="text">
<string>Activate &amp; Scroll</string>
</property>
</item>
<item>
<property name="text">
<string>Activate, Raise &amp; Scroll</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="whatsThis">
<string>Here you can customize KDE's behavior when clicking somewhere into a window while pressing a modifier key.</string>
</property>
<property name="title">
<string>Inner Window, Titlebar &amp;&amp; Frame</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Modifier &amp;key:</string>
</property>
<property name="buddy">
<cstring>coAllKey</cstring>
</property>
</widget>
</item>
<item>
<widget class="KComboBox" name="coAllKey">
<property name="whatsThis">
<string>Here you select whether holding the Meta key or Alt key will allow you to perform the following actions.</string>
</property>
<item>
<property name="text">
<string>Meta</string>
</property>
</item>
<item>
<property name="text">
<string>Alt</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string> + </string>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Left &amp;button</string>
</property>
<property name="buddy">
<cstring>coAll1</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="coAll1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>In this row you can customize left click behavior when clicking into the titlebar or the frame.</string>
</property>
<item>
<property name="text">
<string>Move</string>
</property>
</item>
<item>
<property name="text">
<string>Activate, Raise &amp; Move</string>
</property>
</item>
<item>
<property name="text">
<string>Toggle Raise &amp; Lower</string>
</property>
</item>
<item>
<property name="text">
<string>Resize</string>
</property>
</item>
<item>
<property name="text">
<string>Raise</string>
</property>
</item>
<item>
<property name="text">
<string>Lower</string>
</property>
</item>
<item>
<property name="text">
<string>Minimize</string>
</property>
</item>
<item>
<property name="text">
<string>Decrease Opacity</string>
</property>
</item>
<item>
<property name="text">
<string>Increase Opacity</string>
</property>
</item>
<item>
<property name="text">
<string>Nothing</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="coAll2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>In this row you can customize middle click behavior when clicking into the titlebar or the frame.</string>
</property>
<item>
<property name="text">
<string>Move</string>
</property>
</item>
<item>
<property name="text">
<string>Activate, Raise &amp; Move</string>
</property>
</item>
<item>
<property name="text">
<string>Toggle Raise &amp; Lower</string>
</property>
</item>
<item>
<property name="text">
<string>Resize</string>
</property>
</item>
<item>
<property name="text">
<string>Raise</string>
</property>
</item>
<item>
<property name="text">
<string>Lower</string>
</property>
</item>
<item>
<property name="text">
<string>Minimize</string>
</property>
</item>
<item>
<property name="text">
<string>Decrease Opacity</string>
</property>
</item>
<item>
<property name="text">
<string>Increase Opacity</string>
</property>
</item>
<item>
<property name="text">
<string>Nothing</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
<widget class="KComboBox" name="coAll3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>In this row you can customize right click behavior when clicking into the titlebar or the frame.</string>
</property>
<item>
<property name="text">
<string>Move</string>
</property>
</item>
<item>
<property name="text">
<string>Activate, Raise &amp; Move</string>
</property>
</item>
<item>
<property name="text">
<string>Toggle Raise &amp; Lower</string>
</property>
</item>
<item>
<property name="text">
<string>Resize</string>
</property>
</item>
<item>
<property name="text">
<string>Raise</string>
</property>
</item>
<item>
<property name="text">
<string>Lower</string>
</property>
</item>
<item>
<property name="text">
<string>Minimize</string>
</property>
</item>
<item>
<property name="text">
<string>Decrease Opacity</string>
</property>
</item>
<item>
<property name="text">
<string>Increase Opacity</string>
</property>
</item>
<item>
<property name="text">
<string>Nothing</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Middle b&amp;utton:</string>
</property>
<property name="buddy">
<cstring>coAll2</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Ri&amp;ght button:</string>
</property>
<property name="buddy">
<cstring>coAll3</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>M&amp;ouse wheel:</string>
</property>
<property name="buddy">
<cstring>coAllW</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KComboBox" name="coAllW">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>Here you can customize KDE's behavior when scrolling with the mouse wheel in a window while pressing the modifier key.</string>
</property>
<item>
<property name="text">
<string>Raise/Lower</string>
</property>
</item>
<item>
<property name="text">
<string>Shade/Unshade</string>
</property>
</item>
<item>
<property name="text">
<string>Maximize/Restore</string>
</property>
</item>
<item>
<property name="text">
<string>Keep Above/Below</string>
</property>
</item>
<item>
<property name="text">
<string>Move to Previous/Next Desktop</string>
</property>
</item>
<item>
<property name="text">
<string>Change Opacity</string>
</property>
</item>
<item>
<property name="text">
<string>Switch to Window Tab to the Left/Right</string>
</property>
</item>
<item>
<property name="text">
<string>Nothing</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -138,6 +138,11 @@ KWinMouseConfigForm::KWinMouseConfigForm(QWidget *parent)
setupUi(this);
}
KWinActionsConfigForm::KWinActionsConfigForm(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
}
void KTitleBarActionsConfig::paletteChanged()
{
@ -439,243 +444,17 @@ void KTitleBarActionsConfig::defaults()
KWindowActionsConfig::KWindowActionsConfig(bool _standAlone, KConfig *_config, const KComponentData &inst, QWidget * parent)
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
, m_ui(new KWinActionsConfigForm(this))
{
QString strWin1, strWin2, strWin3, strWinWheel, strAllKey, strAll1, strAll2, strAll3, strAllW;
QGroupBox *box;
QString strMouseButton1, strMouseButton2, strMouseButton3, strMouseWheel;
QString txtButton1, txtButton2, txtButton3, txtWheel;
QStringList items;
bool leftHandedMouse = (KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded);
QVBoxLayout *layout = new QVBoxLayout(this);
/** Inactive inner window ******************/
box = new QGroupBox(i18n("Inactive Inner Window"), this);
layout->addWidget(box);
box->setObjectName(QString::fromLatin1("Inactive Inner Window"));
box->setWhatsThis(i18n("Here you can customize mouse click behavior when clicking on an inactive"
" inner window ('inner' means: not titlebar, not frame)."));
QGridLayout *gridLayout = new QGridLayout(box);
strMouseButton1 = i18n("Left button:");
txtButton1 = i18n("In this row you can customize left click behavior when clicking into"
" the titlebar or the frame.");
strMouseButton2 = i18n("Middle button:");
txtButton2 = i18n("In this row you can customize middle click behavior when clicking into"
" the titlebar or the frame.");
strMouseButton3 = i18n("Right button:");
txtButton3 = i18n("In this row you can customize right click behavior when clicking into"
" the titlebar or the frame.");
strMouseWheel = i18n("Wheel");
if (leftHandedMouse) {
qSwap(strMouseButton1, strMouseButton3);
qSwap(txtButton1, txtButton3);
}
strWin1 = i18n("In this row you can customize left click behavior when clicking into"
" an inactive inner window ('inner' means: not titlebar, not frame).");
strWin2 = i18n("In this row you can customize middle click behavior when clicking into"
" an inactive inner window ('inner' means: not titlebar, not frame).");
strWin3 = i18n("In this row you can customize right click behavior when clicking into"
" an inactive inner window ('inner' means: not titlebar, not frame).");
strWinWheel = i18n("In this row you can customize behavior when scrolling into"
" an inactive inner window ('inner' means: not titlebar, not frame).");
// Be nice to lefties
if (leftHandedMouse) qSwap(strWin1, strWin3);
items.clear();
items << i18n("Activate, Raise & Pass Click")
<< i18n("Activate & Pass Click")
<< i18n("Activate")
<< i18n("Activate & Raise");
KComboBox* combo = new KComboBox(box);
coWin1 = combo;
combo->addItems(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
combo->setWhatsThis(strWin1);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QLabel* label = new QLabel(strMouseButton1, this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 0, 0);
gridLayout->addWidget(combo, 0, 1);
combo = new KComboBox(box);
combo->addItems(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coWin2 = combo;
combo->setWhatsThis(strWin2);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(strMouseButton2, this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 1, 0);
gridLayout->addWidget(combo, 1, 1);
combo = new KComboBox(box);
combo->addItems(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coWin3 = combo;
combo->setWhatsThis(strWin3);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(strMouseButton3, this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 2, 0);
gridLayout->addWidget(combo, 2, 1);
items.clear();
items << i18n("Scroll")
<< i18n("Activate & Scroll")
<< i18n("Activate, Raise & Scroll");
combo = new KComboBox(box);
combo->addItems(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coWinWheel = combo;
combo->setWhatsThis(strWinWheel);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(strMouseWheel, this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 3, 0);
gridLayout->addWidget(combo, 3, 1);
/** Inner window, titlebar and frame **************/
box = new QGroupBox(i18n("Inner Window, Titlebar && Frame"), this);
layout->addWidget(box);
box->setObjectName(QString::fromLatin1("Inner Window, Titlebar and Frame"));
box->setWhatsThis(i18n("Here you can customize KDE's behavior when clicking somewhere into"
" a window while pressing a modifier key."));
QHBoxLayout* innerLay = new QHBoxLayout(box);
QHBoxLayout* fLay = new QHBoxLayout;
gridLayout = new QGridLayout;
innerLay->addLayout(fLay);
innerLay->addLayout(gridLayout);
// Labels
strMouseButton1 = i18n("Left button:");
strAll1 = i18n("In this row you can customize left click behavior when clicking into"
" the titlebar or the frame.");
strMouseButton2 = i18n("Middle button:");
strAll2 = i18n("In this row you can customize middle click behavior when clicking into"
" the titlebar or the frame.");
strMouseButton3 = i18n("Right button:");
strAll3 = i18n("In this row you can customize right click behavior when clicking into"
" the titlebar or the frame.");
if (leftHandedMouse) {
qSwap(strMouseButton1, strMouseButton3);
qSwap(strAll1, strAll3);
}
// Combo's
combo = new KComboBox(box);
combo->addItem(i18n("Meta"));
combo->addItem(i18n("Alt"));
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coAllKey = combo;
combo->setWhatsThis(i18n("Here you select whether holding the Meta key or Alt key "
"will allow you to perform the following actions."));
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(i18n("Modifier key:"), this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
fLay->addWidget(label);
fLay->addWidget(combo);
fLay->addWidget(new QLabel(" + ", this));
items.clear();
items << i18n("Move")
<< i18n("Activate, Raise and Move")
<< i18n("Toggle Raise & Lower")
<< i18n("Resize")
<< i18n("Raise")
<< i18n("Lower")
<< i18n("Minimize")
<< i18n("Decrease Opacity")
<< i18n("Increase Opacity")
<< i18n("Nothing");
combo = new KComboBox(box);
combo->addItems(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coAll1 = combo;
combo->setWhatsThis(strAll1);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(strMouseButton1, this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 0, 0);
gridLayout->addWidget(combo, 0, 1);
combo = new KComboBox(box);
combo->addItems(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coAll2 = combo;
combo->setWhatsThis(strAll2);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(strMouseButton2, this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 1, 0);
gridLayout->addWidget(combo, 1, 1);
combo = new KComboBox(box);
combo->addItems(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coAll3 = combo;
combo->setWhatsThis(strAll3);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(strMouseButton3, this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 2, 0);
gridLayout->addWidget(combo, 2, 1);
combo = new KComboBox(box);
combo->addItem(i18n("Raise/Lower"));
combo->addItem(i18n("Shade/Unshade"));
combo->addItem(i18n("Maximize/Restore"));
combo->addItem(i18n("Keep Above/Below"));
combo->addItem(i18n("Move to Previous/Next Desktop"));
combo->addItem(i18n("Change Opacity"));
combo->addItem(i18n("Switch to Window Tab to the Left/Right"));
combo->addItem(i18n("Nothing"));
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coAllW = combo;
combo->setWhatsThis(i18n("Here you can customize KDE's behavior when scrolling with the mouse wheel"
" in a window while pressing the modifier key."));
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
label = new QLabel(i18n("Mouse wheel:"), this);
label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
label->setBuddy(combo);
gridLayout->addWidget(label, 3, 0);
gridLayout->addWidget(combo, 3, 1);
layout->addStretch();
connect(m_ui->coWin1, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coWin2, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coWin3, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coWinWheel, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coAllKey, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coAll1, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coAll2, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coAll3, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->coAllW, SIGNAL(activated(int)), SLOT(changed()));
load();
}
@ -687,15 +466,15 @@ KWindowActionsConfig::~KWindowActionsConfig()
void KWindowActionsConfig::setComboText(KComboBox* combo, const char*txt)
{
if (combo == coWin1 || combo == coWin2 || combo == coWin3)
if (combo == m_ui->coWin1 || combo == m_ui->coWin2 || combo == m_ui->coWin3)
combo->setCurrentIndex(tbl_txt_lookup(tbl_Win, txt));
else if (combo == coWinWheel)
else if (combo == m_ui->coWinWheel)
combo->setCurrentIndex(tbl_txt_lookup(tbl_WinWheel, txt));
else if (combo == coAllKey)
else if (combo == m_ui->coAllKey)
combo->setCurrentIndex(tbl_txt_lookup(tbl_AllKey, txt));
else if (combo == coAll1 || combo == coAll2 || combo == coAll3)
else if (combo == m_ui->coAll1 || combo == m_ui->coAll2 || combo == m_ui->coAll3)
combo->setCurrentIndex(tbl_txt_lookup(tbl_All, txt));
else if (combo == coAllW)
else if (combo == m_ui->coAllW)
combo->setCurrentIndex(tbl_txt_lookup(tbl_AllW, txt));
else
abort();
@ -738,29 +517,29 @@ void KWindowActionsConfig::showEvent(QShowEvent *ev)
void KWindowActionsConfig::load()
{
KConfigGroup cg(config, "MouseBindings");
setComboText(coWin1, cg.readEntry("CommandWindow1", "Activate, raise and pass click").toAscii());
setComboText(coWin2, cg.readEntry("CommandWindow2", "Activate and pass click").toAscii());
setComboText(coWin3, cg.readEntry("CommandWindow3", "Activate and pass click").toAscii());
setComboText(coWinWheel, cg.readEntry("CommandWindowWheel", "Scroll").toAscii());
setComboText(coAllKey, cg.readEntry("CommandAllKey", "Alt").toAscii());
setComboText(coAll1, cg.readEntry("CommandAll1", "Move").toAscii());
setComboText(coAll2, cg.readEntry("CommandAll2", "Toggle raise and lower").toAscii());
setComboText(coAll3, cg.readEntry("CommandAll3", "Resize").toAscii());
setComboText(coAllW, cg.readEntry("CommandAllWheel", "Nothing").toAscii());
setComboText(m_ui->coWin1, cg.readEntry("CommandWindow1", "Activate, raise and pass click").toAscii());
setComboText(m_ui->coWin2, cg.readEntry("CommandWindow2", "Activate and pass click").toAscii());
setComboText(m_ui->coWin3, cg.readEntry("CommandWindow3", "Activate and pass click").toAscii());
setComboText(m_ui->coWinWheel, cg.readEntry("CommandWindowWheel", "Scroll").toAscii());
setComboText(m_ui->coAllKey, cg.readEntry("CommandAllKey", "Alt").toAscii());
setComboText(m_ui->coAll1, cg.readEntry("CommandAll1", "Move").toAscii());
setComboText(m_ui->coAll2, cg.readEntry("CommandAll2", "Toggle raise and lower").toAscii());
setComboText(m_ui->coAll3, cg.readEntry("CommandAll3", "Resize").toAscii());
setComboText(m_ui->coAllW, cg.readEntry("CommandAllWheel", "Nothing").toAscii());
}
void KWindowActionsConfig::save()
{
KConfigGroup cg(config, "MouseBindings");
cg.writeEntry("CommandWindow1", functionWin(coWin1->currentIndex()));
cg.writeEntry("CommandWindow2", functionWin(coWin2->currentIndex()));
cg.writeEntry("CommandWindow3", functionWin(coWin3->currentIndex()));
cg.writeEntry("CommandWindowWheel", functionWinWheel(coWinWheel->currentIndex()));
cg.writeEntry("CommandAllKey", functionAllKey(coAllKey->currentIndex()));
cg.writeEntry("CommandAll1", functionAll(coAll1->currentIndex()));
cg.writeEntry("CommandAll2", functionAll(coAll2->currentIndex()));
cg.writeEntry("CommandAll3", functionAll(coAll3->currentIndex()));
cg.writeEntry("CommandAllWheel", functionAllW(coAllW->currentIndex()));
cg.writeEntry("CommandWindow1", functionWin(m_ui->coWin1->currentIndex()));
cg.writeEntry("CommandWindow2", functionWin(m_ui->coWin2->currentIndex()));
cg.writeEntry("CommandWindow3", functionWin(m_ui->coWin3->currentIndex()));
cg.writeEntry("CommandWindowWheel", functionWinWheel(m_ui->coWinWheel->currentIndex()));
cg.writeEntry("CommandAllKey", functionAllKey(m_ui->coAllKey->currentIndex()));
cg.writeEntry("CommandAll1", functionAll(m_ui->coAll1->currentIndex()));
cg.writeEntry("CommandAll2", functionAll(m_ui->coAll2->currentIndex()));
cg.writeEntry("CommandAll3", functionAll(m_ui->coAll3->currentIndex()));
cg.writeEntry("CommandAllWheel", functionAllW(m_ui->coAllW->currentIndex()));
if (standAlone) {
config->sync();
@ -773,13 +552,13 @@ void KWindowActionsConfig::save()
void KWindowActionsConfig::defaults()
{
setComboText(coWin1, "Activate, raise and pass click");
setComboText(coWin2, "Activate and pass click");
setComboText(coWin3, "Activate and pass click");
setComboText(coWinWheel, "Scroll");
setComboText(coAllKey, "Alt");
setComboText(coAll1, "Move");
setComboText(coAll2, "Toggle raise and lower");
setComboText(coAll3, "Resize");
setComboText(coAllW, "Nothing");
setComboText(m_ui->coWin1, "Activate, raise and pass click");
setComboText(m_ui->coWin2, "Activate and pass click");
setComboText(m_ui->coWin3, "Activate and pass click");
setComboText(m_ui->coWinWheel, "Scroll");
setComboText(m_ui->coAllKey, "Alt");
setComboText(m_ui->coAll1, "Move");
setComboText(m_ui->coAll2, "Toggle raise and lower");
setComboText(m_ui->coAll3, "Resize");
setComboText(m_ui->coAllW, "Nothing");
}

View File

@ -28,6 +28,7 @@ class KConfig;
#include <KComboBox>
#include <klocale.h>
#include "ui_actions.h"
#include "ui_mouse.h"
class KWinMouseConfigForm : public QWidget, public Ui::KWinMouseConfigForm
@ -38,6 +39,14 @@ public:
explicit KWinMouseConfigForm(QWidget* parent);
};
class KWinActionsConfigForm : public QWidget, public Ui::KWinActionsConfigForm
{
Q_OBJECT
public:
explicit KWinActionsConfigForm(QWidget* parent);
};
class KTitleBarActionsConfig : public KCModule
{
Q_OBJECT
@ -103,20 +112,11 @@ public slots:
}
private:
KComboBox* coWin1;
KComboBox* coWin2;
KComboBox* coWin3;
KComboBox* coWinWheel;
KComboBox* coAllKey;
KComboBox* coAll1;
KComboBox* coAll2;
KComboBox* coAll3;
KComboBox* coAllW;
KConfig *config;
bool standAlone;
KWinActionsConfigForm *m_ui;
const char* functionWin(int);
const char* functionWinWheel(int);
const char* functionAllKey(int);