Kconf update for converting the old tabbox settings to the new one.
Using C++ as the bash script didn't work. Nevertheless thanks to Jan Gerrit Marker for the half working script (would have worked if all entries were in the same config group). BUG: 211215 svn path=/trunk/KDE/kdebase/workspace/; revision=1063079
This commit is contained in:
parent
586f4e9010
commit
67f047e290
3 changed files with 66 additions and 1 deletions
|
@ -24,10 +24,19 @@ target_link_libraries( kwin_update_default_rules ${KDE4_KDECORE_LIBS} )
|
|||
|
||||
install(TARGETS kwin_update_default_rules DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin/ )
|
||||
|
||||
########### next target ###############
|
||||
set( kwin_update_tabbox_settings_SRCS update_tabbox_settings.cpp )
|
||||
|
||||
kde4_add_executable( kwin_update_tabbox_settings ${kwin_update_tabbox_settings_SRCS} )
|
||||
|
||||
target_link_libraries( kwin_update_tabbox_settings ${KDE4_KDECORE_LIBS} )
|
||||
|
||||
install( TARGETS kwin_update_tabbox_settings DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin/ )
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install( FILES fsp_workarounds_1.kwinrules DESTINATION ${DATA_INSTALL_DIR}/kwin/default_rules )
|
||||
install( FILES pop.wav DESTINATION ${SOUND_INSTALL_DIR} )
|
||||
install( FILES kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd kwin_on_off.upd kwin_window_shortcuts.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
|
||||
install( FILES kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd kwin_on_off.upd kwin_window_shortcuts.upd kwin_update_tabbox_settings.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
|
||||
install( PROGRAMS pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh on-off_to_true-false.sh kwin_window_shortcuts.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
|
||||
|
||||
|
|
2
data/kwin_update_tabbox_settings.upd
Normal file
2
data/kwin_update_tabbox_settings.upd
Normal file
|
@ -0,0 +1,2 @@
|
|||
Id=Kwin-Tabbox
|
||||
Script=kwin_update_tabbox_settings
|
54
data/update_tabbox_settings.cpp
Normal file
54
data/update_tabbox_settings.cpp
Normal file
|
@ -0,0 +1,54 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2005 Lubos Lunak <l.lunak@kde.org>
|
||||
Copyright (C) 2009 Martin Gräßlin <kde@martin-graesslin.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
// read additional window rules and add them to kwinrulesrc
|
||||
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kcomponentdata.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <kglobal.h>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
KAboutData about( "kwin_update_tabbox_settings", "kwin", KLocalizedString(), 0 );
|
||||
KCmdLineArgs::init( argc, argv, &about );
|
||||
KComponentData inst( &about );
|
||||
Q_UNUSED( KGlobal::locale() ); // jump-start locales to get to translated descriptions
|
||||
KConfig config( "kwinrc" );
|
||||
KConfigGroup windows(&config, "Windows");
|
||||
KConfigGroup tabbox(&config, "TabBox");
|
||||
const bool traverse = tabbox.readEntry<bool>("TraverseAll", false);
|
||||
const QString style = windows.readEntry<QString>("AltTabStyle", "KDE");
|
||||
if( !tabbox.hasKey("ListMode") )
|
||||
tabbox.writeEntry("ListMode", traverse?1:0);
|
||||
if( !tabbox.hasKey("ShowTabBox") )
|
||||
tabbox.writeEntry("ShowTabBox", (style.compare("KDE", Qt::CaseInsensitive) == 0)?true:false);
|
||||
tabbox.sync();
|
||||
config.sync();
|
||||
// Send signal to all kwin instances
|
||||
QDBusMessage message =
|
||||
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
|
||||
}
|
Loading…
Reference in a new issue