Show
Ignore:
Timestamp:
04/10/08 02:50:04 (8 months ago)
Author:
flynd
Message:

Added option to not change status until away message dialog is closed. This closes #1421.

Location:
trunk/qt4-gui/src/dialogs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/dialogs/awaymsgdlg.cpp

    r6068 r6139  
    4040#include <licq_user.h> 
    4141 
     42#include "core/licqgui.h" 
     43 
    4244#include "helpers/licqstrings.h" 
    4345#include "helpers/support.h" 
     
    5557AwayMsgDlg* AwayMsgDlg::myInstance = NULL; 
    5658 
    57 void AwayMsgDlg::showAwayMsgDlg(unsigned short status, bool autoClose) 
     59void AwayMsgDlg::showAwayMsgDlg(unsigned short status, bool autoClose, 
     60    unsigned long ppid, bool invisible, bool setStatus) 
    5861{ 
    5962  if (myInstance == NULL) 
     
    6265    myInstance->raise(); 
    6366 
    64   myInstance->selectAutoResponse(status, autoClose); 
     67  myInstance->selectAutoResponse(status, autoClose, ppid, invisible, setStatus); 
    6568} 
    6669 
     
    109112} 
    110113 
    111 void AwayMsgDlg::selectAutoResponse(unsigned short status, bool autoClose) 
     114void AwayMsgDlg::selectAutoResponse(unsigned short status, bool autoClose, 
     115    unsigned long ppid, bool invisible, bool setStatus) 
    112116{ 
    113117  switch (status & 0x00FF) 
     
    120124 
    121125  myStatus = status; 
     126  myInvisible = invisible; 
     127  myPpid = ppid; 
     128  mySetStatus = setStatus; 
    122129 
    123130  // Fill in the select menu 
     
    235242  myAutoCloseCounter = -1; 
    236243 
     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 
    237252  QString s = myAwayMsg->toPlainText().trimmed(); 
    238253 
  • trunk/qt4-gui/src/dialogs/awaymsgdlg.h

    r5811 r6139  
    4343   * @param status Status to prompt for away message to 
    4444   * @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 
    4548   */ 
    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); 
    4751 
    4852  static void showAutoResponseHints(QWidget* parent = 0); 
     
    5357  AwayMsgDlg(QWidget* parent = 0); 
    5458  ~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); 
    5661 
    5762  MLEdit* myAwayMsg; 
     
    6166 
    6267  unsigned short myStatus; 
     68  bool myInvisible; 
     69  unsigned long myPpid; 
     70  bool mySetStatus; 
    6371  short mySAR; 
    6472  int myAutoCloseCounter;