Changeset 4791
- Timestamp:
- 11/30/06 03:02:49 (23 months ago)
- Location:
- trunk/qt-gui/src
- Files:
-
- 9 modified
-
ewidgets.cpp (modified) (13 diffs)
-
ewidgets.h (modified) (4 diffs)
-
mainwin.cpp (modified) (4 diffs)
-
mainwin.h (modified) (2 diffs)
-
mlview.cpp (modified) (1 diff)
-
mlview.h (modified) (1 diff)
-
optionsdlg.cpp (modified) (7 diffs)
-
optionsdlg.h (modified) (3 diffs)
-
userinfodlg.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt-gui/src/ewidgets.cpp
r4788 r4791 45 45 #include <qlayout.h> 46 46 #include <qheader.h> 47 #include <qstringlist.h> 47 48 #include <ctype.h> 48 49 #include <algorithm> … … 662 663 663 664 //- Message View Widget --------------------------------------------------------- 665 666 QStringList CMessageViewWidget::getStyleNames(bool includeHistoryStyles) 667 { 668 static const char *const styleNames[] = { 669 QT_TR_NOOP("Default"), 670 QT_TR_NOOP("Compact"), 671 QT_TR_NOOP("Tiny"), 672 QT_TR_NOOP("Table"), 673 QT_TR_NOOP("Long"), 674 QT_TR_NOOP("Wide") 675 }; 676 677 int listLength; 678 679 // Style 5 (Wide) is currently only supported in buffered mode which is not used for chat 680 if(includeHistoryStyles) 681 listLength = 6; 682 else 683 listLength = 5; 684 685 QStringList styleList; 686 for(int i = 0; i < listLength; ++i) 687 styleList.append(tr(styleNames[i])); 688 689 return styleList; 690 } 691 664 692 CMessageViewWidget::CMessageViewWidget(const char *szId, unsigned long nPPID, 665 CMainWindow *m, QWidget* parent, const char * name)693 CMainWindow *m, QWidget* parent, const char *name, bool historyMode) 666 694 : CHistoryWidget(parent, name) 667 695 { 668 696 m_szId = szId ? strdup(szId) : 0; 669 697 m_nPPID = nPPID; 670 m_nMsgStyle = m->m_nMsgStyle; 671 m_nDateFormat = m->m_nDateFormat; 672 m_bAppendLineBreak = m->m_bAppendLineBreak; 698 if (historyMode) 699 { 700 m_useBuffer = true; 701 m_nMsgStyle = m->m_histMsgStyle; 702 m_nDateFormat = m->m_histDateFormat; 703 m_extraSpacing = m->m_histVertSpacing; 704 m_appendLineBreak = false; 705 } 706 else 707 { 708 m_useBuffer = false; 709 m_nMsgStyle = m->m_chatMsgStyle; 710 m_nDateFormat = m->m_chatDateFormat; 711 m_extraSpacing = m->m_chatVertSpacing; 712 m_appendLineBreak = m->m_chatAppendLineBreak; 713 } 673 714 m_colorRcv = m->m_colorRcv; 674 715 m_colorSnt = m->m_colorSnt; … … 679 720 mainwin = m; 680 721 722 clear(); 723 681 724 /* 682 725 // add all unread messages. … … 698 741 } 699 742 700 CMessageViewWidget::CMessageViewWidget(unsigned long _nUin, CMainWindow *m, QWidget * parent, const char * name)743 CMessageViewWidget::CMessageViewWidget(unsigned long _nUin, CMainWindow *m, QWidget *parent, const char *name, bool historyMode) 701 744 :CHistoryWidget(parent,name) 702 745 { 703 746 m_nUin= _nUin; 704 747 m_szId = NULL; // avoid desalocation error at destructor 705 m_nMsgStyle = m->m_nMsgStyle; 706 m_nDateFormat = m->m_nDateFormat; 707 m_bAppendLineBreak = m->m_bAppendLineBreak; 748 if (historyMode) 749 { 750 m_useBuffer = true; 751 m_nMsgStyle = m->m_histMsgStyle; 752 m_nDateFormat = m->m_histDateFormat; 753 m_extraSpacing = m->m_histVertSpacing; 754 m_appendLineBreak = false; 755 } 756 else 757 { 758 m_useBuffer = false; 759 m_nMsgStyle = m->m_chatMsgStyle; 760 m_nDateFormat = m->m_chatDateFormat; 761 m_extraSpacing = m->m_chatVertSpacing; 762 m_appendLineBreak = m->m_chatAppendLineBreak; 763 } 708 764 m_colorRcv = m->m_colorRcv; 709 765 m_colorSnt = m->m_colorSnt; … … 713 769 setPaletteBackgroundColor(m->m_colorChatBkg); 714 770 mainwin = m; 771 772 clear(); 773 715 774 /* 716 775 // add all unread messages. … … 746 805 } 747 806 807 void CMessageViewWidget::clear() 808 { 809 CHistoryWidget::clear(); 810 811 m_buffer = ""; 812 813 switch (m_nMsgStyle) 814 { 815 case 5: 816 // table doesn't work when appending so must buffer when using this style 817 m_buffer.append("<table border=\"0\">"); 818 m_useBuffer = true; 819 break; 820 } 821 if (m_useBuffer) 822 m_buffer.prepend("<html><body>"); 823 } 824 825 void CMessageViewWidget::updateContent() 826 { 827 if (m_useBuffer) 828 setText(m_buffer); 829 } 830 831 void CMessageViewWidget::internalAddMsg(QString s) 832 { 833 if (m_extraSpacing) 834 { 835 if (m_nMsgStyle != 5) 836 { 837 if (m_useBuffer) 838 { 839 s.prepend("<p>"); 840 s.append("</p>"); 841 } 842 else 843 { 844 s.append("<br>"); 845 } 846 } 847 else 848 { 849 s.append("<tr><td colspan=\"3\"></td></tr>"); 850 } 851 } 852 853 if (m_useBuffer) 854 { 855 if (!m_extraSpacing && m_nMsgStyle != 5) 856 s.append("<br>"); 857 858 m_buffer.append(s); 859 if (m_appendLineBreak) 860 m_buffer.append("<hr>"); 861 } 862 else 863 { 864 append(s); 865 if (m_appendLineBreak) 866 append("<hr>"); 867 } 868 } 869 748 870 void CMessageViewWidget::addMsg(ICQEvent * _e) 749 871 { … … 759 881 QString s; 760 882 QString color; 761 bool bAIM = (m_nPPID == LICQ_PPID) && !isdigit(m_szId[0]); 762 763 if (fromHistory)883 884 if (fromHistory) 885 { 764 886 if (dir == D_RECEIVER) 765 887 color = m_colorRcvHistory.name(); 766 888 else 767 color = m_colorSntHistory.name(); 889 color = m_colorSntHistory.name(); 890 } 768 891 else 892 { 769 893 if (dir == D_RECEIVER) 770 894 color = m_colorRcv.name(); 771 895 else 772 color = m_colorSnt.name(); 773 774 /* Remove trailing line breaks. */ 775 for (unsigned int i = messageText.length() - 1; i>=0; i--) { 776 if (messageText.at(i) == '\n' || messageText.at(i) == '\r') { 896 color = m_colorSnt.name(); 897 } 898 899 // Remove trailing line breaks. 900 for (int i = messageText.length(); i >= 0; i--) 901 { 902 if (messageText.at(i - 1) != '\n' && messageText.at(i - 1) != '\r') 903 { 777 904 messageText.truncate(i); 778 } else {779 905 break; 780 906 } 781 907 } 782 908 909 // Extract everything inside <body>...</body> 910 // Leaving <html> and <body> messes with our message display 911 QRegExp body("<body[^>]*>(.*)</body>"); 912 if (body.search(messageText) != -1) 913 messageText = body.cap(1); 914 915 // Remove all font tags 916 messageText.replace(QRegExp("</?font[^>]*>"), ""); 917 783 918 QString my_date = date.toString( m_nDateFormat ); 784 919 785 920 switch (m_nMsgStyle) { 786 921 case 0: 787 s = QString("< html><body><font color=\"%1\"><b>%2%3 [%4%5%6%7] %8:</b></font><br>")922 s = QString("<font color=\"%1\"><b>%2%3 [%4%5%6%7] %8:</b></font><br>") 788 923 .arg(color) 789 924 .arg(eventDescription) … … 794 929 .arg(isEncrypted ? 'E' : '-') 795 930 .arg(contactName); 796 s.append(QString("<font color=\"%1\">%2</font> </body></html>")931 s.append(QString("<font color=\"%1\">%2</font>") 797 932 .arg(color) 798 933 .arg(messageText)); … … 811 946 .arg(color) 812 947 .arg(messageText)); 813 if (bAIM)814 {815 s.prepend("<html><body>");816 s.append("</body></html>");817 }818 819 948 break; 820 949 case 2: … … 827 956 .arg(color) 828 957 .arg(messageText)); 829 830 if (bAIM)831 {832 s.prepend("<html><body>");833 s.append("</body></html>");834 }835 836 958 break; 837 959 case 3: … … 864 986 .arg(color) 865 987 .arg(messageText)); 866 break; 867 } 868 869 append(s); 870 if (m_bAppendLineBreak) { 871 append("<hr>"); 872 } 988 break; 989 case 5: 990 // Mode 5 is a table so it cannot be displayed in paragraphs 991 s = QString("<tr><td><nobr><b><font color=\"%1\">%2</font><b></nobr></td>") 992 .arg(color) 993 .arg(my_date); 994 s.append(QString("<td><b><font color=\"%3\">%4</font></b></font></td>") 995 .arg(color) 996 .arg(contactName)); 997 s.append(QString("<td><font color=\"%1\">%2</font></td></tr>") 998 .arg(color) 999 .arg(messageText)); 1000 break; 1001 } 1002 1003 internalAddMsg(s); 873 1004 } 874 1005 … … 989 1120 break; 990 1121 1122 case 5: 1123 s = QString("<tr><td><b><font color=\"%1\">%2</font><b></td><td colspan=\"2\"><b><font color=\"%3\">%4</font></b></font></td></tr>") 1124 .arg(color) 1125 .arg(dateTime) 1126 .arg(color) 1127 .arg(messageText); 1128 break; 1129 991 1130 case 0: 992 1131 default: 993 s = QString("< html><body><font color=\"%1\"><b>[%2] %3</b></font><br></body></html>")1132 s = QString("<font color=\"%1\"><b>[%2] %3</b></font><br>") 994 1133 .arg(color) 995 1134 .arg(dateTime) … … 998 1137 } 999 1138 1000 append(s); 1001 if (m_bAppendLineBreak) 1002 append("<hr>"); 1139 internalAddMsg(s); 1003 1140 } 1004 1141 -
trunk/qt-gui/src/ewidgets.h
r4736 r4791 33 33 #include <qsize.h> 34 34 #include <qlistview.h> 35 #include <qstringlist.h> 35 36 36 37 #include "mlview.h" … … 199 200 CMainWindow *mainwin; 200 201 public: 202 static QStringList getStyleNames(bool includeHistoryStyles = false); 203 201 204 CMessageViewWidget(const char *szId, unsigned long nPPID, 202 CMainWindow *m, QWidget *parent = 0, const char *name = 0 );205 CMainWindow *m, QWidget *parent = 0, const char *name = 0, bool historyMode = false); 203 206 CMessageViewWidget(unsigned long _nUin, CMainWindow *m, 204 QWidget* parent=0, const char * name =0);207 QWidget* parent = 0, const char *name = 0, bool historyMode = false); 205 208 virtual ~CMessageViewWidget(); 206 209 207 210 void setOwner(const char *szId); 211 void updateContent(); 212 void clear(); 208 213 void addMsg(direction dir, bool fromHistory, QString eventDescription, QDateTime date, 209 214 bool isDirect, bool isMultiRec, bool isUrgent, bool isEncrypted, … … 213 218 unsigned short m_nMsgStyle; 214 219 QString m_nDateFormat; 215 bool m_bAppendLineBreak; 220 bool m_extraSpacing; 221 bool m_appendLineBreak; 222 bool m_useBuffer; 216 223 QColor m_colorRcvHistory; 217 224 QColor m_colorSntHistory; … … 223 230 virtual void addMsg(CUserEvent *, const char * = 0, unsigned long = 0); 224 231 void addMsg(ICQEvent *); 232 233 private: 234 void internalAddMsg(QString s); 235 QString m_buffer; 225 236 }; 226 237 -
trunk/qt-gui/src/mainwin.cpp
r4775 r4791 433 433 licqConf.ReadBool("AutoSendThroughServer", m_bAutoSendThroughServer, false); 434 434 licqConf.ReadBool("EnableMainwinMouseMovement", m_bEnableMainwinMouseMovement, true); 435 licqConf.ReadNum("ChatMessageStyle", m_nMsgStyle, 0); 436 licqConf.ReadBool("ChatAppendLinebreak", m_bAppendLineBreak, false); 435 licqConf.ReadNum("ChatMessageStyle", m_chatMsgStyle, 0); 436 licqConf.ReadBool("ChatVerticalSpacing", m_chatVertSpacing, true); 437 licqConf.ReadBool("ChatAppendLinebreak", m_chatAppendLineBreak, false); 437 438 licqConf.ReadBool("FlashTaskbar", m_bFlashTaskbar, true); 438 439 licqConf.ReadBool("ShowUserIcons", m_bShowUserIcons, true); … … 442 443 licqConf.ReadBool("CheckSpellingEnabled", m_bCheckSpellingEnabled, false); 443 444 licqConf.ReadStr("DateFormat", szTemp, "hh:mm:ss"); 444 m_nDateFormat = QString::fromLatin1(szTemp); 445 m_chatDateFormat = QString::fromLatin1(szTemp); 446 licqConf.ReadNum("HistoryMessageStyle", m_histMsgStyle, 0); 447 licqConf.ReadBool("HistoryVerticalSpacing", m_histVertSpacing, true); 448 licqConf.ReadStr("HistoryDateFormat", szTemp, "yyyy-MM-dd hh:mm:ss"); 449 m_histDateFormat = QString::fromLatin1(szTemp); 445 450 446 451 licqConf.ReadStr("ReceiveMessageColor", szTemp, "red"); … … 3577 3582 licqConf.WriteBool("CheckSpellingEnabled", m_bCheckSpellingEnabled); 3578 3583 3579 licqConf.WriteNum("ChatMessageStyle", m_nMsgStyle); 3580 licqConf.WriteBool("ChatAppendLinebreak", m_bAppendLineBreak); 3584 licqConf.WriteNum("ChatMessageStyle", m_chatMsgStyle); 3585 licqConf.WriteBool("ChatVerticalSpacing", m_chatVertSpacing); 3586 licqConf.WriteBool("ChatAppendLinebreak", m_chatAppendLineBreak); 3581 3587 licqConf.WriteStr("ReceiveMessageColor", m_colorRcv.name()); 3582 3588 licqConf.WriteStr("ReceiveHistoryColor", m_colorRcvHistory.name()); … … 3587 3593 licqConf.WriteStr("TabOnTypingColor", m_colorTabTyping.name()); 3588 3594 licqConf.WriteStr("ChatBackground", m_colorChatBkg.name()); 3589 licqConf.WriteStr("DateFormat", m_nDateFormat.latin1()); 3595 licqConf.WriteStr("DateFormat", m_chatDateFormat.latin1()); 3596 licqConf.WriteNum("HistoryMessageStyle", m_histMsgStyle); 3597 licqConf.WriteBool("HistoryVerticalSpacing", m_histVertSpacing); 3598 licqConf.WriteStr("HistoryDateFormat", m_histDateFormat.latin1()); 3590 3599 3591 3600 licqConf.WriteBool("showPopPicture", m_bPopPicture); -
trunk/qt-gui/src/mainwin.h
r4736 r4791 162 162 m_bDisableDockIcon, 163 163 m_bSortColumnAscending, 164 m_bAppendLineBreak, 164 m_chatVertSpacing, 165 m_chatAppendLineBreak, 166 m_histVertSpacing, 165 167 m_bFlashTaskbar, 166 168 m_bMainWinSticky, … … 180 182 unsigned short m_nSortByStatus, 181 183 m_nSortColumn, 182 m_nMsgStyle; 183 QString m_nDateFormat; 184 184 m_chatMsgStyle, 185 m_histMsgStyle; 186 187 QString m_chatDateFormat, 188 m_histDateFormat; 189 185 190 QColor m_colorRcvHistory, 186 191 m_colorSntHistory, -
trunk/qt-gui/src/mlview.cpp
r4682 r4791 157 157 } 158 158 159 void MLView::GotoHome() 160 { 161 setContentsPos(0, 0); 162 } 163 159 164 void MLView::GotoEnd() 160 165 { -
trunk/qt-gui/src/mlview.h
r4550 r4791 32 32 void appendNoNewLine(const QString& s); 33 33 void append(const QString& s); 34 void GotoHome(); 34 35 void GotoEnd(); 35 36 -
trunk/qt-gui/src/optionsdlg.cpp
r4782 r4791 213 213 chkSendFromClipboard->setChecked(mainwin->m_bSendFromClipboard); 214 214 chkMsgChatView->setChecked(mainwin->m_bMsgChatView); 215 216 bool isCustomDate = true; 217 for (int i = 0; i < cmbDateFormat->count(); i++) 218 { 219 if (cmbDateFormat->text(i) == mainwin->m_nDateFormat) 220 { 221 cmbDateFormat->setCurrentItem(i); 222 isCustomDate = false; 223 break; 224 } 225 } 226 227 // Make sure the checkbox is actually toggled, so that widgets are enabled/disabled. 228 chkCustomDateFormat->setChecked(!isCustomDate); 229 chkCustomDateFormat->setChecked(isCustomDate); 230 231 customDateFormat->setText(mainwin->m_nDateFormat); 232 233 chkLineBreak->setChecked(mainwin->m_bAppendLineBreak); 234 cmbStyle->setCurrentItem(mainwin->m_nMsgStyle); 215 cmbChatDateFormat->lineEdit()->setText(mainwin->m_chatDateFormat); 216 chkChatVertSpacing->setChecked(mainwin->m_chatVertSpacing); 217 chkChatLineBreak->setChecked(mainwin->m_chatAppendLineBreak); 218 cmbChatStyle->setCurrentItem(mainwin->m_chatMsgStyle); 219 cmbHistStyle->setCurrentItem(mainwin->m_histMsgStyle); 220 chkHistVertSpacing->setChecked(mainwin->m_histVertSpacing); 221 cmbHistDateFormat->lineEdit()->setText(mainwin->m_histDateFormat); 235 222 btnColorRcv->setPaletteBackgroundColor(mainwin->m_colorRcv); 236 223 btnColorSnt->setPaletteBackgroundColor(mainwin->m_colorSnt); … … 528 515 mainwin->m_bSendFromClipboard = chkSendFromClipboard->isChecked(); 529 516 mainwin->m_bMsgChatView = chkMsgChatView->isChecked(); 530 mainwin->m_bAppendLineBreak = chkLineBreak->isChecked(); 531 mainwin->m_nMsgStyle = cmbStyle->currentItem(); 532 mainwin->m_nDateFormat = getCurrentDateFormat(); 517 mainwin->m_chatVertSpacing = chkChatVertSpacing->isChecked(); 518 mainwin->m_chatAppendLineBreak = chkChatLineBreak->isChecked(); 519 mainwin->m_chatMsgStyle = cmbChatStyle->currentItem(); 520 mainwin->m_chatDateFormat = cmbChatDateFormat->currentText(); 521 mainwin->m_histMsgStyle = cmbHistStyle->currentItem(); 522 mainwin->m_histVertSpacing = chkHistVertSpacing->isChecked(); 523 mainwin->m_histDateFormat = cmbHistDateFormat->currentText(); 533 524 mainwin->m_colorRcv = btnColorRcv->paletteBackgroundColor(); 534 525 mainwin->m_colorSnt = btnColorSnt->paletteBackgroundColor(); … … 1567 1558 lay->addWidget(boxRight); 1568 1559 1569 QGroupBox* boxOptions = new QGroupBox(1, Horizontal, tr("Options"), boxRight); 1570 1571 new QLabel(tr("Style:"), boxOptions); 1572 cmbStyle = new QComboBox(false, boxOptions); 1573 cmbStyle->insertItem("Default"); 1574 cmbStyle->insertItem("Compact"); 1575 cmbStyle->insertItem("Tiny"); 1576 cmbStyle->insertItem("Table"); 1577 cmbStyle->insertItem("History"); 1578 connect(cmbStyle, SIGNAL(activated(int)), this, SLOT(slot_refresh_msgViewer())); 1579 1580 chkLineBreak = new QCheckBox(tr("Insert Horizontal Line"), boxOptions); 1581 connect(chkLineBreak, SIGNAL(toggled(bool)), this, SLOT(slot_refresh_msgViewer())); 1582 1583 new QLabel(tr("Date Format:"), boxOptions); 1584 cmbDateFormat = new QComboBox(false, boxOptions); 1585 cmbDateFormat->insertItem("hh:mm:ss"); 1586 cmbDateFormat->insertItem("yyyy-MM-dd hh:mm:ss"); 1587 cmbDateFormat->insertItem("yyyy-MM-dd"); 1588 cmbDateFormat->insertItem("yyyy/MM/dd hh:mm:ss"); 1589 cmbDateFormat->insertItem("yyyy/MM/dd"); 1590 cmbDateFormat->insertItem("dd.MM.yyyy hh:mm:ss"); 1591 cmbDateFormat->insertItem("dd.MM.yyyy"); 1592 connect(cmbDateFormat, SIGNAL(activated(int)), this, SLOT(slot_refresh_msgViewer())); 1593 1594 chkCustomDateFormat = new QCheckBox(tr("Custom Date Format:"), boxOptions); 1595 connect(chkCustomDateFormat, SIGNAL(toggled(bool)), this, SLOT(slot_refresh_msgViewer())); 1596 connect(chkCustomDateFormat, SIGNAL(toggled(bool)), cmbDateFormat, SLOT(setDisabled(bool))); 1597 1598 customDateFormat = new QLineEdit(boxOptions); 1599 connect(chkCustomDateFormat, SIGNAL(toggled(bool)), customDateFormat, SLOT(setEnabled(bool))); 1600 connect(customDateFormat, SIGNAL(textChanged(const QString&)), this, SLOT(slot_refresh_msgViewer())); 1601 QWhatsThis::add(customDateFormat, tr( 1560 QGroupBox* boxChatOptions = new QGroupBox(1, Horizontal, tr("Chat Options"), boxRight); 1561 1562 static const int dateFormatsLength = 7; 1563 static const char *const dateFormats[dateFormatsLength] = { 1564 "hh:mm:ss", 1565 "yyyy-MM-dd hh:mm:ss", 1566 "yyyy-MM-dd", 1567 "yyyy/MM/dd hh:mm:ss", 1568 "yyyy/MM/dd", 1569 "dd.MM.yyyy hh:mm:ss", 1570 "dd.MM.yyyy" 1571 }; 1572 1573 new QLabel(tr("Style:"), boxChatOptions); 1574 cmbChatStyle = new QComboBox(false, boxChatOptions); 1575 cmbChatStyle->insertStringList(CMessageViewWidget::getStyleNames(false)); 1576 connect(cmbChatStyle, SIGNAL(activated(int)), this, SLOT(slot_refresh_msgViewer())); 1577 1578 chkChatVertSpacing = new QCheckBox(tr("Insert Vertical Spacing"), boxChatOptions); 1579 connect(chkChatVertSpacing, SIGNAL(toggled(bool)), this, SLOT(slot_refresh_msgViewer())); 1580 QWhatsThis::add(chkChatVertSpacing, tr("Insert extra space between messages.")); 1581 1582 chkChatLineBreak = new QCheckBox(tr("Insert Horizontal Line"), boxChatOptions); 1583 connect(chkChatLineBreak, SIGNAL(toggled(bool)), this, SLOT(slot_refresh_msgViewer())); 1584 QWhatsThis::add(chkChatLineBreak, tr("Insert a line between each message.")); 1585 1586 QLabel* lblChatDateFormat = new QLabel(tr("Date Format:"), boxChatOptions); 1587 cmbChatDateFormat = new QComboBox(true, boxChatOptions); 1588 for(int i = 0; i < dateFormatsLength; ++i) 1589 cmbChatDateFormat->insertItem(dateFormats[i]); 1590 connect(cmbChatDateFormat, SIGNAL(activated(int)), this, SLOT(slot_refresh_msgViewer())); 1591 connect(cmbChatDateFormat, SIGNAL(textChanged(const QString&)), this, SLOT(slot_refresh_msgViewer())); 1592 1593 QString helpDateFormat = tr( 1602 1594 "<p>Available custom date format variables.</p>\n" 1603 1595 "<table>\n" … … 1624 1616 "<tr><td>AP</td><td>use AM/PM display. AP will be replaced by either 'AM' or 'PM'</td></tr>\n" 1625 1617 "<tr><td>ap</td><td>use am/pm display. ap will be replaced by either 'am' or 'pm'</td></tr>\n" 1626 "</table>")); 1618 "</table>"); 1619 1620 QWhatsThis::add(lblChatDateFormat, helpDateFormat); 1621 QWhatsThis::add(cmbChatDateFormat, helpDateFormat); 1622 1623 QGroupBox* boxHistOptions = new QGroupBox(1, Horizontal, tr("History Options"), boxRight); 1624 new QLabel(tr("Style:"), boxHistOptions); 1625 cmbHistStyle = new QComboBox(false, boxHistOptions); 1626 cmbHistStyle->insertStringList(CMessageViewWidget::getStyleNames(true)); 1627 connect(cmbHistStyle, SIGNAL(activated(int)), this, SLOT(slot_refresh_msgViewer())); 1628 1629 chkHistVertSpacing = new QCheckBox(tr("Insert Vertical Spacing"), boxHistOptions); 1630 connect(chkHistVertSpacing, SIGNAL(toggled(bool)), this, SLOT(slot_refresh_msgViewer())); 1631 QWhatsThis::add(chkHistVertSpacing, tr("Insert extra space between messages.")); 1632 1633 QLabel* lblHistDateFormat = new QLabel(tr("Date Format:"), boxHistOptions); 1634 cmbHistDateFormat = new QComboBox(true, boxHistOptions); 1635 for(int i = 0; i < dateFormatsLength; ++i) 1636 cmbHistDateFormat->insertItem(dateFormats[i]); 1637 connect(cmbHistDateFormat, SIGNAL(activated(int)), this, SLOT(slot_refresh_msgViewer())); 1638 connect(cmbHistDateFormat, SIGNAL(textChanged(const QString&)), this, SLOT(slot_refresh_msgViewer())); 1639 QWhatsThis::add(lblHistDateFormat, helpDateFormat); 1640 QWhatsThis::add(cmbHistDateFormat, helpDateFormat); 1641 1627 1642 1628 1643 QGroupBox *boxColors = new QGroupBox(2, Horizontal, tr("Colors"), boxRight); … … 1661 1676 connect(btnColorChatBkg, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 1662 1677 1663 tabViewer = new QTabWidget(w);1678 tabViewer = new CETabWidget(w); 1664 1679 lay->addWidget(tabViewer); 1665 1680 1666 msgViewer = new CMessageViewWidget(0, gMainWindow, tabViewer); 1667 tabViewer->insertTab(msgViewer, "Marge"); 1681 msgChatViewer = new CMessageViewWidget(0, gMainWindow, tabViewer); 1682 tabViewer->insertTab(msgChatViewer, "Marge"); 1683 1684 msgHistViewer = new CMessageViewWidget(0, gMainWindow, tabViewer, 0, true); 1685 tabViewer->insertTab(msgHistViewer, "History"); 1668 1686 1669 1687 lay->activate(); 1670 1688 1671 1689 return w; 1672 }1673 1674 QString OptionsDlg::getCurrentDateFormat() const1675 {1676 if (chkCustomDateFormat->isChecked())1677 return customDateFormat->text();1678 else1679 return cmbDateFormat->currentText();1680 1690 } 1681 1691 … … 1697 1707 }; 1698 1708 1699 msgViewer->m_nMsgStyle = cmbStyle->currentItem(); 1700 msgViewer->m_bAppendLineBreak = chkLineBreak->isChecked(); 1701 msgViewer->m_colorSnt = btnColorSnt->paletteBackgroundColor(); 1702 msgViewer->m_colorRcv = btnColorRcv->paletteBackgroundColor(); 1703 msgViewer->m_colorSntHistory = btnColorSntHistory->paletteBackgroundColor(); 1704 msgViewer->m_colorRcvHistory = btnColorRcvHistory->paletteBackgroundColor(); 1705 msgViewer->m_colorNotice = btnColorNotice->paletteBackgroundColor(); 1706 tabViewer->setPaletteForegroundColor(btnColorTypingLabel->paletteBackgroundColor()); 1707 msgViewer->setPaletteBackgroundColor(btnColorChatBkg->paletteBackgroundColor()); 1708 1709 msgViewer->m_nDateFormat = getCurrentDateFormat(); 1710 1711 msgViewer->clear(); 1709 msgChatViewer->m_nMsgStyle = cmbChatStyle->currentItem(); 1710 msgChatViewer->m_extraSpacing = chkChatVertSpacing->isChecked(); 1711 msgChatViewer->m_appendLineBreak = chkChatLineBreak->isChecked(); 1712 msgChatViewer->m_colorSnt = btnColorSnt->paletteBackgroundColor();
