OSSP CVS Repository

ossp - Check-in [4068]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4068
Date: 2003-Feb-21 11:11:35 (local)
2003-Feb-21 10:11:35 (UTC)
User:ms
Branch:
Comment: Implemented user-defined row shading colours, acessible in preferences panel and elsewhere.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_assist.cpp      1.110 -> 1.111     7 inserted, 1 deleted
ossp-pkg/as/as-gui/as_const.h      1.56 -> 1.57     12 inserted, 0 deleted
ossp-pkg/as/as-gui/as_panel.cpp      1.13 -> 1.14     119 inserted, 3 deleted
ossp-pkg/as/as-gui/as_panel.h      1.10 -> 1.11     27 inserted, 8 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.129 -> 1.130     19 inserted, 0 deleted

ossp-pkg/as/as-gui/as_assist.cpp 1.110 -> 1.111

--- as_assist.cpp        2003/02/20 16:47:18     1.110
+++ as_assist.cpp        2003/02/21 10:11:35     1.111
@@ -132,6 +132,12 @@
         m_pPrefs->setNumber(TITRAQ_PREFREPORTYPE, TITRAQ_DEFREPORTYPE);
         m_pPrefs->setNumber(TITRAQ_PREFREPORTWEEKS, TITRAQ_DEFREPORTWEEKS);
         m_pPrefs->setNumber(TITRAQ_PREFREPORTMONTHS, TITRAQ_DEFREPORTMONTHS);
+        m_pPrefs->setNumber(TITRAQ_PREFLIGHTRED, TITRAQ_DEFLIGHTRED);
+        m_pPrefs->setNumber(TITRAQ_PREFLIGHTGREEN, TITRAQ_DEFLIGHTGREEN);
+        m_pPrefs->setNumber(TITRAQ_PREFLIGHTBLUE, TITRAQ_DEFLIGHTBLUE);
+        m_pPrefs->setNumber(TITRAQ_PREFDARKRED, TITRAQ_DEFDARKRED);
+        m_pPrefs->setNumber(TITRAQ_PREFDARKGREEN, TITRAQ_DEFDARKGREEN);
+        m_pPrefs->setNumber(TITRAQ_PREFDARKBLUE, TITRAQ_DEFDARKBLUE);
         m_pPrefs->flush();  // Write the new conf file
         QTextStream cerr(stderr, IO_WriteOnly);
         cerr << trUtf8("Created new preferences file ") << Homedir << QChar('/')
@@ -606,7 +612,7 @@
 void Titraqform::setupTable(void)
 {
     // Create, configure, and setup the table itself
-    m_pMaintable = new TiTable(m_pCenframe, "Maintable");
+    m_pMaintable = new TiTable(m_pPrefs, m_pCenframe, "Maintable");
     if (m_pMaintable == NULL)   // Sanity check
         throw Genexcept("Main window table creation failed.");
     m_pMaintable->setNumCols(TITRAQ_IDXTAIL);


ossp-pkg/as/as-gui/as_const.h 1.56 -> 1.57

--- as_const.h   2003/02/20 16:48:00     1.56
+++ as_const.h   2003/02/21 10:11:36     1.57
@@ -72,6 +72,18 @@
 #define TITRAQ_DEFREPORTWEEKS   1
 #define TITRAQ_PREFREPORTMONTHS "reportmonths"
 #define TITRAQ_DEFREPORTMONTHS  1
+#define TITRAQ_PREFLIGHTRED     "lightred"
+#define TITRAQ_DEFLIGHTRED      248
+#define TITRAQ_PREFLIGHTGREEN   "lightgreen"
+#define TITRAQ_DEFLIGHTGREEN    248
+#define TITRAQ_PREFLIGHTBLUE    "lightblue"
+#define TITRAQ_DEFLIGHTBLUE     240
+#define TITRAQ_PREFDARKRED      "darkred"
+#define TITRAQ_DEFDARKRED       224
+#define TITRAQ_PREFDARKGREEN    "darkgreen"
+#define TITRAQ_DEFDARKGREEN     224
+#define TITRAQ_PREFDARKBLUE     "darkblue"
+#define TITRAQ_DEFDARKBLUE      216
 
 // Column show preferences
 #define TITRAQ_PREFSTATCOLON    "statcolshow"


ossp-pkg/as/as-gui/as_panel.cpp 1.13 -> 1.14

--- as_panel.cpp 2003/02/20 21:28:57     1.13
+++ as_panel.cpp 2003/02/21 10:11:36     1.14
@@ -53,6 +53,10 @@
     this->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
         (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth()));
 
+    // Initialize our button colours
+    m_pLight = new QColor();
+    m_pDark = new QColor();
+
     m_pVlayout = new QVBoxLayout(this, 11, 6, "Formlayout");
     m_pTabselect = new QTabWidget(this, "Tabselector");
 
@@ -135,7 +139,6 @@
     QToolTip::add(m_pSigncheck, trUtf8("Append a signature line", "Comment for toolTip Signaturecheck"));
     QWhatsThis::add(m_pSigncheck, trUtf8("Check this box to write a signature line to the report footer", "Comment whatsThis for Signaturecheck"));
     m_pReportlay->addWidget(m_pSigncheck);
-
     m_pBoolayout->addWidget(m_pStylegroup);
     m_pBinlayout->addWidget(m_pReportgroup);
     m_pBinlayout->addWidget(m_pSwitchgroup);
@@ -146,7 +149,6 @@
     m_pGeneralpage = new QWidget(m_pTabselect, "Generalpage");
     m_pGenlayout = new QHBoxLayout(m_pGeneralpage, 11, 6, "Genlayout");
     m_pGenbox = new QGroupBox(m_pGeneralpage, "Groupboxlayout");
-
     m_pGenbox->setColumnLayout(0, Qt::Vertical);
     m_pGenbox->layout()->setSpacing(6);
     m_pGenbox->layout()->setMargin(11);
@@ -208,6 +210,55 @@
     m_pRemlayout->addWidget(m_pRembox);
     m_pTabselect->insertTab(m_pRemotepage, "");
 
+    // Start of color page UI pieces
+    m_pColourpage = new QWidget(m_pTabselect, "Colourpage");
+    m_pColourlayout = new QHBoxLayout(m_pColourpage, 11, 6, "Colourlayout");
+    m_pShadebox = new QGroupBox(m_pColourpage, "Shadegroupbox");
+    m_pShadebox->setColumnLayout(0, Qt::Horizontal);
+    m_pShadebox->layout()->setSpacing(6);
+    m_pShadebox->layout()->setMargin(11);
+    m_pShadeboxlay = new QVBoxLayout(m_pShadebox->layout());
+    m_pShadeboxlay->setAlignment(Qt::AlignTop);
+
+    m_pShadelayout = new QGridLayout(0, 2, 2, 11, 6, "Shadelayout");
+    m_pLightlab = new QLabel(m_pShadebox, "Lightlabel");
+    m_pShadelayout->addWidget(m_pLightlab, 0, 0);
+    m_pLightbutt = new QToolButton(m_pShadebox, "Lightbutton");
+    m_pLightbutt->setCursor(QCursor(13));
+    m_pShadelayout->addWidget(m_pLightbutt, 0, 1);
+
+    m_pDarklab = new QLabel(m_pShadebox, "Darklabel");
+    m_pShadelayout->addWidget(m_pDarklab, 1, 0);
+    m_pDarkbutt = new QToolButton(m_pShadebox, "Darkbutton");
+    m_pDarkbutt->setCursor(QCursor(13));
+    m_pShadelayout->addWidget(m_pDarkbutt, 1, 1);
+
+    m_pRevertlab = new QLabel(m_pShadebox, "Revertlabel");
+    m_pShadelayout->addWidget(m_pRevertlab, 2, 0);
+    m_pRevertbutt = new QToolButton(m_pShadebox, "Revertbutton");
+    m_pRevertbutt->setCursor(QCursor(13));
+    m_pShadelayout->addWidget(m_pRevertbutt, 2, 1);
+
+    m_pThemebox = new QGroupBox(m_pColourpage, "Themegroupbox");
+    m_pThemebox->setColumnLayout(0, Qt::Vertical);
+    m_pThemebox->layout()->setSpacing(6);
+    m_pThemebox->layout()->setMargin(11);
+    m_pThemeboxlay = new QVBoxLayout(m_pThemebox->layout());
+    m_pThemeboxlay->setAlignment(Qt::AlignTop);
+
+    QLabel *pNuder = new QLabel(m_pThemebox, "Crapolabel");
+    pNuder->setText(trUtf8("Please ignore", "Comment for Nuderlabel"));
+    m_pThemeboxlay->addWidget(pNuder);
+
+    m_pShadeboxlay->addLayout(m_pShadelayout);
+    m_pColourlayout->addWidget(m_pShadebox);
+    m_pColourlayout->addWidget(m_pThemebox);
+    m_pTabselect->insertTab(m_pColourpage, "");
+
+    connect(m_pLightbutt, SIGNAL(clicked(void)), SLOT(shadeLight(void)));
+    connect(m_pDarkbutt, SIGNAL(clicked(void)), SLOT(shadeDark(void)));
+    connect(m_pRevertbutt, SIGNAL(clicked(void)), SLOT(shadeRevert(void)));
+
     // Finally add the damn pages to the tab selector widget!
     m_pVlayout->addWidget(m_pTabselect);
 
@@ -244,6 +295,59 @@
 }
 
 //
+// Sets the light shading colour for rows
+//
+void Prefpanel::shadeLight(void)
+{
+    QColorDialog::setCustomColor(0, m_pLight->rgb());
+    QColorDialog::setCustomColor(1, m_pDark->rgb());
+    QColor Colortemp = QColorDialog::getColor(*m_pLight);
+    if (Colortemp.isValid()) {
+        delete m_pLight;
+        m_pLight = new QColor(Colortemp);
+        m_pLightbutt->setPaletteBackgroundColor(*m_pLight);
+    }
+}
+
+//
+// Sets the dark shading colour for rows
+//
+void Prefpanel::shadeDark(void)
+{
+    QColorDialog::setCustomColor(0, m_pLight->rgb());
+    QColorDialog::setCustomColor(1, m_pDark->rgb());
+    QColor Colortemp = QColorDialog::getColor(*m_pDark);
+    if (Colortemp.isValid()) {
+        delete m_pDark;
+        m_pDark = new QColor(Colortemp);
+        m_pDarkbutt->setPaletteBackgroundColor(*m_pDark);
+    }
+}
+
+//
+// Reverts the shading colours to default values
+//
+void Prefpanel::shadeRevert(void)
+{
+//    delete m_pLight;
+//    m_pLight = new QColor();
+//    m_pLightbutt->setPaletteBackgroundColor(*m_pLight);
+//    delete m_pDark;
+//    m_pDark = new QColor();
+//    m_pDarkbutt->setPaletteBackgroundColor(*m_pDark);
+}
+
+//
+// Polish off ending changes after creating and before widget shows
+//
+void Prefpanel::polish(void)
+{
+    // Set our buttons now that user has probably set their colours
+    m_pLightbutt->setPaletteBackgroundColor(*m_pLight);
+    m_pDarkbutt->setPaletteBackgroundColor(*m_pDark);
+}
+
+//
 // Sets the strings of the subwidgets using the current language
 //
 void Prefpanel::textChange(void)
@@ -253,6 +357,7 @@
     m_pTabselect->changeTab(m_pBoolpage, trUtf8("General"));
     m_pTabselect->changeTab(m_pGeneralpage, trUtf8("Paths"));
     m_pTabselect->changeTab(m_pRemotepage, trUtf8("Hosts"));
+    m_pTabselect->changeTab(m_pColourpage, trUtf8("Colour"));
 
     m_pOkaybutton->setText(trUtf8("Okay", "Comment for Okaybutton"));
     QToolTip::add(m_pOkaybutton, trUtf8("Applies and saves changes", "Comment for tooltip Okaybutton"));
@@ -288,7 +393,18 @@
 
     m_pSoapcheck->setText(trUtf8("Enable SOAP transmission", "Comment for Soapcheck"));
     QToolTip::add(m_pSoapcheck, trUtf8("Will enable transmission over SOAP", "Comment for toolTip Soapcheck"));
-    QWhatsThis::add(m_pSoapcheck, trUtf8("Check this box to enable transmission over to a SOAP host", "Comment whatsThis for Soapcheck"));
+    QWhatsThis::add(m_pSoapcheck, trUtf8("Check this box to enable transmission to a SOAP host", "Comment whatsThis for Soapcheck"));
+
+    m_pShadebox->setTitle(trUtf8("Row shading", "Comment for Shadebox"));
+    m_pThemebox->setTitle(trUtf8("Skin themes", "Comment for Themebox"));
+
+    m_pLightlab->setText(trUtf8("Light shading", "Comment for Lightlabel"));
+    m_pDarklab->setText(trUtf8("Dark shading", "Comment for Darklabel"));
+    m_pRevertlab->setText(trUtf8("Revert defaults", "Comment for Revertlabel"));
+    QToolTip::add(m_pLightbutt, trUtf8("Light row shading colour", "Comment for tooltip Lightbutt"));
+    QWhatsThis::add(m_pLightbutt, trUtf8("The Light button sets the light row shading colour.", "Comment for whatsThis Lightbutt"));
+    QToolTip::add(m_pDarkbutt, trUtf8("Dark row shading colour", "Comment for tooltip Darkbutt"));
+    QWhatsThis::add(m_pDarkbutt, trUtf8("The Dark button sets the light row shading colour.", "Comment for whatsThis Darkbutt"));
 
     m_pStylegroup->setTitle(trUtf8("Available styles", "Comment for Stylebuttons"));
     m_pReportgroup->setTitle(trUtf8("Report options", "Comment for Reportbox"));


ossp-pkg/as/as-gui/as_panel.h 1.10 -> 1.11

--- as_panel.h   2003/02/20 21:08:47     1.10
+++ as_panel.h   2003/02/21 10:11:36     1.11
@@ -38,6 +38,8 @@
 #include <qlabel.h>
 #include <qlineedit.h>
 #include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qcolordialog.h>
 #include <qradiobutton.h>
 #include <qcheckbox.h>
 #include <qtabwidget.h>
@@ -48,7 +50,7 @@
 #include <qstylefactory.h>
 #include <qlayout.h>
 
-#include "as_gui.h" // For usage of style_t
+#include "as_gui.h"     // For usage of style_t
 
 
 class Prefpanel : public QDialog
@@ -59,14 +61,20 @@
     Prefpanel(QWidget *pParent = 0, const char *kszName = 0, bool bModal = true, WFlags Flags = 0);
 //    ~Prefpanel(void); // No need to destroy widgets, because qt does it for us
 
-    QGroupBox *m_pGenbox, *m_pRembox;
+private:
+    Preferences *m_pPanprefs;
+    QColor *m_pLight, *m_pDark;
+
+public:
+    QGroupBox *m_pGenbox, *m_pRembox, *m_pShadebox, *m_pThemebox;
     QVBoxLayout *m_pStylelay, *m_pReportlay, *m_pSwitchlay;
     QVBoxLayout *m_pVlayout, *m_pBinlayout;
     QHBoxLayout *m_pBoolayout, *m_pGenlayout, *m_pRemlayout;
-    QHBoxLayout *m_pGenboxlay, *m_pRemboxlay;
-    QGridLayout *m_pGeninner, *m_pReminner;
+    QVBoxLayout *m_pShadeboxlay, *m_pThemeboxlay;
+    QHBoxLayout *m_pGenboxlay, *m_pRemboxlay, *m_pColourlayout;
+    QGridLayout *m_pGeninner, *m_pReminner, *m_pShadelayout;
 
-    QWidget *m_pBoolpage, *m_pGeneralpage, *m_pRemotepage;
+    QWidget *m_pBoolpage, *m_pGeneralpage, *m_pRemotepage, *m_pColourpage;
 
     QHBoxLayout *m_pButtlay;
     QPushButton *m_pOkaybutton;
@@ -82,6 +90,9 @@
     QLineEdit *m_pCorbaline, *m_pSoapline;
     QCheckBox *m_pCorbacheck, *m_pSoapcheck;
 
+    QLabel *m_pLightlab, *m_pDarklab, *m_pRevertlab;
+    QToolButton *m_pLightbutt, *m_pDarkbutt, *m_pRevertbutt;
+
     QButtonGroup *m_pStylegroup, *m_pReportgroup, *m_pSwitchgroup;
     QCheckBox *m_pBackupcheck, *m_pExtendcheck;
     QCheckBox *m_pDetailcheck, *m_pSigncheck;
@@ -99,6 +110,8 @@
     bool getSoapon(void)       {return (m_pSoapcheck->isChecked());};
     bool getBackon(void)       {return (m_pBackupcheck->isChecked());};
     bool getExtendon(void)     {return (m_pExtendcheck->isChecked());};
+    QColor *getLight(void)     {return m_pLight;};
+    QColor *getDark(void)      {return m_pDark;};
 
     // Accessor set methods
     void setAccounts(const QString &kInstr)  {m_pAcctline->setText(kInstr);};
@@ -109,9 +122,11 @@
     void setSoaphost(const QString &kInstr)  {m_pSoapline->setText(kInstr);};
     void setBackon(const bool &kbEnable = true)   {m_pBackupcheck->setChecked(kbEnable);};
     void setExtendon(const bool &kbEnable = true) {m_pExtendcheck->setChecked(kbEnable);};
-    void lockCorba(const bool &kbLock = true) {m_pCorbacheck->setEnabled(!kbLock);};
-    void lockSoap(const bool &kbLock = true) {m_pSoapcheck->setEnabled(!kbLock);};
-    void setCorbaon(const bool &kbEnable = true) {
+    void lockCorba(const bool &kbLock = true)     {m_pCorbacheck->setEnabled(!kbLock);};
+    void lockSoap(const bool &kbLock = true)      {m_pSoapcheck->setEnabled(!kbLock);};
+    void setLight(const QColor *pLight)           {m_pLight = (QColor *)pLight;};
+    void setDark(const QColor *pDark)             {m_pDark = (QColor *)pDark;};
+    void setCorbaon(const bool &kbEnable = true)  {
         m_pCorbaline->setEnabled(kbEnable);
         m_pCorbacheck->setChecked(kbEnable);
     };
@@ -126,7 +141,11 @@
     };
 
 protected slots:
+    virtual void polish(void);
     virtual void textChange(void);
+    virtual void shadeLight(void);
+    virtual void shadeDark(void);
+    virtual void shadeRevert(void);
     void enableCorba(bool bOn) {m_pCorbaline->setEnabled(bOn);};
     void enableSoap(bool bOn) {m_pSoapline->setEnabled(bOn);};
 


ossp-pkg/as/as-gui/as_slot.cpp 1.129 -> 1.130

--- as_slot.cpp  2003/02/20 16:46:38     1.129
+++ as_slot.cpp  2003/02/21 10:11:36     1.130
@@ -1179,6 +1179,19 @@
         break;
     }
 
+    // Set default colours
+    int nRed, nGreen, nBlue;
+    nRed   = m_pPrefs->getNumber(TITRAQ_PREFLIGHTRED, TITRAQ_DEFLIGHTRED);
+    nGreen = m_pPrefs->getNumber(TITRAQ_PREFLIGHTGREEN, TITRAQ_DEFLIGHTGREEN);
+    nBlue  = m_pPrefs->getNumber(TITRAQ_PREFLIGHTBLUE, TITRAQ_DEFLIGHTBLUE);
+    const QColor Lightshade = QColor(nRed, nGreen, nBlue);
+    pUserpanel->setLight(&Lightshade);
+    nRed   = m_pPrefs->getNumber(TITRAQ_PREFDARKRED, TITRAQ_DEFDARKRED);
+    nGreen = m_pPrefs->getNumber(TITRAQ_PREFDARKGREEN, TITRAQ_DEFDARKGREEN);
+    nBlue  = m_pPrefs->getNumber(TITRAQ_PREFDARKBLUE, TITRAQ_DEFDARKBLUE);
+    const QColor Darkshade = QColor(nRed, nGreen, nBlue);
+    pUserpanel->setDark(&Darkshade);
+
     // Modal panel handler
     if (pUserpanel->exec() == QDialog::Accepted)
         this->applyPrefs(pUserpanel);
@@ -1905,6 +1918,12 @@
     m_pPrefs->setBool(TITRAQ_PREFSOAPON, pPrefpanel->getSoapon());
     m_pPrefs->setBool(TITRAQ_PREFBAKON, pPrefpanel->getBackon());
     m_pPrefs->setBool(TITRAQ_PREFEXTENDON, pPrefpanel->getExtendon());
+    m_pPrefs->setNumber(TITRAQ_PREFLIGHTRED, pPrefpanel->getLight()->red());
+    m_pPrefs->setNumber(TITRAQ_PREFLIGHTGREEN, pPrefpanel->getLight()->green());
+    m_pPrefs->setNumber(TITRAQ_PREFLIGHTBLUE, pPrefpanel->getLight()->blue());
+    m_pPrefs->setNumber(TITRAQ_PREFDARKRED, pPrefpanel->getDark()->red());
+    m_pPrefs->setNumber(TITRAQ_PREFDARKGREEN, pPrefpanel->getDark()->green());
+    m_pPrefs->setNumber(TITRAQ_PREFDARKBLUE, pPrefpanel->getDark()->blue());
 
     // Dim the lights if no RPC transports are available
     if (this->isOpen())

CVSTrac 2.0.1