Remove BoxSwitch from list of Window Switcher effects

Replaced by a TabBox layout. The effect is still there as it
can be used for desktop switching (which is not yet ported to layouts)
and as a proxy effect for CoverSwitch.

The users who use BoxSwitch will be migrated to the new layout.
This commit is contained in:
Martin Gräßlin 2011-11-10 21:40:38 +01:00
parent 95430bc741
commit 972529cabd

View file

@ -101,13 +101,9 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
// TODO: way to recognize if a effect is not found // TODO: way to recognize if a effect is not found
KServiceTypeTrader* trader = KServiceTypeTrader::self(); KServiceTypeTrader* trader = KServiceTypeTrader::self();
KService::List services; KService::List services;
QString boxswitch;
QString presentwindows; QString presentwindows;
QString coverswitch; QString coverswitch;
QString flipswitch; QString flipswitch;
services = trader->query("KWin/Effect", "[X-KDE-PluginInfo-Name] == 'kwin4_effect_boxswitch'");
if (!services.isEmpty())
boxswitch = services.first()->name();
services = trader->query("KWin/Effect", "[X-KDE-PluginInfo-Name] == 'kwin4_effect_presentwindows'"); services = trader->query("KWin/Effect", "[X-KDE-PluginInfo-Name] == 'kwin4_effect_presentwindows'");
if (!services.isEmpty()) if (!services.isEmpty())
presentwindows = services.first()->name(); presentwindows = services.first()->name();
@ -118,14 +114,14 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
if (!services.isEmpty()) if (!services.isEmpty())
flipswitch = services.first()->name(); flipswitch = services.first()->name();
m_primaryTabBoxUi->effectCombo->addItem(i18n("No Effect")); m_primaryTabBoxUi->effectCombo->addItem(i18nc("ComboBox item for window switcher based on layouts instead of a desktop effect",
m_primaryTabBoxUi->effectCombo->addItem(boxswitch); "Layout based switcher"));
m_primaryTabBoxUi->effectCombo->addItem(presentwindows); m_primaryTabBoxUi->effectCombo->addItem(presentwindows);
m_primaryTabBoxUi->effectCombo->addItem(coverswitch); m_primaryTabBoxUi->effectCombo->addItem(coverswitch);
m_primaryTabBoxUi->effectCombo->addItem(flipswitch); m_primaryTabBoxUi->effectCombo->addItem(flipswitch);
m_alternativeTabBoxUi->effectCombo->addItem(i18n("No Effect")); m_alternativeTabBoxUi->effectCombo->addItem(i18nc("ComboBox item for window switcher based on layouts instead of a desktop effect",
m_alternativeTabBoxUi->effectCombo->addItem(boxswitch); "Layout based switcher"));
m_alternativeTabBoxUi->effectCombo->addItem(presentwindows); m_alternativeTabBoxUi->effectCombo->addItem(presentwindows);
m_alternativeTabBoxUi->effectCombo->addItem(coverswitch); m_alternativeTabBoxUi->effectCombo->addItem(coverswitch);
m_alternativeTabBoxUi->effectCombo->addItem(flipswitch); m_alternativeTabBoxUi->effectCombo->addItem(flipswitch);
@ -201,13 +197,6 @@ void KWinTabBoxConfig::load()
m_primaryTabBoxUi->effectCombo->setCurrentIndex(0); m_primaryTabBoxUi->effectCombo->setCurrentIndex(0);
m_alternativeTabBoxUi->effectCombo->setCurrentIndex(0); m_alternativeTabBoxUi->effectCombo->setCurrentIndex(0);
KConfigGroup effectconfig(m_config, "Plugins"); KConfigGroup effectconfig(m_config, "Plugins");
KConfigGroup boxswitchconfig(m_config, "Effect-BoxSwitch");
if (effectEnabled("boxswitch", effectconfig)) {
if (boxswitchconfig.readEntry("TabBox", true))
m_primaryTabBoxUi->effectCombo->setCurrentIndex(1);
if (boxswitchconfig.readEntry("TabBoxAlternative", false))
m_alternativeTabBoxUi->effectCombo->setCurrentIndex(1);
}
KConfigGroup presentwindowsconfig(m_config, "Effect-PresentWindows"); KConfigGroup presentwindowsconfig(m_config, "Effect-PresentWindows");
if (effectEnabled("presentwindows", effectconfig)) { if (effectEnabled("presentwindows", effectconfig)) {
if (presentwindowsconfig.readEntry("TabBox", false)) if (presentwindowsconfig.readEntry("TabBox", false))
@ -299,25 +288,20 @@ void KWinTabBoxConfig::save()
saveConfig(config, m_tabBoxAlternativeConfig); saveConfig(config, m_tabBoxAlternativeConfig);
// effects // effects
bool boxSwitch = false;
bool presentWindowSwitching = false; bool presentWindowSwitching = false;
bool coverSwitch = false; bool coverSwitch = false;
bool flipSwitch = false; bool flipSwitch = false;
bool boxSwitchAlternative = false;
bool presentWindowSwitchingAlternative = false; bool presentWindowSwitchingAlternative = false;
bool coverSwitchAlternative = false; bool coverSwitchAlternative = false;
bool flipSwitchAlternative = false; bool flipSwitchAlternative = false;
switch(m_primaryTabBoxUi->effectCombo->currentIndex()) { switch(m_primaryTabBoxUi->effectCombo->currentIndex()) {
case 1: case 1:
boxSwitch = true;
break;
case 2:
presentWindowSwitching = true; presentWindowSwitching = true;
break; break;
case 3: case 2:
coverSwitch = true; coverSwitch = true;
break; break;
case 4: case 3:
flipSwitch = true; flipSwitch = true;
break; break;
default: default:
@ -325,15 +309,12 @@ void KWinTabBoxConfig::save()
} }
switch(m_alternativeTabBoxUi->effectCombo->currentIndex()) { switch(m_alternativeTabBoxUi->effectCombo->currentIndex()) {
case 1: case 1:
boxSwitchAlternative = true;
break;
case 2:
presentWindowSwitchingAlternative = true; presentWindowSwitchingAlternative = true;
break; break;
case 3: case 2:
coverSwitchAlternative = true; coverSwitchAlternative = true;
break; break;
case 4: case 3:
flipSwitchAlternative = true; flipSwitchAlternative = true;
break; break;
default: default:
@ -341,8 +322,6 @@ void KWinTabBoxConfig::save()
} }
// activate effects if not active // activate effects if not active
KConfigGroup effectconfig(m_config, "Plugins"); KConfigGroup effectconfig(m_config, "Plugins");
if (boxSwitch || boxSwitchAlternative)
effectconfig.writeEntry("kwin4_effect_boxswitchEnabled", true);
if (presentWindowSwitching || presentWindowSwitchingAlternative) if (presentWindowSwitching || presentWindowSwitchingAlternative)
effectconfig.writeEntry("kwin4_effect_presentwindowsEnabled", true); effectconfig.writeEntry("kwin4_effect_presentwindowsEnabled", true);
if (coverSwitch || coverSwitchAlternative) if (coverSwitch || coverSwitchAlternative)
@ -350,10 +329,6 @@ void KWinTabBoxConfig::save()
if (flipSwitch || flipSwitchAlternative) if (flipSwitch || flipSwitchAlternative)
effectconfig.writeEntry("kwin4_effect_flipswitchEnabled", true); effectconfig.writeEntry("kwin4_effect_flipswitchEnabled", true);
effectconfig.sync(); effectconfig.sync();
KConfigGroup boxswitchconfig(m_config, "Effect-BoxSwitch");
boxswitchconfig.writeEntry("TabBox", boxSwitch);
boxswitchconfig.writeEntry("TabBoxAlternative", boxSwitchAlternative);
boxswitchconfig.sync();
KConfigGroup presentwindowsconfig(m_config, "Effect-PresentWindows"); KConfigGroup presentwindowsconfig(m_config, "Effect-PresentWindows");
presentwindowsconfig.writeEntry("TabBox", presentWindowSwitching); presentwindowsconfig.writeEntry("TabBox", presentWindowSwitching);
presentwindowsconfig.writeEntry("TabBoxAlternative", presentWindowSwitchingAlternative); presentwindowsconfig.writeEntry("TabBoxAlternative", presentWindowSwitchingAlternative);
@ -480,15 +455,12 @@ void KWinTabBoxConfig::aboutEffectClicked(KWinTabBoxConfigForm* ui)
QString effect; QString effect;
switch(ui->effectCombo->currentIndex()) { switch(ui->effectCombo->currentIndex()) {
case 1: case 1:
effect = "boxswitch";
break;
case 2:
effect = "presentwindows"; effect = "presentwindows";
break; break;
case 3: case 2:
effect = "coverswitch"; effect = "coverswitch";
break; break;
case 4: case 3:
effect = "flipswitch"; effect = "flipswitch";
break; break;
default: default:
@ -541,15 +513,12 @@ void KWinTabBoxConfig::configureEffectClicked(KWinTabBoxConfigForm* ui)
QString effect; QString effect;
switch(ui->effectCombo->currentIndex()) { switch(ui->effectCombo->currentIndex()) {
case 1: case 1:
effect = "boxswitch_config";
break;
case 2:
effect = "presentwindows_config"; effect = "presentwindows_config";
break; break;
case 3: case 2:
effect = "coverswitch_config"; effect = "coverswitch_config";
break; break;
case 4: case 3:
effect = "flipswitch_config"; effect = "flipswitch_config";
break; break;
default: default: