Changeset 4793

Show
Ignore:
Timestamp:
11/30/06 07:02:54 (2 years ago)
Author:
erijo
Message:

Moved CColorOption to its own file (in a new "widgets" directory) and renamed it to CColorButton.

Location:
branches/qt-gui_qt4/src
Files:
3 added
3 modified

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4/src/CMakeLists.txt

    r4761 r4793  
     1# Widgets 
     2set(widgets_SRCS 
     3  widgets/colorbutton.cpp 
     4) 
     5 
    16# Sources common for both Qt- and KDE-GUI 
    27set(Qt-GUI_SRCS 
     8  ${widgets_SRCS} 
    39  adduserdlg.cpp 
    410  authuserdlg.cpp 
  • branches/qt-gui_qt4/src/optionsdlg.cpp

    r4756 r4793  
    2020 
    2121#include "config.h" 
     22 
     23#include "widgets/colorbutton.h" 
    2224 
    2325#include <Qt/qdir.h> 
     
    235237  chkLineBreak->setChecked(mainwin->m_bAppendLineBreak); 
    236238  cmbStyle->setCurrentItem(mainwin->m_nMsgStyle); 
    237   btnColorRcv->setPaletteBackgroundColor(mainwin->m_colorRcv); 
    238   btnColorSnt->setPaletteBackgroundColor(mainwin->m_colorSnt); 
    239   btnColorRcvHistory->setPaletteBackgroundColor(mainwin->m_colorRcvHistory); 
    240   btnColorSntHistory->setPaletteBackgroundColor(mainwin->m_colorSntHistory); 
    241   btnColorNotice->setPaletteBackgroundColor(mainwin->m_colorNotice); 
    242   /*btnColorTabLabel->setPaletteBackgroundColor(mainwin->m_colorTab);*/ 
    243   btnColorTypingLabel->setPaletteBackgroundColor(mainwin->m_colorTabTyping); 
    244   btnColorChatBkg->setPaletteBackgroundColor(mainwin->m_colorChatBkg); 
     239  btnColorRcv->setColor(mainwin->m_colorRcv); 
     240  btnColorSnt->setColor(mainwin->m_colorSnt); 
     241  btnColorRcvHistory->setColor(mainwin->m_colorRcvHistory); 
     242  btnColorSntHistory->setColor(mainwin->m_colorSntHistory); 
     243  btnColorNotice->setColor(mainwin->m_colorNotice); 
     244  /*btnColorTabLabel->setColor(mainwin->m_colorTab);*/ 
     245  btnColorTypingLabel->setColor(mainwin->m_colorTabTyping); 
     246  btnColorChatBkg->setColor(mainwin->m_colorChatBkg); 
    245247  slot_refresh_msgViewer(); 
    246248   
     
    533535  mainwin->m_nMsgStyle = cmbStyle->currentItem(); 
    534536  mainwin->m_nDateFormat = getCurrentDateFormat(); 
    535   mainwin->m_colorRcv = btnColorRcv->paletteBackgroundColor(); 
    536   mainwin->m_colorSnt = btnColorSnt->paletteBackgroundColor(); 
    537   mainwin->m_colorRcvHistory = btnColorRcvHistory->paletteBackgroundColor(); 
    538   mainwin->m_colorSntHistory = btnColorSntHistory->paletteBackgroundColor(); 
    539   mainwin->m_colorNotice = btnColorNotice->paletteBackgroundColor(); 
    540   /*mainwin->m_colorTab = btnColorTabLabel->paletteBackgroundColor();*/ 
    541   mainwin->m_colorTabTyping = btnColorTypingLabel->paletteBackgroundColor(); 
    542   mainwin->m_colorChatBkg = btnColorChatBkg->paletteBackgroundColor(); 
     537  mainwin->m_colorRcv = btnColorRcv->getColor(); 
     538  mainwin->m_colorSnt = btnColorSnt->getColor(); 
     539  mainwin->m_colorRcvHistory = btnColorRcvHistory->getColor(); 
     540  mainwin->m_colorSntHistory = btnColorSntHistory->getColor(); 
     541  mainwin->m_colorNotice = btnColorNotice->getColor(); 
     542  /*mainwin->m_colorTab = btnColorTabLabel->getColor();*/ 
     543  mainwin->m_colorTabTyping = btnColorTypingLabel->getColor(); 
     544  mainwin->m_colorChatBkg = btnColorChatBkg->getColor(); 
    543545 
    544546  mainwin->m_bTabbedChatting = chkTabbedChatting->isChecked(); 
     
    16371639 
    16381640  new QLabel(tr("Message Received:"), boxColors); 
    1639   btnColorRcv = new CColorOption(boxColors); 
     1641  btnColorRcv = new CColorButton(boxColors); 
    16401642 
    16411643  new QLabel(tr("Message Sent:"), boxColors); 
    1642   btnColorSnt = new CColorOption(boxColors); 
     1644  btnColorSnt = new CColorButton(boxColors); 
    16431645 
    16441646  new QLabel(tr("History Received:"), boxColors); 
    1645   btnColorRcvHistory = new CColorOption(boxColors); 
     1647  btnColorRcvHistory = new CColorButton(boxColors); 
    16461648 
    16471649  new QLabel(tr("History Sent:"), boxColors); 
    1648   btnColorSntHistory = new CColorOption(boxColors); 
     1650  btnColorSntHistory = new CColorButton(boxColors); 
    16491651 
    16501652  new QLabel(tr("Notice:"), boxColors); 
    1651   btnColorNotice = new CColorOption(boxColors); 
     1653  btnColorNotice = new CColorButton(boxColors); 
    16521654 
    16531655  /*new QLabel(tr("Tab Label Color:"), boxColors); 
    1654   btnColorTabLabel = new CColorOption(boxColors);*/ 
     1656  btnColorTabLabel = new CColorButton(boxColors);*/ 
    16551657 
    16561658  new QLabel(tr("Typing Notification Color:"), boxColors); 
    1657   btnColorTypingLabel = new CColorOption(boxColors); 
     1659  btnColorTypingLabel = new CColorButton(boxColors); 
    16581660 
    16591661  new QLabel(tr("Background Color:"), boxColors); 
    1660   btnColorChatBkg = new CColorOption(boxColors); 
     1662  btnColorChatBkg = new CColorButton(boxColors); 
    16611663 
    16621664  connect(btnColorSnt, SIGNAL(changed()), this, SLOT(slot_refresh_msgViewer())); 
     
    17071709  msgViewer->m_nMsgStyle = cmbStyle->currentItem(); 
    17081710  msgViewer->m_bAppendLineBreak = chkLineBreak->isChecked(); 
    1709   msgViewer->m_colorSnt = btnColorSnt->paletteBackgroundColor(); 
    1710   msgViewer->m_colorRcv = btnColorRcv->paletteBackgroundColor(); 
    1711   msgViewer->m_colorSntHistory = btnColorSntHistory->paletteBackgroundColor(); 
    1712   msgViewer->m_colorRcvHistory = btnColorRcvHistory->paletteBackgroundColor(); 
    1713   msgViewer->m_colorNotice = btnColorNotice->paletteBackgroundColor(); 
    1714   tabViewer->setPaletteForegroundColor(btnColorTypingLabel->paletteBackgroundColor()); 
    1715   msgViewer->setPaletteBackgroundColor(btnColorChatBkg->paletteBackgroundColor()); 
     1711  msgViewer->m_colorSnt = btnColorSnt->getColor(); 
     1712  msgViewer->m_colorRcv = btnColorRcv->getColor(); 
     1713  msgViewer->m_colorSntHistory = btnColorSntHistory->getColor(); 
     1714  msgViewer->m_colorRcvHistory = btnColorRcvHistory->getColor(); 
     1715  msgViewer->m_colorNotice = btnColorNotice->getColor(); 
     1716  tabViewer->setPaletteForegroundColor(btnColorTypingLabel->getColor()); 
     1717  msgViewer->setPaletteForegroundColor(btnColorChatBkg->getColor()); 
    17161718 
    17171719  msgViewer->m_nDateFormat = getCurrentDateFormat(); 
     
    17301732} 
    17311733 
    1732 CColorOption::CColorOption (QWidget* parent) 
    1733     : QPushButton(parent)  
    1734 { 
    1735   setFixedSize(40, 20); 
    1736   connect(this, SIGNAL(clicked()), this, SLOT(slot_select_color())); 
    1737 } 
    1738  
    1739 void CColorOption::slot_select_color() 
    1740 { 
    1741   QColor color = QColorDialog::getColor( 
    1742       paletteBackgroundColor(), this); 
    1743   if (color.isValid())  
    1744   { 
    1745     setPaletteBackgroundColor(color); 
    1746     emit changed(); 
    1747   } 
    1748 } 
    1749  
    17501734// ----------------------------------------------------------------------------- 
    17511735QWidget* OptionsDlg::new_phone_options() 
  • branches/qt-gui_qt4/src/optionsdlg.h

    r4752 r4793  
    2929#include <QtGui/QLabel> 
    3030 
     31class CColorButton; 
    3132class CMainWindow; 
    3233class MLEditWrap; 
     
    5657}; 
    5758#endif 
    58  
    59 class CColorOption : public QPushButton 
    60 { 
    61    Q_OBJECT 
    62 public: 
    63    CColorOption (QWidget* parent=0); 
    64  
    65 signals: 
    66    void changed(); 
    67     
    68 protected slots: 
    69      void slot_select_color(); 
    70 }; 
    7159 
    7260class OptionsDlg : public LicqDialog 
     
    169157   QLineEdit *customDateFormat; 
    170158   QCheckBox *chkLineBreak; 
    171    CColorOption *btnColorRcv; 
    172    CColorOption *btnColorSnt; 
    173    CColorOption *btnColorRcvHistory; 
    174    CColorOption *btnColorSntHistory; 
    175    CColorOption *btnColorNotice; 
    176    CColorOption *btnColorTabLabel; 
    177    CColorOption *btnColorTypingLabel; 
    178    CColorOption *btnColorChatBkg; 
     159   CColorButton *btnColorRcv; 
     160   CColorButton *btnColorSnt; 
     161   CColorButton *btnColorRcvHistory; 
     162   CColorButton *btnColorSntHistory; 
     163   CColorButton *btnColorNotice; 
     164   CColorButton *btnColorTabLabel; 
     165   CColorButton *btnColorTypingLabel; 
     166   CColorButton *btnColorChatBkg; 
    179167   // Phone & celluar tab 
    180168   QWidget* new_phone_options();