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->quickCornerTileBox, &QCheckBox::stateChanged, this, [this] { changed(); }); | ||||
graesslin: Please use new connect syntax. | |||||
64 | connect(m_ui->electricBorderCornerRatio, SIGNAL(valueChanged(int)), this, SLOT(changed())); | 65 | connect(m_ui->electricBorderCornerRatio, SIGNAL(valueChanged(int)), this, SLOT(changed())); | ||
65 | 66 | | |||
66 | // Visual feedback of action group conflicts | 67 | // Visual feedback of action group conflicts | ||
67 | connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(groupChanged())); | 68 | connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(groupChanged())); | ||
68 | connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | 69 | connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | ||
69 | connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | 70 | connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); | ||
71 | connect(m_ui->quickCornerTileBox, &QCheckBox::stateChanged, this, &KWinScreenEdgesConfig::groupChanged); | ||||
70 | 72 | | |||
71 | load(); | 73 | load(); | ||
72 | 74 | | |||
73 | sanitizeCooldown(); | 75 | sanitizeCooldown(); | ||
74 | } | 76 | } | ||
75 | 77 | | |||
76 | KWinScreenEdgesConfig::~KWinScreenEdgesConfig() | 78 | KWinScreenEdgesConfig::~KWinScreenEdgesConfig() | ||
77 | { | 79 | { | ||
Show All 19 Lines | 95 | { | |||
97 | 99 | | |||
98 | KConfigGroup config(m_config, "Windows"); | 100 | KConfigGroup config(m_config, "Windows"); | ||
99 | 101 | | |||
100 | m_ui->desktopSwitchCombo->setCurrentIndex(config.readEntry("ElectricBorders", 0)); | 102 | m_ui->desktopSwitchCombo->setCurrentIndex(config.readEntry("ElectricBorders", 0)); | ||
101 | m_ui->activationDelaySpin->setValue(config.readEntry("ElectricBorderDelay", 150)); | 103 | m_ui->activationDelaySpin->setValue(config.readEntry("ElectricBorderDelay", 150)); | ||
102 | m_ui->triggerCooldownSpin->setValue(config.readEntry("ElectricBorderCooldown", 350)); | 104 | m_ui->triggerCooldownSpin->setValue(config.readEntry("ElectricBorderCooldown", 350)); | ||
103 | m_ui->quickMaximizeBox->setChecked(config.readEntry("ElectricBorderMaximize", true)); | 105 | m_ui->quickMaximizeBox->setChecked(config.readEntry("ElectricBorderMaximize", true)); | ||
104 | m_ui->quickTileBox->setChecked(config.readEntry("ElectricBorderTiling", true)); | 106 | m_ui->quickTileBox->setChecked(config.readEntry("ElectricBorderTiling", true)); | ||
107 | m_ui->quickCornerTileBox->setChecked(config.readEntry("ElectricBorderCornerTiling", true)); | ||||
105 | m_ui->electricBorderCornerRatio->setValue(qRound(config.readEntry("ElectricBorderCornerRatio", 0.25)*100)); | 108 | m_ui->electricBorderCornerRatio->setValue(qRound(config.readEntry("ElectricBorderCornerRatio", 0.25)*100)); | ||
106 | 109 | | |||
107 | emit changed(false); | 110 | emit changed(false); | ||
108 | } | 111 | } | ||
109 | 112 | | |||
110 | void KWinScreenEdgesConfig::save() | 113 | void KWinScreenEdgesConfig::save() | ||
111 | { | 114 | { | ||
112 | KCModule::save(); | 115 | KCModule::save(); | ||
113 | 116 | | |||
114 | monitorSave(); | 117 | monitorSave(); | ||
115 | 118 | | |||
116 | KConfigGroup config(m_config, "Windows"); | 119 | KConfigGroup config(m_config, "Windows"); | ||
117 | 120 | | |||
118 | config.writeEntry("ElectricBorders", m_ui->desktopSwitchCombo->currentIndex()); | 121 | config.writeEntry("ElectricBorders", m_ui->desktopSwitchCombo->currentIndex()); | ||
119 | config.writeEntry("ElectricBorderDelay", m_ui->activationDelaySpin->value()); | 122 | config.writeEntry("ElectricBorderDelay", m_ui->activationDelaySpin->value()); | ||
120 | config.writeEntry("ElectricBorderCooldown", m_ui->triggerCooldownSpin->value()); | 123 | config.writeEntry("ElectricBorderCooldown", m_ui->triggerCooldownSpin->value()); | ||
121 | config.writeEntry("ElectricBorderMaximize", m_ui->quickMaximizeBox->isChecked()); | 124 | config.writeEntry("ElectricBorderMaximize", m_ui->quickMaximizeBox->isChecked()); | ||
122 | config.writeEntry("ElectricBorderTiling", m_ui->quickTileBox->isChecked()); | 125 | config.writeEntry("ElectricBorderTiling", m_ui->quickTileBox->isChecked()); | ||
126 | config.writeEntry("ElectricBorderCornerTiling", m_ui->quickCornerTileBox->isChecked()); | ||||
123 | config.writeEntry("ElectricBorderCornerRatio", m_ui->electricBorderCornerRatio->value()/100.0); | 127 | config.writeEntry("ElectricBorderCornerRatio", m_ui->electricBorderCornerRatio->value()/100.0); | ||
124 | 128 | | |||
125 | config.sync(); | 129 | config.sync(); | ||
126 | 130 | | |||
127 | // Reload KWin. | 131 | // Reload KWin. | ||
128 | QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | 132 | QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | ||
129 | QDBusConnection::sessionBus().send(message); | 133 | QDBusConnection::sessionBus().send(message); | ||
130 | // and reconfigure the effects | 134 | // and reconfigure the effects | ||
Show All 11 Lines | |||||
142 | { | 146 | { | ||
143 | monitorDefaults(); | 147 | monitorDefaults(); | ||
144 | 148 | | |||
145 | m_ui->desktopSwitchCombo->setCurrentIndex(0); | 149 | m_ui->desktopSwitchCombo->setCurrentIndex(0); | ||
146 | m_ui->activationDelaySpin->setValue(150); | 150 | m_ui->activationDelaySpin->setValue(150); | ||
147 | m_ui->triggerCooldownSpin->setValue(350); | 151 | m_ui->triggerCooldownSpin->setValue(350); | ||
148 | m_ui->quickMaximizeBox->setChecked(true); | 152 | m_ui->quickMaximizeBox->setChecked(true); | ||
149 | m_ui->quickTileBox->setChecked(true); | 153 | m_ui->quickTileBox->setChecked(true); | ||
154 | m_ui->quickCornerTileBox->setChecked(true); | ||||
150 | m_ui->electricBorderCornerRatio->setValue(25); | 155 | m_ui->electricBorderCornerRatio->setValue(25); | ||
151 | 156 | | |||
152 | emit changed(true); | 157 | emit changed(true); | ||
153 | } | 158 | } | ||
154 | 159 | | |||
155 | void KWinScreenEdgesConfig::showEvent(QShowEvent* e) | 160 | void KWinScreenEdgesConfig::showEvent(QShowEvent* e) | ||
156 | { | 161 | { | ||
157 | KCModule::showEvent(e); | 162 | KCModule::showEvent(e); | ||
▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines |
Please use new connect syntax.