diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 04ff275277..70d363867f 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -27,7 +27,10 @@ #include #include #include + +#ifdef KWIN_BUILD_ACTIVITIES #include +#endif #include #include @@ -86,7 +89,9 @@ RulesWidget::RulesWidget(QWidget* parent) SETUP(size, set); SETUP(desktop, set); SETUP(screen, set); +#ifdef KWIN_BUILD_ACTIVITIES SETUP(activity, set); +#endif SETUP(maximizehoriz, set); SETUP(maximizevert, set); SETUP(minimize, set); @@ -126,6 +131,11 @@ RulesWidget::RulesWidget(QWidget* parent) edit_reg_title->hide(); edit_reg_machine->hide(); +#ifndef KWIN_BUILD_ACTIVITIES + rule_activity->hide(); + enable_activity->hide(); + activity->hide(); +#endif int i; for (i = 1; i <= KWindowSystem::numberOfDesktops(); @@ -133,6 +143,7 @@ RulesWidget::RulesWidget(QWidget* parent) desktop->addItem(QString::number(i).rightJustified(2) + ':' + KWindowSystem::desktopName(i)); desktop->addItem(i18n("All Desktops")); +#ifdef KWIN_BUILD_ACTIVITIES static KActivities::Consumer activities; foreach (const QString & activityId, activities.listActivities()) { activity->addItem(KActivities::Info::name(activityId), activityId); @@ -141,6 +152,7 @@ RulesWidget::RulesWidget(QWidget* parent) #define NULL_UUID "00000000-0000-0000-0000-000000000000" activity->addItem(i18n("All Activities"), QString::fromLatin1(NULL_UUID)); #undef NULL_UUID +#endif } #undef SETUP @@ -157,7 +169,9 @@ UPDATE_ENABLE_SLOT(position) UPDATE_ENABLE_SLOT(size) UPDATE_ENABLE_SLOT(desktop) UPDATE_ENABLE_SLOT(screen) +#ifdef KWIN_BUILD_ACTIVITIES UPDATE_ENABLE_SLOT(activity) +#endif UPDATE_ENABLE_SLOT(maximizehoriz) UPDATE_ENABLE_SLOT(maximizevert) UPDATE_ENABLE_SLOT(minimize) @@ -275,7 +289,7 @@ int RulesWidget::comboToDesktop(int val) const return NET::OnAllDesktops; return val + 1; } - +#ifdef KWIN_BUILD_ACTIVITIES int RulesWidget::activityToCombo(QString d) const { // TODO: ivan - do a multiselection list @@ -296,7 +310,7 @@ QString RulesWidget::comboToActivity(int val) const return activity->itemData(val).toString(); } - +#endif static int placementToCombo(Placement::Policy placement) { static const int conv[] = { @@ -431,7 +445,9 @@ void RulesWidget::setRules(Rules* rules) LINEEDIT_SET_RULE(size, sizeToStr); COMBOBOX_SET_RULE(desktop, desktopToCombo); SPINBOX_SET_RULE(screen, inc); +#ifdef KWIN_BUILD_ACTIVITIES COMBOBOX_SET_RULE(activity, activityToCombo); +#endif CHECKBOX_SET_RULE(maximizehoriz,); CHECKBOX_SET_RULE(maximizevert,); CHECKBOX_SET_RULE(minimize,); @@ -528,7 +544,9 @@ Rules* RulesWidget::rules() const LINEEDIT_SET_RULE(size, strToSize); COMBOBOX_SET_RULE(desktop, comboToDesktop); SPINBOX_SET_RULE(screen, dec); +#ifdef KWIN_BUILD_ACTIVITIES COMBOBOX_SET_RULE(activity, comboToActivity); +#endif CHECKBOX_SET_RULE(maximizehoriz,); CHECKBOX_SET_RULE(maximizevert,); CHECKBOX_SET_RULE(minimize,); diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index 4392ac93e1..7e875601db 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -20,6 +20,8 @@ #ifndef __RULESWIDGET_H__ #define __RULESWIDGET_H__ +#include + #include #include #include @@ -58,7 +60,9 @@ private slots: void updateEnablesize(); void updateEnabledesktop(); void updateEnablescreen(); +#ifdef KWIN_BUILD_ACTIVITIES void updateEnableactivity(); +#endif void updateEnablemaximizehoriz(); void updateEnablemaximizevert(); void updateEnableminimize(); @@ -94,8 +98,10 @@ private slots: private: int desktopToCombo(int d) const; int comboToDesktop(int val) const; +#ifdef KWIN_BUILD_ACTIVITIES int activityToCombo(QString d) const; QString comboToActivity(int val) const; +#endif int comboToTiling(int val) const; int inc(int i) const { return i+1; } int dec(int i) const { return i-1; }