as_reportpanel.cpp

changeset 3
c1941114ca88
parent 1
d64aaa7d146f
child 12
ceb4ba3d2d00
equal deleted inserted replaced
0:a2abb4ec678d 1:ed0d9ef86461
1 // 1 //
2 // OSSP asgui - Accounting system graphical user interface 2 // OSSP asgui - Accounting system graphical user interface
3 // Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) 3 // Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/)
4 // Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com> 4 // Copyright (c) 2002-2008 Ralf S. Engelschall <rse@engelschall.com>
5 // Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com> 5 // Copyright (c) 2002-2008 Michael Schloh von Bennewitz <michael@schloh.com>
6 // Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH 6 // Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH
7 // 7 //
8 // This file is part of OSSP asgui, an accounting system graphical user 8 // This file is part of OSSP asgui, an accounting system graphical user
9 // interface which can be found at http://www.ossp.org/pkg/tool/asgui/. 9 // interface which can be found at http://asgui.europalab.com/.
10 // 10 //
11 // Permission to use, copy, modify, and distribute this software for 11 // Permission to use, copy, modify, and distribute this software for
12 // any purpose with or without fee is hereby granted, provided that 12 // any purpose with or without fee is hereby granted, provided that
13 // the above copyright notice and this permission notice appear in all 13 // the above copyright notice and this permission notice appear in all
14 // copies. 14 // copies.
27 // SUCH DAMAGE. 27 // SUCH DAMAGE.
28 // 28 //
29 // as_reportpanel.cpp: ISO C++ implementation 29 // as_reportpanel.cpp: ISO C++ implementation
30 // 30 //
31 31
32 #define QT3_SUPPORT
33
32 #include <qvariant.h> 34 #include <qvariant.h>
33 #include <qpushbutton.h> 35 #include <qpushbutton.h>
34 #include <qtextedit.h> 36 #include <q3textedit.h>
35 #include <qtoolbutton.h> 37 #include <qtoolbutton.h>
36 #include <qbuttongroup.h> 38 #include <q3buttongroup.h>
37 #include <qpopupmenu.h> 39 #include <q3popupmenu.h>
38 #include <qlayout.h> 40 #include <qlayout.h>
39 #include <qtooltip.h> 41 #include <qtooltip.h>
40 #include <qwhatsthis.h> 42 #include <q3whatsthis.h>
41 #include <qtextstream.h> 43 #include <q3textstream.h>
42 #include <qfiledialog.h> 44 #include <q3filedialog.h>
43 #include <qprinter.h> 45 #include <qprinter.h>
44 #include <qpaintdevicemetrics.h> 46 #include <q3paintdevicemetrics.h>
45 #include <qpainter.h> 47 #include <qpainter.h>
46 #include <qfile.h> 48 #include <qfile.h>
47 #include <qdir.h> 49 #include <qdir.h>
50
51 //Added by qt3to4:
52 #include <Q3HBoxLayout>
53 #include <Q3Frame>
54 #include <Q3VBoxLayout>
48 55
49 #include "as_reportpanel.h" 56 #include "as_reportpanel.h"
50 #include "as_numdial.h" 57 #include "as_numdial.h"
51 #include "as_table.h" 58 #include "as_table.h"
52 #include "as_pref.h" 59 #include "as_pref.h"
69 // The dialog will by default be modal, unless you set 'bModal' to 76 // The dialog will by default be modal, unless you set 'bModal' to
70 // false to construct a modeless dialog. 77 // false to construct a modeless dialog.
71 // 78 //
72 Reportpanel::Reportpanel(TiTable *pTable, Preferences *pPreferences, 79 Reportpanel::Reportpanel(TiTable *pTable, Preferences *pPreferences,
73 QWidget *pParent, const char *kszName, 80 QWidget *pParent, const char *kszName,
74 bool bModal, WFlags Flags) 81 bool bModal, Qt::WFlags Flags)
75 : QDialog(pParent, kszName, bModal, Flags) 82 : QDialog(pParent, kszName, bModal, Flags)
76 { 83 {
77 // Boilerplate code to initialize the panel 84 // Boilerplate code to initialize the panel
78 if (!kszName) 85 if (!kszName)
79 this->setName("Reportpanel"); 86 this->setName("Reportpanel");
91 // Preset number of weeks and months to report 98 // Preset number of weeks and months to report
92 m_nWeeks = m_pReprefs->getNumber(TITRAQ_PREFREPORTWEEKS, TITRAQ_DEFREPORTWEEKS); 99 m_nWeeks = m_pReprefs->getNumber(TITRAQ_PREFREPORTWEEKS, TITRAQ_DEFREPORTWEEKS);
93 m_nMonths = m_pReprefs->getNumber(TITRAQ_PREFREPORTMONTHS, TITRAQ_DEFREPORTMONTHS); 100 m_nMonths = m_pReprefs->getNumber(TITRAQ_PREFREPORTMONTHS, TITRAQ_DEFREPORTMONTHS);
94 101
95 // Build panel using already constructed widgets and layouts 102 // Build panel using already constructed widgets and layouts
96 m_pFormlay = new QVBoxLayout(this, 11, 6, "Formlayout"); 103 m_pFormlay = new Q3VBoxLayout(this, 11, 6, "Formlayout");
97 m_pToolay = new QHBoxLayout(0, 0, 6, "Toolbuttonlay"); 104 m_pToolay = new Q3HBoxLayout(0, 0, 6, "Toolbuttonlay");
98 m_pPushlay = new QHBoxLayout(0, 0, 6, "Pushbuttonlay"); 105 m_pPushlay = new Q3HBoxLayout(0, 0, 6, "Pushbuttonlay");
99 106
100 // Groupbox and its text display 107 // Groupbox and its text display
101 m_pBrowser = new QTextEdit(this, "Reportbrowser"); 108 m_pBrowser = new Q3TextEdit(this, "Reportbrowser");
102 m_pBrowser->setTextFormat(PlainText); 109 m_pBrowser->setTextFormat(Qt::PlainText);
103 m_pBrowser->setReadOnly(true); 110 m_pBrowser->setReadOnly(true);
104 m_pBrowser->setFont(QFont("Courier", 10)); 111 m_pBrowser->setFont(QFont("Courier", 10));
105 m_pFormlay->addWidget(m_pBrowser); 112 m_pFormlay->addWidget(m_pBrowser);
106 m_pFormlay->addSpacing(6); 113 m_pFormlay->addSpacing(6);
107 m_pFormlay->addLayout(m_pToolay); 114 m_pFormlay->addLayout(m_pToolay);
108 m_pFormlay->addSpacing(6); 115 m_pFormlay->addSpacing(6);
109 m_pFormlay->addLayout(m_pPushlay); 116 m_pFormlay->addLayout(m_pPushlay);
110 117
111 // Tool button suite 118 // Tool button suite
112 m_pWeekmonthgroup = new QButtonGroup(this, "Weekmonthgroup"); 119 m_pWeekmonthgroup = new Q3ButtonGroup(this, "Weekmonthgroup");
113 m_pWeekmonthgroup->setColumnLayout(0, Qt::Horizontal); 120 m_pWeekmonthgroup->setColumnLayout(0, Qt::Horizontal);
114 m_pWeekmonthgroup->layout()->setSpacing(11); 121 m_pWeekmonthgroup->layout()->setSpacing(11);
115 m_pWeekmonthgroup->layout()->setMargin(0); 122 m_pWeekmonthgroup->layout()->setMargin(0);
116 m_pWeekmonthlay = new QHBoxLayout(m_pWeekmonthgroup->layout()); 123 m_pWeekmonthlay = new Q3HBoxLayout(m_pWeekmonthgroup->layout());
117 m_pWeekmonthgroup->setFrameShape(QFrame::NoFrame); 124 //m_pWeekmonthgroup->setFrameShape(QFrame::NoFrame);
118 m_pWeekmonthgroup->setExclusive(true); 125 m_pWeekmonthgroup->setExclusive(true);
119 m_pWeeklybutt = new QToolButton(m_pWeekmonthgroup, "Weeklybutton"); 126 m_pWeeklybutt = new QToolButton(m_pWeekmonthgroup, "Weeklybutton");
120 // m_pWeeklybutt->setPaletteBackgroundColor(QColor(198, 196, 186)); 127 // m_pWeeklybutt->setPaletteBackgroundColor(QColor(198, 196, 186));
121 m_pWeeklybutt->setFocusPolicy(QWidget::TabFocus); 128 m_pWeeklybutt->setFocusPolicy(Qt::TabFocus);
122 m_pWeeklybutt->setCursor(QCursor(13)); 129 m_pWeeklybutt->setCursor(QCursor(13));
123 m_pWeeklybutt->setToggleButton(true); 130 m_pWeeklybutt->setToggleButton(true);
124 m_pMonthlybutt = new QToolButton(m_pWeekmonthgroup, "Monthlybutton"); 131 m_pMonthlybutt = new QToolButton(m_pWeekmonthgroup, "Monthlybutton");
125 // m_pMonthlybutt->setPaletteBackgroundColor(QColor(198, 196, 186)); 132 // m_pMonthlybutt->setPaletteBackgroundColor(QColor(198, 196, 186));
126 m_pMonthlybutt->setFocusPolicy(QWidget::TabFocus); 133 m_pMonthlybutt->setFocusPolicy(Qt::TabFocus);
127 m_pMonthlybutt->setCursor(QCursor(13)); 134 m_pMonthlybutt->setCursor(QCursor(13));
128 m_pMonthlybutt->setToggleButton(true); 135 m_pMonthlybutt->setToggleButton(true);
129 136
130 // Popup for number of weeks 137 // Popup for number of weeks
131 m_pWeekpop = new QPopupMenu(this); 138 m_pWeekpop = new Q3PopupMenu(this);
132 if (m_pWeekpop == NULL) // Sanity check 139 if (m_pWeekpop == NULL) // Sanity check
133 throw Genexcept("Weekly toolbutton popup creation failed."); 140 throw Genexcept("Weekly toolbutton popup creation failed.");
134 m_pWeekpop->insertItem(trUtf8("One week"), this, SLOT(reportWeeks(int))); 141 m_pWeekpop->insertItem(trUtf8("One week"), this, SLOT(reportWeeks(int)));
135 m_pWeekpop->insertItem(trUtf8("Two weeks"), this, SLOT(reportWeeks(int))); 142 m_pWeekpop->insertItem(trUtf8("Two weeks"), this, SLOT(reportWeeks(int)));
136 m_pWeekpop->insertItem(trUtf8("Three weeks"), this, SLOT(reportWeeks(int))); 143 m_pWeekpop->insertItem(trUtf8("Three weeks"), this, SLOT(reportWeeks(int)));
144 int nPosition = (m_nWeeks < m_pWeekpop->count()) ? m_nWeeks : m_pWeekpop->count(); 151 int nPosition = (m_nWeeks < m_pWeekpop->count()) ? m_nWeeks : m_pWeekpop->count();
145 m_pWeekpop->setItemChecked(m_pWeekpop->idAt(--nPosition), true); 152 m_pWeekpop->setItemChecked(m_pWeekpop->idAt(--nPosition), true);
146 } 153 }
147 154
148 // Popup for number of months 155 // Popup for number of months
149 m_pMonthpop = new QPopupMenu(this); 156 m_pMonthpop = new Q3PopupMenu(this);
150 if (m_pMonthpop == NULL) // Sanity check 157 if (m_pMonthpop == NULL) // Sanity check
151 throw Genexcept("Monthly toolbutton popup creation failed."); 158 throw Genexcept("Monthly toolbutton popup creation failed.");
152 m_pMonthpop->insertItem(trUtf8("One month"), this, SLOT(reportMonths(int))); 159 m_pMonthpop->insertItem(trUtf8("One month"), this, SLOT(reportMonths(int)));
153 m_pMonthpop->insertItem(trUtf8("Two months"), this, SLOT(reportMonths(int))); 160 m_pMonthpop->insertItem(trUtf8("Two months"), this, SLOT(reportMonths(int)));
154 m_pMonthpop->insertItem(trUtf8("Three months"), this, SLOT(reportMonths(int))); 161 m_pMonthpop->insertItem(trUtf8("Three months"), this, SLOT(reportMonths(int)));
523 for (int nIter = 0; nIter < nRows; nIter++) { 530 for (int nIter = 0; nIter < nRows; nIter++) {
524 // Work on this tuple only if it within the reporting range 531 // Work on this tuple only if it within the reporting range
525 Tempstring = m_pReptable->text(nIter, TITRAQ_IDXTASK); 532 Tempstring = m_pReptable->text(nIter, TITRAQ_IDXTASK);
526 Tempdate = QDate::fromString(m_pReptable->text(nIter, TITRAQ_IDXDATE), Qt::ISODate); 533 Tempdate = QDate::fromString(m_pReptable->text(nIter, TITRAQ_IDXDATE), Qt::ISODate);
527 if (!Tempstring.isEmpty() && Firstday <= Tempdate && Tempdate < Lastday) { 534 if (!Tempstring.isEmpty() && Firstday <= Tempdate && Tempdate < Lastday) {
528 string Convstring = Tempstring; // Convert to string (can't cast?) 535 string Convstring = Tempstring.toStdString(); // Convert to string (can't cast?)
529 QTime Intable = QTime::fromString(m_pReptable->text(nIter, TITRAQ_IDXAMOUNT), Qt::ISODate); 536 QTime Intable = QTime::fromString(m_pReptable->text(nIter, TITRAQ_IDXAMOUNT), Qt::ISODate);
530 int nTothours = QString(Hashtasks[Convstring]).section(':', 0, 0).toInt() + Intable.hour(); 537 string Gethashed = Hashtasks[Convstring];
531 int nTotminut = QString(Hashtasks[Convstring]).section(':', 1, 1).toInt() + Intable.minute(); 538 int nTothours = QString::fromStdString(Gethashed).section(':', 0, 0).toInt() + Intable.hour();;
539 int nTotminut = QString::fromStdString(Gethashed).section(':', 1, 1).toInt() + Intable.minute();
532 nTothours += nTotminut / 60; 540 nTothours += nTotminut / 60;
533 nTotminut %= 60; 541 nTotminut %= 60;
534 QString Hours = QString::number(nTothours).rightJustify(3, ' '); 542 QString Hours = QString::number(nTothours).rightJustify(3, ' ');
535 QString Mins = QString::number(nTotminut).rightJustify(2, '0'); 543 QString Mins = QString::number(nTotminut).rightJustify(2, '0');
536 string Timestring = Hours + ':' + Mins; // Convert to string (can't cast?) 544 string Timestring = Hours.toStdString() + ':' + Mins.toStdString(); // Convert to string (can't cast?)
537 Hashtasks[Convstring] = Timestring; // Finally store in hashtable 545 Hashtasks[Convstring] = Timestring; // Finally store in hashtable
538 } 546 }
539 } 547 }
540 548
541 // Reverse copy the tasks hashtable to both sort and index by amount key 549 // Reverse copy the tasks hashtable to both sort and index by amount key
542 for (Taskiter = Hashtasks.begin(); Taskiter != Hashtasks.end(); Taskiter++) 550 for (Taskiter = Hashtasks.begin(); Taskiter != Hashtasks.end(); Taskiter++)
543 Hashhours.insert(pair<string, string>(Taskiter->second, Taskiter->first)); 551 Hashhours.insert(pair<string, string>(Taskiter->second, Taskiter->first));
544 552
545 // Write the actual data totals to the outgoing string in reverse order 553 // Write the actual data totals to the outgoing string in reverse order
546 for (Houriter = Hashhours.begin(); Houriter != Hashhours.end(); Houriter++) 554 for (Houriter = Hashhours.begin(); Houriter != Hashhours.end(); Houriter++)
547 Totals = Houriter->first + ' ' + Houriter->second + '\n' + Totals; 555 Totals = QString::fromStdString(Houriter->first + ' ' + Houriter->second + '\n' + Totals.toStdString());
548 556
549 // Write some quick header text to the outgoing string in reverse order 557 // Write some quick header text to the outgoing string in reverse order
550 Totals = QString("------ ----------------------------------------\n") + Totals; 558 Totals = QString("------ ----------------------------------------\n") + Totals;
551 Totals = trUtf8("Total Account summary\n") + Totals; 559 Totals = trUtf8("Total Account summary\n") + Totals;
552 560
629 for (int nIter = 0; nIter < nRows; nIter++) { 637 for (int nIter = 0; nIter < nRows; nIter++) {
630 // Work on this tuple only if it within the reporting range 638 // Work on this tuple only if it within the reporting range
631 Tempstring = m_pReptable->text(nIter, TITRAQ_IDXTASK); 639 Tempstring = m_pReptable->text(nIter, TITRAQ_IDXTASK);
632 Tempdate = QDate::fromString(m_pReptable->text(nIter, TITRAQ_IDXDATE), Qt::ISODate); 640 Tempdate = QDate::fromString(m_pReptable->text(nIter, TITRAQ_IDXDATE), Qt::ISODate);
633 if (!Tempstring.isEmpty() && Firstday <= Tempdate && Tempdate < Lastday) { 641 if (!Tempstring.isEmpty() && Firstday <= Tempdate && Tempdate < Lastday) {
634 string Convstring = Tempstring; // Convert to string (can't cast?) 642 string Convstring = Tempstring.toStdString(); // Convert to string (can't cast?)
635 QTime Intable = QTime::fromString(m_pReptable->text(nIter, TITRAQ_IDXAMOUNT), Qt::ISODate); 643 QTime Intable = QTime::fromString(m_pReptable->text(nIter, TITRAQ_IDXAMOUNT), Qt::ISODate);
636 int nTothours = QString(Hashtasks[Convstring]).section(':', 0, 0).toInt() + Intable.hour(); 644 string Gethashed = Hashtasks[Convstring];
637 int nTotminut = QString(Hashtasks[Convstring]).section(':', 1, 1).toInt() + Intable.minute(); 645 int nTothours = QString::fromStdString(Gethashed).section(':', 0, 0).toInt() + Intable.hour();;
646 int nTotminut = QString::fromStdString(Gethashed).section(':', 1, 1).toInt() + Intable.minute();
638 nTothours += nTotminut / 60; 647 nTothours += nTotminut / 60;
639 nTotminut %= 60; 648 nTotminut %= 60;
640 QString Hours = QString::number(nTothours).rightJustify(3, ' '); 649 QString Hours = QString::number(nTothours).rightJustify(3, ' ');
641 QString Mins = QString::number(nTotminut).rightJustify(2, '0'); 650 QString Mins = QString::number(nTotminut).rightJustify(2, '0');
642 string Timestring = Hours + ':' + Mins; // Convert to string (can't cast?) 651 QString Timestring = Hours + ':' + Mins; // Convert to string (can't cast?)
643 Hashtasks[Convstring] = Timestring; // Finally store in hashtable 652 Hashtasks[Convstring] = Timestring.toStdString(); // Finally store in hashtable
644 } 653 }
645 } 654 }
646 655
647 // Reverse copy the tasks hashtable to both sort and index by amount key 656 // Reverse copy the tasks hashtable to both sort and index by amount key
648 for (Taskiter = Hashtasks.begin(); Taskiter != Hashtasks.end(); Taskiter++) 657 for (Taskiter = Hashtasks.begin(); Taskiter != Hashtasks.end(); Taskiter++)
649 Hashhours.insert(pair<string, string>(Taskiter->second, Taskiter->first)); 658 Hashhours.insert(pair<string, string>(Taskiter->second, Taskiter->first));
650 659
651 // Write the actual data totals to the outgoing string in reverse order 660 // Write the actual data totals to the outgoing string in reverse order
652 for (Houriter = Hashhours.begin(); Houriter != Hashhours.end(); Houriter++) 661 for (Houriter = Hashhours.begin(); Houriter != Hashhours.end(); Houriter++)
653 Totals = Houriter->first + ' ' + Houriter->second + '\n' + Totals; 662 Totals = QString::fromStdString(Houriter->first + ' ' + Houriter->second + '\n' + Totals.toStdString());
654 663
655 // Write some quick header text to the outgoing string in reverse order 664 // Write some quick header text to the outgoing string in reverse order
656 Totals = QString("------ ----------------------------------------\n") + Totals; 665 Totals = QString("------ ----------------------------------------\n") + Totals;
657 Totals = trUtf8("Total Account summary\n") + Totals; 666 Totals = trUtf8("Total Account summary\n") + Totals;
658 667
668 QFile Report; // The resulting report file 677 QFile Report; // The resulting report file
669 QString Filestring; // The user chosen file name to save 678 QString Filestring; // The user chosen file name to save
670 QString Openas = m_pReprefs->getString(TITRAQ_PREFHOME, TITRAQ_DEFHOME); 679 QString Openas = m_pReprefs->getString(TITRAQ_PREFHOME, TITRAQ_DEFHOME);
671 680
672 // And then get the name of the selected file to save to 681 // And then get the name of the selected file to save to
673 Filestring = QFileDialog::getSaveFileName(Openas, trUtf8("Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to save"), NULL, false); 682 Filestring = Q3FileDialog::getSaveFileName(Openas, trUtf8("Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to save"), NULL, false);
674 if (!Filestring.isEmpty()) { 683 if (!Filestring.isEmpty()) {
675 if (QFile::exists(Filestring)) { 684 if (QFile::exists(Filestring)) {
676 nResult = QMessageBox::warning(this, QString(TITRAQ_APPTITLE) 685 nResult = QMessageBox::warning(this, QString(TITRAQ_APPTITLE)
677 + ' ' + asgui_version.v_short, trUtf8(TITRAQ_OVERWRITE), 686 + ' ' + asgui_version.v_short, trUtf8(TITRAQ_OVERWRITE),
678 trUtf8("&Yes"), trUtf8("&No"), NULL, 1, 1); 687 trUtf8("&Yes"), trUtf8("&No"), NULL, 1, 1);
679 if (nResult = QMessageBox::Ok) { // Overwrite a file 688 if (nResult = QMessageBox::Ok) { // Overwrite a file
680 Report.setName(Filestring); // User wished name 689 Report.setName(Filestring); // User wished name
681 Report.open(IO_WriteOnly | IO_Truncate); // Open report file 690 Report.open(QIODevice::WriteOnly | QIODevice::Truncate); // Open report file
682 QTextStream Outstream(&Report); // Convert to stream 691 Q3TextStream Outstream(&Report); // Convert to stream
683 Outstream << m_pBrowser->text(); // Write the data 692 Outstream << m_pBrowser->text(); // Write the data
684 Report.close(); // Finish by closing 693 Report.close(); // Finish by closing
685 } 694 }
686 } 695 }
687 else { // User gave a file name, and there was no preexisting file there 696 else { // User gave a file name, and there was no preexisting file there
688 Report.setName(Filestring); // User wished name 697 Report.setName(Filestring); // User wished name
689 Report.open(IO_WriteOnly | IO_Truncate); // Open report file 698 Report.open(QIODevice::WriteOnly | QIODevice::Truncate); // Open report file
690 QTextStream Outstream(&Report); // Convert to stream 699 Q3TextStream Outstream(&Report); // Convert to stream
691 Outstream << m_pBrowser->text(); // Write the data 700 Outstream << m_pBrowser->text(); // Write the data
692 Report.close(); // Finish by closing 701 Report.close(); // Finish by closing
693 } 702 }
694 } 703 }
695 // Otherwise, user did not select a valid file and push okay button 704 // Otherwise, user did not select a valid file and push okay button
705 m_pPrinter->setFullPage(true); // Set our own margins 714 m_pPrinter->setFullPage(true); // Set our own margins
706 QPainter Paint; // Our painter (for pages) 715 QPainter Paint; // Our painter (for pages)
707 Paint.begin(m_pPrinter); // Paint on printer 716 Paint.begin(m_pPrinter); // Paint on printer
708 Paint.setFont(m_pBrowser->font()); 717 Paint.setFont(m_pBrowser->font());
709 QFontMetrics Fontmetrics = Paint.fontMetrics(); 718 QFontMetrics Fontmetrics = Paint.fontMetrics();
710 QPaintDeviceMetrics Devmetrics(m_pPrinter); // Need width/height of printer surface 719 Q3PaintDeviceMetrics Devmetrics(m_pPrinter); // Need width/height of printer surface
711 const int knMargin = Devmetrics.logicalDpiX() / 2; // Half-inch margin 720 const int knMargin = Devmetrics.logicalDpiX() / 2; // Half-inch margin
712 int nYpos = knMargin; // Y position for each line 721 int nYpos = knMargin; // Y position for each line
713 int nPageno = 1; // The starting page number 722 int nPageno = 1; // The starting page number
714 723
715 for (int nIter = 0; nIter < m_pBrowser->lines() && !m_pPrinter->aborted(); nIter++) { 724 for (int nIter = 0; nIter < m_pBrowser->lines() && !m_pPrinter->aborted(); nIter++) {
741 this->setCaption(trUtf8("AS local report", "Local report using weekly or monthly data.")); 750 this->setCaption(trUtf8("AS local report", "Local report using weekly or monthly data."));
742 751
743 // Top level push buttons associated with accept and save slots 752 // Top level push buttons associated with accept and save slots
744 m_pSavebutt->setText(trUtf8("Save As...", "Comment for Savebutton")); 753 m_pSavebutt->setText(trUtf8("Save As...", "Comment for Savebutton"));
745 QToolTip::add(m_pSavebutt, trUtf8("Saves the report text", "Comment for tooltip Savebutton")); 754 QToolTip::add(m_pSavebutt, trUtf8("Saves the report text", "Comment for tooltip Savebutton"));
746 QWhatsThis::add(m_pSavebutt, trUtf8("The save button saves the report text to a file", "Comment for whatsThis Savebutton")); 755 Q3WhatsThis::add(m_pSavebutt, trUtf8("The save button saves the report text to a file", "Comment for whatsThis Savebutton"));
747 m_pPrintbutt->setText(trUtf8("Print...", "Comment for Printbutton")); 756 m_pPrintbutt->setText(trUtf8("Print...", "Comment for Printbutton"));
748 QToolTip::add(m_pPrintbutt, trUtf8("Print the report text", "Comment for tooltip Printbutton")); 757 QToolTip::add(m_pPrintbutt, trUtf8("Print the report text", "Comment for tooltip Printbutton"));
749 QWhatsThis::add(m_pPrintbutt, trUtf8("The print button prints the report text to a file", "Comment for whatsThis Printbutton")); 758 Q3WhatsThis::add(m_pPrintbutt, trUtf8("The print button prints the report text to a file", "Comment for whatsThis Printbutton"));
750 m_pDismissbutt->setText(trUtf8("Dismiss", "Comment for Dismissbutton")); 759 m_pDismissbutt->setText(trUtf8("Dismiss", "Comment for Dismissbutton"));
751 QToolTip::add(m_pDismissbutt, trUtf8("Closes the report panel", "Comment for tooltip Dismissbutton")); 760 QToolTip::add(m_pDismissbutt, trUtf8("Closes the report panel", "Comment for tooltip Dismissbutton"));
752 QWhatsThis::add(m_pDismissbutt, trUtf8("The dismiss button dismisses the report panel", "Comment for whatsThis Dismissbutton")); 761 Q3WhatsThis::add(m_pDismissbutt, trUtf8("The dismiss button dismisses the report panel", "Comment for whatsThis Dismissbutton"));
753 762
754 // Inner tool buttons for new local report generation 763 // Inner tool buttons for new local report generation
755 m_pWeeklybutt->setText(trUtf8("Weekly", "Comment for Weeklybutt")); 764 m_pWeeklybutt->setText(trUtf8("Weekly", "Comment for Weeklybutt"));
756 QToolTip::add(m_pWeeklybutt, trUtf8("Hold down for options", "Comment for tooltip Weeklybutt")); 765 QToolTip::add(m_pWeeklybutt, trUtf8("Hold down for options", "Comment for tooltip Weeklybutt"));
757 QWhatsThis::add(m_pWeeklybutt, trUtf8("The Weekly button generates a new weekly report.\nHold this button down to specify many weeks.", "Comment for whatsThis Weeklybutt")); 766 Q3WhatsThis::add(m_pWeeklybutt, trUtf8("The Weekly button generates a new weekly report.\nHold this button down to specify many weeks.", "Comment for whatsThis Weeklybutt"));
758 m_pMonthlybutt->setText(trUtf8("Monthly", "Comment for Monthlybutt")); 767 m_pMonthlybutt->setText(trUtf8("Monthly", "Comment for Monthlybutt"));
759 QToolTip::add(m_pMonthlybutt, trUtf8("Hold down for options", "Comment for tooltip Monthlybutt")); 768 QToolTip::add(m_pMonthlybutt, trUtf8("Hold down for options", "Comment for tooltip Monthlybutt"));
760 QWhatsThis::add(m_pMonthlybutt, trUtf8("The Monthly button makes a new monthly report.\nHold this button down to specify how many months.", "Comment for whatsThis Monthlybutt")); 769 Q3WhatsThis::add(m_pMonthlybutt, trUtf8("The Monthly button makes a new monthly report.\nHold this button down to specify how many months.", "Comment for whatsThis Monthlybutt"));
761 } 770 }
762 } // namespace AS 771 } // namespace AS

mercurial