as_panel.cpp

Thu, 06 Aug 2009 13:04:50 +0200

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

Correct cursor method signatures and explicitly require XML linkage.

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

mercurial