Changeset 5459

Show
Ignore:
Timestamp:
09/29/07 07:19:48 (14 months ago)
Author:
eugene
Message:

Made focusing the new message popup window configurable.
This is to address the request in #1014.

Location:
branches/qt-gui_qt4/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4/src/mainwin.cpp

    r5447 r5459  
    455455  licqConf.ReadBool("AutoClose", m_bAutoClose, true); 
    456456  licqConf.ReadBool("AutoPopup", m_bAutoPopup, false); 
     457  licqConf.ReadBool("AutoFocus", m_bAutoFocus, true); 
    457458  licqConf.ReadStr("MsgPopupKey", szTemp, "none"); 
    458459 
     
    22342235        { 
    22352236          e->show(); 
    2236           if(!qApp->activeWindow() || !qApp->activeWindow()->inherits("UserEventCommon")) 
     2237          if (m_bAutoFocus && 
     2238              (!qApp->activeWindow() || !qApp->activeWindow()->inherits("UserEventCommon"))) 
    22372239          { 
    22382240            e->raise(); 
     
    22702272            { 
    22712273              userEventTabDlg->show(); 
    2272               userEventTabDlg->selectTab(e); 
    2273               userEventTabDlg->raise(); 
    2274               userEventTabDlg->activateWindow(); 
     2274              if (m_bAutoFocus) 
     2275              { 
     2276                userEventTabDlg->selectTab(e); 
     2277                userEventTabDlg->raise(); 
     2278                userEventTabDlg->activateWindow(); 
     2279              } 
    22752280            } 
    22762281            else 
    22772282            { 
    22782283              e->show(); 
    2279               if (!qApp->activeWindow() || !qApp->activeWindow()->inherits("UserEventCommon")) 
     2284              if (m_bAutoFocus && 
     2285                  (!qApp->activeWindow() || !qApp->activeWindow()->inherits("UserEventCommon"))) 
    22802286              { 
    22812287                e->raise(); 
     
    22912297  } 
    22922298 
     2299  bool newtabw = false; 
    22932300  QWidget *parent = NULL; 
    22942301  if (m_bTabbedChatting) 
    22952302  { 
    2296     if (userEventTabDlg != NULL) { 
    2297       userEventTabDlg->raise(); 
    2298       userEventTabDlg->activateWindow(); 
     2303    if (userEventTabDlg != NULL) 
     2304    { 
     2305      if (m_bAutoFocus) 
     2306      { 
     2307        userEventTabDlg->raise(); 
     2308        userEventTabDlg->activateWindow(); 
     2309      } 
    22992310    } 
    23002311    else 
     
    23032314      userEventTabDlg = new UserEventTabDlg(this, 0, "UserEventTabbedDialog"); 
    23042315      connect(userEventTabDlg, SIGNAL(signal_done()), this, SLOT(slot_doneUserEventTabDlg())); 
     2316      newtabw = true; 
    23052317    } 
    23062318    parent = userEventTabDlg; 
    23072319  } 
    23082320 
    2309   UserEventCommon *e = NULL; 
     2321  UserEventCommon* e = NULL; 
    23102322 
    23112323  switch (fcn) 
     
    23572369    userEventTabDlg->addTab(e); 
    23582370    userEventTabDlg->show(); 
    2359     e->setFocus(); 
    2360     userEventTabDlg->raise(); 
    2361     userEventTabDlg->activateWindow(); 
     2371    if (newtabw) 
     2372      e->setFocus(); 
     2373 
     2374    if (m_bAutoFocus) 
     2375    { 
     2376      userEventTabDlg->raise(); 
     2377      userEventTabDlg->activateWindow(); 
     2378    } 
    23622379 
    23632380    // Check if we want the window sticky 
     
    26992716  licqConf.WriteBool("AutoClose", m_bAutoClose); 
    27002717  licqConf.WriteBool("AutoPopup", m_bAutoPopup); 
     2718  licqConf.WriteBool("AutoFocus", m_bAutoFocus); 
    27012719  licqConf.WriteStr("MsgPopupKey", m_MsgAutopopupKey.isEmpty() ? "none" : m_MsgAutopopupKey.toLatin1()); 
    27022720 
  • branches/qt-gui_qt4/src/mainwin.h

    r5446 r5459  
    144144       m_bAutoClose, 
    145145       m_bAutoPopup, 
     146       m_bAutoFocus, 
    146147       m_bShowOffline, 
    147148       m_bAlwaysShowONU, 
  • branches/qt-gui_qt4/src/optionsdlg.cpp

    r5446 r5459  
    190190  chkFlashAll->setChecked(mainwin->m_nFlash == FLASH_ALL); 
    191191  chkAutoPopup->setChecked(mainwin->m_bAutoPopup); 
     192  chkAutoFocus->setChecked(mainwin->m_bAutoFocus); 
    192193  chkAutoRaise->setChecked(mainwin->m_bAutoRaise); 
    193194  chkHidden->setChecked(mainwin->m_bHidden); 
     
    480481  mainwin->m_bAutoClose = chkAutoClose->isChecked(); 
    481482  mainwin->m_bAutoPopup = chkAutoPopup->isChecked(); 
     483  mainwin->m_bAutoFocus = chkAutoFocus->isChecked(); 
    482484  mainwin->m_bAutoRaise = chkAutoRaise->isChecked(); 
    483485  mainwin->m_bHidden = chkHidden->isChecked(); 
     
    11721174  layNewMsgActions->addWidget(chkAutoPopup); 
    11731175 
     1176  chkAutoFocus = new QCheckBox(tr("Auto-focus message")); 
     1177  chkAutoFocus->setToolTip(tr("Automatically focus opened message windows.")); 
     1178  layNewMsgActions->addWidget(chkAutoFocus); 
     1179 
    11741180  chkAutoRaise = new QCheckBox(tr("Auto-raise main window")); 
    11751181  chkAutoRaise->setToolTip(tr("Raise the main window on incoming messages")); 
  • branches/qt-gui_qt4/src/optionsdlg.h

    r5446 r5459  
    282282  QVBoxLayout *layNewMsgActions, *layParanoia; 
    283283  QCheckBox *chkOEAway, *chkOENA, *chkOEOccupied, *chkOEDND, *chkAlwaysOnlineNotify, 
    284              *chkBoldOnMsg, *chkAutoPopup, *chkAutoRaise, 
     284             *chkBoldOnMsg, *chkAutoPopup, *chkAutoRaise, *chkAutoFocus, 
    285285             *chkFlashTaskbar, *chkFlashAll, *chkFlashUrgent; 
    286286  QCheckBox *chkIgnoreNewUsers, *chkIgnoreWebPanel, *chkIgnoreMassMsg, *chkIgnoreEmailPager; 
  • branches/qt-gui_qt4/src/userevents/usereventtabdlg.cpp

    r5422 r5459  
    7878  updateTabLabel(u); 
    7979  gUserManager.DropUser(u); 
    80   tabw->setCurrentIndex(index); 
     80  QWidget* fw = tabw->focusWidget(); 
     81  if (gMainWindow->m_bAutoFocus) 
     82    tabw->setCurrentIndex(index); 
     83  else 
     84    if (fw != NULL) 
     85      fw->setFocus(); 
    8186} 
    8287