mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kwin: remove non-operational kcmkwincompositing bits
m_showConfirmDialog is always false, no idea why KWinCompositingConfig::showConfirmDialog() was virtual Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b46a7dfc01
commit
7985700ad3
2 changed files with 2 additions and 80 deletions
|
@ -40,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <kservice.h>
|
#include <kservice.h>
|
||||||
#include <ktitlewidget.h>
|
#include <ktitlewidget.h>
|
||||||
#include <knotification.h>
|
#include <knotification.h>
|
||||||
|
#include <kdialog.h>
|
||||||
|
|
||||||
#include <QtDBus/QtDBus>
|
#include <QtDBus/QtDBus>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
@ -60,29 +61,9 @@ K_EXPORT_PLUGIN(KWinCompositingConfigFactory("kcmkwincompositing"))
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
ConfirmDialog::ConfirmDialog() :
|
|
||||||
KTimerDialog(10000, KTimerDialog::CountDown, 0,
|
|
||||||
i18n("Confirm Desktop Effects Change"), KTimerDialog::Ok | KTimerDialog::Cancel,
|
|
||||||
KTimerDialog::Cancel)
|
|
||||||
{
|
|
||||||
setObjectName(QLatin1String("mainKTimerDialog"));
|
|
||||||
setButtonGuiItem(KDialog::Ok, KGuiItem(i18n("&Accept Configuration"), "dialog-ok"));
|
|
||||||
setButtonGuiItem(KDialog::Cancel, KGuiItem(i18n("&Return to Previous Configuration"), "dialog-cancel"));
|
|
||||||
|
|
||||||
QLabel *label = new QLabel(i18n("Desktop effects settings have changed.\n"
|
|
||||||
"Do you want to keep the new settings?\n"
|
|
||||||
"They will be automatically reverted in 10 seconds."), this);
|
|
||||||
label->setWordWrap(true);
|
|
||||||
setMainWidget(label);
|
|
||||||
|
|
||||||
setWindowIcon(KIcon("preferences-desktop-effect"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList &args)
|
KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList &args)
|
||||||
: KCModule(KWinCompositingConfigFactory::componentData(), parent)
|
: KCModule(KWinCompositingConfigFactory::componentData(), parent)
|
||||||
, mKWinConfig(KSharedConfig::openConfig("kwinrc"))
|
, mKWinConfig(KSharedConfig::openConfig("kwinrc"))
|
||||||
, m_showConfirmDialog(false)
|
|
||||||
, m_showDetailedErrors(new QAction(i18nc("Action to open a dialog showing detailed information why an effect could not be loaded",
|
, m_showDetailedErrors(new QAction(i18nc("Action to open a dialog showing detailed information why an effect could not be loaded",
|
||||||
"Details"), this))
|
"Details"), this))
|
||||||
, m_dontShowAgain(new QAction(i18nc("Prevent warning from bein displayed again", "Don't show again!"), this))
|
, m_dontShowAgain(new QAction(i18nc("Prevent warning from bein displayed again", "Don't show again!"), this))
|
||||||
|
@ -204,44 +185,6 @@ void KWinCompositingConfig::reparseConfiguration(const QByteArray& conf)
|
||||||
KSettings::Dispatcher::reparseConfiguration(conf);
|
KSettings::Dispatcher::reparseConfiguration(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KWinCompositingConfig::showConfirmDialog(bool reinitCompositing)
|
|
||||||
{
|
|
||||||
bool revert = false;
|
|
||||||
// Feel free to extend this to support several kwin instances (multihead) if you
|
|
||||||
// think it makes sense.
|
|
||||||
OrgKdeKWinInterface kwin("org.kde.KWin", "/KWin", QDBusConnection::sessionBus());
|
|
||||||
if (reinitCompositing ? !kwin.compositingActive().value() : !kwin.waitForCompositingSetup().value()) {
|
|
||||||
KMessageBox::sorry(this, i18n(
|
|
||||||
"Failed to activate desktop effects using the given "
|
|
||||||
"configuration options. Settings will be reverted to their previous values.\n\n"
|
|
||||||
"Check your X configuration. You may also consider changing advanced options, "
|
|
||||||
"especially changing the compositing type."));
|
|
||||||
revert = true;
|
|
||||||
} else {
|
|
||||||
ConfirmDialog confirm;
|
|
||||||
if (!confirm.exec())
|
|
||||||
revert = true;
|
|
||||||
else {
|
|
||||||
// compositing is enabled now
|
|
||||||
checkLoadedEffects();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (revert) {
|
|
||||||
// Revert settings
|
|
||||||
KConfigGroup config(mKWinConfig, "Compositing");
|
|
||||||
config.deleteGroup();
|
|
||||||
QMap<QString, QString>::const_iterator it = mPreviousConfig.constBegin();
|
|
||||||
for (; it != mPreviousConfig.constEnd(); ++it) {
|
|
||||||
if (it.value().isEmpty())
|
|
||||||
continue;
|
|
||||||
config.writeEntry(it.key(), it.value());
|
|
||||||
}
|
|
||||||
// Sync with KWin and reload
|
|
||||||
configChanged(reinitCompositing);
|
|
||||||
load();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void KWinCompositingConfig::initEffectSelector()
|
void KWinCompositingConfig::initEffectSelector()
|
||||||
{
|
{
|
||||||
// Find all .desktop files of the effects
|
// Find all .desktop files of the effects
|
||||||
|
@ -519,15 +462,6 @@ void KWinCompositingConfig::save()
|
||||||
"Your settings have been saved but as KDE is currently running in failsafe "
|
"Your settings have been saved but as KDE is currently running in failsafe "
|
||||||
"mode desktop effects cannot be enabled at this time.\n\n"
|
"mode desktop effects cannot be enabled at this time.\n\n"
|
||||||
"Please exit failsafe mode to enable desktop effects."));
|
"Please exit failsafe mode to enable desktop effects."));
|
||||||
m_showConfirmDialog = false; // Dangerous but there is no way to test if failsafe mode
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_showConfirmDialog) {
|
|
||||||
m_showConfirmDialog = false;
|
|
||||||
if (advancedChanged)
|
|
||||||
QTimer::singleShot(1000, this, SLOT(confirmReInit()));
|
|
||||||
else
|
|
||||||
showConfirmDialog(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,8 +606,7 @@ void KWinCompositingConfig::configChanged(bool reinitCompositing)
|
||||||
// HACK: We can't just do this here, due to the asynchronous nature of signals.
|
// HACK: We can't just do this here, due to the asynchronous nature of signals.
|
||||||
// We also can't change reinitCompositing into a message (which would allow
|
// We also can't change reinitCompositing into a message (which would allow
|
||||||
// callWithCallbac() to do this neater) due to multiple kwin instances.
|
// callWithCallbac() to do this neater) due to multiple kwin instances.
|
||||||
if (!m_showConfirmDialog)
|
QTimer::singleShot(1000, this, SLOT(checkLoadedEffects()));
|
||||||
QTimer::singleShot(1000, this, SLOT(checkLoadedEffects()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <kcmodule.h>
|
#include <kcmodule.h>
|
||||||
#include <ksharedconfig.h>
|
#include <ksharedconfig.h>
|
||||||
#include <ktemporaryfile.h>
|
#include <ktemporaryfile.h>
|
||||||
#include <ktimerdialog.h>
|
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
|
@ -38,13 +37,6 @@ class KActionCollection;
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
class ConfirmDialog : public KTimerDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
ConfirmDialog();
|
|
||||||
};
|
|
||||||
|
|
||||||
class KWinCompositingConfig : public KCModule
|
class KWinCompositingConfig : public KCModule
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -55,7 +47,6 @@ public:
|
||||||
virtual QString quickHelp() const;
|
virtual QString quickHelp() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void showConfirmDialog(bool reinitCompositing);
|
|
||||||
void currentTabChanged(int tab);
|
void currentTabChanged(int tab);
|
||||||
|
|
||||||
virtual void load();
|
virtual void load();
|
||||||
|
@ -77,7 +68,6 @@ public slots:
|
||||||
void warn(QString message, QString details, QString dontAgainKey);
|
void warn(QString message, QString details, QString dontAgainKey);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void confirmReInit() { showConfirmDialog(true); }
|
|
||||||
void alignGuiToCompositingType(int compositingType);
|
void alignGuiToCompositingType(int compositingType);
|
||||||
void toggleEffectShortcutChanged(const QKeySequence &seq);
|
void toggleEffectShortcutChanged(const QKeySequence &seq);
|
||||||
void updateStatusUI(bool compositingIsPossible);
|
void updateStatusUI(bool compositingIsPossible);
|
||||||
|
@ -93,7 +83,6 @@ private:
|
||||||
QMap<QString, QString> mPreviousConfig;
|
QMap<QString, QString> mPreviousConfig;
|
||||||
KTemporaryFile mTmpConfigFile;
|
KTemporaryFile mTmpConfigFile;
|
||||||
KSharedConfigPtr mTmpConfig;
|
KSharedConfigPtr mTmpConfig;
|
||||||
bool m_showConfirmDialog;
|
|
||||||
KActionCollection* m_actionCollection;
|
KActionCollection* m_actionCollection;
|
||||||
QAction *m_showDetailedErrors;
|
QAction *m_showDetailedErrors;
|
||||||
QAction *m_dontShowAgain;
|
QAction *m_dontShowAgain;
|
||||||
|
|
Loading…
Add table
Reference in a new issue