Ticket #1442: licq-4735-notice_color_option.patch

File licq-4735-notice_color_option.patch, 6.8 kB (added by flynd, 2 years ago)

Here is a patch to allow changing the color of the notices.

  • licq/plugins/qt-gui/src/mainwin.h

     
    186186         m_colorSntHistory, 
    187187         m_colorRcv, 
    188188         m_colorSnt, 
     189         m_colorNotice, 
    189190         m_colorTab, 
    190191         m_colorTabTyping, 
    191192         m_colorChatBkg; 
  • licq/plugins/qt-gui/src/ewidgets.h

     
    217217  QColor m_colorSntHistory; 
    218218  QColor m_colorRcv; 
    219219  QColor m_colorSnt; 
     220  QColor m_colorNotice; 
    220221   
    221222public slots: 
    222223  virtual void addMsg(CUserEvent *, const char * = 0, unsigned long = 0); 
  • licq/plugins/qt-gui/src/optionsdlg.cpp

     
    236236  btnColorSnt->setPaletteBackgroundColor(mainwin->m_colorSnt); 
    237237  btnColorRcvHistory->setPaletteBackgroundColor(mainwin->m_colorRcvHistory); 
    238238  btnColorSntHistory->setPaletteBackgroundColor(mainwin->m_colorSntHistory); 
     239  btnColorNotice->setPaletteBackgroundColor(mainwin->m_colorNotice); 
    239240  /*btnColorTabLabel->setPaletteBackgroundColor(mainwin->m_colorTab);*/ 
    240241  btnColorTypingLabel->setPaletteBackgroundColor(mainwin->m_colorTabTyping); 
    241242  btnColorChatBkg->setPaletteBackgroundColor(mainwin->m_colorChatBkg); 
     
    533534  mainwin->m_colorSnt = btnColorSnt->paletteBackgroundColor(); 
    534535  mainwin->m_colorRcvHistory = btnColorRcvHistory->paletteBackgroundColor(); 
    535536  mainwin->m_colorSntHistory = btnColorSntHistory->paletteBackgroundColor(); 
     537  mainwin->m_colorNotice = btnColorNotice->paletteBackgroundColor(); 
    536538  /*mainwin->m_colorTab = btnColorTabLabel->paletteBackgroundColor();*/ 
    537539  mainwin->m_colorTabTyping = btnColorTypingLabel->paletteBackgroundColor(); 
    538540  mainwin->m_colorChatBkg = btnColorChatBkg->paletteBackgroundColor(); 
     
    16371639  new QLabel(tr("History Sent:"), boxColors); 
    16381640  btnColorSntHistory = new CColorOption(boxColors); 
    16391641 
     1642  new QLabel(tr("Notice:"), boxColors); 
     1643  btnColorNotice = new CColorOption(boxColors); 
     1644 
    16401645  /*new QLabel(tr("Tab Label Color:"), boxColors); 
    16411646  btnColorTabLabel = new CColorOption(boxColors);*/ 
    16421647 
     
    16501655  connect(btnColorRcv, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 
    16511656  connect(btnColorSntHistory, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 
    16521657  connect(btnColorRcvHistory, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 
     1658  connect(btnColorNotice, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 
    16531659  /*connect(btnColorTabLabel, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer()));*/ 
    16541660  connect(btnColorTypingLabel, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 
    16551661  connect(btnColorChatBkg, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 
     
    16791685  static QDateTime date = QDateTime::currentDateTime(); 
    16801686 
    16811687  const char *names[2] = {"Marge", "Homer"}; 
    1682   const char *msgs[7] = { 
     1688  const char *msgs[8] = { 
    16831689      "This is received message", 
    16841690      "This is a sent message", 
    16851691      "Have you gone to the Licq IRC Channel?", 
    16861692      "No, where is it?", 
    16871693      "#Licq on irc.freenode.net", 
    16881694      "Cool, I'll see you there :)", 
    1689       "We'll be waiting!"}; 
     1695      "We'll be waiting!", 
     1696      "Marge has left the conversation."}; 
    16901697 
    16911698  msgViewer->m_nMsgStyle = cmbStyle->currentItem(); 
    16921699  msgViewer->m_bAppendLineBreak = chkLineBreak->isChecked(); 
     
    16941701  msgViewer->m_colorRcv = btnColorRcv->paletteBackgroundColor(); 
    16951702  msgViewer->m_colorSntHistory = btnColorSntHistory->paletteBackgroundColor(); 
    16961703  msgViewer->m_colorRcvHistory = btnColorRcvHistory->paletteBackgroundColor(); 
     1704  msgViewer->m_colorNotice = btnColorNotice->paletteBackgroundColor(); 
    16971705  tabViewer->setPaletteForegroundColor(btnColorTypingLabel->paletteBackgroundColor()); 
    16981706  msgViewer->setPaletteBackgroundColor(btnColorChatBkg->paletteBackgroundColor()); 
    16991707 
     
    17091717          names[i % 2], 
    17101718          MLView::toRichText(msgs[i], true, true)); 
    17111719  } 
     1720  msgViewer->addNotice(date, MLView::toRichText(msgs[7], true, true)); 
    17121721} 
    17131722 
    17141723CColorOption::CColorOption (QWidget* parent) 
  • licq/plugins/qt-gui/src/mainwin.cpp

     
    451451  m_colorSnt = QColor(szTemp); 
    452452  licqConf.ReadStr("SentHistoryColor", szTemp, "light blue"); 
    453453  m_colorSntHistory = QColor(szTemp); 
     454  licqConf.ReadStr("NoticeColor", szTemp, "green"); 
     455  m_colorNotice = QColor(szTemp); 
    454456  licqConf.ReadStr("TabFontColor", szTemp,  
    455457      QApplication::palette(this).active().text().name()); 
    456458  m_colorTab = QColor(szTemp); 
     
    35803582  licqConf.WriteStr("ReceiveHistoryColor", m_colorRcvHistory.name()); 
    35813583  licqConf.WriteStr("SentMessageColor", m_colorSnt.name()); 
    35823584  licqConf.WriteStr("SentHistoryColor", m_colorSntHistory.name()); 
     3585  licqConf.WriteStr("NoticeColor", m_colorNotice.name()); 
    35833586  licqConf.WriteStr("TabFontColor", m_colorTab.name()); 
    35843587  licqConf.WriteStr("TabOnTypingColor", m_colorTabTyping.name()); 
    35853588  licqConf.WriteStr("ChatBackground", m_colorChatBkg.name()); 
  • licq/plugins/qt-gui/src/ewidgets.cpp

     
    674674  m_colorSnt = m->m_colorSnt; 
    675675  m_colorRcvHistory = m->m_colorRcvHistory; 
    676676  m_colorSntHistory = m->m_colorSntHistory; 
     677  m_colorNotice = m->m_colorNotice; 
    677678  setPaletteBackgroundColor(m->m_colorChatBkg); 
    678679  mainwin = m; 
    679680 
     
    708709  m_colorSnt = m->m_colorSnt; 
    709710  m_colorRcvHistory = m->m_colorRcvHistory; 
    710711  m_colorSntHistory = m->m_colorSntHistory; 
     712  m_colorNotice = m->m_colorNotice; 
    711713  setPaletteBackgroundColor(m->m_colorChatBkg); 
    712714  mainwin = m; 
    713715/* 
     
    950952 
    951953void CMessageViewWidget::addNotice(QDateTime dt, QString messageText) 
    952954{ 
    953   QString color = "green"; 
     955  QString color = m_colorNotice.name(); 
    954956  QString s = ""; 
    955957  const QString dateTime = dt.toString( m_nDateFormat ); 
    956958 
  • licq/plugins/qt-gui/src/optionsdlg.h

     
    170170   CColorOption *btnColorSnt; 
    171171   CColorOption *btnColorRcvHistory; 
    172172   CColorOption *btnColorSntHistory; 
     173   CColorOption *btnColorNotice; 
    173174   CColorOption *btnColorTabLabel; 
    174175   CColorOption *btnColorTypingLabel; 
    175176   CColorOption *btnColorChatBkg;