Commit 07bffe88 authored by David Faure's avatar David Faure
Browse files

remove dependency on kdesktop's dbus interface

rename file

svn path=/trunk/KDE/kdebase/apps/; revision=680486
parent f5a99df3
......@@ -5,23 +5,23 @@ include_directories( ${CMAKE_SOURCE_DIR}/libkonq )
set(kcm_konq_PART_SRCS
behaviour.cpp
rootopts.cpp
globalpaths.cpp
fontopts.cpp
previews.cpp
browser.cpp
konqkcmfactory.cpp
desktopbehavior_impl.cpp
#desktopbehavior_impl.cpp
kcustommenueditor.cpp)
if(Q_WS_X11)
set(kcm_konq_PART_SRCS desktop.cpp ${kcm_konq_PART_SRCS})
set(kdesktop_xml ${KDEBASE_WORKSPACE_SOURCE_DIR}/kdesktop/org.kde.kdesktop.Desktop.xml)
QT4_ADD_DBUS_INTERFACE( kcm_konq_PART_SRCS ${kdesktop_xml} kdesktop_interface )
endif(Q_WS_X11)
#if(Q_WS_X11)
#set(kcm_konq_PART_SRCS desktop.cpp ${kcm_konq_PART_SRCS})
#set(kdesktop_xml ${KDEBASE_WORKSPACE_SOURCE_DIR}/kdesktop/org.kde.kdesktop.Desktop.xml)
#QT4_ADD_DBUS_INTERFACE( kcm_konq_PART_SRCS ${kdesktop_xml} kdesktop_interface )
#endif(Q_WS_X11)
#kde4_add_ui_files(kcm_konq_PART_SRCS desktopbehavior.ui )
kde4_automoc(${kcm_konq_PART_SRCS})
kde4_add_ui_files(kcm_konq_PART_SRCS desktopbehavior.ui )
kde4_add_plugin(kcm_konq ${kcm_konq_PART_SRCS})
......@@ -33,12 +33,17 @@ install(TARGETS kcm_konq DESTINATION ${PLUGIN_INSTALL_DIR} )
########### install files ###############
if(Q_WS_X11)
install( FILES desktop.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
endif(Q_WS_X11)
install( FILES desktopbehavior.desktop desktoppath.desktop
filebehavior.desktop fileappearance.desktop filepreviews.desktop
filebrowser.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
#if(Q_WS_X11)
#install( FILES desktop.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
#endif(Q_WS_X11)
install( FILES
#desktopbehavior.desktop
desktoppath.desktop
filebehavior.desktop
fileappearance.desktop
filepreviews.desktop
filebrowser.desktop
DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES overlapping.png onlyone.png DESTINATION ${DATA_INSTALL_DIR}/kcontrol/pics )
......@@ -46,7 +46,9 @@
#include <netwm.h>
#if 0
#include "kdesktop_interface.h"
#endif
typedef KonqKcmFactory<KDesktopConfig> KDesktopConfigFactory;
K_EXPORT_COMPONENT_FACTORY(ddesktop, KDesktopConfigFactory)
......@@ -118,10 +120,12 @@ KDesktopConfig::KDesktopConfig(QWidget *parent, const QStringList &)
layout->addWidget(name_group);
#if 0
_wheelOption = new QCheckBox(i18n("Mouse wheel over desktop background switches desktop"), this);
connect(_wheelOption,SIGNAL(toggled(bool)), SLOT( changed() ));
layout->addWidget(_wheelOption);
#endif
layout->addStretch(1);
// Begin check for immutable
......@@ -176,6 +180,7 @@ void KDesktopConfig::load()
_nameInput[i-1]->setEnabled(i <= n);
emit changed(false);
#if 0
KSharedConfig::Ptr desktopConfig = KSharedConfig::openConfig("kdesktoprc", KConfig::NoGlobals);
desktopConfig->setGroup("Mouse Buttons");
_wheelOption->setChecked(desktopConfig->readEntry("WheelSwitchesWorkspace", false));
......@@ -184,6 +189,7 @@ void KDesktopConfig::load()
if (_wheelOptionImmutable || n<2)
_wheelOption->setEnabled(false);
#endif
#else
_numInput->setValue(1);
#endif
......@@ -205,6 +211,7 @@ void KDesktopConfig::save()
XSync(QX11Info::display(), false);
#if 0
KSharedConfig::Ptr desktopConfig = KSharedConfig::openConfig("kdesktoprc");
desktopConfig->setGroup("Mouse Buttons");
desktopConfig->writeEntry("WheelSwitchesWorkspace", _wheelOption->isChecked());
......@@ -222,6 +229,7 @@ void KDesktopConfig::save()
org::kde::kdesktop::Desktop desktop(appname, "/Desktop", QDBusConnection::sessionBus());
desktop.configure();
#endif
emit changed(false);
#endif
......@@ -238,9 +246,11 @@ void KDesktopConfig::defaults()
for(int i = 0; i < maxDesktops; i++)
_nameInput[i]->setEnabled(i < n);
#if 0
_wheelOption->setChecked(false);
if (!_wheelOptionImmutable)
_wheelOption->setEnabled(true);
#endif
emit changed(false);
}
......@@ -253,8 +263,10 @@ void KDesktopConfig::slotValueChanged(int n)
if(i<n && _nameInput[i]->text().isEmpty())
_nameInput[i]->setText(i18n("Desktop %1", i+1));
}
#if 0
if (!_wheelOptionImmutable)
_wheelOption->setEnabled(n>1);
#endif
emit changed(true);
}
......
......@@ -20,8 +20,6 @@
#define __desktop_h__
#include <kcmodule.h>
//Added by qt3to4:
#include <QtGui/QLabel>
class QLabel;
class QCheckBox;
......@@ -35,23 +33,25 @@ static const int maxDesktops = 20;
class KDesktopConfig : public KCModule
{
Q_OBJECT
public:
KDesktopConfig(QWidget *parent, const QStringList &args);
void load();
void save();
void defaults();
protected Q_SLOTS:
void slotValueChanged(int);
private:
KIntNumInput *_numInput;
QLabel *_nameLabel[maxDesktops];
KLineEdit *_nameInput[maxDesktops];
#if 0
QCheckBox *_wheelOption;
bool _wheelOptionImmutable;
#endif
};
#endif
......@@ -45,9 +45,9 @@
// Local
#include "konqkcmfactory.h"
#ifdef Q_WS_X11
#include "kdesktop_interface.h"
#endif
//#ifdef Q_WS_X11
//include "kdesktop_interface.h"
//endif
class KonqFontOptionsDesktop : public KonqFontOptions
{
......@@ -381,6 +381,7 @@ void KonqFontOptions::save()
QDBusMessage message =
QDBusMessage::createSignal("/KonqMain", "org.kde.Konqueror.Main", "reparseConfiguration");
QDBusConnection::sessionBus().send(message);
#if 0 // replace with DBUS signal
#ifdef Q_WS_X11
// Tell kdesktop about the new config file
int konq_screen_number = KApplication::desktop()->primaryScreen();
......@@ -392,6 +393,7 @@ void KonqFontOptions::save()
org::kde::kdesktop::Desktop desktop(appname, "/Desktop", QDBusConnection::sessionBus());
desktop.configure();
#endif
#endif
}
void KonqFontOptions::slotTextBackgroundClicked()
......
......@@ -14,7 +14,7 @@
// Own
#include "rootopts.h"
#include "globalpaths.h"
// Qt
#include <QtGui/QCheckBox>
......@@ -45,9 +45,6 @@
#include <kurlrequester.h>
#include "konqkcmfactory.h"
#ifdef Q_WS_X11
#include "kdesktop_interface.h"
#endif
// Local
#include <config-apps.h>
......@@ -255,7 +252,9 @@ void DesktopPathConfig::save()
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
}
// TODO connect the apps to the settingsChanged() signal from KGlobalSettings instead
// Tell kdesktop about the new config file
#if 0
#ifdef Q_WS_X11
int konq_screen_number = KApplication::desktop()->primaryScreen();
QByteArray appname;
......@@ -266,6 +265,7 @@ void DesktopPathConfig::save()
org::kde::kdesktop::Desktop desktop(appname, "/Desktop", QDBusConnection::sessionBus());
desktop.configure();
#endif
#endif
}
bool DesktopPathConfig::moveDir( const KUrl & src, const KUrl & dest, const QString & type )
......@@ -296,6 +296,7 @@ bool DesktopPathConfig::moveDir( const KUrl & src, const KUrl & dest, const QStr
else
{
KIO::Job * job = KIO::move( src, dest );
job->ui()->setWindow(this);
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
// wait for job
qApp->enter_loop();
......@@ -324,6 +325,7 @@ void DesktopPathConfig::slotEntries( KIO::Job * job, const KIO::UDSEntryList& li
}
KIO::Job * moveJob = KIO::move( file.url(), m_copyToDest );
moveJob->ui()->setWindow(this);
connect( moveJob, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->enter_loop();
}
......@@ -339,10 +341,9 @@ void DesktopPathConfig::slotResult( KJob * job )
// If the source doesn't exist, no wonder we couldn't move the dir.
// In that case, trust the user and set the new setting in any case.
static_cast<KIO::Job*>(job)->ui()->setWindow(this);
static_cast<KIO::Job*>(job)->ui()->showErrorMessage();
}
qApp->exit_loop();
}
#include "rootopts.moc"
#include "globalpaths.moc"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment