| 1 | // -*- c-basic-offset: 2 -*- |
|---|
| 2 | /* |
|---|
| 3 | * This file is part of Licq, an instant messaging client for UNIX. |
|---|
| 4 | * Copyright (C) 2007 Licq developers |
|---|
| 5 | * |
|---|
| 6 | * Licq is free software; you can redistribute it and/or modify |
|---|
| 7 | * it under the terms of the GNU General Public License as published by |
|---|
| 8 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | * (at your option) any later version. |
|---|
| 10 | * |
|---|
| 11 | * Licq is distributed in the hope that it will be useful, |
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | * GNU General Public License for more details. |
|---|
| 15 | * |
|---|
| 16 | * You should have received a copy of the GNU General Public License |
|---|
| 17 | * along with Licq; if not, write to the Free Software |
|---|
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 19 | */ |
|---|
| 20 | |
|---|
| 21 | #include "general.h" |
|---|
| 22 | |
|---|
| 23 | #include "config.h" |
|---|
| 24 | |
|---|
| 25 | #include <QApplication> |
|---|
| 26 | #include <QDesktopWidget> |
|---|
| 27 | |
|---|
| 28 | #ifdef USE_KDE |
|---|
| 29 | #include <KDE/KGlobalSettings> |
|---|
| 30 | #endif |
|---|
| 31 | |
|---|
| 32 | #include <licq_file.h> |
|---|
| 33 | |
|---|
| 34 | using namespace LicqQtGui; |
|---|
| 35 | /* TRANSLATOR LicqQtGui::Config::General */ |
|---|
| 36 | |
|---|
| 37 | Config::General* Config::General::myInstance = NULL; |
|---|
| 38 | |
|---|
| 39 | void Config::General::createInstance(QObject* parent) |
|---|
| 40 | { |
|---|
| 41 | myInstance = new Config::General(parent); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | Config::General::General(QObject* parent) |
|---|
| 45 | : QObject(parent), |
|---|
| 46 | myMainwinHasChanged(false), |
|---|
| 47 | myDockHasChanged(false), |
|---|
| 48 | myDockModeHasChanged(false), |
|---|
| 49 | myFontHasChanged(false), |
|---|
| 50 | myBlockUpdates(false) |
|---|
| 51 | { |
|---|
| 52 | #ifdef USE_KDE |
|---|
| 53 | myDefaultFont = KGlobalSettings::generalFont(); |
|---|
| 54 | #else |
|---|
| 55 | myDefaultFont = qApp->font(); |
|---|
| 56 | #endif |
|---|
| 57 | |
|---|
| 58 | myDefaultFixedFont = QFont(myDefaultFont); |
|---|
| 59 | myDefaultFixedFont.setFamily("Monospace"); |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | void Config::General::loadConfiguration(CIniFile& iniFile) |
|---|
| 63 | { |
|---|
| 64 | char szTemp[255]; |
|---|
| 65 | |
|---|
| 66 | iniFile.SetSection("functions"); |
|---|
| 67 | iniFile.ReadStr("MsgPopupKey", szTemp, "none"); |
|---|
| 68 | myMsgPopupKey = (strcmp(szTemp, "none") != 0 ? QString::fromLatin1(szTemp) : QString()); |
|---|
| 69 | iniFile.ReadBool("DelayStatusChange", myDelayStatusChange, false); |
|---|
| 70 | |
|---|
| 71 | iniFile.SetSection("appearance"); |
|---|
| 72 | iniFile.ReadBool("UseDoubleReturn", myUseDoubleReturn, false); |
|---|
| 73 | |
|---|
| 74 | iniFile.ReadStr("Font", szTemp, "default"); |
|---|
| 75 | if (strcmp(szTemp, "default") == 0) |
|---|
| 76 | szTemp[0] = '\0'; |
|---|
| 77 | setNormalFont(szTemp); |
|---|
| 78 | iniFile.ReadStr("EditFont", szTemp, "default"); |
|---|
| 79 | if (strcmp(szTemp, "default") == 0) |
|---|
| 80 | szTemp[0] = '\0'; |
|---|
| 81 | setEditFont(szTemp); |
|---|
| 82 | iniFile.ReadStr("HistoryFont", szTemp, "default"); |
|---|
| 83 | if (strcmp(szTemp, "default") == 0) |
|---|
| 84 | szTemp[0] = '\0'; |
|---|
| 85 | setHistoryFont(szTemp); |
|---|
| 86 | iniFile.ReadStr("FixedFont", szTemp, "default"); |
|---|
| 87 | if (strcmp(szTemp, "default") == 0) |
|---|
| 88 | szTemp[0] = '\0'; |
|---|
| 89 | setFixedFont(szTemp); |
|---|
| 90 | |
|---|
| 91 | iniFile.ReadBool("InMiniMode", myMiniMode, false); |
|---|
| 92 | iniFile.ReadBool("ShowGroupIfNoMsg", myShowGroupIfNoMsg, true); |
|---|
| 93 | iniFile.ReadBool("BoldOnMsg", myBoldOnMsg, true); |
|---|
| 94 | iniFile.ReadBool("EnableMainwinMouseMovement", myMainwinDraggable, true); |
|---|
| 95 | iniFile.ReadBool("MainWinSticky", myMainwinSticky, false); |
|---|
| 96 | iniFile.ReadBool("AutoRaise", myAutoRaiseMainwin, true); |
|---|
| 97 | iniFile.ReadBool("Hidden", myMainwinStartHidden, false); |
|---|
| 98 | |
|---|
| 99 | unsigned short dockMode; |
|---|
| 100 | iniFile.ReadNum("UseDock", dockMode, DockTray); |
|---|
| 101 | myDockMode = static_cast<DockMode>(dockMode); |
|---|
| 102 | #ifndef USE_KDE |
|---|
| 103 | iniFile.ReadBool("Dock64x48", myDefaultIconFortyEight, false); |
|---|
| 104 | char szDockTheme[64]; |
|---|
| 105 | iniFile.ReadStr("DockTheme", szDockTheme, ""); |
|---|
| 106 | myThemedIconTheme = szDockTheme; |
|---|
| 107 | #endif |
|---|
| 108 | iniFile.ReadBool("TrayBlink", myTrayBlink, true); |
|---|
| 109 | iniFile.ReadBool("TrayMsgOnlineNotify", myTrayMsgOnlineNotify, true); |
|---|
| 110 | |
|---|
| 111 | iniFile.SetSection("startup"); |
|---|
| 112 | iniFile.ReadNum("Logon", myAutoLogon, 0); |
|---|
| 113 | if (myAutoLogon > 16) |
|---|
| 114 | myAutoLogon = 0; |
|---|
| 115 | iniFile.ReadNum("AutoAway", myAutoAwayTime, 5); |
|---|
| 116 | iniFile.ReadNum("AutoNA", myAutoNaTime, 10); |
|---|
| 117 | iniFile.ReadNum("AutoOffline", myAutoOfflineTime, 0); |
|---|
| 118 | iniFile.ReadNum("AutoAwayMess", myAutoAwayMess, 0); |
|---|
| 119 | iniFile.ReadNum("AutoNAMess", myAutoNaMess, 0); |
|---|
| 120 | |
|---|
| 121 | iniFile.SetSection("geometry"); |
|---|
| 122 | short xPos, yPos, wVal, hVal; |
|---|
| 123 | iniFile.ReadNum("MainWindow.X", xPos, 0); |
|---|
| 124 | iniFile.ReadNum("MainWindow.Y", yPos, 0); |
|---|
| 125 | iniFile.ReadNum("MainWindow.W", wVal, 0); |
|---|
| 126 | iniFile.ReadNum("MainWindow.H", hVal, 0); |
|---|
| 127 | if (xPos > QApplication::desktop()->width() - 16) |
|---|
| 128 | xPos = 0; |
|---|
| 129 | if (yPos > QApplication::desktop()->height() - 16) |
|---|
| 130 | yPos = 0; |
|---|
| 131 | myMainwinRect.setRect(xPos, yPos, wVal, hVal); |
|---|
| 132 | |
|---|
| 133 | emit msgPopupKeyChanged(myMsgPopupKey); |
|---|
| 134 | emit mainwinChanged(); |
|---|
| 135 | emit dockModeChanged(); |
|---|
| 136 | emit fontChanged(); |
|---|
| 137 | } |
|---|
| 138 | |
|---|
| 139 | void Config::General::saveConfiguration(CIniFile& iniFile) const |
|---|
| 140 | { |
|---|
| 141 | iniFile.SetSection("functions"); |
|---|
| 142 | iniFile.WriteStr("MsgPopupKey", myMsgPopupKey.isEmpty() ? "none" : myMsgPopupKey.toLatin1()); |
|---|
| 143 | iniFile.WriteBool("DelayStatusChange", myDelayStatusChange); |
|---|
| 144 | |
|---|
| 145 | iniFile.SetSection("appearance"); |
|---|
| 146 | iniFile.WriteBool("UseDoubleReturn", myUseDoubleReturn); |
|---|
| 147 | |
|---|
| 148 | iniFile.WriteStr("Font", qApp->font() == myDefaultFont ? |
|---|
| 149 | "default" : qApp->font().toString().toLatin1()); |
|---|
| 150 | iniFile.WriteStr("EditFont", myEditFont == myDefaultFont ? |
|---|
| 151 | "default" : myEditFont.toString().toLatin1()); |
|---|
| 152 | iniFile.WriteStr("HistoryFont", myHistoryFont == myDefaultFont ? |
|---|
| 153 | "default" : myHistoryFont.toString().toLatin1()); |
|---|
| 154 | iniFile.WriteStr("FixedFont", myFixedFont == myDefaultFixedFont ? |
|---|
| 155 | "default" : myFixedFont.toString().toLatin1()); |
|---|
| 156 | |
|---|
| 157 | iniFile.WriteBool("InMiniMode", myMiniMode); |
|---|
| 158 | iniFile.WriteBool("ShowGroupIfNoMsg", myShowGroupIfNoMsg); |
|---|
| 159 | iniFile.WriteBool("BoldOnMsg", myBoldOnMsg); |
|---|
| 160 | iniFile.WriteBool("EnableMainwinMouseMovement", myMainwinDraggable); |
|---|
| 161 | iniFile.WriteBool("MainWinSticky", myMainwinSticky); |
|---|
| 162 | iniFile.WriteBool("AutoRaise", myAutoRaiseMainwin); |
|---|
| 163 | iniFile.WriteBool("Hidden", myMainwinStartHidden); |
|---|
| 164 | |
|---|
| 165 | iniFile.WriteNum("UseDock", static_cast<unsigned short>(myDockMode)); |
|---|
| 166 | #ifndef USE_KDE |
|---|
| 167 | iniFile.WriteBool("Dock64x48", myDefaultIconFortyEight); |
|---|
| 168 | iniFile.WriteStr("DockTheme", myThemedIconTheme.toLatin1()); |
|---|
| 169 | #endif |
|---|
| 170 | iniFile.WriteBool("TrayBlink", myTrayBlink); |
|---|
| 171 | iniFile.WriteBool("TrayMsgOnlineNotify", myTrayMsgOnlineNotify); |
|---|
| 172 | |
|---|
| 173 | iniFile.SetSection("startup"); |
|---|
| 174 | iniFile.WriteNum("Logon", myAutoLogon); |
|---|
| 175 | iniFile.WriteNum("AutoAway", myAutoAwayTime); |
|---|
| 176 | iniFile.WriteNum("AutoNA", myAutoNaTime); |
|---|
| 177 | iniFile.WriteNum("AutoOffline", myAutoOfflineTime); |
|---|
| 178 | iniFile.WriteNum("AutoAwayMess", myAutoAwayMess); |
|---|
| 179 | iniFile.WriteNum("AutoNAMess", myAutoNaMess); |
|---|
| 180 | |
|---|
| 181 | iniFile.SetSection("geometry"); |
|---|
| 182 | iniFile.WriteNum("MainWindow.X", static_cast<short>(myMainwinRect.x())); |
|---|
| 183 | iniFile.WriteNum("MainWindow.Y", static_cast<short>(myMainwinRect.y())); |
|---|
| 184 | iniFile.WriteNum("MainWindow.W", static_cast<short>(myMainwinRect.width())); |
|---|
| 185 | iniFile.WriteNum("MainWindow.H", static_cast<short>(myMainwinRect.height())); |
|---|
| 186 | } |
|---|
| 187 | |
|---|
| 188 | void Config::General::blockUpdates(bool block) |
|---|
| 189 | { |
|---|
| 190 | if ((myBlockUpdates = block)) |
|---|
| 191 | return; |
|---|
| 192 | |
|---|
| 193 | if (myMainwinHasChanged) |
|---|
| 194 | { |
|---|
| 195 | myMainwinHasChanged = false; |
|---|
| 196 | emit mainwinChanged(); |
|---|
| 197 | } |
|---|
| 198 | if (myDockModeHasChanged) |
|---|
| 199 | { |
|---|
| 200 | myDockModeHasChanged = false; |
|---|
| 201 | myDockHasChanged = false; |
|---|
| 202 | emit dockModeChanged(); |
|---|
| 203 | } |
|---|
| 204 | if (myDockHasChanged) |
|---|
| 205 | { |
|---|
| 206 | myDockHasChanged = false; |
|---|
| 207 | emit dockChanged(); |
|---|
| 208 | } |
|---|
| 209 | if (myFontHasChanged) |
|---|
| 210 | { |
|---|
| 211 | myFontHasChanged = false; |
|---|
| 212 | emit fontChanged(); |
|---|
| 213 | } |
|---|
| 214 | } |
|---|
| 215 | |
|---|
| 216 | void Config::General::setUseDoubleReturn(bool useDoubleReturn) |
|---|
| 217 | { |
|---|
| 218 | if (useDoubleReturn == myUseDoubleReturn) |
|---|
| 219 | return; |
|---|
| 220 | |
|---|
| 221 | myUseDoubleReturn = useDoubleReturn; |
|---|
| 222 | } |
|---|
| 223 | |
|---|
| 224 | void Config::General::setDelayStatusChange(bool delayStatusChange) |
|---|
| 225 | { |
|---|
| 226 | if (delayStatusChange == myDelayStatusChange) |
|---|
| 227 | return; |
|---|
| 228 | |
|---|
| 229 | myDelayStatusChange = delayStatusChange; |
|---|
| 230 | } |
|---|
| 231 | |
|---|
| 232 | void Config::General::setMsgPopupKey(QString msgPopupKey) |
|---|
| 233 | { |
|---|
| 234 | if (msgPopupKey == myMsgPopupKey) |
|---|
| 235 | return; |
|---|
| 236 | |
|---|
| 237 | myMsgPopupKey = msgPopupKey; |
|---|
| 238 | emit msgPopupKeyChanged(myMsgPopupKey); |
|---|
| 239 | } |
|---|
| 240 | |
|---|
| 241 | QFont Config::General::normalFont() const |
|---|
| 242 | { |
|---|
| 243 | return qApp->font(); |
|---|
| 244 | } |
|---|
| 245 | |
|---|
| 246 | void Config::General::setNormalFont(QString normalFont) |
|---|
| 247 | { |
|---|
| 248 | QFont f; |
|---|
| 249 | if (normalFont.isEmpty()) |
|---|
| 250 | f = myDefaultFont; |
|---|
| 251 | else |
|---|
| 252 | f.fromString(normalFont); |
|---|
| 253 | |
|---|
| 254 | if (f == qApp->font()) |
|---|
| 255 | return; |
|---|
| 256 | |
|---|
| 257 | qApp->setFont(f); |
|---|
| 258 | // No need to emit fontChanged for normal font, qt will handle this for us |
|---|
| 259 | } |
|---|
| 260 | |
|---|
| 261 | void Config::General::setEditFont(QString editFont) |
|---|
| 262 | { |
|---|
| 263 | QFont f; |
|---|
| 264 | if (editFont.isEmpty()) |
|---|
| 265 | f = myDefaultFont; |
|---|
| 266 | else |
|---|
| 267 | f.fromString(editFont); |
|---|
| 268 | |
|---|
| 269 | if (f == myEditFont) |
|---|
| 270 | return; |
|---|
| 271 | |
|---|
| 272 | myEditFont = f; |
|---|
| 273 | if (myBlockUpdates) |
|---|
| 274 | myFontHasChanged = true; |
|---|
| 275 | else |
|---|
| 276 | emit fontChanged(); |
|---|
| 277 | } |
|---|
| 278 | |
|---|
| 279 | void Config::General::setHistoryFont(QString historyFont) |
|---|
| 280 | { |
|---|
| 281 | QFont f; |
|---|
| 282 | if (historyFont.isEmpty()) |
|---|
| 283 | f = myDefaultFont; |
|---|
| 284 | else |
|---|
| 285 | f.fromString(historyFont); |
|---|
| 286 | |
|---|
| 287 | if (f == myHistoryFont) |
|---|
| 288 | return; |
|---|
| 289 | |
|---|
| 290 | myHistoryFont = f; |
|---|
| 291 | if (myBlockUpdates) |
|---|
| 292 | myFontHasChanged = true; |
|---|
| 293 | else |
|---|
| 294 | emit fontChanged(); |
|---|
| 295 | } |
|---|
| 296 | |
|---|
| 297 | void Config::General::setFixedFont(QString fixedFont) |
|---|
| 298 | { |
|---|
| 299 | QFont f; |
|---|
| 300 | if (fixedFont.isEmpty()) |
|---|
| 301 | f = myDefaultFixedFont; |
|---|
| 302 | else |
|---|
| 303 | f.fromString(fixedFont); |
|---|
| 304 | |
|---|
| 305 | if (f == myFixedFont) |
|---|
| 306 | return; |
|---|
| 307 | |
|---|
| 308 | myFixedFont = f; |
|---|
| 309 | if (myBlockUpdates) |
|---|
| 310 | myFontHasChanged = true; |
|---|
| 311 | else |
|---|
| 312 | emit fontChanged(); |
|---|
| 313 | } |
|---|
| 314 | |
|---|
| 315 | void Config::General::setMiniMode(bool miniMode) |
|---|
| 316 | { |
|---|
| 317 | if (miniMode == myMiniMode) |
|---|
| 318 | return; |
|---|
| 319 | |
|---|
| 320 | myMiniMode = miniMode; |
|---|
| 321 | if (myBlockUpdates) |
|---|
| 322 | myMainwinHasChanged = true; |
|---|
| 323 | else |
|---|
| 324 | emit mainwinChanged(); |
|---|
| 325 | } |
|---|
| 326 | |
|---|
| 327 | void Config::General::toggleMiniMode() |
|---|
| 328 | { |
|---|
| 329 | setMiniMode(!myMiniMode); |
|---|
| 330 | } |
|---|
| 331 | |
|---|
| 332 | void Config::General::setShowGroupIfNoMsg(bool showGroupIfNoMsg) |
|---|
| 333 | { |
|---|
| 334 | if (showGroupIfNoMsg == myShowGroupIfNoMsg) |
|---|
| 335 | return; |
|---|
| 336 | |
|---|
| 337 | myShowGroupIfNoMsg = showGroupIfNoMsg; |
|---|
| 338 | if (myBlockUpdates) |
|---|
| 339 | myMainwinHasChanged = true; |
|---|
| 340 | else |
|---|
| 341 | emit mainwinChanged(); |
|---|
| 342 | } |
|---|
| 343 | |
|---|
| 344 | void Config::General::setBoldOnMsg(bool boldOnMsg) |
|---|
| 345 | { |
|---|
| 346 | if (boldOnMsg == myBoldOnMsg) |
|---|
| 347 | return; |
|---|
| 348 | |
|---|
| 349 | myBoldOnMsg = boldOnMsg; |
|---|
| 350 | if (myBlockUpdates) |
|---|
| 351 | myMainwinHasChanged = true; |
|---|
| 352 | else |
|---|
| 353 | emit mainwinChanged(); |
|---|
| 354 | } |
|---|
| 355 | |
|---|
| 356 | void Config::General::setMainwinDraggable(bool mainwinDraggable) |
|---|
| 357 | { |
|---|
| 358 | if (mainwinDraggable == myMainwinDraggable) |
|---|
| 359 | return; |
|---|
| 360 | |
|---|
| 361 | myMainwinDraggable = mainwinDraggable; |
|---|
| 362 | } |
|---|
| 363 | |
|---|
| 364 | void Config::General::setMainwinSticky(bool mainwinSticky) |
|---|
| 365 | { |
|---|
| 366 | if (mainwinSticky == myMainwinSticky) |
|---|
| 367 | return; |
|---|
| 368 | |
|---|
| 369 | myMainwinSticky = mainwinSticky; |
|---|
| 370 | if (myBlockUpdates) |
|---|
| 371 | myMainwinHasChanged = true; |
|---|
| 372 | else |
|---|
| 373 | emit mainwinChanged(); |
|---|
| 374 | } |
|---|
| 375 | |
|---|
| 376 | void Config::General::setAutoRaiseMainwin(bool autoRaiseMainwin) |
|---|
| 377 | { |
|---|
| 378 | if (autoRaiseMainwin == myAutoRaiseMainwin) |
|---|
| 379 | return; |
|---|
| 380 | |
|---|
| 381 | myAutoRaiseMainwin = autoRaiseMainwin; |
|---|
| 382 | } |
|---|
| 383 | |
|---|
| 384 | void Config::General::setMainwinStartHidden(bool mainwinStartHidden) |
|---|
| 385 | { |
|---|
| 386 | if (mainwinStartHidden == myMainwinStartHidden) |
|---|
| 387 | return; |
|---|
| 388 | |
|---|
| 389 | myMainwinStartHidden = mainwinStartHidden; |
|---|
| 390 | } |
|---|
| 391 | |
|---|
| 392 | void Config::General::setMainwinRect(const QRect& geometry) |
|---|
| 393 | { |
|---|
| 394 | if (geometry.isValid()) |
|---|
| 395 | myMainwinRect = geometry; |
|---|
| 396 | } |
|---|
| 397 | |
|---|
| 398 | void Config::General::setDockMode(DockMode dockMode) |
|---|
| 399 | { |
|---|
| 400 | if (dockMode == myDockMode) |
|---|
| 401 | return; |
|---|
| 402 | |
|---|
| 403 | myDockMode = dockMode; |
|---|
| 404 | if (myBlockUpdates) |
|---|
| 405 | myDockModeHasChanged = true; |
|---|
| 406 | else |
|---|
| 407 | emit dockModeChanged(); |
|---|
| 408 | } |
|---|
| 409 | |
|---|
| 410 | #ifndef USE_KDE |
|---|
| 411 | void Config::General::setDefaultIconFortyEight(bool defaultIconFortyEight) |
|---|
| 412 | { |
|---|
| 413 | if (defaultIconFortyEight == myDefaultIconFortyEight) |
|---|
| 414 | return; |
|---|
| 415 | |
|---|
| 416 | myDefaultIconFortyEight = defaultIconFortyEight; |
|---|
| 417 | if (myDockMode != DockDefault) |
|---|
| 418 | return; |
|---|
| 419 | |
|---|
| 420 | if (myBlockUpdates) |
|---|
| 421 | myDockHasChanged = true; |
|---|
| 422 | else |
|---|
| 423 | emit dockChanged(); |
|---|
| 424 | } |
|---|
| 425 | |
|---|
| 426 | void Config::General::setThemedIconTheme(QString themedIconTheme) |
|---|
| 427 | { |
|---|
| 428 | if (themedIconTheme == myThemedIconTheme) |
|---|
| 429 | return; |
|---|
| 430 | |
|---|
| 431 | myThemedIconTheme = themedIconTheme; |
|---|
| 432 | if (myDockMode != DockThemed) |
|---|
| 433 | return; |
|---|
| 434 | |
|---|
| 435 | if (myBlockUpdates) |
|---|
| 436 | myDockHasChanged = true; |
|---|
| 437 | else |
|---|
| 438 | emit dockChanged(); |
|---|
| 439 | } |
|---|
| 440 | #endif |
|---|
| 441 | |
|---|
| 442 | void Config::General::setTrayBlink(bool trayBlink) |
|---|
| 443 | { |
|---|
| 444 | if (trayBlink == myTrayBlink) |
|---|
| 445 | return; |
|---|
| 446 | |
|---|
| 447 | myTrayBlink = trayBlink; |
|---|
| 448 | if (myDockMode != DockTray) |
|---|
| 449 | return; |
|---|
| 450 | |
|---|
| 451 | if (myBlockUpdates) |
|---|
| 452 | myDockHasChanged = true; |
|---|
| 453 | else |
|---|
| 454 | emit dockChanged(); |
|---|
| 455 | } |
|---|
| 456 | |
|---|
| 457 | void Config::General::setTrayMsgOnlineNotify(bool trayMsgOnlineNotify) |
|---|
| 458 | { |
|---|
| 459 | if (trayMsgOnlineNotify == myTrayMsgOnlineNotify) |
|---|
| 460 | return; |
|---|
| 461 | |
|---|
| 462 | myTrayMsgOnlineNotify = trayMsgOnlineNotify; |
|---|
| 463 | } |
|---|
| 464 | |
|---|
| 465 | void Config::General::setAutoLogon(unsigned short autoLogon) |
|---|
| 466 | { |
|---|
| 467 | if (autoLogon == myAutoLogon) |
|---|
| 468 | return; |
|---|
| 469 | |
|---|
| 470 | myAutoLogon = autoLogon; |
|---|
| 471 | } |
|---|
| 472 | |
|---|
| 473 | void Config::General::setAutoAwayTime(unsigned short autoAwayTime) |
|---|
| 474 | { |
|---|
| 475 | if (autoAwayTime == myAutoAwayTime) |
|---|
| 476 | return; |
|---|
| 477 | |
|---|
| 478 | myAutoAwayTime = autoAwayTime; |
|---|
| 479 | } |
|---|
| 480 | |
|---|
| 481 | void Config::General::setAutoNaTime(unsigned short autoNaTime) |
|---|
| 482 | { |
|---|
| 483 | if (autoNaTime == myAutoNaTime) |
|---|
| 484 | return; |
|---|
| 485 | |
|---|
| 486 | myAutoNaTime = autoNaTime; |
|---|
| 487 | } |
|---|
| 488 | |
|---|
| 489 | void Config::General::setAutoOfflineTime(unsigned short autoOfflineTime) |
|---|
| 490 | { |
|---|
| 491 | if (autoOfflineTime == myAutoOfflineTime) |
|---|
| 492 | return; |
|---|
| 493 | |
|---|
| 494 | myAutoOfflineTime = autoOfflineTime; |
|---|
| 495 | } |
|---|
| 496 | |
|---|
| 497 | void Config::General::setAutoAwayMess(unsigned short autoAwayMess) |
|---|
| 498 | { |
|---|
| 499 | if (autoAwayMess == myAutoAwayMess) |
|---|
| 500 | return; |
|---|
| 501 | |
|---|
| 502 | myAutoAwayMess = autoAwayMess; |
|---|
| 503 | } |
|---|
| 504 | |
|---|
| 505 | void Config::General::setAutoNaMess(unsigned short autoNaMess) |
|---|
| 506 | { |
|---|
| 507 | if (autoNaMess == myAutoNaMess) |
|---|
| 508 | return; |
|---|
| 509 | |
|---|
| 510 | myAutoNaMess = autoNaMess; |
|---|
| 511 | } |
|---|