as_panel.cpp

changeset 3
c1941114ca88
parent 1
d64aaa7d146f
child 12
ceb4ba3d2d00
     1.1 --- a/as_panel.cpp	Fri Nov 28 14:20:00 2008 +0100
     1.2 +++ b/as_panel.cpp	Fri Dec 05 23:14:02 2008 +0100
     1.3 @@ -1,12 +1,12 @@
     1.4  //
     1.5  //  OSSP asgui - Accounting system graphical user interface
     1.6 -//  Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/)
     1.7 -//  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>
     1.8 -//  Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com>
     1.9 -//  Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH
    1.10 +//  Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/)
    1.11 +//  Copyright (c) 2002-2008 Ralf S. Engelschall <rse@engelschall.com>
    1.12 +//  Copyright (c) 2002-2008 Michael Schloh von Bennewitz <michael@schloh.com>
    1.13 +//  Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH
    1.14  //
    1.15  //  This file is part of OSSP asgui, an accounting system graphical user
    1.16 -//  interface which can be found at http://www.ossp.org/pkg/tool/asgui/.
    1.17 +//  interface which can be found at http://asgui.europalab.com/.
    1.18  //
    1.19  //  Permission to use, copy, modify, and distribute this software for
    1.20  //  any purpose with or without fee is hereby granted, provided that
    1.21 @@ -29,10 +29,18 @@
    1.22  //  as_panel.cpp: ISO C++ implementation
    1.23  //
    1.24  
    1.25 +#define QT3_SUPPORT
    1.26 +
    1.27  #include <vector>
    1.28  
    1.29  #include <qimage.h>
    1.30  
    1.31 +//Added by qt3to4:
    1.32 +#include <Q3HBoxLayout>
    1.33 +#include <Q3GridLayout>
    1.34 +#include <QLabel>
    1.35 +#include <Q3VBoxLayout>
    1.36 +
    1.37  #include "as_panel.h"
    1.38  #include "as_generic.h"
    1.39  #include "as_const.h"
    1.40 @@ -46,7 +54,7 @@
    1.41  // The dialog will by default be modal, unless you set 'bModal' to
    1.42  // false to construct a modeless dialog.
    1.43  //
    1.44 -Prefpanel::Prefpanel(QWidget *pParent, const char *kszName, bool bModal, WFlags Flags)
    1.45 +Prefpanel::Prefpanel(QWidget *pParent, const char *kszName, bool bModal, Qt::WFlags Flags)
    1.46      : QDialog(pParent, kszName, bModal, Flags)
    1.47  {
    1.48      if (!kszName)
    1.49 @@ -60,20 +68,20 @@
    1.50      m_pLight = new QColor();
    1.51      m_pDark = new QColor();
    1.52  
    1.53 -    m_pVlayout = new QVBoxLayout(this, 11, 6, "Formlayout");
    1.54 +    m_pVlayout = new Q3VBoxLayout(this, 11, 6, "Formlayout");
    1.55      m_pTabselect = new QTabWidget(this, "Tabselector");
    1.56  
    1.57      // Start of style chooser UI pieces
    1.58      m_pBoolpage = new QWidget(m_pTabselect, "Tabpage");
    1.59 -    m_pBoolayout = new QHBoxLayout(m_pBoolpage, 11, 6, "Genlayout"); 
    1.60 -    m_pBinlayout = new QVBoxLayout(0, 0, 6, "Binarylayout"); 
    1.61 -    m_pStylegroup = new QButtonGroup(m_pBoolpage, "Stylebuttongroup");
    1.62 +    m_pBoolayout = new Q3HBoxLayout(m_pBoolpage, 11, 6, "Genlayout"); 
    1.63 +    m_pBinlayout = new Q3VBoxLayout(0, 0, 6, "Binarylayout"); 
    1.64 +    m_pStylegroup = new Q3ButtonGroup(m_pBoolpage, "Stylebuttongroup");
    1.65      m_pStylegroup->setColumnLayout(0, Qt::Vertical);
    1.66      m_pStylegroup->layout()->setSpacing(6);
    1.67      m_pStylegroup->layout()->setMargin(11);
    1.68      m_pStylegroup->setExclusive(true);
    1.69  
    1.70 -    m_pStylelay = new QVBoxLayout(m_pStylegroup->layout());
    1.71 +    m_pStylelay = new Q3VBoxLayout(m_pStylegroup->layout());
    1.72      m_pStylelay->setAlignment(Qt::AlignTop);
    1.73  
    1.74      // Block to handle a vector of radio buttons
    1.75 @@ -91,56 +99,56 @@
    1.76              Stylevector[nIter]->sizePolicy().hasHeightForWidth());
    1.77          QToolTip::add(Stylevector[nIter], trUtf8("The " + *Stylename + " style",
    1.78              "Comment for toolTip " + *Stylename));
    1.79 -        QWhatsThis::add(Stylevector[nIter], trUtf8("Click this button to enjoy the style of the "
    1.80 +        Q3WhatsThis::add(Stylevector[nIter], trUtf8("Click this button to enjoy the style of the "
    1.81              + *Stylename + " user interface", "Comment whatsThis for " + *Stylename));
    1.82          m_pStylelay->addWidget(Stylevector[nIter]);
    1.83          nIter++;
    1.84      }
    1.85  
    1.86      // Start of binary option UI pieces (like make backups, yes or no)
    1.87 -    m_pSwitchgroup = new QButtonGroup(m_pBoolpage, "Switchbuttongroup");
    1.88 +    m_pSwitchgroup = new Q3ButtonGroup(m_pBoolpage, "Switchbuttongroup");
    1.89      m_pSwitchgroup->setColumnLayout(0, Qt::Vertical);
    1.90      m_pSwitchgroup->layout()->setSpacing(6);
    1.91      m_pSwitchgroup->layout()->setMargin(11);
    1.92      m_pSwitchgroup->setExclusive(false);
    1.93 -    m_pSwitchlay = new QVBoxLayout(m_pSwitchgroup->layout());
    1.94 +    m_pSwitchlay = new Q3VBoxLayout(m_pSwitchgroup->layout());
    1.95      m_pSwitchlay->setAlignment(Qt::AlignTop);
    1.96  
    1.97      // Optional file backups with hard coded extension .bak
    1.98      m_pBackupcheck = new QCheckBox(m_pSwitchgroup, "Backupbutton");
    1.99      m_pBackupcheck->setText(trUtf8("Make .bak file on save", "Comment for Backupcheck"));
   1.100      QToolTip::add(m_pBackupcheck, trUtf8("Make a .bak file when saving", "Comment for toolTip Backupcheck"));
   1.101 -    QWhatsThis::add(m_pBackupcheck, trUtf8("Check this box to enable automatic file backups when overwriting an existing file", "Comment whatsThis for Backupcheck"));
   1.102 +    Q3WhatsThis::add(m_pBackupcheck, trUtf8("Check this box to enable automatic file backups when overwriting an existing file", "Comment whatsThis for Backupcheck"));
   1.103      m_pSwitchlay->addWidget(m_pBackupcheck);
   1.104  
   1.105      // Optional easy filename appending with hard coded extension .as
   1.106      m_pExtendcheck = new QCheckBox(m_pSwitchgroup, "Extensionbutton");
   1.107      m_pExtendcheck->setText(trUtf8("Append .as extension", "Comment for Extensioncheck"));
   1.108      QToolTip::add(m_pExtendcheck, trUtf8("Use the .as file extension", "Comment for toolTip Extensioncheck"));
   1.109 -    QWhatsThis::add(m_pExtendcheck, trUtf8("Check this box to automatically append '.as' to new filenames when saving", "Comment whatsThis for Extensioncheck"));
   1.110 +    Q3WhatsThis::add(m_pExtendcheck, trUtf8("Check this box to automatically append '.as' to new filenames when saving", "Comment whatsThis for Extensioncheck"));
   1.111      m_pSwitchlay->addWidget(m_pExtendcheck);
   1.112  
   1.113      // Start of report option UI pieces (like detailed report listings)
   1.114 -    m_pReportgroup = new QButtonGroup(m_pBoolpage, "Reportbuttongroup");
   1.115 +    m_pReportgroup = new Q3ButtonGroup(m_pBoolpage, "Reportbuttongroup");
   1.116      m_pReportgroup->setColumnLayout(0, Qt::Vertical);
   1.117      m_pReportgroup->layout()->setSpacing(6);
   1.118      m_pReportgroup->layout()->setMargin(11);
   1.119      m_pReportgroup->setExclusive(false);
   1.120 -    m_pReportlay = new QVBoxLayout(m_pReportgroup->layout());
   1.121 +    m_pReportlay = new Q3VBoxLayout(m_pReportgroup->layout());
   1.122      m_pReportlay->setAlignment(Qt::AlignTop);
   1.123  
   1.124      // Optional detailed report listings write all events in range
   1.125      m_pDetailcheck = new QCheckBox(m_pReportgroup, "Detailistbutton");
   1.126      m_pDetailcheck->setText(trUtf8("Detailed listing", "Comment for Detailcheck"));
   1.127      QToolTip::add(m_pDetailcheck, trUtf8("Write detailed event listings", "Comment for toolTip Detailcheck"));
   1.128 -    QWhatsThis::add(m_pDetailcheck, trUtf8("Check this box to enable writing of detailed event listings to the local report", "Comment whatsThis for Detailcheck"));
   1.129 +    Q3WhatsThis::add(m_pDetailcheck, trUtf8("Check this box to enable writing of detailed event listings to the local report", "Comment whatsThis for Detailcheck"));
   1.130      m_pReportlay->addWidget(m_pDetailcheck);
   1.131  
   1.132      // Optional signature line in report footer
   1.133      m_pSigncheck = new QCheckBox(m_pReportgroup, "Signaturebutton");
   1.134      m_pSigncheck->setText(trUtf8("Signature line", "Comment for Signaturecheck"));
   1.135      QToolTip::add(m_pSigncheck, trUtf8("Append a signature line", "Comment for toolTip Signaturecheck"));
   1.136 -    QWhatsThis::add(m_pSigncheck, trUtf8("Check this box to write a signature line to the report footer", "Comment whatsThis for Signaturecheck"));
   1.137 +    Q3WhatsThis::add(m_pSigncheck, trUtf8("Check this box to write a signature line to the report footer", "Comment whatsThis for Signaturecheck"));
   1.138      m_pReportlay->addWidget(m_pSigncheck);
   1.139      m_pBoolayout->addWidget(m_pStylegroup);
   1.140      m_pBinlayout->addWidget(m_pReportgroup);
   1.141 @@ -150,16 +158,16 @@
   1.142  
   1.143      // Start of paths page UI pieces
   1.144      m_pGeneralpage = new QWidget(m_pTabselect, "Generalpage");
   1.145 -    m_pGenlayout = new QHBoxLayout(m_pGeneralpage, 11, 6, "Genlayout");
   1.146 -    m_pGenbox = new QGroupBox(m_pGeneralpage, "Groupboxlayout");
   1.147 +    m_pGenlayout = new Q3HBoxLayout(m_pGeneralpage, 11, 6, "Genlayout");
   1.148 +    m_pGenbox = new Q3GroupBox(m_pGeneralpage, "Groupboxlayout");
   1.149      m_pGenbox->setColumnLayout(0, Qt::Vertical);
   1.150      m_pGenbox->layout()->setSpacing(6);
   1.151      m_pGenbox->layout()->setMargin(11);
   1.152 -    m_pGenboxlay = new QHBoxLayout(m_pGenbox->layout());
   1.153 +    m_pGenboxlay = new Q3HBoxLayout(m_pGenbox->layout());
   1.154      m_pGenboxlay->setAlignment(Qt::AlignTop);
   1.155  
   1.156      // Start of path text entry preferences UI pieces
   1.157 -    m_pGeninner = new QGridLayout(0, 4, 2, 0, 16, "Innergrid");
   1.158 +    m_pGeninner = new Q3GridLayout(0, 4, 2, 0, 16, "Innergrid");
   1.159      m_pAcctlabel = new QLabel(m_pGenbox, "Accfilelabel");
   1.160      m_pGeninner->addWidget(m_pAcctlabel, 0, 0);
   1.161      m_pAcctline = new QLineEdit(m_pGenbox, "Accountline");
   1.162 @@ -183,17 +191,17 @@
   1.163  
   1.164      // Start of remote page UI pieces
   1.165      m_pRemotepage = new QWidget(m_pTabselect, "Remotepage");
   1.166 -    m_pRemlayout = new QHBoxLayout(m_pRemotepage, 11, 6, "Remlayout");
   1.167 -    m_pRembox = new QGroupBox(m_pRemotepage, "Remoteboxlayout");
   1.168 +    m_pRemlayout = new Q3HBoxLayout(m_pRemotepage, 11, 6, "Remlayout");
   1.169 +    m_pRembox = new Q3GroupBox(m_pRemotepage, "Remoteboxlayout");
   1.170  
   1.171      m_pRembox->setColumnLayout(0, Qt::Vertical);
   1.172      m_pRembox->layout()->setSpacing(6);
   1.173      m_pRembox->layout()->setMargin(11);
   1.174 -    m_pRemboxlay = new QHBoxLayout(m_pRembox->layout());
   1.175 +    m_pRemboxlay = new Q3HBoxLayout(m_pRembox->layout());
   1.176      m_pRemboxlay->setAlignment(Qt::AlignTop);
   1.177  
   1.178      // Start of RPC preferences UI pieces
   1.179 -    m_pReminner = new QGridLayout(0, 5, 2, 0, 12, "Innergrid");
   1.180 +    m_pReminner = new Q3GridLayout(0, 5, 2, 0, 12, "Innergrid");
   1.181      m_pCorbalabel = new QLabel(m_pRembox, "Corbalabel");
   1.182      m_pReminner->addWidget(m_pCorbalabel, 0, 0);
   1.183      m_pCorbaline = new QLineEdit(m_pRembox, "Corbaline");
   1.184 @@ -215,20 +223,20 @@
   1.185  
   1.186      // Start of color page UI pieces
   1.187      m_pColourpage = new QWidget(m_pTabselect, "Colourpage");
   1.188 -    m_pColourlayout = new QHBoxLayout(m_pColourpage, 11, 6, "Colourlayout");
   1.189 -    m_pShadebox = new QGroupBox(m_pColourpage, "Shadegroupbox");
   1.190 +    m_pColourlayout = new Q3HBoxLayout(m_pColourpage, 11, 6, "Colourlayout");
   1.191 +    m_pShadebox = new Q3GroupBox(m_pColourpage, "Shadegroupbox");
   1.192      m_pShadebox->setColumnLayout(0, Qt::Horizontal);
   1.193      m_pShadebox->layout()->setSpacing(6);
   1.194      m_pShadebox->layout()->setMargin(11);
   1.195 -    m_pShadeboxlay = new QVBoxLayout(m_pShadebox->layout());
   1.196 +    m_pShadeboxlay = new Q3VBoxLayout(m_pShadebox->layout());
   1.197      m_pShadeboxlay->setAlignment(Qt::AlignTop);
   1.198  
   1.199 -    m_pShadelayout = new QGridLayout(0, 2, 2, 6, 16, "Shadelayout");
   1.200 +    m_pShadelayout = new Q3GridLayout(0, 2, 2, 6, 16, "Shadelayout");
   1.201      m_pLightlab = new QLabel(m_pShadebox, "Lightlabel");
   1.202      m_pLightlab->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred, this->sizePolicy().hasHeightForWidth());
   1.203      m_pShadelayout->addWidget(m_pLightlab, 0, 0);
   1.204      m_pLightbutt = new QToolButton(m_pShadebox, "Lightbutton");
   1.205 -    m_pLightbutt->setFocusPolicy(QToolButton::TabFocus);
   1.206 +    m_pLightbutt->setFocusPolicy(Qt::TabFocus);
   1.207      m_pLightbutt->setCursor(QCursor(13));
   1.208      m_pShadelayout->addWidget(m_pLightbutt, 0, 1);
   1.209  
   1.210 @@ -236,23 +244,23 @@
   1.211      m_pDarklab->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred, this->sizePolicy().hasHeightForWidth());
   1.212      m_pShadelayout->addWidget(m_pDarklab, 1, 0);
   1.213      m_pDarkbutt = new QToolButton(m_pShadebox, "Darkbutton");
   1.214 -    m_pDarkbutt->setFocusPolicy(QToolButton::TabFocus);
   1.215 +    m_pDarkbutt->setFocusPolicy(Qt::TabFocus);
   1.216      m_pDarkbutt->setCursor(QCursor(13));
   1.217      m_pShadelayout->addWidget(m_pDarkbutt, 1, 1);
   1.218  
   1.219      m_pRevertlab = new QLabel(m_pShadebox, "Revertlabel");
   1.220      m_pShadelayout->addWidget(m_pRevertlab, 2, 0);
   1.221      m_pRevertbutt = new QToolButton(m_pShadebox, "Revertbutton");
   1.222 -    m_pRevertbutt->setFocusPolicy(QToolButton::TabFocus);
   1.223 +    m_pRevertbutt->setFocusPolicy(Qt::TabFocus);
   1.224  //    m_pRevertbutt->setIconSet(QIconSet(QPixmap(s_kpcRevcolour_xpm)));
   1.225      m_pRevertbutt->setCursor(QCursor(13));
   1.226      m_pShadelayout->addWidget(m_pRevertbutt, 2, 1);
   1.227  
   1.228 -    m_pThemebox = new QGroupBox(m_pColourpage, "Themegroupbox");
   1.229 +    m_pThemebox = new Q3GroupBox(m_pColourpage, "Themegroupbox");
   1.230      m_pThemebox->setColumnLayout(0, Qt::Vertical);
   1.231      m_pThemebox->layout()->setSpacing(6);
   1.232      m_pThemebox->layout()->setMargin(11);
   1.233 -    m_pThemeboxlay = new QVBoxLayout(m_pThemebox->layout());
   1.234 +    m_pThemeboxlay = new Q3VBoxLayout(m_pThemebox->layout());
   1.235  
   1.236      QLabel *pPlaceholder = new QLabel(m_pThemebox, "Placeholderlabel");
   1.237      pPlaceholder->setText(trUtf8("Reserved for future use", "Comment for Placeholderlabel"));
   1.238 @@ -271,7 +279,7 @@
   1.239      m_pVlayout->addWidget(m_pTabselect);
   1.240  
   1.241      // Start of bottom buttons for aknowlegement and commital of changes
   1.242 -    m_pButtlay = new QHBoxLayout(0, 0, 12, "Buttonlayout");
   1.243 +    m_pButtlay = new Q3HBoxLayout(0, 0, 12, "Buttonlayout");
   1.244      m_pOkaybutton = new QPushButton(this, "Okaybutton");
   1.245      m_pOkaybutton->setMinimumWidth(120);
   1.246      m_pOkaybutton->setPaletteBackgroundColor(QColor(202, 194, 182));
   1.247 @@ -371,15 +379,15 @@
   1.248  
   1.249      m_pOkaybutton->setText(trUtf8("Okay", "Comment for Okaybutton"));
   1.250      QToolTip::add(m_pOkaybutton, trUtf8("Applies and saves changes", "Comment for tooltip Okaybutton"));
   1.251 -    QWhatsThis::add(m_pOkaybutton, trUtf8("The okay button applies and saves changes", "Comment for whatsThis Okaybutton"));
   1.252 +    Q3WhatsThis::add(m_pOkaybutton, trUtf8("The okay button applies and saves changes", "Comment for whatsThis Okaybutton"));
   1.253  
   1.254      m_pApplybutton->setText(trUtf8("Apply", "Comment for Applybutton"));
   1.255      QToolTip::add(m_pApplybutton, trUtf8("Apply changes immediately", "Comment for toolTip Applybutton"));
   1.256 -    QWhatsThis::add(m_pApplybutton, trUtf8("The apply button applies changes immediately", "Comment for whatsThis Applybutton"));
   1.257 +    Q3WhatsThis::add(m_pApplybutton, trUtf8("The apply button applies changes immediately", "Comment for whatsThis Applybutton"));
   1.258  
   1.259      m_pCancelbutton->setText(trUtf8("Cancel", "Comment for Cancelbutton"));
   1.260      QToolTip::add(m_pCancelbutton, trUtf8("Cancel any changes", "Comment for toolTip Cancelbutton"));
   1.261 -    QWhatsThis::add(m_pCancelbutton, trUtf8("The cancel button cancels any changes", "Comment for whatsThis Cancelbutton"));
   1.262 +    Q3WhatsThis::add(m_pCancelbutton, trUtf8("The cancel button cancels any changes", "Comment for whatsThis Cancelbutton"));
   1.263  
   1.264      m_pGenbox->setTitle(trUtf8("File and directory paths", "Comment for Genbox"));
   1.265      m_pAcctlabel->setText(trUtf8("Accounts path", "Comment for Acctlabel"));
   1.266 @@ -399,11 +407,11 @@
   1.267  
   1.268      m_pCorbacheck->setText(trUtf8("Enable IIOP transmission", "Comment for Corbacheck"));
   1.269      QToolTip::add(m_pCorbacheck, trUtf8("Will enable transmission over IIOP", "Comment for toolTip Corbacheck"));
   1.270 -    QWhatsThis::add(m_pCorbacheck, trUtf8("Check this box to enable transmission to a CORBA host", "Comment whatsThis for Corbacheck"));
   1.271 +    Q3WhatsThis::add(m_pCorbacheck, trUtf8("Check this box to enable transmission to a CORBA host", "Comment whatsThis for Corbacheck"));
   1.272  
   1.273      m_pSoapcheck->setText(trUtf8("Enable SOAP transmission", "Comment for Soapcheck"));
   1.274      QToolTip::add(m_pSoapcheck, trUtf8("Will enable transmission over SOAP", "Comment for toolTip Soapcheck"));
   1.275 -    QWhatsThis::add(m_pSoapcheck, trUtf8("Check this box to enable transmission to a SOAP host", "Comment whatsThis for Soapcheck"));
   1.276 +    Q3WhatsThis::add(m_pSoapcheck, trUtf8("Check this box to enable transmission to a SOAP host", "Comment whatsThis for Soapcheck"));
   1.277  
   1.278      m_pShadebox->setTitle(trUtf8("Row shading", "Comment for Shadebox"));
   1.279      m_pThemebox->setTitle(trUtf8("Skin themes", "Comment for Themebox"));
   1.280 @@ -412,9 +420,9 @@
   1.281      m_pDarklab->setText(trUtf8("Dark", "Comment for Darklabel"));
   1.282      m_pRevertlab->setText(trUtf8("Revert", "Comment for Revertlabel"));
   1.283      QToolTip::add(m_pLightbutt, trUtf8("Light row shading colour", "Comment for tooltip Lightbutt"));
   1.284 -    QWhatsThis::add(m_pLightbutt, trUtf8("The Light button sets the light row shading colour.", "Comment for whatsThis Lightbutt"));
   1.285 +    Q3WhatsThis::add(m_pLightbutt, trUtf8("The Light button sets the light row shading colour.", "Comment for whatsThis Lightbutt"));
   1.286      QToolTip::add(m_pDarkbutt, trUtf8("Dark row shading colour", "Comment for tooltip Darkbutt"));
   1.287 -    QWhatsThis::add(m_pDarkbutt, trUtf8("The Dark button sets the light row shading colour.", "Comment for whatsThis Darkbutt"));
   1.288 +    Q3WhatsThis::add(m_pDarkbutt, trUtf8("The Dark button sets the light row shading colour.", "Comment for whatsThis Darkbutt"));
   1.289  
   1.290      m_pStylegroup->setTitle(trUtf8("Available styles", "Comment for Stylebuttons"));
   1.291      m_pReportgroup->setTitle(trUtf8("Report options", "Comment for Reportbox"));

mercurial