Changeset 6139
- Timestamp:
- 04/10/08 02:50:04 (8 months ago)
- Location:
- trunk/qt4-gui/src
- Files:
-
- 7 modified
-
config/general.cpp (modified) (3 diffs)
-
config/general.h (modified) (3 diffs)
-
core/systemmenu.cpp (modified) (2 diffs)
-
dialogs/awaymsgdlg.cpp (modified) (6 diffs)
-
dialogs/awaymsgdlg.h (modified) (3 diffs)
-
settings/status.cpp (modified) (4 diffs)
-
settings/status.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/config/general.cpp
r6090 r6139 64 64 iniFile.ReadStr("MsgPopupKey", szTemp, "none"); 65 65 myMsgPopupKey = (strcmp(szTemp, "none") != 0 ? QString::fromLatin1(szTemp) : QString()); 66 iniFile.ReadBool("DelayStatusChange", myDelayStatusChange, false); 66 67 67 68 iniFile.SetSection("appearance"); … … 133 134 iniFile.SetSection("functions"); 134 135 iniFile.WriteStr("MsgPopupKey", myMsgPopupKey.isEmpty() ? "none" : myMsgPopupKey.toLatin1()); 136 iniFile.WriteBool("DelayStatusChange", myDelayStatusChange); 135 137 136 138 iniFile.SetSection("appearance"); … … 208 210 } 209 211 212 void Config::General::setDelayStatusChange(bool delayStatusChange) 213 { 214 if (delayStatusChange == myDelayStatusChange) 215 return; 216 217 myDelayStatusChange = delayStatusChange; 218 } 219 210 220 void Config::General::setMsgPopupKey(QString msgPopupKey) 211 221 { -
trunk/qt4-gui/src/config/general.h
r6090 r6139 78 78 bool useDoubleReturn() const { return myUseDoubleReturn; } 79 79 QString msgPopupKey() const { return myMsgPopupKey; } 80 bool delayStatusChange() const { return myDelayStatusChange; } 80 81 QFont defaultFont() const { return myDefaultFont; } 81 82 QFont normalFont() const; … … 120 121 void setUseDoubleReturn(bool useDoubleReturn); 121 122 void setMsgPopupKey(QString msgPopupKey); 123 void setDelayStatusChange(bool delayStatusChange); 122 124 void setNormalFont(QString normalFont); 123 125 void setEditFont(QString editFont); … … 189 191 bool myUseDoubleReturn; 190 192 QString myMsgPopupKey; 193 bool myDelayStatusChange; 191 194 QFont myDefaultFont; 192 195 QFont myEditFont; -
trunk/qt4-gui/src/core/systemmenu.cpp
r6054 r6139 445 445 { 446 446 unsigned long status = action->data().toUInt(); 447 448 if (status != ICQ_STATUS_OFFLINE && status != ICQ_STATUS_ONLINE) 449 AwayMsgDlg::showAwayMsgDlg(status, true); 450 451 LicqGui::instance()->changeStatus(status, myStatusInvisibleAction->isChecked()); 447 bool withMsg = (status != ICQ_STATUS_OFFLINE && status != ICQ_STATUS_ONLINE); 448 bool changeNow = !Config::General::instance()->delayStatusChange(); 449 450 if (withMsg) 451 AwayMsgDlg::showAwayMsgDlg(status, true, 0, myStatusInvisibleAction->isChecked(), !changeNow); 452 453 if (changeNow || !withMsg) 454 LicqGui::instance()->changeStatus(status, myStatusInvisibleAction->isChecked()); 452 455 } 453 456 … … 697 700 { 698 701 int status = action->data().toInt(); 699 if (status != ICQ_STATUS_OFFLINE && status != ICQ_STATUS_ONLINE) 700 AwayMsgDlg::showAwayMsgDlg(status, true); 701 LicqGui::instance()->changeStatus(status, myPpid, myStatusInvisibleAction->isChecked()); 702 bool withMsg = (status != ICQ_STATUS_OFFLINE && status != ICQ_STATUS_ONLINE); 703 bool changeNow = !Config::General::instance()->delayStatusChange(); 704 705 if (withMsg) 706 AwayMsgDlg::showAwayMsgDlg(status, true, myPpid, myStatusInvisibleAction->isChecked(), !changeNow); 707 708 if (changeNow || !withMsg) 709 LicqGui::instance()->changeStatus(status, myPpid, myStatusInvisibleAction->isChecked()); 702 710 } 703 711 -
trunk/qt4-gui/src/dialogs/awaymsgdlg.cpp
r6068 r6139 40 40 #include <licq_user.h> 41 41 42 #include "core/licqgui.h" 43 42 44 #include "helpers/licqstrings.h" 43 45 #include "helpers/support.h" … … 55 57 AwayMsgDlg* AwayMsgDlg::myInstance = NULL; 56 58 57 void AwayMsgDlg::showAwayMsgDlg(unsigned short status, bool autoClose) 59 void AwayMsgDlg::showAwayMsgDlg(unsigned short status, bool autoClose, 60 unsigned long ppid, bool invisible, bool setStatus) 58 61 { 59 62 if (myInstance == NULL) … … 62 65 myInstance->raise(); 63 66 64 myInstance->selectAutoResponse(status, autoClose );67 myInstance->selectAutoResponse(status, autoClose, ppid, invisible, setStatus); 65 68 } 66 69 … … 109 112 } 110 113 111 void AwayMsgDlg::selectAutoResponse(unsigned short status, bool autoClose) 114 void AwayMsgDlg::selectAutoResponse(unsigned short status, bool autoClose, 115 unsigned long ppid, bool invisible, bool setStatus) 112 116 { 113 117 switch (status & 0x00FF) … … 120 124 121 125 myStatus = status; 126 myInvisible = invisible; 127 myPpid = ppid; 128 mySetStatus = setStatus; 122 129 123 130 // Fill in the select menu … … 235 242 myAutoCloseCounter = -1; 236 243 244 if (mySetStatus) 245 { 246 if (myPpid == 0) 247 LicqGui::instance()->changeStatus(myStatus, myInvisible); 248 else 249 LicqGui::instance()->changeStatus(myStatus, myPpid, myInvisible); 250 } 251 237 252 QString s = myAwayMsg->toPlainText().trimmed(); 238 253 -
trunk/qt4-gui/src/dialogs/awaymsgdlg.h
r5811 r6139 43 43 * @param status Status to prompt for away message to 44 44 * @param autoClose True if dialog should close after a timeout 45 * @param ppid Protocol to set status for or 0 to change globaly 46 * @param invisible True if new status is also invisible 47 * @param setStatus True if status should be set when dialog is closed 45 48 */ 46 static void showAwayMsgDlg(unsigned short status, bool autoClose = false); 49 static void showAwayMsgDlg(unsigned short status, bool autoClose = false, 50 unsigned long ppid = 0, bool invisible = false, bool setStatus = false); 47 51 48 52 static void showAutoResponseHints(QWidget* parent = 0); … … 53 57 AwayMsgDlg(QWidget* parent = 0); 54 58 ~AwayMsgDlg(); 55 void selectAutoResponse(unsigned short status, bool autoClose = false); 59 void selectAutoResponse(unsigned short status, bool autoClose = false, 60 unsigned long ppid = 0, bool invisible = false, bool setStatus = false); 56 61 57 62 MLEdit* myAwayMsg; … … 61 66 62 67 unsigned short myStatus; 68 bool myInvisible; 69 unsigned long myPpid; 70 bool mySetStatus; 63 71 short mySAR; 64 72 int myAutoCloseCounter; -
trunk/qt4-gui/src/settings/status.cpp
r6134 r6139 63 63 myPageStatusLayout->setContentsMargins(0, 0, 0, 0); 64 64 65 myGeneralBox = new QGroupBox(tr("General Status Options")); 66 myGeneralLayout = new QVBoxLayout(myGeneralBox); 67 68 myDelayStatusChangeCheck = new QCheckBox(tr("Delay status changes")); 69 myDelayStatusChangeCheck->setToolTip(tr("Set status after closing the away message dialog instead of setting it directly.")); 70 myGeneralLayout->addWidget(myDelayStatusChangeCheck); 71 65 72 myAutoLogonBox = new QGroupBox(tr("Startup")); 66 73 myAutoLogonLayout = new QVBoxLayout(myAutoLogonBox); … … 120 127 buildAutoStatusCombos(1); 121 128 129 myPageStatusLayout->addWidget(myGeneralBox); 122 130 myPageStatusLayout->addWidget(myAutoLogonBox); 123 131 myPageStatusLayout->addWidget(myAutoAwayBox); … … 264 272 Config::General* generalConfig = Config::General::instance(); 265 273 274 myDelayStatusChangeCheck->setChecked(generalConfig->delayStatusChange()); 266 275 myAutoAwaySpin->setValue(generalConfig->autoAwayTime()); 267 276 myAutoNaSpin->setValue(generalConfig->autoNaTime()); … … 278 287 generalConfig->blockUpdates(true); 279 288 289 generalConfig->setDelayStatusChange(myDelayStatusChangeCheck->isChecked()); 280 290 generalConfig->setAutoAwayTime(myAutoAwaySpin->value()); 281 291 generalConfig->setAutoNaTime(myAutoNaSpin->value()); -
trunk/qt4-gui/src/settings/status.h
r6091 r6139 76 76 77 77 // Widgets for status settings 78 QGroupBox* myGeneralBox; 79 QVBoxLayout* myGeneralLayout; 80 QCheckBox* myDelayStatusChangeCheck; 78 81 QVBoxLayout* myPageStatusLayout; 79 82 QGroupBox* myAutoLogonBox;
