Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwinscreenedges/main.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 49 | { | |||
---|---|---|---|---|---|
56 | connect(m_ui->monitor, SIGNAL(changed()), this, SLOT(changed())); | 56 | connect(m_ui->monitor, SIGNAL(changed()), this, SLOT(changed())); | ||
57 | 57 | | |||
58 | connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); | 58 | connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); | ||
59 | connect(m_ui->activationDelaySpin, SIGNAL(valueChanged(int)), this, SLOT(sanitizeCooldown())); | 59 | connect(m_ui->activationDelaySpin, SIGNAL(valueChanged(int)), this, SLOT(sanitizeCooldown())); | ||
60 | connect(m_ui->activationDelaySpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); | 60 | connect(m_ui->activationDelaySpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); | ||
61 | connect(m_ui->triggerCooldownSpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); | 61 | connect(m_ui->triggerCooldownSpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); | ||
62 | connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); | 62 | connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); | ||
63 | connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); | 63 | connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); | ||
64 | connect(m_ui->electricBorderCornerRatio, SIGNAL(valueChanged(int)), this, SLOT(changed())); | 64 | connect(m_ui->electricBorderCornerRatioSpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); | ||
65 | 65 | | |||
66 | // Visual feedback of action group conflicts | 66 | // Visual feedback of action group conflicts | ||
67 | connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(groupChanged())); | 67 | connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(groupChanged())); | ||
68 | connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | 68 | connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | ||
69 | connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | 69 | connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | ||
70 | 70 | | |||
71 | load(); | 71 | load(); | ||
72 | 72 | | |||
Show All 24 Lines | 93 | { | |||
97 | 97 | | |||
98 | KConfigGroup config(m_config, "Windows"); | 98 | KConfigGroup config(m_config, "Windows"); | ||
99 | 99 | | |||
100 | m_ui->desktopSwitchCombo->setCurrentIndex(config.readEntry("ElectricBorders", 0)); | 100 | m_ui->desktopSwitchCombo->setCurrentIndex(config.readEntry("ElectricBorders", 0)); | ||
101 | m_ui->activationDelaySpin->setValue(config.readEntry("ElectricBorderDelay", 150)); | 101 | m_ui->activationDelaySpin->setValue(config.readEntry("ElectricBorderDelay", 150)); | ||
102 | m_ui->triggerCooldownSpin->setValue(config.readEntry("ElectricBorderCooldown", 350)); | 102 | m_ui->triggerCooldownSpin->setValue(config.readEntry("ElectricBorderCooldown", 350)); | ||
103 | m_ui->quickMaximizeBox->setChecked(config.readEntry("ElectricBorderMaximize", true)); | 103 | m_ui->quickMaximizeBox->setChecked(config.readEntry("ElectricBorderMaximize", true)); | ||
104 | m_ui->quickTileBox->setChecked(config.readEntry("ElectricBorderTiling", true)); | 104 | m_ui->quickTileBox->setChecked(config.readEntry("ElectricBorderTiling", true)); | ||
105 | m_ui->electricBorderCornerRatio->setValue(qRound(config.readEntry("ElectricBorderCornerRatio", 0.25)*100)); | 105 | m_ui->electricBorderCornerRatioSpin->setValue(qRound(config.readEntry("ElectricBorderCornerRatio", 0.25)*100)); | ||
106 | 106 | | |||
107 | emit changed(false); | 107 | emit changed(false); | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | void KWinScreenEdgesConfig::save() | 110 | void KWinScreenEdgesConfig::save() | ||
111 | { | 111 | { | ||
112 | KCModule::save(); | 112 | KCModule::save(); | ||
113 | 113 | | |||
114 | monitorSave(); | 114 | monitorSave(); | ||
115 | 115 | | |||
116 | KConfigGroup config(m_config, "Windows"); | 116 | KConfigGroup config(m_config, "Windows"); | ||
117 | 117 | | |||
118 | config.writeEntry("ElectricBorders", m_ui->desktopSwitchCombo->currentIndex()); | 118 | config.writeEntry("ElectricBorders", m_ui->desktopSwitchCombo->currentIndex()); | ||
119 | config.writeEntry("ElectricBorderDelay", m_ui->activationDelaySpin->value()); | 119 | config.writeEntry("ElectricBorderDelay", m_ui->activationDelaySpin->value()); | ||
120 | config.writeEntry("ElectricBorderCooldown", m_ui->triggerCooldownSpin->value()); | 120 | config.writeEntry("ElectricBorderCooldown", m_ui->triggerCooldownSpin->value()); | ||
121 | config.writeEntry("ElectricBorderMaximize", m_ui->quickMaximizeBox->isChecked()); | 121 | config.writeEntry("ElectricBorderMaximize", m_ui->quickMaximizeBox->isChecked()); | ||
122 | config.writeEntry("ElectricBorderTiling", m_ui->quickTileBox->isChecked()); | 122 | config.writeEntry("ElectricBorderTiling", m_ui->quickTileBox->isChecked()); | ||
123 | config.writeEntry("ElectricBorderCornerRatio", m_ui->electricBorderCornerRatio->value()/100.0); | 123 | config.writeEntry("ElectricBorderCornerRatio", m_ui->electricBorderCornerRatioSpin->value()/100.0); | ||
124 | 124 | | |||
125 | config.sync(); | 125 | config.sync(); | ||
126 | 126 | | |||
127 | // Reload KWin. | 127 | // Reload KWin. | ||
128 | QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | 128 | QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | ||
129 | QDBusConnection::sessionBus().send(message); | 129 | QDBusConnection::sessionBus().send(message); | ||
130 | // and reconfigure the effects | 130 | // and reconfigure the effects | ||
131 | OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), | 131 | OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), | ||
Show All 10 Lines | |||||
142 | { | 142 | { | ||
143 | monitorDefaults(); | 143 | monitorDefaults(); | ||
144 | 144 | | |||
145 | m_ui->desktopSwitchCombo->setCurrentIndex(0); | 145 | m_ui->desktopSwitchCombo->setCurrentIndex(0); | ||
146 | m_ui->activationDelaySpin->setValue(150); | 146 | m_ui->activationDelaySpin->setValue(150); | ||
147 | m_ui->triggerCooldownSpin->setValue(350); | 147 | m_ui->triggerCooldownSpin->setValue(350); | ||
148 | m_ui->quickMaximizeBox->setChecked(true); | 148 | m_ui->quickMaximizeBox->setChecked(true); | ||
149 | m_ui->quickTileBox->setChecked(true); | 149 | m_ui->quickTileBox->setChecked(true); | ||
150 | m_ui->electricBorderCornerRatio->setValue(25); | 150 | m_ui->electricBorderCornerRatioSpin->setValue(25); | ||
151 | 151 | | |||
152 | emit changed(true); | 152 | emit changed(true); | ||
153 | } | 153 | } | ||
154 | 154 | | |||
155 | void KWinScreenEdgesConfig::showEvent(QShowEvent* e) | 155 | void KWinScreenEdgesConfig::showEvent(QShowEvent* e) | ||
156 | { | 156 | { | ||
157 | KCModule::showEvent(e); | 157 | KCModule::showEvent(e); | ||
158 | 158 | | |||
▲ Show 20 Lines • Show All 377 Lines • Show Last 20 Lines |