Changeset 5115

Show
Ignore:
Timestamp:
08/08/07 06:06:52 (14 months ago)
Author:
eugene
Message:

Make history reverse optional.

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

Legend:

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

    r5081 r5115  
    162162    m_nDateFormat = m->m_histDateFormat; 
    163163    m_extraSpacing = m->m_histVertSpacing; 
     164    m_reverse = m->m_histReverse; 
    164165    m_appendLineBreak = false; 
    165166  } 
     
    170171    m_nDateFormat = m->m_chatDateFormat; 
    171172    m_extraSpacing = m->m_chatVertSpacing; 
     173    m_reverse = false; 
    172174    m_appendLineBreak = m->m_chatAppendLineBreak; 
    173175  } 
     
    213215    m_nDateFormat = m->m_histDateFormat; 
    214216    m_extraSpacing = m->m_histVertSpacing; 
     217    m_reverse = m->m_histReverse; 
    215218    m_appendLineBreak = false; 
    216219  } 
     
    221224    m_nDateFormat = m->m_chatDateFormat; 
    222225    m_extraSpacing = m->m_chatVertSpacing; 
     226    m_reverse = false; 
    223227    m_appendLineBreak = m->m_chatAppendLineBreak; 
    224228  } 
     
    318322      s.append("<br>"); 
    319323 
    320     m_buffer.append(s); 
    321324    if (m_appendLineBreak) 
    322       m_buffer.append("<hr>"); 
     325      s.append("<hr>"); 
     326 
     327    if (m_reverse) 
     328      m_buffer.prepend(s); 
     329    else 
     330      m_buffer.append(s); 
    323331  } 
    324332  else 
    325333  { 
     334    if (m_appendLineBreak) 
     335      s.append("<hr>"); 
     336 
    326337    append(s); 
    327     if (m_appendLineBreak) 
    328       append("<hr>"); 
    329338  } 
    330339} 
  • branches/qt-gui_qt4/src/ewidgets.h

    r5081 r5115  
    8282  QString m_nDateFormat; 
    8383  bool m_extraSpacing; 
     84  bool m_reverse; 
    8485  bool m_appendLineBreak; 
    8586  bool m_useBuffer; 
  • branches/qt-gui_qt4/src/mainwin.cpp

    r5113 r5115  
    490490  licqConf.ReadNum("HistoryMessageStyle", m_histMsgStyle, 0); 
    491491  licqConf.ReadBool("HistoryVerticalSpacing", m_histVertSpacing, true); 
     492  licqConf.ReadBool("HistoryReverse", m_histReverse, true); 
    492493  licqConf.ReadStr("HistoryDateFormat", szTemp, "yyyy-MM-dd hh:mm:ss"); 
    493494  m_histDateFormat = QString::fromLatin1(szTemp); 
     
    36283629  licqConf.WriteNum("HistoryMessageStyle", m_histMsgStyle); 
    36293630  licqConf.WriteBool("HistoryVerticalSpacing", m_histVertSpacing); 
     3631  licqConf.WriteBool("HistoryReverse", m_histReverse); 
    36303632  licqConf.WriteStr("HistoryDateFormat", m_histDateFormat.latin1()); 
    36313633 
  • branches/qt-gui_qt4/src/mainwin.h

    r5110 r5115  
    205205       m_chatAppendLineBreak, 
    206206       m_histVertSpacing, 
     207       m_histReverse, 
    207208       m_bFlashTaskbar, 
    208209       m_bMainWinSticky, 
  • branches/qt-gui_qt4/src/optionsdlg.cpp

    r5113 r5115  
    213213  cmbHistStyle->setCurrentIndex(mainwin->m_histMsgStyle); 
    214214  chkHistVertSpacing->setChecked(mainwin->m_histVertSpacing); 
     215  chkHistReverse->setChecked(mainwin->m_histReverse); 
    215216  cmbHistDateFormat->lineEdit()->setText(mainwin->m_histDateFormat); 
    216217  btnColorRcv->setColor(mainwin->m_colorRcv); 
     
    505506  mainwin->m_histMsgStyle = cmbHistStyle->currentIndex(); 
    506507  mainwin->m_histVertSpacing = chkHistVertSpacing->isChecked(); 
     508  mainwin->m_histReverse = chkHistReverse->isChecked(); 
    507509  mainwin->m_histDateFormat = cmbHistDateFormat->currentText(); 
    508510  mainwin->m_colorRcv = btnColorRcv->getColor(); 
     
    11171119  layHistDisp->addLayout(layHistDateFormat); 
    11181120 
     1121  QHBoxLayout *layHistOpts = new QHBoxLayout(); 
    11191122  chkHistVertSpacing = new QCheckBox(tr("Insert vertical spacing")); 
    11201123  connect(chkHistVertSpacing, SIGNAL(toggled(bool)), this, SLOT(slot_refresh_msgViewer())); 
    11211124  chkHistVertSpacing->setToolTip(tr("Insert extra space between messages.")); 
    1122   layHistDisp->addWidget(chkHistVertSpacing); 
     1125  layHistOpts->addWidget(chkHistVertSpacing); 
     1126 
     1127  chkHistReverse = new QCheckBox(tr("Reverse history")); 
     1128  connect(chkHistReverse, SIGNAL(toggled(bool)), this, SLOT(slot_refresh_msgViewer())); 
     1129  chkHistReverse->setToolTip(tr("Put recent messages on top.")); 
     1130  layHistOpts->addWidget(chkHistReverse); 
     1131  layHistDisp->addLayout(layHistOpts); 
    11231132 
    11241133  boxHistPreview = new QGroupBox(tr("Preview")); 
     
    20202029  msgHistViewer->m_nMsgStyle = cmbHistStyle->currentIndex(); 
    20212030  msgHistViewer->m_extraSpacing = chkHistVertSpacing->isChecked(); 
     2031  msgHistViewer->m_reverse = chkHistReverse->isChecked(); 
    20222032  msgHistViewer->m_colorSnt = btnColorSnt->getColor(); 
    20232033  msgHistViewer->m_colorRcv = btnColorRcv->getColor(); 
  • branches/qt-gui_qt4/src/optionsdlg.h

    r5106 r5115  
    269269  QComboBox *cmbHistStyle; 
    270270  QCheckBox *chkHistVertSpacing; 
     271  QCheckBox *chkHistReverse; 
    271272  QComboBox *cmbHistDateFormat; 
    272273  CMessageViewWidget *msgHistViewer; 
  • branches/qt-gui_qt4/src/userinfodlg.cpp

    r5081 r5115  
    17741774  chkHistoryReverse = new QCheckBox(tr("Rever&se")); 
    17751775  connect(chkHistoryReverse, SIGNAL(toggled(bool)), SLOT(HistoryReverse(bool))); 
    1776   chkHistoryReverse->setChecked(m_bHistoryReverse = true); 
     1776  chkHistoryReverse->setChecked(m_bHistoryReverse = mainwin->m_histReverse); 
    17771777  chkHistoryReverse->setFixedSize(chkHistoryReverse->sizeHint()); 
    17781778  l->addWidget(chkHistoryReverse); 
     
    20452045  // Last check (will be true if history is empty) 
    20462046  if (m_lHistoryList.size() == 0) return; 
    2047   HistoryListIter tempIter; 
    2048  
    2049   if(m_bHistoryReverse) 
    2050   { 
    2051     tempIter = m_iHistoryEIter; 
    2052     tempIter--; 
    2053   } 
    2054   else 
    2055   { 
    2056     tempIter = m_iHistorySIter; 
    2057   } 
     2047  HistoryListIter tempIter = m_iHistorySIter; 
     2048 
    20582049  QString s; 
    20592050  QString tmp; 
     
    20942085 
    20952086  mlvHistory->clear(); 
     2087  mlvHistory->m_reverse = m_bHistoryReverse; 
    20962088  while (m_nHistoryShowing < (NUM_MSG_PER_HISTORY)) 
    20972089  { 
     
    21172109      barFiltering->setValue(m_nHistoryShowing); 
    21182110    } 
    2119     if(m_bHistoryReverse) 
    2120     { 
    2121       if (tempIter == (lneFilter->text().isEmpty() ? 
    2122                        m_iHistorySIter : m_lHistoryList.begin())) 
    2123         break; 
    2124       tempIter--; 
    2125     } 
    2126     else 
    2127     { 
    2128        tempIter++; 
    2129        if (tempIter == (lneFilter->text().isEmpty() ? 
    2130                         m_iHistoryEIter : m_lHistoryList.end())) 
    2131          break; 
    2132     } 
     2111     
     2112    tempIter++; 
     2113    if (tempIter == (lneFilter->text().isEmpty() ? 
     2114                     m_iHistoryEIter : m_lHistoryList.end())) 
     2115      break; 
    21332116  } 
    21342117