mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
generic: adjust to KGlobalSettings changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7e561880f1
commit
186a7702e8
21 changed files with 70 additions and 58 deletions
|
@ -80,7 +80,7 @@ void NavigationSettingsPage::applySettings()
|
||||||
KConfigGroup group = config.group("KDE");
|
KConfigGroup group = config.group("KDE");
|
||||||
group.writeEntry("SingleClick", m_singleClick->isChecked(), KConfig::Persistent|KConfig::Global);
|
group.writeEntry("SingleClick", m_singleClick->isChecked(), KConfig::Persistent|KConfig::Global);
|
||||||
config.sync();
|
config.sync();
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::MouseChanged);
|
||||||
|
|
||||||
GeneralSettings* settings = GeneralSettings::self();
|
GeneralSettings* settings = GeneralSettings::self();
|
||||||
settings->setAutoExpandFolders(m_autoExpandFolders->isChecked());
|
settings->setAutoExpandFolders(m_autoExpandFolders->isChecked());
|
||||||
|
|
|
@ -554,7 +554,7 @@ void KItemListControllerTest::testMouseClickActivation()
|
||||||
// Default setting: single click activation.
|
// Default setting: single click activation.
|
||||||
group.writeEntry("SingleClick", true, KConfig::Persistent|KConfig::Global);
|
group.writeEntry("SingleClick", true, KConfig::Persistent|KConfig::Global);
|
||||||
config.sync();
|
config.sync();
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::MouseChanged);
|
||||||
|
|
||||||
int iterations = 0;
|
int iterations = 0;
|
||||||
const int maxIterations = 20;
|
const int maxIterations = 20;
|
||||||
|
@ -576,7 +576,7 @@ void KItemListControllerTest::testMouseClickActivation()
|
||||||
// Set the global setting to "double click activation".
|
// Set the global setting to "double click activation".
|
||||||
group.writeEntry("SingleClick", false, KConfig::Persistent|KConfig::Global);
|
group.writeEntry("SingleClick", false, KConfig::Persistent|KConfig::Global);
|
||||||
config.sync();
|
config.sync();
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::MouseChanged);
|
||||||
|
|
||||||
iterations = 0;
|
iterations = 0;
|
||||||
while (KGlobalSettings::singleClick() && iterations < maxIterations) {
|
while (KGlobalSettings::singleClick() && iterations < maxIterations) {
|
||||||
|
@ -611,7 +611,7 @@ void KItemListControllerTest::testMouseClickActivation()
|
||||||
// Set the global setting back to "single click activation".
|
// Set the global setting back to "single click activation".
|
||||||
group.writeEntry("SingleClick", true, KConfig::Persistent|KConfig::Global);
|
group.writeEntry("SingleClick", true, KConfig::Persistent|KConfig::Global);
|
||||||
config.sync();
|
config.sync();
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::MouseChanged);
|
||||||
|
|
||||||
iterations = 0;
|
iterations = 0;
|
||||||
while (!KGlobalSettings::singleClick() && iterations < maxIterations) {
|
while (!KGlobalSettings::singleClick() && iterations < maxIterations) {
|
||||||
|
@ -640,7 +640,7 @@ void KItemListControllerTest::testMouseClickActivation()
|
||||||
m_controller->setSingleClickActivationEnforced(true);
|
m_controller->setSingleClickActivationEnforced(true);
|
||||||
group.writeEntry("SingleClick", restoreKGlobalSettingsSingleClick, KConfig::Persistent|KConfig::Global);
|
group.writeEntry("SingleClick", restoreKGlobalSettingsSingleClick, KConfig::Persistent|KConfig::Global);
|
||||||
config.sync();
|
config.sync();
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::MouseChanged);
|
||||||
|
|
||||||
iterations = 0;
|
iterations = 0;
|
||||||
while (KGlobalSettings::singleClick() != restoreKGlobalSettingsSingleClick && iterations < maxIterations) {
|
while (KGlobalSettings::singleClick() != restoreKGlobalSettingsSingleClick && iterations < maxIterations) {
|
||||||
|
|
|
@ -230,7 +230,7 @@ void DesktopPathConfig::save()
|
||||||
|
|
||||||
if (pathChanged) {
|
if (pathChanged) {
|
||||||
kDebug() << "sending message SettingsChanged";
|
kDebug() << "sending message SettingsChanged";
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::PathsChanged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -809,7 +809,7 @@ void MouseSettings::save(KConfig *config)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
config->sync();
|
config->sync();
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::MouseChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseConfig::slotScrollPolarityChanged()
|
void MouseConfig::slotScrollPolarityChanged()
|
||||||
|
|
|
@ -264,7 +264,7 @@ bool ThemePage::applyTheme(const CursorTheme *theme, const int size)
|
||||||
runRdb();
|
runRdb();
|
||||||
|
|
||||||
// Notify all applications that the cursor theme has changed
|
// Notify all applications that the cursor theme has changed
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::CursorChanged);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::MouseChanged);
|
||||||
|
|
||||||
// Reload the standard cursors
|
// Reload the standard cursors
|
||||||
QStringList names;
|
QStringList names;
|
||||||
|
|
|
@ -126,7 +126,7 @@ void KCMKeyboardWidget::save()
|
||||||
actionCollection->setLayoutShortcuts(keyboardConfig->layouts, rules);
|
actionCollection->setLayoutShortcuts(keyboardConfig->layouts, rules);
|
||||||
|
|
||||||
//TODO: skip if no change in shortcuts?
|
//TODO: skip if no change in shortcuts?
|
||||||
KGlobalSettings::emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_SHORTCUTS);
|
KGlobalSettings::emitChange(KGlobalSettings::ShortcutsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KCMKeyboardWidget::updateUI()
|
void KCMKeyboardWidget::updateUI()
|
||||||
|
|
|
@ -137,7 +137,7 @@ void KeyboardDaemon::registerShortcut()
|
||||||
actionCollection->loadLayoutShortcuts(keyboardConfig.layouts, rules);
|
actionCollection->loadLayoutShortcuts(keyboardConfig.layouts, rules);
|
||||||
connect(actionCollection, SIGNAL(actionTriggered(QAction*)), this, SLOT(setLayout(QAction*)));
|
connect(actionCollection, SIGNAL(actionTriggered(QAction*)), this, SLOT(setLayout(QAction*)));
|
||||||
|
|
||||||
connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), this, SLOT(globalSettingsChanged(int)));
|
connect(KGlobalSettings::self(), SIGNAL(shortcutsChanged()), this, SLOT(globalShortcutsChanged()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ void KeyboardDaemon::unregisterShortcut()
|
||||||
{
|
{
|
||||||
// register KDE keyboard shortcut for switching layouts
|
// register KDE keyboard shortcut for switching layouts
|
||||||
if( actionCollection != NULL ) {
|
if( actionCollection != NULL ) {
|
||||||
disconnect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), this, SLOT(globalSettingsChanged(int)));
|
disconnect(KGlobalSettings::self(), SIGNAL(shortcutsChanged()), this, SLOT(globalShortcutsChanged()));
|
||||||
|
|
||||||
disconnect(actionCollection, SIGNAL(actionTriggered(QAction*)), this, SLOT(setLayout(QAction*)));
|
disconnect(actionCollection, SIGNAL(actionTriggered(QAction*)), this, SLOT(setLayout(QAction*)));
|
||||||
disconnect(actionCollection->getToggeAction(), SIGNAL(triggered()), this, SLOT(switchToNextLayout()));
|
disconnect(actionCollection->getToggeAction(), SIGNAL(triggered()), this, SLOT(switchToNextLayout()));
|
||||||
|
@ -178,13 +178,11 @@ void KeyboardDaemon::unregisterListeners()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardDaemon::globalSettingsChanged(int category)
|
void KeyboardDaemon::globalShortcutsChanged()
|
||||||
{
|
{
|
||||||
if ( category == KGlobalSettings::SETTINGS_SHORTCUTS) {
|
|
||||||
//TODO: optimize this? seems like we'll get configReload and globalShortcuts from kcm so we'll reconfigure twice
|
//TODO: optimize this? seems like we'll get configReload and globalShortcuts from kcm so we'll reconfigure twice
|
||||||
unregisterShortcut();
|
unregisterShortcut();
|
||||||
registerShortcut();
|
registerShortcut();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardDaemon::layoutChanged()
|
void KeyboardDaemon::layoutChanged()
|
||||||
|
|
|
@ -57,7 +57,7 @@ class KDE_EXPORT KeyboardDaemon : public KDEDModule
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void switchToNextLayout();
|
void switchToNextLayout();
|
||||||
void globalSettingsChanged(int category);
|
void globalShortcutsChanged();
|
||||||
void configureKeyboard();
|
void configureKeyboard();
|
||||||
void configureMouse();
|
void configureMouse();
|
||||||
void layoutChanged();
|
void layoutChanged();
|
||||||
|
|
|
@ -428,7 +428,7 @@ void KCMLocale::save()
|
||||||
);
|
);
|
||||||
|
|
||||||
KBuildSycocaProgressDialog::rebuildKSycoca(this);
|
KBuildSycocaProgressDialog::rebuildKSycoca(this);
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_LOCALE);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::LocaleChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KCMLocale::defaults()
|
void KCMLocale::defaults()
|
||||||
|
|
|
@ -128,7 +128,7 @@ KCMStyle::KCMStyle( QWidget* parent, const QVariantList& )
|
||||||
"and effects."));
|
"and effects."));
|
||||||
|
|
||||||
m_bStyleDirty= false;
|
m_bStyleDirty= false;
|
||||||
m_bEffectsDirty = false;
|
m_bToolbarDirty = false;
|
||||||
|
|
||||||
|
|
||||||
KGlobal::dirs()->addResourceType("themes", "data", "kstyle/themes");
|
KGlobal::dirs()->addResourceType("themes", "data", "kstyle/themes");
|
||||||
|
@ -211,11 +211,11 @@ KCMStyle::KCMStyle( QWidget* parent, const QVariantList& )
|
||||||
fineTuningUi.comboGraphicEffectsLevel->addItem(i18n("High display resolution and High CPU"), static_cast<int>(KGlobalSettings::SimpleAnimationEffects | KGlobalSettings::ComplexAnimationEffects));
|
fineTuningUi.comboGraphicEffectsLevel->addItem(i18n("High display resolution and High CPU"), static_cast<int>(KGlobalSettings::SimpleAnimationEffects | KGlobalSettings::ComplexAnimationEffects));
|
||||||
|
|
||||||
connect(cbStyle, SIGNAL(activated(int)), this, SLOT(setStyleDirty()));
|
connect(cbStyle, SIGNAL(activated(int)), this, SLOT(setStyleDirty()));
|
||||||
connect(fineTuningUi.cbIconsOnButtons, SIGNAL(toggled(bool)), this, SLOT(setEffectsDirty()));
|
connect(fineTuningUi.cbIconsOnButtons, SIGNAL(toggled(bool)), this, SLOT(setToolbarDirty()));
|
||||||
connect(fineTuningUi.cbIconsInMenus, SIGNAL(toggled(bool)), this, SLOT(setEffectsDirty()));
|
connect(fineTuningUi.cbIconsInMenus, SIGNAL(toggled(bool)), this, SLOT(setToolbarDirty()));
|
||||||
connect(fineTuningUi.comboGraphicEffectsLevel, SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
|
connect(fineTuningUi.comboGraphicEffectsLevel, SIGNAL(activated(int)), this, SLOT(setStyleDirty()));
|
||||||
connect(fineTuningUi.comboToolbarIcons, SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
|
connect(fineTuningUi.comboToolbarIcons, SIGNAL(activated(int)), this, SLOT(setToolbarDirty()));
|
||||||
connect(fineTuningUi.comboSecondaryToolbarIcons, SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
|
connect(fineTuningUi.comboSecondaryToolbarIcons, SIGNAL(activated(int)), this, SLOT(setToolbarDirty()));
|
||||||
|
|
||||||
// Page1
|
// Page1
|
||||||
cbStyle->setWhatsThis( i18n("Here you can choose from a list of"
|
cbStyle->setWhatsThis( i18n("Here you can choose from a list of"
|
||||||
|
@ -341,7 +341,7 @@ void KCMStyle::load()
|
||||||
loadEffects( config );
|
loadEffects( config );
|
||||||
|
|
||||||
m_bStyleDirty= false;
|
m_bStyleDirty= false;
|
||||||
m_bEffectsDirty = false;
|
m_bToolbarDirty = false;
|
||||||
//Enable/disable the button for the initial style
|
//Enable/disable the button for the initial style
|
||||||
updateConfigButton();
|
updateConfigButton();
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ void KCMStyle::load()
|
||||||
void KCMStyle::save()
|
void KCMStyle::save()
|
||||||
{
|
{
|
||||||
// Don't do anything if we don't need to.
|
// Don't do anything if we don't need to.
|
||||||
if ( !(m_bStyleDirty | m_bEffectsDirty ) )
|
if ( !(m_bStyleDirty | m_bToolbarDirty ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const bool showMenuIcons = !QApplication::testAttribute(Qt::AA_DontShowIconsInMenus);
|
const bool showMenuIcons = !QApplication::testAttribute(Qt::AA_DontShowIconsInMenus);
|
||||||
|
@ -384,11 +384,10 @@ void KCMStyle::save()
|
||||||
_config.sync();
|
_config.sync();
|
||||||
|
|
||||||
// Now allow KDE apps to reconfigure themselves.
|
// Now allow KDE apps to reconfigure themselves.
|
||||||
if ( m_bStyleDirty )
|
if ( m_bStyleDirty)
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::StyleChanged);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::StyleChanged);
|
||||||
|
|
||||||
if ( m_bEffectsDirty ) {
|
if ( m_bToolbarDirty ) {
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_STYLE);
|
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::ToolbarStyleChanged);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::ToolbarStyleChanged);
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
|
@ -402,14 +401,14 @@ void KCMStyle::save()
|
||||||
// Export the changes we made to qtrc, and update all qt-only
|
// Export the changes we made to qtrc, and update all qt-only
|
||||||
// applications on the fly, ensuring that we still follow the user's
|
// applications on the fly, ensuring that we still follow the user's
|
||||||
// export fonts/colors settings.
|
// export fonts/colors settings.
|
||||||
if (m_bStyleDirty | m_bEffectsDirty) // Export only if necessary
|
if (m_bStyleDirty | m_bToolbarDirty) // Export only if necessary
|
||||||
{
|
{
|
||||||
runRdb();
|
runRdb();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
m_bStyleDirty = false;
|
m_bStyleDirty = false;
|
||||||
m_bEffectsDirty = false;
|
m_bToolbarDirty = false;
|
||||||
emit changed( false );
|
emit changed( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,9 +463,9 @@ void KCMStyle::defaults()
|
||||||
emit changed(true);
|
emit changed(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KCMStyle::setEffectsDirty()
|
void KCMStyle::setToolbarDirty()
|
||||||
{
|
{
|
||||||
m_bEffectsDirty = true;
|
m_bToolbarDirty = true;
|
||||||
emit changed(true);
|
emit changed(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,7 +687,7 @@ void KCMStyle::loadEffects( KConfig& config )
|
||||||
KConfigGroup graphicConfigGroup = config.group("KDE-Global GUI Settings");
|
KConfigGroup graphicConfigGroup = config.group("KDE-Global GUI Settings");
|
||||||
fineTuningUi.comboGraphicEffectsLevel->setCurrentIndex(fineTuningUi.comboGraphicEffectsLevel->findData(graphicConfigGroup.readEntry("GraphicEffectsLevel", ((int) KGlobalSettings::graphicEffectsLevel()))));
|
fineTuningUi.comboGraphicEffectsLevel->setCurrentIndex(fineTuningUi.comboGraphicEffectsLevel->findData(graphicConfigGroup.readEntry("GraphicEffectsLevel", ((int) KGlobalSettings::graphicEffectsLevel()))));
|
||||||
|
|
||||||
m_bEffectsDirty = false;
|
m_bToolbarDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_kcmstyle.cpp"
|
#include "moc_kcmstyle.cpp"
|
||||||
|
|
|
@ -80,7 +80,7 @@ protected Q_SLOTS:
|
||||||
void updateConfigButton();
|
void updateConfigButton();
|
||||||
|
|
||||||
void setStyleDirty();
|
void setStyleDirty();
|
||||||
void setEffectsDirty();
|
void setToolbarDirty();
|
||||||
|
|
||||||
void styleChanged();
|
void styleChanged();
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ private:
|
||||||
static QString toolbarButtonText(int index);
|
static QString toolbarButtonText(int index);
|
||||||
static int toolbarButtonIndex(const QString &text);
|
static int toolbarButtonIndex(const QString &text);
|
||||||
|
|
||||||
bool m_bStyleDirty, m_bEffectsDirty;
|
bool m_bStyleDirty, m_bToolbarDirty;
|
||||||
QHash <QString,StyleEntry*> styleEntries;
|
QHash <QString,StyleEntry*> styleEntries;
|
||||||
QMap <QString,QString> nameToStyleKey;
|
QMap <QString,QString> nameToStyleKey;
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ void Workspace::init()
|
||||||
connect(&updateToolWindowsTimer, SIGNAL(timeout()), this, SLOT(slotUpdateToolWindows()));
|
connect(&updateToolWindowsTimer, SIGNAL(timeout()), this, SLOT(slotUpdateToolWindows()));
|
||||||
|
|
||||||
connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), this, SLOT(reconfigure()));
|
connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), this, SLOT(reconfigure()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), this, SLOT(slotSettingsChanged(int)));
|
connect(KGlobalSettings::self(), SIGNAL(shortcutsChanged()), this, SLOT(slotShortcutsChanged()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(blockShortcuts(int)), this, SLOT(slotBlockShortcuts(int)));
|
connect(KGlobalSettings::self(), SIGNAL(blockShortcuts(int)), this, SLOT(slotBlockShortcuts(int)));
|
||||||
|
|
||||||
active_client = NULL;
|
active_client = NULL;
|
||||||
|
@ -735,11 +735,10 @@ bool Workspace::waitForCompositingSetup()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::slotSettingsChanged(int category)
|
void Workspace::slotShortcutsChanged()
|
||||||
{
|
{
|
||||||
kDebug(1212) << "Workspace::slotSettingsChanged()";
|
kDebug(1212) << "Workspace::slotShortcutsChanged()";
|
||||||
if (category == KGlobalSettings::SETTINGS_SHORTCUTS)
|
m_userActionsMenu->discard();
|
||||||
m_userActionsMenu->discard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -357,7 +357,7 @@ public slots:
|
||||||
void slotWindowToDesktopUp();
|
void slotWindowToDesktopUp();
|
||||||
void slotWindowToDesktopDown();
|
void slotWindowToDesktopDown();
|
||||||
|
|
||||||
void slotSettingsChanged(int category);
|
void slotShortcutsChanged();
|
||||||
|
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void slotReconfigure();
|
void slotReconfigure();
|
||||||
|
|
|
@ -729,7 +729,7 @@ KonqOperations *KonqOperations::rename( QWidget * parent, const KUrl & oldurl, c
|
||||||
KConfig xdgUserConf( userDirsFile, KConfig::SimpleConfig );
|
KConfig xdgUserConf( userDirsFile, KConfig::SimpleConfig );
|
||||||
KConfigGroup g( &xdgUserConf, "" );
|
KConfigGroup g( &xdgUserConf, "" );
|
||||||
g.writeEntry( "XDG_DESKTOP_DIR", QString("\"" + translatePath( newurl.path() ) + "\"") );
|
g.writeEntry( "XDG_DESKTOP_DIR", QString("\"" + translatePath( newurl.path() ) + "\"") );
|
||||||
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
|
KGlobalSettings::self()->emitChange(KGlobalSettings::PathsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
return op;
|
return op;
|
||||||
|
|
|
@ -76,7 +76,7 @@ void Clock::init()
|
||||||
dataEngine("time")->connectSource(currentTimezone(), this, updateInterval(), intervalAlignment());
|
dataEngine("time")->connectSource(currentTimezone(), this, updateInterval(), intervalAlignment());
|
||||||
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(updateColors()));
|
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(updateColors()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), SLOT(resetSize()));
|
connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), SLOT(resetSize()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(updateClock(int)));
|
connect(KGlobalSettings::self(), SIGNAL(localeChanged()), SLOT(updateClock()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clock::constraintsEvent(Plasma::Constraints constraints)
|
void Clock::constraintsEvent(Plasma::Constraints constraints)
|
||||||
|
@ -89,12 +89,8 @@ void Clock::constraintsEvent(Plasma::Constraints constraints)
|
||||||
}
|
}
|
||||||
|
|
||||||
// In case time format has changed, e.g. from 24h to 12h format.
|
// In case time format has changed, e.g. from 24h to 12h format.
|
||||||
void Clock::updateClock(int category)
|
void Clock::updateClock()
|
||||||
{
|
{
|
||||||
if (category != KGlobalSettings::SETTINGS_LOCALE) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
generatePixmap();
|
generatePixmap();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class Clock : public ClockApplet
|
||||||
void clockConfigChanged();
|
void clockConfigChanged();
|
||||||
void constraintsEvent(Plasma::Constraints constraints);
|
void constraintsEvent(Plasma::Constraints constraints);
|
||||||
void resetSize();
|
void resetSize();
|
||||||
void updateClock(int category);
|
void updateClock();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void createClockConfigurationInterface(KConfigDialog *parent);
|
void createClockConfigurationInterface(KConfigDialog *parent);
|
||||||
|
|
|
@ -54,7 +54,7 @@ Animator::Animator(AbstractItemView *view)
|
||||||
: QObject(view)
|
: QObject(view)
|
||||||
{
|
{
|
||||||
m_effectsOn = (KGlobalSettings::graphicEffectsLevel() != KGlobalSettings::NoEffects); //do not animate if the graphics effects are set to Low CPU
|
m_effectsOn = (KGlobalSettings::graphicEffectsLevel() != KGlobalSettings::NoEffects); //do not animate if the graphics effects are set to Low CPU
|
||||||
connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(graphicsEffectsToggled(int)));
|
connect(KGlobalSettings::self(), SIGNAL(kdisplayStyleChanged()), SLOT(graphicsEffectsToggled()));
|
||||||
connect(view, SIGNAL(entered(QModelIndex)), SLOT(entered(QModelIndex)));
|
connect(view, SIGNAL(entered(QModelIndex)), SLOT(entered(QModelIndex)));
|
||||||
connect(view, SIGNAL(left(QModelIndex)), SLOT(left(QModelIndex)));
|
connect(view, SIGNAL(left(QModelIndex)), SLOT(left(QModelIndex)));
|
||||||
}
|
}
|
||||||
|
@ -126,9 +126,9 @@ void Animator::left(const QModelIndex &index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Animator::graphicsEffectsToggled(int category)
|
void Animator::graphicsEffectsToggled()
|
||||||
{
|
{
|
||||||
if ( (category == KGlobalSettings::SETTINGS_STYLE) && (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects) ) {
|
if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects) {
|
||||||
m_effectsOn = true;
|
m_effectsOn = true;
|
||||||
} else {
|
} else {
|
||||||
m_effectsOn = false;
|
m_effectsOn = false;
|
||||||
|
|
|
@ -70,7 +70,7 @@ private slots:
|
||||||
void entered(const QModelIndex &index);
|
void entered(const QModelIndex &index);
|
||||||
void left(const QModelIndex &index);
|
void left(const QModelIndex &index);
|
||||||
void animationDestroyed(QObject *object);
|
void animationDestroyed(QObject *object);
|
||||||
void graphicsEffectsToggled(int category);
|
void graphicsEffectsToggled();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<HoverAnimation*> m_list;
|
QList<HoverAnimation*> m_list;
|
||||||
|
|
|
@ -363,7 +363,7 @@ void FolderView::init()
|
||||||
// Find out about icon and font settings changes
|
// Find out about icon and font settings changes
|
||||||
connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), SLOT(fontSettingsChanged()));
|
connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), SLOT(fontSettingsChanged()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), SLOT(iconSettingsChanged(int)));
|
connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), SLOT(iconSettingsChanged(int)));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(clickSettingsChanged(int)));
|
connect(KGlobalSettings::self(), SIGNAL(mouseChanged()), SLOT(clickSettingsChanged()));
|
||||||
|
|
||||||
// Find out about theme changes
|
// Find out about theme changes
|
||||||
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(plasmaThemeChanged()));
|
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(plasmaThemeChanged()));
|
||||||
|
@ -1189,9 +1189,9 @@ void FolderView::iconSettingsChanged(int group)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FolderView::clickSettingsChanged(int category)
|
void FolderView::clickSettingsChanged()
|
||||||
{
|
{
|
||||||
if (category == KGlobalSettings::SETTINGS_MOUSE && m_iconView) {
|
if (m_iconView) {
|
||||||
m_iconView->setShowSelectionMarker(KGlobalSettings::singleClick());
|
m_iconView->setShowSelectionMarker(KGlobalSettings::singleClick());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ protected slots:
|
||||||
void deselectAllMimeTypes();
|
void deselectAllMimeTypes();
|
||||||
void fontSettingsChanged();
|
void fontSettingsChanged();
|
||||||
void iconSettingsChanged(int group);
|
void iconSettingsChanged(int group);
|
||||||
void clickSettingsChanged(int category);
|
void clickSettingsChanged();
|
||||||
void plasmaThemeChanged();
|
void plasmaThemeChanged();
|
||||||
//void clipboardDataChanged();
|
//void clipboardDataChanged();
|
||||||
void updateScreenRegion();
|
void updateScreenRegion();
|
||||||
|
|
|
@ -364,11 +364,13 @@ private slots:
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
updateEffects();
|
updateEffects();
|
||||||
|
updateMouse();
|
||||||
|
|
||||||
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()), this, SLOT(updateToolbarIcons()));
|
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()), this, SLOT(updateToolbarIcons()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(toolbarAppearanceChanged(int)), this, SLOT(updateToolbarStyle()));
|
connect(KGlobalSettings::self(), SIGNAL(toolbarAppearanceChanged(int)), this, SLOT(updateToolbarStyle()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(kdisplayStyleChanged()), this, SLOT(updateStyle()));
|
connect(KGlobalSettings::self(), SIGNAL(kdisplayStyleChanged()), this, SLOT(updateStyle()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(updatePalette()));
|
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(updatePalette()));
|
||||||
|
connect(KGlobalSettings::self(), SIGNAL(mouseChanged()), this, SLOT(updateMouse()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateToolbarStyle()
|
void updateToolbarStyle()
|
||||||
|
@ -429,6 +431,24 @@ private slots:
|
||||||
{
|
{
|
||||||
QApplication::setPalette(palette());
|
QApplication::setPalette(palette());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateMouse()
|
||||||
|
{
|
||||||
|
KConfigGroup cg(KGlobal::config(), "KDE");
|
||||||
|
int num = cg.readEntry("CursorBlinkRate", QApplication::cursorFlashTime());
|
||||||
|
num = qBound(200, num, 2000);
|
||||||
|
QApplication::setCursorFlashTime(num);
|
||||||
|
num = cg.readEntry("DoubleClickInterval", QApplication::doubleClickInterval());
|
||||||
|
QApplication::setDoubleClickInterval(num);
|
||||||
|
num = cg.readEntry("StartDragTime", QApplication::startDragTime());
|
||||||
|
QApplication::setStartDragTime(num);
|
||||||
|
num = cg.readEntry("StartDragDist", QApplication::startDragDistance());
|
||||||
|
QApplication::setStartDragDistance(num);
|
||||||
|
num = cg.readEntry("WheelScrollLines", QApplication::wheelScrollLines());
|
||||||
|
QApplication::setWheelScrollLines(num);
|
||||||
|
bool showIcons = cg.readEntry("ShowIconsInMenuItems", !QApplication::testAttribute(Qt::AA_DontShowIconsInMenus));
|
||||||
|
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus, !showIcons);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(KQGuiPlatformPlugin)
|
Q_EXPORT_PLUGIN(KQGuiPlatformPlugin)
|
||||||
|
|
Loading…
Add table
Reference in a new issue