Index: ossp-pkg/as/as-gui/as_panel.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.cpp,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.cpp,v' 2>/dev/null --- as_panel.cpp 2003/02/21 10:11:36 1.14 +++ as_panel.cpp 2003/02/21 15:04:04 1.15 @@ -31,10 +31,13 @@ #include +#include + #include "as_panel.h" #include "as_generic.h" #include "as_const.h" +#include "as_gfx/revcolour.xpm" // // Constructs a Prefpanel as a child of 'pParent', with the @@ -51,7 +54,7 @@ this->setSizeGripEnabled(false); this->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, - (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth())); + (QSizePolicy::SizeType)5, 0, 0, this->sizePolicy().hasHeightForWidth())); // Initialize our button colours m_pLight = new QColor(); @@ -220,22 +223,28 @@ m_pShadeboxlay = new QVBoxLayout(m_pShadebox->layout()); m_pShadeboxlay->setAlignment(Qt::AlignTop); - m_pShadelayout = new QGridLayout(0, 2, 2, 11, 6, "Shadelayout"); + m_pShadelayout = new QGridLayout(0, 2, 2, 6, 16, "Shadelayout"); m_pLightlab = new QLabel(m_pShadebox, "Lightlabel"); + m_pLightlab->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred, this->sizePolicy().hasHeightForWidth()); m_pShadelayout->addWidget(m_pLightlab, 0, 0); m_pLightbutt = new QToolButton(m_pShadebox, "Lightbutton"); + m_pLightbutt->setFocusPolicy(QToolButton::TabFocus); m_pLightbutt->setCursor(QCursor(13)); m_pShadelayout->addWidget(m_pLightbutt, 0, 1); m_pDarklab = new QLabel(m_pShadebox, "Darklabel"); + m_pDarklab->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred, this->sizePolicy().hasHeightForWidth()); m_pShadelayout->addWidget(m_pDarklab, 1, 0); m_pDarkbutt = new QToolButton(m_pShadebox, "Darkbutton"); + m_pDarkbutt->setFocusPolicy(QToolButton::TabFocus); 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->setFocusPolicy(QToolButton::TabFocus); +// m_pRevertbutt->setIconSet(QIconSet(QPixmap(s_kpcRevcolour_xpm))); m_pRevertbutt->setCursor(QCursor(13)); m_pShadelayout->addWidget(m_pRevertbutt, 2, 1); @@ -244,11 +253,10 @@ 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); + QLabel *pPlaceholder = new QLabel(m_pThemebox, "Placeholderlabel"); + pPlaceholder->setText(trUtf8("Reserved for future use", "Comment for Placeholderlabel")); + m_pThemeboxlay->addWidget(pPlaceholder, 1, Qt::AlignCenter); m_pShadeboxlay->addLayout(m_pShadelayout); m_pColourlayout->addWidget(m_pShadebox); @@ -329,12 +337,12 @@ // 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); + delete m_pLight; + m_pLight = new QColor(*this->getRevlight()); + m_pLightbutt->setPaletteBackgroundColor(*m_pLight); + delete m_pDark; + m_pDark = new QColor(*this->getRevdark()); + m_pDarkbutt->setPaletteBackgroundColor(*m_pDark); } // @@ -398,9 +406,9 @@ 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")); + m_pLightlab->setText(trUtf8("Light", "Comment for Lightlabel")); + m_pDarklab->setText(trUtf8("Dark", "Comment for Darklabel")); + m_pRevertlab->setText(trUtf8("Revert", "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")); Index: ossp-pkg/as/as-gui/as_panel.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.h,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.h,v' 2>/dev/null --- as_panel.h 2003/02/21 10:11:36 1.11 +++ as_panel.h 2003/02/21 15:04:04 1.12 @@ -64,6 +64,7 @@ private: Preferences *m_pPanprefs; QColor *m_pLight, *m_pDark; + QColorGroup *m_pOrigcolours; public: QGroupBox *m_pGenbox, *m_pRembox, *m_pShadebox, *m_pThemebox; @@ -112,6 +113,8 @@ bool getExtendon(void) {return (m_pExtendcheck->isChecked());}; QColor *getLight(void) {return m_pLight;}; QColor *getDark(void) {return m_pDark;}; + QColor *getRevlight(void) {return (QColor *)&m_pOrigcolours->foreground();}; + QColor *getRevdark(void) {return (QColor *)&m_pOrigcolours->background();}; // Accessor set methods void setAccounts(const QString &kInstr) {m_pAcctline->setText(kInstr);}; @@ -126,6 +129,7 @@ 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 setOrigcolour(QColorGroup *pGroup) {m_pOrigcolours = pGroup;}; void setCorbaon(const bool &kbEnable = true) { m_pCorbaline->setEnabled(kbEnable); m_pCorbacheck->setChecked(kbEnable); Index: ossp-pkg/as/as-gui/as_reportpanel.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_reportpanel.cpp,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_reportpanel.cpp,v' 2>/dev/null --- as_reportpanel.cpp 2003/02/21 10:12:37 1.9 +++ as_reportpanel.cpp 2003/02/21 15:04:04 1.10 @@ -77,7 +77,7 @@ // Make Panel resizeable this->setSizeGripEnabled(true); this->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, - (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth())); + (QSizePolicy::SizeType)5, 0, 0, this->sizePolicy().hasHeightForWidth())); // Store matrix and prefs members m_pReptable = pTable; Index: ossp-pkg/as/as-gui/as_slot.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v rcsdiff -q -kk '-r1.130' '-r1.131' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- as_slot.cpp 2003/02/21 10:11:36 1.130 +++ as_slot.cpp 2003/02/21 15:04:04 1.131 @@ -1179,8 +1179,18 @@ break; } - // Set default colours + // Colour preferences int nRed, nGreen, nBlue; + QColorGroup Origcolour; + const QColor Origlight = QColor(TITRAQ_DEFLIGHTRED, TITRAQ_DEFLIGHTGREEN, TITRAQ_DEFLIGHTBLUE); + const QColor Origdark = QColor(TITRAQ_DEFDARKRED, TITRAQ_DEFDARKGREEN, TITRAQ_DEFDARKBLUE); + + // Set colours to revert to if user screws up and wants out + Origcolour.setColor(QColorGroup::Background, Origlight); + Origcolour.setColor(QColorGroup::Foreground, Origdark); + pUserpanel->setOrigcolour(&Origcolour); + + // Set colour preferences saved from last session nRed = m_pPrefs->getNumber(TITRAQ_PREFLIGHTRED, TITRAQ_DEFLIGHTRED); nGreen = m_pPrefs->getNumber(TITRAQ_PREFLIGHTGREEN, TITRAQ_DEFLIGHTGREEN); nBlue = m_pPrefs->getNumber(TITRAQ_PREFLIGHTBLUE, TITRAQ_DEFLIGHTBLUE);