OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_panel.cpp versions 1.13 and 1.14
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

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"));

CVSTrac 2.0.1