*** /dev/null Sat Nov 23 06:31:33 2024
--- - Sat Nov 23 06:31:51 2024
***************
*** 0 ****
--- 1,140 ----
+ //
+ // OSSP asgui - Accounting system graphical user interface
+ // Copyright (c) 2002-2003 The OSSP Project (http://www.ossp.org/)
+ // Copyright (c) 2002-2003 Cable & Wireless Deutschland (http://www.cw.com/de/)
+ // Copyright (c) 2002-2003 Ralf S. Engelschall <rse@engelschall.com>
+ // Copyright (c) 2002-2003 Michael Schloh von Bennewitz <michael@schloh.com>
+ //
+ // This file is part of OSSP asgui, an accounting system graphical user
+ // interface which can be found at http://www.ossp.org/pkg/tool/asgui/.
+ //
+ // Permission to use, copy, modify, and distribute this software for
+ // any purpose with or without fee is hereby granted, provided that
+ // the above copyright notice and this permission notice appear in all
+ // copies.
+ //
+ // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ // IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ // SUCH DAMAGE.
+ //
+ // as_reportpanel.cpp: ISO C++ implementation
+ //
+
+ #include <qvariant.h>
+ #include <qgroupbox.h>
+ #include <qpushbutton.h>
+ #include <qtextbrowser.h>
+ #include <qtoolbutton.h>
+ #include <qlayout.h>
+ #include <qtooltip.h>
+ #include <qwhatsthis.h>
+
+ #include "as_reportpanel.h"
+ #include "as_generic.h"
+
+
+ //
+ // Constructs a Reportpanel as a child of 'pParent', with the
+ // name 'kszName' and widget flags set to 'Flags'.
+ //
+ // The dialog will by default be modal, unless you set 'bModal' to
+ // true to construct a modal dialog.
+ //
+ Reportpanel::Reportpanel(QWidget *pParent, const char *kszName, bool bModal, WFlags Flags)
+ : QDialog(pParent, kszName, bModal, Flags)
+ {
+ // Boilerplate code to initialize the panel
+ if (!kszName)
+ this->setName("Reportpanel");
+
+ // Make Panel resizeable
+ this->setSizeGripEnabled(true);
+ this->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
+ (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth()));
+
+ // Build panel using already constructed widgets and layouts
+ m_pFormlay = new QVBoxLayout(this, 11, 6, "Formlayout");
+ m_pToolay = new QHBoxLayout(0, 0, 6, "Toolbuttonlay");
+ m_pPushlay = new QHBoxLayout(0, 0, 6, "Pushbuttonlay");
+
+ // Groupbox and its browser
+ m_pGroupbox = new QGroupBox(this, "Groupbox");
+ m_pGroupbox->setFrameShape(QGroupBox::GroupBoxPanel);
+ m_pGroupbox->setFrameShadow(QGroupBox::Sunken);
+ m_pGroupbox->setColumnLayout(0, Qt::Vertical);
+ m_pGroupbox->layout()->setSpacing(6);
+ m_pGroupbox->layout()->setMargin(11);
+ m_pGrouplay = new QVBoxLayout(m_pGroupbox->layout());
+ m_pGrouplay->setAlignment(Qt::AlignTop);
+ m_pBrowser = new QTextBrowser(m_pGroupbox, "Reportbrowser");
+ m_pGrouplay->addWidget(m_pBrowser);
+ m_pGrouplay->addLayout(m_pToolay);
+
+ // Tool button suite
+ m_pWeeklybutt = new QToolButton(m_pGroupbox, "Weeklybutton");
+ m_pMonthlybutt = new QToolButton(m_pGroupbox, "Monthlybutton");
+ m_pBothbutt = new QToolButton(m_pGroupbox, "Bothbutton");
+ m_pToolay->addWidget(m_pWeeklybutt);
+ m_pToolay->addWidget(m_pMonthlybutt);
+ m_pToolay->addWidget(m_pBothbutt);
+ m_pFormlay->addWidget(m_pGroupbox);
+
+ // Push button suite
+ m_pSavebutt = new QPushButton(this, "Savebutton");
+ m_pDismissbutt = new QPushButton(this, "Dismissbutton");
+ m_pPushlay->addWidget(m_pSavebutt);
+ m_pPushlay->addWidget(m_pDismissbutt);
+ m_pFormlay->addLayout(m_pPushlay);
+
+ // Connect signals to slots, accept() and reject() are Qt implicit
+ connect(m_pDismissbutt, SIGNAL(clicked(void)), SLOT(accept(void)));
+ connect(m_pSavebutt, SIGNAL(clicked(void)), SLOT(saveReport(void)));
+ this->textChange();
+ this->resize(QSize(400, 332).expandedTo(minimumSizeHint()));
+ }
+
+ //
+ // Saves the currently displayed local report
+ //
+ void Reportpanel::saveReport(void)
+ {
+ Prototype Unimp;
+ Unimp.doMbox();
+ }
+
+ //
+ // Sets the strings of the subwidgets using the current language
+ //
+ void Reportpanel::textChange(void)
+ {
+ this->setCaption(tr("AS local report", "Local report using weekly data or monthly data or both."));
+ m_pGroupbox->setTitle(tr("Local report", "Comment for Groupbox"));
+
+ // Top level push buttons associated with accept and save slots
+ m_pDismissbutt->setText(tr("Dismiss", "Comment for Dismissbutton"));
+ QToolTip::add(m_pDismissbutt, tr("Closes the report panel", "Comment for tooltip Reportbutton"));
+ QWhatsThis::add(m_pDismissbutt, tr("The dismiss button dismisses the report panel", "Comment for whatsThis Reportbutton"));
+ m_pSavebutt->setText(tr("Save", "Comment for Savebutton"));
+ QToolTip::add(m_pSavebutt, tr("Closes the report panel", "Comment for tooltip Reportbutton"));
+ QWhatsThis::add(m_pSavebutt, tr("The dismiss button dismisses the report panel", "Comment for whatsThis Reportbutton"));
+
+ // Inner tool buttons for new local report generation
+ m_pWeeklybutt->setText(tr("Weekly", "Comment for Weeklybutt"));
+ QToolTip::add(m_pWeeklybutt, tr("Generates a weekly report", "Comment for tooltip Weeklybutt"));
+ QWhatsThis::add(m_pWeeklybutt, tr("The weekly button generates a new weekly report", "Comment for whatsThis Weeklybutt"));
+ m_pMonthlybutt->setText(tr("Monthly", "Comment for Monthlybutt"));
+ QToolTip::add(m_pMonthlybutt, tr("Generates a weekly report", "Comment for tooltip Monthlybutt"));
+ QWhatsThis::add(m_pMonthlybutt, tr("The weekly button generates a new weekly report", "Comment for whatsThis Monthlybutt"));
+ m_pBothbutt->setText(tr("Both", "Comment for Bothbutt"));
+ QToolTip::add(m_pBothbutt, tr("Generates a weekly report", "Comment for tooltip Bothbutt"));
+ QWhatsThis::add(m_pBothbutt, tr("The weekly button generates a new weekly report", "Comment for whatsThis Bothbutt"));
+ }
|