Use dbus interface
svn path=/trunk/KDE/kdebase/workspace/; revision=615451
This commit is contained in:
parent
150699179d
commit
074f3342e0
12 changed files with 69 additions and 67 deletions
|
@ -1,8 +1,14 @@
|
|||
|
||||
set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml)
|
||||
|
||||
set(interface_file)
|
||||
|
||||
QT4_ADD_DBUS_INTERFACE( interface_file ${kwin_xml} kwin_interface )
|
||||
|
||||
|
||||
########### next target ###############
|
||||
set(kwin_update_window_settings_SRCS update_window_settings.cpp)
|
||||
set(kwin_update_window_settings_SRCS update_window_settings.cpp ${interface_file})
|
||||
|
||||
|
||||
kde4_automoc(${kwin_update_window_settings_SRCS})
|
||||
|
||||
|
@ -15,7 +21,7 @@ install(TARGETS kwin_update_window_settings DESTINATION ${LIB_INSTALL_DIR}/kconf
|
|||
|
||||
|
||||
########### next target ###############
|
||||
set(kwin_update_default_rules_SRCS update_default_rules.cpp)
|
||||
set(kwin_update_default_rules_SRCS update_default_rules.cpp ${interface_file})
|
||||
|
||||
kde4_automoc(${kwin_update_default_rules})
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include <kinstance.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include <kwin_interface.h>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
@ -54,6 +55,6 @@ int main( int argc, char* argv[] )
|
|||
#warning D-BUS TODO
|
||||
// kwin* , and an attach to dbus is missing as well
|
||||
#endif
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include <QByteArray>
|
||||
#include <QList>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
#include <kwin_interface.h>
|
||||
struct SessionInfo
|
||||
{
|
||||
QByteArray sessionId;
|
||||
|
@ -172,6 +172,6 @@ int main()
|
|||
#warning D-BUS TODO
|
||||
// kwin* , and an attach to dbus is missing as well
|
||||
#endif
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,11 @@ include_directories( ${CMAKE_SOURCE_DIR}/workspace/kwin/lib )
|
|||
|
||||
set(kcm_kwindecoration_PART_SRCS kwindecoration.cpp buttons.cpp preview.cpp )
|
||||
|
||||
set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml)
|
||||
|
||||
QT4_ADD_DBUS_INTERFACE( kcm_kwindecoration_PART_SRCS ${kwin_xml} kwin_interface )
|
||||
|
||||
|
||||
kde4_automoc(${kcm_kwindecoration_PART_SRCS})
|
||||
|
||||
|
||||
|
|
|
@ -62,8 +62,7 @@
|
|||
#include <kdecoration_plugins_p.h>
|
||||
#include <kdecorationfactory.h>
|
||||
#include <kvbox.h>
|
||||
#include "kwindecorationadaptor.h"
|
||||
#include <QtDBus/QtDBus>
|
||||
#include <kwin_interface.h>
|
||||
|
||||
// KCModule plugin interface
|
||||
// =========================
|
||||
|
@ -75,8 +74,6 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QStringList &)
|
|||
kwinConfig("kwinrc"),
|
||||
pluginObject(0)
|
||||
{
|
||||
new DecorationAdaptor(this);
|
||||
QDBusConnection::sessionBus().registerObject("/KWinClientDecoration", this);
|
||||
kwinConfig.setGroup("Style");
|
||||
plugins = new KDecorationPreviewPlugins( &kwinConfig );
|
||||
|
||||
|
@ -534,8 +531,8 @@ void KWinDecorationModule::save()
|
|||
emit pluginSave( &kwinConfig );
|
||||
|
||||
kwinConfig.sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,11 +5,14 @@
|
|||
|
||||
set(kcm_kwinoptions_PART_SRCS windows.cpp mouse.cpp main.cpp )
|
||||
|
||||
kde4_automoc(kcm_kwinoptions ${kcm_kwinoptions_PART_SRCS})
|
||||
set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml)
|
||||
|
||||
QT4_ADD_DBUS_INTERFACE( kcm_kwinoptions_PART_SRCS ${kwin_xml} kwin_interface )
|
||||
|
||||
kde4_automoc(${kcm_kwinoptions_PART_SRCS})
|
||||
|
||||
kde4_add_plugin(kcm_kwinoptions ${kcm_kwinoptions_PART_SRCS})
|
||||
|
||||
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kcm_kwinoptions )
|
||||
|
||||
target_link_libraries(kcm_kwinoptions ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${QT_QT3SUPPORT_LIBRARY})
|
||||
|
||||
|
@ -18,32 +21,9 @@ install(TARGETS kcm_kwinoptions DESTINATION ${PLUGIN_INSTALL_DIR} )
|
|||
|
||||
########### install files ###############
|
||||
|
||||
install( FILES kwinoptions.desktop DESTINATION ${XDG_APPS_DIR} )
|
||||
install( FILES kwinactions.desktop kwinadvanced.desktop kwinfocus.desktop kwinmoving.desktop kwintranslucency.desktop DESTINATION ${APPLNK_INSTALL_DIR}/.hidden )
|
||||
install( FILES kwinoptions.desktop kwinactions.desktop kwinadvanced.desktop
|
||||
kwinfocus.desktop kwinmoving.desktop kwintranslucency.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR})
|
||||
|
||||
kde4_install_icons( ${ICON_INSTALL_DIR} crystalsvg )
|
||||
kde4_install_icons( ${ICON_INSTALL_DIR} )
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#METASOURCES = AUTO
|
||||
#INCLUDES = $(all_includes)
|
||||
#
|
||||
#kde_module_LTLIBRARIES = kcm_kwinoptions.la
|
||||
#
|
||||
#kcm_kwinoptions_la_SOURCES = windows.cpp mouse.cpp main.cpp
|
||||
#kcm_kwinoptions_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined
|
||||
#kcm_kwinoptions_la_LIBADD = $(LIB_KDEUI)
|
||||
#
|
||||
#noinst_HEADERS = windows.h mouse.h
|
||||
#
|
||||
#messages:
|
||||
# $(XGETTEXT) *.cpp -o $(podir)/kcmkwm.pot
|
||||
#
|
||||
#kwin_kcmkwin_options_data_DATA = kwinactions.desktop kwinadvanced.desktop kwinfocus.desktop kwinmoving.desktop kwintranslucency.desktop
|
||||
#kwin_kcmkwin_options_datadir = $(kde_appsdir)/.hidden
|
||||
#
|
||||
#xdg_apps_DATA = kwinoptions.desktop
|
||||
#KDE_ICON=AUTO
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include "mouse.h"
|
||||
#include "windows.h"
|
||||
|
||||
#include "kwin_interface.h"
|
||||
#include "main.h"
|
||||
|
||||
static KInstance *_kcmkwm = 0;
|
||||
|
@ -184,8 +184,8 @@ void KWinOptions::save()
|
|||
#warning D-BUS TODO
|
||||
// All these calls in kcmkwin modules should be actually kwin*, because of multihead.
|
||||
#endif
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
|
||||
|
||||
|
@ -260,8 +260,8 @@ void KActionsOptions::save()
|
|||
emit KCModule::changed( false );
|
||||
// Send signal to kwin
|
||||
mConfig->sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
#include "mouse.h"
|
||||
#include "mouse.moc"
|
||||
|
||||
#include "kwin_interface.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -571,8 +571,8 @@ void KTitleBarActionsConfig::save()
|
|||
if (standAlone)
|
||||
{
|
||||
config->sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -847,8 +847,8 @@ void KWindowActionsConfig::save()
|
|||
if (standAlone)
|
||||
{
|
||||
config->sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <kmessagebox.h>
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <klocale.h>
|
||||
#include <kcolorbutton.h>
|
||||
#include <kconfig.h>
|
||||
|
@ -55,7 +56,7 @@
|
|||
#include <X11/Xutil.h>
|
||||
|
||||
#include "windows.h"
|
||||
|
||||
#include "kwin_interface.h"
|
||||
|
||||
// kwin config keywords
|
||||
#define KWIN_FOCUS "FocusPolicy"
|
||||
|
@ -496,8 +497,8 @@ void KFocusConfig::save( void )
|
|||
if (standAlone)
|
||||
{
|
||||
config->sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
emit KCModule::changed(false);
|
||||
}
|
||||
|
@ -688,7 +689,7 @@ void KAdvancedConfig::load( void )
|
|||
setShadeHover(config->readEntry(KWIN_SHADEHOVER, QVariant(false)).toBool());
|
||||
setShadeHoverInterval(config->readEntry(KWIN_SHADEHOVER_INTERVAL, 250));
|
||||
|
||||
setElectricBorders(config->readEntry(KWM_ELECTRIC_BORDER, false));
|
||||
setElectricBorders(config->readEntry(KWM_ELECTRIC_BORDER, 0));
|
||||
setElectricBorderDelay(config->readEntry(KWM_ELECTRIC_BORDER_DELAY, 150));
|
||||
|
||||
// setFocusStealing( config->readEntry(KWIN_FOCUS_STEALING, 2 ));
|
||||
|
@ -723,8 +724,8 @@ void KAdvancedConfig::save( void )
|
|||
if (standAlone)
|
||||
{
|
||||
config->sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
emit KCModule::changed(false);
|
||||
}
|
||||
|
@ -1187,8 +1188,8 @@ void KMovingConfig::save( void )
|
|||
if (standAlone)
|
||||
{
|
||||
config->sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
emit KCModule::changed(false);
|
||||
}
|
||||
|
@ -1254,6 +1255,8 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KI
|
|||
"And if your GPU provides hardware-accelerated Xrender support (mainly nVidia cards):<br><br>"
|
||||
"<i>Option \"RenderAccel\" \"true\"</i><br>"
|
||||
"In <i>Section \"Device\"</i></qt>"), this);
|
||||
label->setOpenExternalLinks(true);
|
||||
label->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
|
||||
lay->addWidget(label);
|
||||
}
|
||||
else
|
||||
|
@ -1474,8 +1477,10 @@ void KTranslucencyConfig::load( void )
|
|||
|
||||
if (!kompmgrAvailable_)
|
||||
return;
|
||||
config->setGroup( "Translucency" );
|
||||
config->setGroup( "Notification Messages" );
|
||||
useTranslucency->setChecked(config->readEntry("UseTranslucency", QVariant(false)).toBool());
|
||||
|
||||
config->setGroup( "Translucency" );
|
||||
activeWindowTransparency->setChecked(config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool());
|
||||
inactiveWindowTransparency->setChecked(config->readEntry("TranslucentInactiveWindows", QVariant(true)).toBool());
|
||||
movingWindowTransparency->setChecked(config->readEntry("TranslucentMovingWindows", QVariant(false)).toBool());
|
||||
|
@ -1535,8 +1540,10 @@ void KTranslucencyConfig::save( void )
|
|||
{
|
||||
if (!kompmgrAvailable_)
|
||||
return;
|
||||
config->setGroup( "Translucency" );
|
||||
config->setGroup( "Notification Messages" );
|
||||
config->writeEntry("UseTranslucency",useTranslucency->isChecked());
|
||||
|
||||
config->setGroup( "Translucency" );
|
||||
config->writeEntry("TranslucentActiveWindows",activeWindowTransparency->isChecked());
|
||||
config->writeEntry("TranslucentInactiveWindows",inactiveWindowTransparency->isChecked());
|
||||
config->writeEntry("TranslucentMovingWindows",movingWindowTransparency->isChecked());
|
||||
|
|
|
@ -4,6 +4,11 @@ ADD_DEFINITIONS(-DKCMRULES)
|
|||
########### next target ###############
|
||||
|
||||
set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp)
|
||||
|
||||
set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml)
|
||||
|
||||
QT4_ADD_DBUS_INTERFACE( kwinrules_SRCS ${kwin_xml} kwin_interface )
|
||||
|
||||
kde4_add_ui_files(kwinrules_SRCS ruleslistbase.ui detectwidgetbase.ui)
|
||||
kde4_add_ui3_files(kwinrules_SRCS ruleswidgetbase.ui editshortcutbase.ui )
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <QtDBus/QtDBus>
|
||||
|
||||
#include "ruleslist.h"
|
||||
#include "kwin_interface.h"
|
||||
|
||||
typedef KGenericFactory<KWinInternal::KCMRules> KCMRulesFactory;
|
||||
K_EXPORT_COMPONENT_FACTORY(kwinrules, KCMRulesFactory("kcmkwinrules"))
|
||||
|
@ -64,8 +65,8 @@ void KCMRules::save()
|
|||
emit KCModule::changed( false );
|
||||
// Send signal to kwin
|
||||
config.sync();
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
}
|
||||
|
||||
void KCMRules::defaults()
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <klocale.h>
|
||||
#include <kwin.h>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
#include <kwin_interface.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <fixx11h.h>
|
||||
|
||||
|
@ -257,8 +257,8 @@ static int edit( Window wid, bool whole_app )
|
|||
delete orig_rule;
|
||||
}
|
||||
saveRules( rules );
|
||||
QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" );
|
||||
kwin.call( "reconfigure" );
|
||||
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
|
||||
kwin.reconfigure();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue