Changeset 5446

Show
Ignore:
Timestamp:
09/28/07 21:38:59 (12 months ago)
Author:
eugene
Message:

Made default amount of messages per history page configurable in range of (2..200), ticket 821.

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

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4/src/gui-defines.h

    r5375 r5446  
    2020#ifndef GUIDEFINES_H 
    2121#define GUIDEFINES_H 
    22  
    23 #define NUM_MSG_PER_HISTORY 40 
    24 #define COLOR_SENT "blue" 
    25 #define COLOR_RECEIVED "red" 
    2622 
    2723#define DOCK_DIR "dock/" 
  • branches/qt-gui_qt4/src/mainwin.cpp

    r5444 r5446  
    380380  licqConf.ReadStr("DateFormat", szTemp, "hh:mm:ss"); 
    381381  m_chatDateFormat = QString::fromLatin1(szTemp); 
     382  licqConf.ReadNum("HistoryMessagesPerPage", m_histMsgNum, 40); 
    382383  licqConf.ReadNum("HistoryMessageStyle", m_histMsgStyle, 0); 
    383384  licqConf.ReadBool("HistoryVerticalSpacing", m_histVertSpacing, true); 
     
    27842785  licqConf.WriteStr("ChatBackground", m_colorChatBkg.name().toLatin1()); 
    27852786  licqConf.WriteStr("DateFormat", m_chatDateFormat.toLatin1()); 
     2787  licqConf.WriteNum("HistoryMessagesPerPage", m_histMsgNum); 
    27862788  licqConf.WriteNum("HistoryMessageStyle", m_histMsgStyle); 
    27872789  licqConf.WriteBool("HistoryVerticalSpacing", m_histVertSpacing); 
  • branches/qt-gui_qt4/src/mainwin.h

    r5422 r5446  
    203203                 m_nSortColumn, 
    204204                 m_chatMsgStyle, 
    205                  m_histMsgStyle; 
     205                 m_histMsgStyle, 
     206                 m_histMsgNum; 
    206207 
    207208  QString m_chatDateFormat, 
  • branches/qt-gui_qt4/src/messagebox.cpp

    r5378 r5446  
    3434 
    3535#include "eventdesc.h" 
    36 #include "gui-defines.h" 
    3736 
    3837using namespace LicqQtGui; 
     
    7372  QColor foreColor; 
    7473  if (myMsg->Direction() == D_SENDER) 
    75     foreColor = QColor(COLOR_SENT); 
     74    foreColor = QColor("blue"); 
    7675  else 
    77     foreColor = QColor(COLOR_RECEIVED); 
     76    foreColor = QColor("red"); 
    7877  setForeground(0, foreColor); 
    7978  setForeground(1, foreColor); 
  • branches/qt-gui_qt4/src/optionsdlg.cpp

    r5421 r5446  
    207207  chkHistReverse->setChecked(mainwin->m_histReverse); 
    208208  cmbHistDateFormat->lineEdit()->setText(mainwin->m_histDateFormat); 
     209  spnHistMsgNum->setValue(mainwin->m_histMsgNum); 
    209210  btnColorRcv->setColor(mainwin->m_colorRcv); 
    210211  btnColorSnt->setColor(mainwin->m_colorSnt); 
     
    497498  mainwin->m_chatMsgStyle = cmbChatStyle->currentIndex(); 
    498499  mainwin->m_chatDateFormat = cmbChatDateFormat->currentText(); 
     500  mainwin->m_histMsgNum = spnHistMsgNum->value(); 
    499501  mainwin->m_histMsgStyle = cmbHistStyle->currentIndex(); 
    500502  mainwin->m_histVertSpacing = chkHistVertSpacing->isChecked(); 
     
    11191121  layHistDisp->addLayout(layHistDateFormat); 
    11201122 
     1123  QHBoxLayout *layHistMsgNum = new QHBoxLayout(); 
     1124  lblHistMsgNum = new QLabel(tr("Entries per page:")); 
     1125  layHistMsgNum->addWidget(lblHistMsgNum); 
     1126  spnHistMsgNum = new QSpinBox(); 
     1127  spnHistMsgNum->setRange(2, 200); 
     1128  layHistMsgNum->addWidget(spnHistMsgNum); 
     1129  layHistDisp->addLayout(layHistMsgNum); 
     1130 
    11211131  QHBoxLayout *layHistOpts = new QHBoxLayout(); 
    11221132  chkHistVertSpacing = new QCheckBox(tr("Insert vertical spacing")); 
  • branches/qt-gui_qt4/src/optionsdlg.h

    r5417 r5446  
    269269  QVBoxLayout *layHistDisp; 
    270270  QVBoxLayout *layHistPreview; 
    271   QLabel *lblHistStyle, *lblHistDateFormat; 
     271  QLabel *lblHistStyle, *lblHistDateFormat, *lblHistMsgNum; 
    272272  QComboBox *cmbHistStyle; 
    273273  QCheckBox *chkHistVertSpacing; 
    274274  QCheckBox *chkHistReverse; 
    275275  QComboBox *cmbHistDateFormat; 
     276  QSpinBox *spnHistMsgNum; 
    276277  HistoryView* msgHistViewer; 
    277278 
  • branches/qt-gui_qt4/src/userinfodlg.cpp

    r5385 r5446  
    8080#include "ewidgets.h" 
    8181#include "eventdesc.h" 
    82 #include "gui-defines.h" 
    8382#include "historyview.h" 
    8483#include "mainwin.h" 
     
    19541953    m_iHistorySIter = m_iHistoryEIter; 
    19551954    for (unsigned short i = 0; 
    1956          (i < NUM_MSG_PER_HISTORY) && (m_iHistorySIter != m_lHistoryList.begin()); 
     1955         (i < gMainWindow->m_histMsgNum) && (m_iHistorySIter != m_lHistoryList.begin()); 
    19571956         i++) 
    19581957    { 
     
    19941993  { 
    19951994    m_iHistoryEIter = m_iHistorySIter; 
    1996     m_nHistoryIndex -= NUM_MSG_PER_HISTORY; 
     1995    m_nHistoryIndex -= gMainWindow->m_histMsgNum; 
    19971996    for (unsigned short i = 0; 
    1998          (i < NUM_MSG_PER_HISTORY) && (m_iHistorySIter != m_lHistoryList.begin()); 
     1997         (i < gMainWindow->m_histMsgNum) && (m_iHistorySIter != m_lHistoryList.begin()); 
    19991998         i++) 
    20001999    { 
     
    20132012    m_iHistorySIter = m_iHistoryEIter; 
    20142013    for (unsigned short i = 0; 
    2015          (i < NUM_MSG_PER_HISTORY) && (m_iHistoryEIter != m_lHistoryList.end()); 
     2014         (i < gMainWindow->m_histMsgNum) && (m_iHistoryEIter != m_lHistoryList.end()); 
    20162015         i++) 
    20172016    { 
     
    20662065      gUserManager.DropUser(u); 
    20672066  } 
    2068   barFiltering->setRange(0, NUM_MSG_PER_HISTORY); 
     2067  barFiltering->setRange(0, gMainWindow->m_histMsgNum); 
    20692068  char* ftxt = qstrdup(codec->fromUnicode(lneFilter->text())); 
    20702069  int flen = strlen(ftxt); 
     
    20832082  mlvHistory->clear(); 
    20842083  mlvHistory->setReverse(m_bHistoryReverse); 
    2085   while (m_nHistoryShowing < (NUM_MSG_PER_HISTORY)) 
     2084  while (m_nHistoryShowing < gMainWindow->m_histMsgNum) 
    20862085  { 
    20872086    if(UserInfoDlg::chkContains((*tempIter)->Text(), ftxt, flen))