as_panel.cpp

Thu, 06 Aug 2009 13:21:30 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 06 Aug 2009 13:21:30 +0200
changeset 15
0e0eb7c91312
parent 14
1c58588f9cb6
permissions
-rw-r--r--

Remove seemingly declarations unnecessary according to Qt 4.5.2 headers.

michael@1 1 //
michael@1 2 // OSSP asgui - Accounting system graphical user interface
michael@12 3 // Copyright (c) 2002-2009 The OSSP Project (http://www.ossp.org/)
michael@12 4 // Copyright (c) 2002-2009 Ralf S. Engelschall <rse@engelschall.com>
michael@12 5 // Copyright (c) 2002-2009 Michael Schloh von Bennewitz <michael@schloh.com>
michael@12 6 // Copyright (c) 2002-2009 Cable & Wireless Telecommunications Services GmbH
michael@1 7 //
michael@1 8 // This file is part of OSSP asgui, an accounting system graphical user
michael@3 9 // interface which can be found at http://asgui.europalab.com/.
michael@1 10 //
michael@1 11 // Permission to use, copy, modify, and distribute this software for
michael@1 12 // any purpose with or without fee is hereby granted, provided that
michael@1 13 // the above copyright notice and this permission notice appear in all
michael@1 14 // copies.
michael@1 15 //
michael@1 16 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@1 17 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@1 18 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@1 19 // IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@1 20 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@1 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@1 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@1 23 // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@1 24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@1 25 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@1 26 // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@1 27 // SUCH DAMAGE.
michael@1 28 //
michael@1 29 // as_panel.cpp: ISO C++ implementation
michael@1 30 //
michael@1 31
michael@1 32 #include <vector>
michael@1 33
michael@1 34 #include <qimage.h>
michael@1 35
michael@3 36 //Added by qt3to4:
michael@3 37 #include <Q3HBoxLayout>
michael@3 38 #include <Q3GridLayout>
michael@3 39 #include <QLabel>
michael@3 40 #include <Q3VBoxLayout>
michael@3 41
michael@1 42 #include "as_panel.h"
michael@1 43 #include "as_generic.h"
michael@1 44 #include "as_const.h"
michael@1 45
michael@1 46 #include "as_gfx/revcolour.xpm"
michael@1 47
michael@1 48 //
michael@1 49 // Constructs a Prefpanel as a child of 'pParent', with the
michael@1 50 // name 'kszName' and widget flags set to 'Flags'.
michael@1 51 //
michael@1 52 // The dialog will by default be modal, unless you set 'bModal' to
michael@1 53 // false to construct a modeless dialog.
michael@1 54 //
michael@3 55 Prefpanel::Prefpanel(QWidget *pParent, const char *kszName, bool bModal, Qt::WFlags Flags)
michael@1 56 : QDialog(pParent, kszName, bModal, Flags)
michael@1 57 {
michael@1 58 if (!kszName)
michael@1 59 this->setName("Prefpanel");
michael@1 60
michael@1 61 this->setSizeGripEnabled(false);
michael@1 62 this->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
michael@1 63 (QSizePolicy::SizeType)5, 0, 0, this->sizePolicy().hasHeightForWidth()));
michael@1 64
michael@1 65 // Initialize our button colours
michael@1 66 m_pLight = new QColor();
michael@1 67 m_pDark = new QColor();
michael@1 68
michael@3 69 m_pVlayout = new Q3VBoxLayout(this, 11, 6, "Formlayout");
michael@1 70 m_pTabselect = new QTabWidget(this, "Tabselector");
michael@1 71
michael@1 72 // Start of style chooser UI pieces
michael@1 73 m_pBoolpage = new QWidget(m_pTabselect, "Tabpage");
michael@3 74 m_pBoolayout = new Q3HBoxLayout(m_pBoolpage, 11, 6, "Genlayout");
michael@3 75 m_pBinlayout = new Q3VBoxLayout(0, 0, 6, "Binarylayout");
michael@3 76 m_pStylegroup = new Q3ButtonGroup(m_pBoolpage, "Stylebuttongroup");
michael@1 77 m_pStylegroup->setColumnLayout(0, Qt::Vertical);
michael@1 78 m_pStylegroup->layout()->setSpacing(6);
michael@1 79 m_pStylegroup->layout()->setMargin(11);
michael@1 80 m_pStylegroup->setExclusive(true);
michael@1 81
michael@3 82 m_pStylelay = new Q3VBoxLayout(m_pStylegroup->layout());
michael@1 83 m_pStylelay->setAlignment(Qt::AlignTop);
michael@1 84
michael@1 85 // Block to handle a vector of radio buttons
michael@1 86 int nIter = 0;
michael@1 87 QStringList Styles = QStyleFactory::keys();
michael@1 88 std::vector<QRadioButton *> Stylevector(Styles.size());
michael@1 89
michael@1 90 // Discover which interface styles are available, and
michael@1 91 // dynamically construct new radio buttons to represent them
michael@1 92 for (QStringList::Iterator Stylename = Styles.begin();
michael@1 93 Stylename != Styles.end(); Stylename++) {
michael@1 94 Stylevector[nIter] = new QRadioButton(m_pStylegroup, *Stylename + "_button");
michael@1 95 Stylevector[nIter]->setText(trUtf8(*Stylename, "Comment for " + *Stylename));
michael@1 96 Stylevector[nIter]->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding,
michael@1 97 Stylevector[nIter]->sizePolicy().hasHeightForWidth());
michael@1 98 QToolTip::add(Stylevector[nIter], trUtf8("The " + *Stylename + " style",
michael@1 99 "Comment for toolTip " + *Stylename));
michael@3 100 Q3WhatsThis::add(Stylevector[nIter], trUtf8("Click this button to enjoy the style of the "
michael@1 101 + *Stylename + " user interface", "Comment whatsThis for " + *Stylename));
michael@1 102 m_pStylelay->addWidget(Stylevector[nIter]);
michael@1 103 nIter++;
michael@1 104 }
michael@1 105
michael@1 106 // Start of binary option UI pieces (like make backups, yes or no)
michael@3 107 m_pSwitchgroup = new Q3ButtonGroup(m_pBoolpage, "Switchbuttongroup");
michael@1 108 m_pSwitchgroup->setColumnLayout(0, Qt::Vertical);
michael@1 109 m_pSwitchgroup->layout()->setSpacing(6);
michael@1 110 m_pSwitchgroup->layout()->setMargin(11);
michael@1 111 m_pSwitchgroup->setExclusive(false);
michael@3 112 m_pSwitchlay = new Q3VBoxLayout(m_pSwitchgroup->layout());
michael@1 113 m_pSwitchlay->setAlignment(Qt::AlignTop);
michael@1 114
michael@1 115 // Optional file backups with hard coded extension .bak
michael@1 116 m_pBackupcheck = new QCheckBox(m_pSwitchgroup, "Backupbutton");
michael@1 117 m_pBackupcheck->setText(trUtf8("Make .bak file on save", "Comment for Backupcheck"));
michael@1 118 QToolTip::add(m_pBackupcheck, trUtf8("Make a .bak file when saving", "Comment for toolTip Backupcheck"));
michael@3 119 Q3WhatsThis::add(m_pBackupcheck, trUtf8("Check this box to enable automatic file backups when overwriting an existing file", "Comment whatsThis for Backupcheck"));
michael@1 120 m_pSwitchlay->addWidget(m_pBackupcheck);
michael@1 121
michael@1 122 // Optional easy filename appending with hard coded extension .as
michael@1 123 m_pExtendcheck = new QCheckBox(m_pSwitchgroup, "Extensionbutton");
michael@1 124 m_pExtendcheck->setText(trUtf8("Append .as extension", "Comment for Extensioncheck"));
michael@1 125 QToolTip::add(m_pExtendcheck, trUtf8("Use the .as file extension", "Comment for toolTip Extensioncheck"));
michael@3 126 Q3WhatsThis::add(m_pExtendcheck, trUtf8("Check this box to automatically append '.as' to new filenames when saving", "Comment whatsThis for Extensioncheck"));
michael@1 127 m_pSwitchlay->addWidget(m_pExtendcheck);
michael@1 128
michael@1 129 // Start of report option UI pieces (like detailed report listings)
michael@3 130 m_pReportgroup = new Q3ButtonGroup(m_pBoolpage, "Reportbuttongroup");
michael@1 131 m_pReportgroup->setColumnLayout(0, Qt::Vertical);
michael@1 132 m_pReportgroup->layout()->setSpacing(6);
michael@1 133 m_pReportgroup->layout()->setMargin(11);
michael@1 134 m_pReportgroup->setExclusive(false);
michael@3 135 m_pReportlay = new Q3VBoxLayout(m_pReportgroup->layout());
michael@1 136 m_pReportlay->setAlignment(Qt::AlignTop);
michael@1 137
michael@1 138 // Optional detailed report listings write all events in range
michael@1 139 m_pDetailcheck = new QCheckBox(m_pReportgroup, "Detailistbutton");
michael@1 140 m_pDetailcheck->setText(trUtf8("Detailed listing", "Comment for Detailcheck"));
michael@1 141 QToolTip::add(m_pDetailcheck, trUtf8("Write detailed event listings", "Comment for toolTip Detailcheck"));
michael@3 142 Q3WhatsThis::add(m_pDetailcheck, trUtf8("Check this box to enable writing of detailed event listings to the local report", "Comment whatsThis for Detailcheck"));
michael@1 143 m_pReportlay->addWidget(m_pDetailcheck);
michael@1 144
michael@1 145 // Optional signature line in report footer
michael@1 146 m_pSigncheck = new QCheckBox(m_pReportgroup, "Signaturebutton");
michael@1 147 m_pSigncheck->setText(trUtf8("Signature line", "Comment for Signaturecheck"));
michael@1 148 QToolTip::add(m_pSigncheck, trUtf8("Append a signature line", "Comment for toolTip Signaturecheck"));
michael@3 149 Q3WhatsThis::add(m_pSigncheck, trUtf8("Check this box to write a signature line to the report footer", "Comment whatsThis for Signaturecheck"));
michael@1 150 m_pReportlay->addWidget(m_pSigncheck);
michael@1 151 m_pBoolayout->addWidget(m_pStylegroup);
michael@1 152 m_pBinlayout->addWidget(m_pReportgroup);
michael@1 153 m_pBinlayout->addWidget(m_pSwitchgroup);
michael@1 154 m_pBoolayout->addLayout(m_pBinlayout);
michael@1 155 m_pTabselect->insertTab(m_pBoolpage, "");
michael@1 156
michael@1 157 // Start of paths page UI pieces
michael@1 158 m_pGeneralpage = new QWidget(m_pTabselect, "Generalpage");
michael@3 159 m_pGenlayout = new Q3HBoxLayout(m_pGeneralpage, 11, 6, "Genlayout");
michael@3 160 m_pGenbox = new Q3GroupBox(m_pGeneralpage, "Groupboxlayout");
michael@1 161 m_pGenbox->setColumnLayout(0, Qt::Vertical);
michael@1 162 m_pGenbox->layout()->setSpacing(6);
michael@1 163 m_pGenbox->layout()->setMargin(11);
michael@3 164 m_pGenboxlay = new Q3HBoxLayout(m_pGenbox->layout());
michael@1 165 m_pGenboxlay->setAlignment(Qt::AlignTop);
michael@1 166
michael@1 167 // Start of path text entry preferences UI pieces
michael@3 168 m_pGeninner = new Q3GridLayout(0, 4, 2, 0, 16, "Innergrid");
michael@1 169 m_pAcctlabel = new QLabel(m_pGenbox, "Accfilelabel");
michael@1 170 m_pGeninner->addWidget(m_pAcctlabel, 0, 0);
michael@1 171 m_pAcctline = new QLineEdit(m_pGenbox, "Accountline");
michael@1 172 m_pGeninner->addWidget(m_pAcctline, 0, 1);
michael@1 173 m_pEventlabel = new QLabel(m_pGenbox, "Evntdirlabel");
michael@1 174 m_pGeninner->addWidget(m_pEventlabel, 1, 0);
michael@1 175 m_pEventline = new QLineEdit(m_pGenbox, "Eventline");
michael@1 176 m_pGeninner->addWidget(m_pEventline, 1, 1);
michael@1 177 m_pHomelabel = new QLabel(m_pGenbox, "Homelabel");
michael@1 178 m_pGeninner->addWidget(m_pHomelabel, 2, 0);
michael@1 179 m_pHomeline = new QLineEdit(m_pGenbox, "Homeline");
michael@1 180 m_pGeninner->addWidget(m_pHomeline, 2, 1);
michael@1 181 m_pUserlabel = new QLabel(m_pGenbox, "Userlabel");
michael@1 182 m_pGeninner->addWidget(m_pUserlabel, 3, 0);
michael@1 183 m_pUserline = new QLineEdit(m_pGenbox, "Userline");
michael@1 184 m_pGeninner->addWidget(m_pUserline, 3, 1);
michael@1 185 m_pGenboxlay->addLayout(m_pGeninner);
michael@1 186
michael@1 187 m_pGenlayout->addWidget(m_pGenbox);
michael@1 188 m_pTabselect->insertTab(m_pGeneralpage, "");
michael@1 189
michael@1 190 // Start of remote page UI pieces
michael@1 191 m_pRemotepage = new QWidget(m_pTabselect, "Remotepage");
michael@3 192 m_pRemlayout = new Q3HBoxLayout(m_pRemotepage, 11, 6, "Remlayout");
michael@3 193 m_pRembox = new Q3GroupBox(m_pRemotepage, "Remoteboxlayout");
michael@1 194
michael@1 195 m_pRembox->setColumnLayout(0, Qt::Vertical);
michael@1 196 m_pRembox->layout()->setSpacing(6);
michael@1 197 m_pRembox->layout()->setMargin(11);
michael@3 198 m_pRemboxlay = new Q3HBoxLayout(m_pRembox->layout());
michael@1 199 m_pRemboxlay->setAlignment(Qt::AlignTop);
michael@1 200
michael@1 201 // Start of RPC preferences UI pieces
michael@3 202 m_pReminner = new Q3GridLayout(0, 5, 2, 0, 12, "Innergrid");
michael@1 203 m_pCorbalabel = new QLabel(m_pRembox, "Corbalabel");
michael@1 204 m_pReminner->addWidget(m_pCorbalabel, 0, 0);
michael@1 205 m_pCorbaline = new QLineEdit(m_pRembox, "Corbaline");
michael@1 206 m_pReminner->addWidget(m_pCorbaline, 0, 1);
michael@1 207 m_pCorbacheck = new QCheckBox(m_pRembox, "Corbacheckbox");
michael@1 208 m_pReminner->addWidget(m_pCorbacheck, 1, 1);
michael@1 209 QSpacerItem *Spacey = new QSpacerItem(6, 12, QSizePolicy::Minimum, QSizePolicy::Minimum);
michael@1 210 m_pReminner->addItem(Spacey, 2, 0);
michael@1 211 m_pSoaplabel = new QLabel(m_pRembox, "Soaplabel");
michael@1 212 m_pReminner->addWidget(m_pSoaplabel, 3, 0);
michael@1 213 m_pSoapline = new QLineEdit(m_pRembox, "Soapline");
michael@1 214 m_pReminner->addWidget(m_pSoapline, 3, 1);
michael@1 215 m_pSoapcheck = new QCheckBox(m_pRembox, "Corbacheckbox");
michael@1 216 m_pReminner->addWidget(m_pSoapcheck, 4, 1);
michael@1 217 m_pRemboxlay->addLayout(m_pReminner);
michael@1 218
michael@1 219 m_pRemlayout->addWidget(m_pRembox);
michael@1 220 m_pTabselect->insertTab(m_pRemotepage, "");
michael@1 221
michael@1 222 // Start of color page UI pieces
michael@1 223 m_pColourpage = new QWidget(m_pTabselect, "Colourpage");
michael@3 224 m_pColourlayout = new Q3HBoxLayout(m_pColourpage, 11, 6, "Colourlayout");
michael@3 225 m_pShadebox = new Q3GroupBox(m_pColourpage, "Shadegroupbox");
michael@1 226 m_pShadebox->setColumnLayout(0, Qt::Horizontal);
michael@1 227 m_pShadebox->layout()->setSpacing(6);
michael@1 228 m_pShadebox->layout()->setMargin(11);
michael@3 229 m_pShadeboxlay = new Q3VBoxLayout(m_pShadebox->layout());
michael@1 230 m_pShadeboxlay->setAlignment(Qt::AlignTop);
michael@1 231
michael@3 232 m_pShadelayout = new Q3GridLayout(0, 2, 2, 6, 16, "Shadelayout");
michael@1 233 m_pLightlab = new QLabel(m_pShadebox, "Lightlabel");
michael@1 234 m_pLightlab->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred, this->sizePolicy().hasHeightForWidth());
michael@1 235 m_pShadelayout->addWidget(m_pLightlab, 0, 0);
michael@1 236 m_pLightbutt = new QToolButton(m_pShadebox, "Lightbutton");
michael@3 237 m_pLightbutt->setFocusPolicy(Qt::TabFocus);
michael@14 238 m_pLightbutt->setCursor(QCursor(Qt::PointingHandCursor));
michael@1 239 m_pShadelayout->addWidget(m_pLightbutt, 0, 1);
michael@1 240
michael@1 241 m_pDarklab = new QLabel(m_pShadebox, "Darklabel");
michael@1 242 m_pDarklab->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred, this->sizePolicy().hasHeightForWidth());
michael@1 243 m_pShadelayout->addWidget(m_pDarklab, 1, 0);
michael@1 244 m_pDarkbutt = new QToolButton(m_pShadebox, "Darkbutton");
michael@3 245 m_pDarkbutt->setFocusPolicy(Qt::TabFocus);
michael@14 246 m_pDarkbutt->setCursor(QCursor(Qt::PointingHandCursor));
michael@1 247 m_pShadelayout->addWidget(m_pDarkbutt, 1, 1);
michael@1 248
michael@1 249 m_pRevertlab = new QLabel(m_pShadebox, "Revertlabel");
michael@1 250 m_pShadelayout->addWidget(m_pRevertlab, 2, 0);
michael@1 251 m_pRevertbutt = new QToolButton(m_pShadebox, "Revertbutton");
michael@3 252 m_pRevertbutt->setFocusPolicy(Qt::TabFocus);
michael@1 253 // m_pRevertbutt->setIconSet(QIconSet(QPixmap(s_kpcRevcolour_xpm)));
michael@14 254 m_pRevertbutt->setCursor(QCursor(Qt::PointingHandCursor));
michael@1 255 m_pShadelayout->addWidget(m_pRevertbutt, 2, 1);
michael@1 256
michael@3 257 m_pThemebox = new Q3GroupBox(m_pColourpage, "Themegroupbox");
michael@1 258 m_pThemebox->setColumnLayout(0, Qt::Vertical);
michael@1 259 m_pThemebox->layout()->setSpacing(6);
michael@1 260 m_pThemebox->layout()->setMargin(11);
michael@3 261 m_pThemeboxlay = new Q3VBoxLayout(m_pThemebox->layout());
michael@1 262
michael@1 263 QLabel *pPlaceholder = new QLabel(m_pThemebox, "Placeholderlabel");
michael@1 264 pPlaceholder->setText(trUtf8("Reserved for future use", "Comment for Placeholderlabel"));
michael@1 265 m_pThemeboxlay->addWidget(pPlaceholder, 1, Qt::AlignCenter);
michael@1 266
michael@1 267 m_pShadeboxlay->addLayout(m_pShadelayout);
michael@1 268 m_pColourlayout->addWidget(m_pShadebox);
michael@1 269 m_pColourlayout->addWidget(m_pThemebox);
michael@1 270 m_pTabselect->insertTab(m_pColourpage, "");
michael@1 271
michael@1 272 connect(m_pLightbutt, SIGNAL(clicked(void)), SLOT(shadeLight(void)));
michael@1 273 connect(m_pDarkbutt, SIGNAL(clicked(void)), SLOT(shadeDark(void)));
michael@1 274 connect(m_pRevertbutt, SIGNAL(clicked(void)), SLOT(shadeRevert(void)));
michael@1 275
michael@1 276 // Finally add the damn pages to the tab selector widget!
michael@1 277 m_pVlayout->addWidget(m_pTabselect);
michael@1 278
michael@1 279 // Start of bottom buttons for aknowlegement and commital of changes
michael@3 280 m_pButtlay = new Q3HBoxLayout(0, 0, 12, "Buttonlayout");
michael@1 281 m_pOkaybutton = new QPushButton(this, "Okaybutton");
michael@1 282 m_pOkaybutton->setMinimumWidth(120);
michael@1 283 m_pOkaybutton->setPaletteBackgroundColor(QColor(202, 194, 182));
michael@14 284 m_pOkaybutton->setCursor(QCursor(Qt::PointingHandCursor));
michael@1 285 m_pButtlay->addWidget(m_pOkaybutton);
michael@1 286 m_pApplybutton = new QPushButton(this, "Applybutton");
michael@1 287 m_pApplybutton->setMinimumWidth(120);
michael@1 288 m_pApplybutton->setPaletteBackgroundColor(QColor(198, 196, 186));
michael@14 289 m_pApplybutton->setCursor(QCursor(Qt::PointingHandCursor));
michael@1 290 m_pButtlay->addWidget(m_pApplybutton);
michael@1 291 // QSpacerItem *Spacey = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
michael@1 292 // m_pButtlay->addItem(Spacey);
michael@1 293 m_pCancelbutton = new QPushButton(this, "Cancelbutton");
michael@1 294 m_pCancelbutton->setMinimumWidth(120);
michael@1 295 m_pCancelbutton->setPaletteBackgroundColor(QColor(198, 196, 186));
michael@14 296 m_pCancelbutton->setCursor(QCursor(Qt::PointingHandCursor));
michael@1 297 m_pButtlay->addWidget(m_pCancelbutton);
michael@1 298 m_pCancelbutton->setDefault(true);
michael@1 299 m_pVlayout->addLayout(m_pButtlay);
michael@1 300
michael@1 301 // Connect our signals to slots, accept() and reject() are Qt implicit
michael@1 302 connect(m_pOkaybutton, SIGNAL(clicked(void)), SLOT(accept(void)));
michael@1 303 connect(m_pApplybutton, SIGNAL(clicked(void)), SIGNAL(applied(void)));
michael@1 304 connect(m_pCancelbutton, SIGNAL(clicked(void)), SLOT(reject(void)));
michael@1 305 connect(m_pCorbacheck, SIGNAL(toggled(bool)), SLOT(enableCorba(bool)));
michael@1 306 connect(m_pSoapcheck, SIGNAL(toggled(bool)), SLOT(enableSoap(bool)));
michael@1 307 this->textChange();
michael@1 308 this->resize(QSize(400, 264).expandedTo(minimumSizeHint()));
michael@1 309 }
michael@1 310
michael@1 311 //
michael@1 312 // Sets the light shading colour for rows
michael@1 313 //
michael@1 314 void Prefpanel::shadeLight(void)
michael@1 315 {
michael@1 316 QColorDialog::setCustomColor(0, this->getRevlight()->rgb());
michael@1 317 QColorDialog::setCustomColor(1, this->getRevdark()->rgb());
michael@1 318 QColorDialog::setCustomColor(2, this->getAltlight()->rgb());
michael@1 319 QColorDialog::setCustomColor(3, this->getAltdark()->rgb());
michael@1 320 QColor Colortemp = QColorDialog::getColor(*m_pLight);
michael@1 321 if (Colortemp.isValid()) {
michael@1 322 delete m_pLight;
michael@1 323 m_pLight = new QColor(Colortemp);
michael@1 324 m_pLightbutt->setPaletteBackgroundColor(*m_pLight);
michael@1 325 }
michael@1 326 }
michael@1 327
michael@1 328 //
michael@1 329 // Sets the dark shading colour for rows
michael@1 330 //
michael@1 331 void Prefpanel::shadeDark(void)
michael@1 332 {
michael@1 333 QColorDialog::setCustomColor(0, m_pLight->rgb());
michael@1 334 QColorDialog::setCustomColor(1, m_pDark->rgb());
michael@1 335 QColor Colortemp = QColorDialog::getColor(*m_pDark);
michael@1 336 if (Colortemp.isValid()) {
michael@1 337 delete m_pDark;
michael@1 338 m_pDark = new QColor(Colortemp);
michael@1 339 m_pDarkbutt->setPaletteBackgroundColor(*m_pDark);
michael@1 340 }
michael@1 341 }
michael@1 342
michael@1 343 //
michael@1 344 // Reverts the shading colours to default values
michael@1 345 //
michael@1 346 void Prefpanel::shadeRevert(void)
michael@1 347 {
michael@1 348 delete m_pLight;
michael@1 349 m_pLight = new QColor(*this->getRevlight());
michael@1 350 m_pLightbutt->setPaletteBackgroundColor(*m_pLight);
michael@1 351 delete m_pDark;
michael@1 352 m_pDark = new QColor(*this->getRevdark());
michael@1 353 m_pDarkbutt->setPaletteBackgroundColor(*m_pDark);
michael@1 354 }
michael@1 355
michael@1 356 //
michael@1 357 // Polish off ending changes after creating and before widget shows
michael@1 358 //
michael@1 359 void Prefpanel::polish(void)
michael@1 360 {
michael@1 361 // Set our buttons now that user has probably set their colours
michael@1 362 m_pLightbutt->setPaletteBackgroundColor(*m_pLight);
michael@1 363 m_pDarkbutt->setPaletteBackgroundColor(*m_pDark);
michael@1 364 }
michael@1 365
michael@1 366 //
michael@1 367 // Sets the strings of the subwidgets using the current language
michael@1 368 //
michael@1 369 void Prefpanel::textChange(void)
michael@1 370 {
michael@1 371 this->setCaption(trUtf8("AS Applicate Preferences", "Personal preferences are persistent across sessions"));
michael@1 372
michael@1 373 m_pTabselect->changeTab(m_pBoolpage, trUtf8("General"));
michael@1 374 m_pTabselect->changeTab(m_pGeneralpage, trUtf8("Paths"));
michael@1 375 m_pTabselect->changeTab(m_pRemotepage, trUtf8("Hosts"));
michael@1 376 m_pTabselect->changeTab(m_pColourpage, trUtf8("Colour"));
michael@1 377
michael@1 378 m_pOkaybutton->setText(trUtf8("Okay", "Comment for Okaybutton"));
michael@1 379 QToolTip::add(m_pOkaybutton, trUtf8("Applies and saves changes", "Comment for tooltip Okaybutton"));
michael@3 380 Q3WhatsThis::add(m_pOkaybutton, trUtf8("The okay button applies and saves changes", "Comment for whatsThis Okaybutton"));
michael@1 381
michael@1 382 m_pApplybutton->setText(trUtf8("Apply", "Comment for Applybutton"));
michael@1 383 QToolTip::add(m_pApplybutton, trUtf8("Apply changes immediately", "Comment for toolTip Applybutton"));
michael@3 384 Q3WhatsThis::add(m_pApplybutton, trUtf8("The apply button applies changes immediately", "Comment for whatsThis Applybutton"));
michael@1 385
michael@1 386 m_pCancelbutton->setText(trUtf8("Cancel", "Comment for Cancelbutton"));
michael@1 387 QToolTip::add(m_pCancelbutton, trUtf8("Cancel any changes", "Comment for toolTip Cancelbutton"));
michael@3 388 Q3WhatsThis::add(m_pCancelbutton, trUtf8("The cancel button cancels any changes", "Comment for whatsThis Cancelbutton"));
michael@1 389
michael@1 390 m_pGenbox->setTitle(trUtf8("File and directory paths", "Comment for Genbox"));
michael@1 391 m_pAcctlabel->setText(trUtf8("Accounts path", "Comment for Acctlabel"));
michael@1 392 m_pEventlabel->setText(trUtf8("Events directory", "Comment for Eventlabel"));
michael@1 393 m_pUserlabel->setText(trUtf8("User name", "Comment for Userlabel"));
michael@1 394 m_pHomelabel->setText(trUtf8("Home directory", "Comment for Homelabel"));
michael@1 395 QToolTip::add(m_pAcctline, trUtf8("The accounts file pathname", "Comment for toolTip Acctline"));
michael@1 396 QToolTip::add(m_pEventline, trUtf8("The default events directory", "Comment for toolTip Eventline"));
michael@1 397 QToolTip::add(m_pUserline, trUtf8("The user name", "Comment for toolTip Userline"));
michael@1 398 QToolTip::add(m_pHomeline, trUtf8("The home directory", "Comment for toolTip Homeline"));
michael@1 399
michael@1 400 m_pRembox->setTitle(trUtf8("Remote host names", "Comment for Rembox"));
michael@1 401 m_pCorbalabel->setText(trUtf8("CORBA host", "Comment for Corbalabel"));
michael@1 402 m_pSoaplabel->setText(trUtf8("SOAP host", "Comment for Soaplabel"));
michael@1 403 QToolTip::add(m_pCorbaline, trUtf8("The CORBA host name", "Comment for toolTip Corbaline"));
michael@1 404 QToolTip::add(m_pSoapline, trUtf8("The SOAP host name", "Comment for toolTip Soapline"));
michael@1 405
michael@1 406 m_pCorbacheck->setText(trUtf8("Enable IIOP transmission", "Comment for Corbacheck"));
michael@1 407 QToolTip::add(m_pCorbacheck, trUtf8("Will enable transmission over IIOP", "Comment for toolTip Corbacheck"));
michael@3 408 Q3WhatsThis::add(m_pCorbacheck, trUtf8("Check this box to enable transmission to a CORBA host", "Comment whatsThis for Corbacheck"));
michael@1 409
michael@1 410 m_pSoapcheck->setText(trUtf8("Enable SOAP transmission", "Comment for Soapcheck"));
michael@1 411 QToolTip::add(m_pSoapcheck, trUtf8("Will enable transmission over SOAP", "Comment for toolTip Soapcheck"));
michael@3 412 Q3WhatsThis::add(m_pSoapcheck, trUtf8("Check this box to enable transmission to a SOAP host", "Comment whatsThis for Soapcheck"));
michael@1 413
michael@1 414 m_pShadebox->setTitle(trUtf8("Row shading", "Comment for Shadebox"));
michael@1 415 m_pThemebox->setTitle(trUtf8("Skin themes", "Comment for Themebox"));
michael@1 416
michael@1 417 m_pLightlab->setText(trUtf8("Light", "Comment for Lightlabel"));
michael@1 418 m_pDarklab->setText(trUtf8("Dark", "Comment for Darklabel"));
michael@1 419 m_pRevertlab->setText(trUtf8("Revert", "Comment for Revertlabel"));
michael@1 420 QToolTip::add(m_pLightbutt, trUtf8("Light row shading colour", "Comment for tooltip Lightbutt"));
michael@3 421 Q3WhatsThis::add(m_pLightbutt, trUtf8("The Light button sets the light row shading colour.", "Comment for whatsThis Lightbutt"));
michael@1 422 QToolTip::add(m_pDarkbutt, trUtf8("Dark row shading colour", "Comment for tooltip Darkbutt"));
michael@3 423 Q3WhatsThis::add(m_pDarkbutt, trUtf8("The Dark button sets the light row shading colour.", "Comment for whatsThis Darkbutt"));
michael@1 424
michael@1 425 m_pStylegroup->setTitle(trUtf8("Available styles", "Comment for Stylebuttons"));
michael@1 426 m_pReportgroup->setTitle(trUtf8("Report options", "Comment for Reportbox"));
michael@1 427 m_pSwitchgroup->setTitle(trUtf8("Other options", "Comment for Switchbox"));
michael@1 428 }

mercurial