phoneorder-commits Mailing List for PhoneOrder - Point-Of-Sale made simple
Status: Alpha
Brought to you by:
hurikhan
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <hur...@us...> - 2011-08-22 19:05:36
|
Revision: 58
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=58&view=rev
Author: hurikhan
Date: 2011-08-22 19:05:30 +0000 (Mon, 22 Aug 2011)
Log Message:
-----------
Fix saving prices
Since Qt4 migration saving prices was not possible due to a
wrong SQL parameter binding.
Modified Paths:
--------------
trunk/src/po_priceseditor.cpp
Added Paths:
-----------
trunk/bin/export-menu.sh
Added: trunk/bin/export-menu.sh
===================================================================
--- trunk/bin/export-menu.sh (rev 0)
+++ trunk/bin/export-menu.sh 2011-08-22 19:05:30 UTC (rev 58)
@@ -0,0 +1,2 @@
+#!/bin/bash
+mysqldump -u phoneorder -p $* phoneorder groups dishes dishprices ingredients ingprices
Property changes on: trunk/bin/export-menu.sh
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/src/po_priceseditor.cpp
===================================================================
--- trunk/src/po_priceseditor.cpp 2011-05-02 21:50:20 UTC (rev 57)
+++ trunk/src/po_priceseditor.cpp 2011-08-22 19:05:30 UTC (rev 58)
@@ -217,23 +217,25 @@
}
break;
default: // price changed
- QString groupId = dishesList->horizontalHeader ()->label (col);
- if (s.isEmpty ()) // delete dish price
+ QString groupId = dishesList->horizontalHeader()->label(col);
+ if (s.isEmpty()) // delete dish price
{
- query.prepare ("DELETE FROM dishprices WHERE (dishid = ?) AND (groupid = ?)");
- query.bindValue (0, dishId);
- query.bindValue (1, groupId);
- if (query.exec ()) qDebug ("DB updated: %s", query.executedQuery ().ascii ());
+ query.prepare("DELETE FROM dishprices WHERE (dishid = ?) AND (groupid = ?)");
+ query.bindValue(0, dishId);
+ query.bindValue(1, groupId);
+ if (query.exec()) qDebug("DB updated: %s", query.executedQuery().ascii());
}
else // update or insert dish price
{
- double price = s.replace (QChar (','), QChar ('.')).toDouble ();
- s = QString ("%L1") .arg (price, 0, 'f', 2); // FS#6
- dishesList->setText (row, col, s);
- query.prepare ("SELECT dpid FROM dishprices WHERE (dishid = ?) AND (groupid = ?)");
- query.bindValue (1, dishId);
- query.bindValue (2, groupId);
- if (query.exec ())
+ double price = s.replace(QChar(','), QChar('.')).toDouble();
+ s = QString("%L1").arg(price, 0, 'f', 2); // FS#6
+ qDebug("Want change @(%d,%d) = %s; dishId = %s; groupId = %s", row, col, s.ascii(), dishId.ascii(), groupId.ascii());
+ dishesList->setText(row, col, s);
+ qDebug("About to execute SELECT dpid FROM dishprices WHERE (dishid = '%s') AND (groupid = '%s')", dishId.ascii(), groupId.ascii());
+ query.prepare("SELECT dpid FROM dishprices WHERE (dishid = ?) AND (groupid = ?)");
+ query.bindValue(0, dishId);
+ query.bindValue(1, groupId);
+ if (query.exec())
{
qlonglong dpId = -1;
if (query.first ()) dpId = query.value (0).toLongLong ();
@@ -252,6 +254,8 @@
}
if (query.exec ()) qDebug ("DB updated: %s", query.executedQuery ().ascii ());
}
+ else
+ qDebug("dpid query failed! :-( %s", query.executedQuery().ascii());
}
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2011-05-02 21:50:26
|
Revision: 57
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=57&view=rev
Author: hurikhan
Date: 2011-05-02 21:50:20 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Fix build problems with Ubuntu
Fixes the problem of missing abs() and unsupported constructor casting
when building in Ubuntu.
(R55 backported from trunk)
Modified Paths:
--------------
branches/qt3/src/orderwidget.ui.h
branches/qt3/src/po_customer.cpp
Property Changed:
----------------
branches/qt3/
Property changes on: branches/qt3
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk:55
Modified: branches/qt3/src/orderwidget.ui.h
===================================================================
--- branches/qt3/src/orderwidget.ui.h 2011-05-02 21:38:08 UTC (rev 56)
+++ branches/qt3/src/orderwidget.ui.h 2011-05-02 21:50:20 UTC (rev 57)
@@ -399,7 +399,7 @@
if (c < -1) c = -1;
i->setText (1, (c < 0) ? "-" : "+");
i->setText (3, QString ("%L1") .arg (sign * currentCount * c * query.value (2).toDouble (), 0, 'f', 2));
- c = abs (c);
+ if (c < 0) c = -c;
if (c == 1)
i->setText (2, query.value (1).toString ());
else
Modified: branches/qt3/src/po_customer.cpp
===================================================================
--- branches/qt3/src/po_customer.cpp 2011-05-02 21:38:08 UTC (rev 56)
+++ branches/qt3/src/po_customer.cpp 2011-05-02 21:50:20 UTC (rev 57)
@@ -24,13 +24,13 @@
PO_Customer::PO_Customer (const QString custNum)
{
- PO_Customer::PO_Customer ();
+ PO_Customer ();
lookupByNum (custNum);
}
PO_Customer::PO_Customer (const Q_LLONG sqlId)
{
- PO_Customer::PO_Customer ();
+ PO_Customer ();
lookupById (sqlId);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2011-05-02 21:38:15
|
Revision: 56
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=56&view=rev
Author: hurikhan
Date: 2011-05-02 21:38:08 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Branch off Qt3 version
The Qt4 version still has some bugs, this is a convenience branch to get
an older copy.
Added Paths:
-----------
branches/qt3/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2011-05-02 21:30:04
|
Revision: 55
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=55&view=rev
Author: hurikhan
Date: 2011-05-02 21:29:58 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Fix build problems with Ubuntu
Fixes the problem of missing abs() and unsupported constructor casting
when building in Ubuntu.
Modified Paths:
--------------
trunk/src/orderwidget.ui.h
trunk/src/po_customer.cpp
Modified: trunk/src/orderwidget.ui.h
===================================================================
--- trunk/src/orderwidget.ui.h 2010-06-13 19:49:51 UTC (rev 54)
+++ trunk/src/orderwidget.ui.h 2011-05-02 21:29:58 UTC (rev 55)
@@ -418,7 +418,7 @@
if (c < -1) c = -1;
i->setText (1, (c < 0) ? "-" : "+");
i->setText (3, QString ("%L1") .arg (sign * currentCount * c * query.value (2).toDouble (), 0, 'f', 2));
- c = abs (c);
+ if (c < 0) c = -c;
if (c == 1)
i->setText (2, query.value (1).toString ());
else
Modified: trunk/src/po_customer.cpp
===================================================================
--- trunk/src/po_customer.cpp 2010-06-13 19:49:51 UTC (rev 54)
+++ trunk/src/po_customer.cpp 2011-05-02 21:29:58 UTC (rev 55)
@@ -27,13 +27,13 @@
PO_Customer::PO_Customer (const QString custNum)
{
- PO_Customer::PO_Customer ();
+ PO_Customer ();
lookupByNum (custNum);
}
PO_Customer::PO_Customer (const qlonglong sqlId)
{
- PO_Customer::PO_Customer ();
+ PO_Customer ();
lookupById (sqlId);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2010-06-13 19:49:57
|
Revision: 54
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=54&view=rev
Author: hurikhan
Date: 2010-06-13 19:49:51 +0000 (Sun, 13 Jun 2010)
Log Message:
-----------
Fix print margin and focus customer number
Fixes the print margin and re-focusses the custom number editor after
returning from an order widget.
Modified Paths:
--------------
trunk/src/main.cpp
trunk/src/mainform.ui.h
trunk/src/orderwidget.ui.h
Modified: trunk/src/main.cpp
===================================================================
--- trunk/src/main.cpp 2010-06-13 12:46:02 UTC (rev 53)
+++ trunk/src/main.cpp 2010-06-13 19:49:51 UTC (rev 54)
@@ -84,7 +84,7 @@
dialog->setWindowTitle(QObject::tr("Printer Setup"));
if (dialog->exec() == QDialog::Accepted)
{
- mw->printer->setFullPage(TRUE);
+ mw->printer->setFullPage(FALSE);
return a.exec ();
}
Modified: trunk/src/mainform.ui.h
===================================================================
--- trunk/src/mainform.ui.h 2010-06-13 12:46:02 UTC (rev 53)
+++ trunk/src/mainform.ui.h 2010-06-13 19:49:51 UTC (rev 54)
@@ -51,14 +51,21 @@
void MainForm::cancelOrder (OrderWidget *ow)
{
qDebug("Cancel order from main window");
- if (pickupWidget->count() <= 1) {
+ if (pickupWidget->count() <= 1)
+ {
qDebug("Last order tab closing - spawning new");
pickupWidget->addTab(new PO_NewOrderWidget(), tr("Ne&w Order"));
}
+
qDebug("Removing current order tab");
pickupWidget->removePage(ow);
+
qDebug("Deleting widget");
delete ow;
+
+ PO_NewOrderWidget *cw = (PO_NewOrderWidget*) pickupWidget->currentPage();
+ if (pickupWidget->tabLabel(cw) == tr("Ne&w Order")) cw->custNumEdit->setFocus();
+
qDebug("Deleted - now returning");
}
Modified: trunk/src/orderwidget.ui.h
===================================================================
--- trunk/src/orderwidget.ui.h 2010-06-13 12:46:02 UTC (rev 53)
+++ trunk/src/orderwidget.ui.h 2010-06-13 19:49:51 UTC (rev 54)
@@ -15,11 +15,11 @@
#include <QRegExp>
#include <QApplication>
#include <QPainter>
-#include <Q3PaintDeviceMetrics>
-#include <Q3SimpleRichText>
+#include <QTextDocument>
#include <QSettings>
#include <QDateTime>
#include <QTextCodec>
+#include <QAbstractTextDocumentLayout>
#include "templatereader.h"
#include "mainform.h"
@@ -652,6 +652,8 @@
MainForm *mw = (MainForm *) qApp->mainWidget ();
QPrinter *printer = mw->printer;
+ qDebug("Printing");
+
/* load static template settings */
QSettings settings("kaishome.de", "PhoneOrder"); // FS#14
settings.setIniCodec(QTextCodec::codecForName("UTF-8"));
@@ -692,22 +694,6 @@
QString invoiceNumber;
invoiceNumber.sprintf("RN%8s-%04d", day.ascii(), number);
- qDebug("Printing");
- QPainter p;
- if (!p.begin(printer))
- {
- qDebug("Printing aborted");
- return;
- }
- Q3PaintDeviceMetrics metrics(p.device());
- int dpiy = metrics.logicalDpiY();
- int dpix = metrics.logicalDpiX(); // FS#46
- int tmargin = (int) ((marginTop / 2.54) * dpiy);
- int bmargin = (int) ((marginBottom / 2.54) * dpiy);
- int lmargin = (int) ((marginLeft / 2.54) * dpix);
- int rmargin = (int) ((marginRight / 2.54) * dpix);
- QRect body(lmargin, tmargin, metrics.width() - (lmargin + rmargin), metrics.height() - (tmargin + bmargin));
-
TemplatePlaceholders vars;
vars["custnum"] = Q3StyleSheet::escape(custNum->text());
@@ -827,31 +813,15 @@
vars["companySlogan"] = companySlogan;
document += sloganBox.getContents(&vars);
- Q3SimpleRichText richText(QString("<qt>%1</qt>").arg(document), QFont("Arial", fontSize));
- richText.setWidth(&p, body.width());
+ printer->setPageMargins(10 * marginLeft, 10 * marginTop, 10 * marginRight, 10 * marginBottom, QPrinter::Millimeter);
- QRect view(body);
- int page = 1;
- do {
- // draw text
- richText.draw(&p, body.left(), body.top(), view, colorGroup());
- view.moveBy(0, body.height()); // FS#15
- p.translate(0, -body.height());
+ QTextDocument htmlText(this);
+ htmlText.documentLayout()->setPaintDevice(printer);
+ htmlText.setDocumentMargin(0);
+ htmlText.setDefaultFont(QFont("Arial", fontSize));
+ htmlText.setHtml(QString("<html><body>%1</body></html>").arg(document));
+ htmlText.print(printer);
- // insert page number
- p.drawText(view.right() - p.fontMetrics().width(QString::number(page)),
- view.bottom() + p.fontMetrics().ascent() + 5,
- QString::number(page));
-
- // exit loop on last page
- if (view.top () >= richText.height ()) break;
-
- printer->newPage();
- page++;
- } while (TRUE);
-
- if (!p.end()) qDebug("Print painter yielded failure");
-
qDebug("Closing form");
this->cancelButton_clicked();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2010-06-13 12:46:09
|
Revision: 53
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=53&view=rev
Author: hurikhan
Date: 2010-06-13 12:46:02 +0000 (Sun, 13 Jun 2010)
Log Message:
-----------
Fix reading settings file
This fixes reading the settings file by adjusting the encoding to UTF-8.
Modified Paths:
--------------
trunk/src/main.cpp
trunk/src/orderwidget.ui.h
Modified: trunk/src/main.cpp
===================================================================
--- trunk/src/main.cpp 2010-06-13 08:48:13 UTC (rev 52)
+++ trunk/src/main.cpp 2010-06-13 12:46:02 UTC (rev 53)
@@ -82,7 +82,11 @@
QPrintDialog *dialog = new QPrintDialog(mw->printer, mw);
dialog->setWindowTitle(QObject::tr("Printer Setup"));
- if (dialog->exec() == QDialog::Accepted) return a.exec ();
+ if (dialog->exec() == QDialog::Accepted)
+ {
+ mw->printer->setFullPage(TRUE);
+ return a.exec ();
+ }
return 1;
}
Modified: trunk/src/orderwidget.ui.h
===================================================================
--- trunk/src/orderwidget.ui.h 2010-06-13 08:48:13 UTC (rev 52)
+++ trunk/src/orderwidget.ui.h 2010-06-13 12:46:02 UTC (rev 53)
@@ -19,6 +19,7 @@
#include <Q3SimpleRichText>
#include <QSettings>
#include <QDateTime>
+#include <QTextCodec>
#include "templatereader.h"
#include "mainform.h"
@@ -653,6 +654,7 @@
/* load static template settings */
QSettings settings("kaishome.de", "PhoneOrder"); // FS#14
+ settings.setIniCodec(QTextCodec::codecForName("UTF-8"));
settings.beginGroup("Template");
QString companyName = settings.value("CompanyName", tr("Example Company")).toString();
@@ -691,7 +693,6 @@
invoiceNumber.sprintf("RN%8s-%04d", day.ascii(), number);
qDebug("Printing");
- printer->setFullPage(TRUE);
QPainter p;
if (!p.begin(printer))
{
@@ -849,6 +850,8 @@
page++;
} while (TRUE);
+ if (!p.end()) qDebug("Print painter yielded failure");
+
qDebug("Closing form");
this->cancelButton_clicked();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2010-06-13 08:48:19
|
Revision: 52
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=52&view=rev
Author: hurikhan
Date: 2010-06-13 08:48:13 +0000 (Sun, 13 Jun 2010)
Log Message:
-----------
Clear kdevelop file, switched to QtCreator
Removed Paths:
-------------
trunk/phoneorder.kdevelop
Deleted: trunk/phoneorder.kdevelop
===================================================================
--- trunk/phoneorder.kdevelop 2010-06-13 08:47:15 UTC (rev 51)
+++ trunk/phoneorder.kdevelop 2010-06-13 08:48:13 UTC (rev 52)
@@ -1,228 +0,0 @@
-<?xml version = '1.0'?>
-<kdevelop>
- <general>
- <author>Kai Krakow</author>
- <email>ka...@ka...</email>
- <version>0.1</version>
- <projectmanagement>KDevTrollProject</projectmanagement>
- <primarylanguage>C++</primarylanguage>
- <keywords>
- <keyword>Qt</keyword>
- </keywords>
- <projectdirectory>.</projectdirectory>
- <absoluteprojectpath>false</absoluteprojectpath>
- <description></description>
- <ignoreparts>
- <part>kdevvalgrind</part>
- <part>kdevsnippet</part>
- <part>kdevscripting</part>
- <part>kdevdoxygen</part>
- <part>kdevtools</part>
- </ignoreparts>
- <secondaryLanguages/>
- <versioncontrol>kdevsubversion</versioncontrol>
- <projectname>phoneorder</projectname>
- <defaultencoding></defaultencoding>
- </general>
- <kdevfileview>
- <groups>
- <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
- <group pattern="*.ui" name="User Interface" />
- <group pattern="*.png" name="Icons" />
- <group pattern="*" name="Others" />
- <hidenonprojectfiles>false</hidenonprojectfiles>
- <hidenonlocation>false</hidenonlocation>
- </groups>
- <tree>
- <hidenonprojectfiles>true</hidenonprojectfiles>
- <hidepatterns>*.o,*.lo,CVS</hidepatterns>
- <showvcsfields>false</showvcsfields>
- </tree>
- </kdevfileview>
- <kdevdoctreeview>
- <ignoretocs>
- <toc>bash</toc>
- <toc>bash_bugs</toc>
- <toc>clanlib</toc>
- <toc>fortran_bugs_gcc</toc>
- <toc>gnome1</toc>
- <toc>gnustep</toc>
- <toc>gtk</toc>
- <toc>gtk_bugs</toc>
- <toc>haskell</toc>
- <toc>haskell_bugs_ghc</toc>
- <toc>java_bugs_gcc</toc>
- <toc>java_bugs_sun</toc>
- <toc>kde2book</toc>
- <toc>opengl</toc>
- <toc>pascal_bugs_fp</toc>
- <toc>php</toc>
- <toc>php_bugs</toc>
- <toc>perl</toc>
- <toc>perl_bugs</toc>
- <toc>python</toc>
- <toc>python_bugs</toc>
- <toc>qt-kdev3</toc>
- <toc>ruby</toc>
- <toc>ruby_bugs</toc>
- <toc>sdl</toc>
- <toc>stl</toc>
- <toc>sw</toc>
- <toc>w3c-dom-level2-html</toc>
- <toc>w3c-svg</toc>
- <toc>w3c-uaag10</toc>
- <toc>wxwidgets_bugs</toc>
- </ignoretocs>
- <ignoredoxygen>
- <toc>KDE Libraries (Doxygen)</toc>
- </ignoredoxygen>
- </kdevdoctreeview>
- <kdevdebugger>
- <general>
- <dbgshell></dbgshell>
- <breakpoints/>
- <programargs/>
- <gdbpath>/usr/bin/</gdbpath>
- <breakonloadinglibs>true</breakonloadinglibs>
- <separatetty>false</separatetty>
- <floatingtoolbar>false</floatingtoolbar>
- <configGdbScript></configGdbScript>
- <runShellScript></runShellScript>
- <runGdbScript></runGdbScript>
- </general>
- <display>
- <staticmembers>false</staticmembers>
- <demanglenames>true</demanglenames>
- <outputradix>10</outputradix>
- </display>
- <breakpoints/>
- </kdevdebugger>
- <kdevtrollproject>
- <run>
- <mainprogram>/home/users/kakra/svn/sourceforge/phoneorder/bin/phoneorder</mainprogram>
- <programargs></programargs>
- <directoryradio>executable</directoryradio>
- <customdirectory>/</customdirectory>
- <terminal>false</terminal>
- <autocompile>true</autocompile>
- <envvars/>
- <globaldebugarguments></globaldebugarguments>
- <globalcwd>/home/users/kakra/svn/sourceforge/phoneorder</globalcwd>
- <useglobalprogram>false</useglobalprogram>
- <autoinstall>false</autoinstall>
- <autokdesu>false</autokdesu>
- </run>
- <general>
- <activedir>src</activedir>
- </general>
- <subclassing>
- <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_neworderwidget.cpp" />
- <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_neworderwidget.h" />
- <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_fullcustomereditor.cpp" />
- <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_fullcustomereditor.h" />
- </subclassing>
- <make>
- <abortonerror>false</abortonerror>
- <numberofjobs>3</numberofjobs>
- <dontact>false</dontact>
- <makebin></makebin>
- <prio>0</prio>
- <envvars/>
- <runmultiplejobs>true</runmultiplejobs>
- </make>
- <qmake>
- <savebehaviour>2</savebehaviour>
- <replacePaths>true</replacePaths>
- <disableDefaultOpts>true</disableDefaultOpts>
- </qmake>
- </kdevtrollproject>
- <workspace>
- <openfiles/>
- </workspace>
- <kdevfilecreate>
- <filetypes/>
- <useglobaltypes>
- <type ext="ui" />
- <type ext="cpp" />
- <type ext="h" />
- <type ext="ts" />
- </useglobaltypes>
- </kdevfilecreate>
- <kdevcppsupport>
- <references/>
- <codecompletion>
- <includeGlobalFunctions>true</includeGlobalFunctions>
- <includeTypes>true</includeTypes>
- <includeEnums>true</includeEnums>
- <includeTypedefs>false</includeTypedefs>
- <automaticCodeCompletion>true</automaticCodeCompletion>
- <automaticArgumentsHint>true</automaticArgumentsHint>
- <automaticHeaderCompletion>true</automaticHeaderCompletion>
- <codeCompletionDelay>250</codeCompletionDelay>
- <argumentsHintDelay>400</argumentsHintDelay>
- <headerCompletionDelay>250</headerCompletionDelay>
- <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
- <completionBoxItemOrder>0</completionBoxItemOrder>
- <howEvaluationContextMenu>true</howEvaluationContextMenu>
- <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
- <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
- <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
- <processPrimaryTypes>true</processPrimaryTypes>
- <processFunctionArguments>false</processFunctionArguments>
- <preProcessAllHeaders>false</preProcessAllHeaders>
- <parseMissingHeaders>false</parseMissingHeaders>
- <resolveIncludePaths>true</resolveIncludePaths>
- <alwaysParseInBackground>true</alwaysParseInBackground>
- <usePermanentCaching>true</usePermanentCaching>
- <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
- <includePaths>.;</includePaths>
- </codecompletion>
- <designerintegration>
- <qtdesigner>
- <implementation class="PO_LocationsEditor" path="/home/users/kakra/svn/other/phoneorder/src/po_locationseditorbase.ui" implementationpath="/home/users/kakra/svn/other/phoneorder/src/po_locationseditor.h" />
- <implementation class="PO_PricesEditor" path="/home/users/kakra/svn/other/phoneorder/src/po_priceseditorbase.ui" implementationpath="/home/users/kakra/svn/other/phoneorder/src/po_priceseditor.h" />
- </qtdesigner>
- </designerintegration>
- <qt>
- <used>true</used>
- <version>3</version>
- <root>/usr/qt/3</root>
- <includestyle>3</includestyle>
- <designerintegration>EmbeddedKDevDesigner</designerintegration>
- <qmake>/usr/qt/3/bin/qmake</qmake>
- <designer>/usr/qt/3/bin/designer</designer>
- <designerpluginpaths/>
- </qt>
- <creategettersetter>
- <prefixGet></prefixGet>
- <prefixSet>set</prefixSet>
- <prefixVariable>m_,_</prefixVariable>
- <parameterName>theValue</parameterName>
- <inlineGet>true</inlineGet>
- <inlineSet>true</inlineSet>
- </creategettersetter>
- <splitheadersource>
- <enabled>false</enabled>
- <synchronize>true</synchronize>
- <orientation>Vertical</orientation>
- </splitheadersource>
- </kdevcppsupport>
- <cppsupportpart>
- <filetemplates>
- <interfacesuffix>.h</interfacesuffix>
- <implementationsuffix>.cpp</implementationsuffix>
- </filetemplates>
- </cppsupportpart>
- <kdevdocumentation>
- <projectdoc>
- <docsystem></docsystem>
- <docurl></docurl>
- <usermanualurl></usermanualurl>
- </projectdoc>
- </kdevdocumentation>
- <ctagspart>
- <customArguments></customArguments>
- <customTagfilePath>/home/users/kakra/svn/sourceforge/phoneorder/tags</customTagfilePath>
- <activeTagsFiles/>
- </ctagspart>
-</kdevelop>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2010-06-13 08:47:22
|
Revision: 51
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=51&view=rev
Author: hurikhan
Date: 2010-06-13 08:47:15 +0000 (Sun, 13 Jun 2010)
Log Message:
-----------
Migration to Qt4 and template system
First working version after migration to Qt4 with first implementation
of the new template system. This version still has some rough edges but
should not crash in normal workflows.
Modified Paths:
--------------
trunk/src/main.cpp
trunk/src/mainform.ui.h
trunk/src/orderwidget.ui
trunk/src/orderwidget.ui.h
trunk/src/src.pro
trunk/src/widgets/historylineedit.cpp
Added Paths:
-----------
trunk/src/templatereader.cpp
trunk/src/templatereader.h
trunk/templates/AdvertBox.html
trunk/templates/DocumentHeader.html
trunk/templates/GroupHeader.html
trunk/templates/IngredientLine.html
trunk/templates/ItemLine.html
trunk/templates/ReportFooter.html
trunk/templates/ReportHeader.html
trunk/templates/SloganBox.html
Removed Paths:
-------------
trunk/templates/cpp
trunk/templates/h
Modified: trunk/src/main.cpp
===================================================================
--- trunk/src/main.cpp 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/src/main.cpp 2010-06-13 08:47:15 UTC (rev 51)
@@ -23,6 +23,8 @@
#include <QTabWidget>
#include <QPushButton>
#include <QSettings>
+#include <QDialog>
+#include <QPrintDialog>
#include "mainform.h"
#include "po_priceseditor.h"
@@ -43,7 +45,7 @@
delete settings;
QApplication a (argc, argv);
- MainForm *mw = new MainForm ();
+ MainForm *mw = new MainForm();
a.setMainWidget (mw);
mw->pickupWidget->removePage (mw->pickupWidget->page (0));
@@ -72,10 +74,15 @@
mw->createNewOrder ();
- mw->printer = new QPrinter ();
- mw->printer->setPageSize (QPrinter::A5); // FS#46
- mw->printer->setNumCopies (2);
- mw->printer->setup (mw);
+ mw->printer = new QPrinter(QPrinter::HighResolution);
+ mw->printer->setPaperSize(QPrinter::A5); // FS#46
+ mw->printer->setNumCopies(2);
+ mw->printer->setColorMode(QPrinter::GrayScale);
+ mw->printer->setCreator("PhoneOrder");
- return a.exec ();
+ QPrintDialog *dialog = new QPrintDialog(mw->printer, mw);
+ dialog->setWindowTitle(QObject::tr("Printer Setup"));
+ if (dialog->exec() == QDialog::Accepted) return a.exec ();
+
+ return 1;
}
Modified: trunk/src/mainform.ui.h
===================================================================
--- trunk/src/mainform.ui.h 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/src/mainform.ui.h 2010-06-13 08:47:15 UTC (rev 51)
@@ -20,43 +20,49 @@
void MainForm::createOrderPage (PO_Customer *from)
{
- OrderWidget *ow = new OrderWidget ();
- ow->custNum->setText (from->num);
- ow->custName->setText (from->name);
- ow->custStreet->setText (from->street);
- ow->custCity->setText (from->city);
- ow->custPhone->setText (from->phone);
- ow->custNotes->setText (from->notes);
- int max = 1;
- for (int i = 0; i < pickupWidget->count (); i++)
- {
- QString l = pickupWidget->label (i);
- l.replace (QRegExp ("[^0-9]+"), "");
- int num = l.toInt ();
- if (num >= max) max = num + 1;
- }
- pickupWidget->addTab (ow, QString ("&%1 %2") .arg (max) .arg (ow->custName->text ()));
- ow->itemGroup->setFocus ();
- pickupWidget->showPage (ow);
+ OrderWidget *ow = new OrderWidget ();
+ ow->custNum->setText (from->num);
+ ow->custName->setText (from->name);
+ ow->custStreet->setText (from->street);
+ ow->custCity->setText (from->city);
+ ow->custPhone->setText (from->phone);
+ ow->custNotes->setText (from->notes);
+ int max = 1;
+ for (int i = 0; i < pickupWidget->count (); i++)
+ {
+ QString l = pickupWidget->label (i);
+ l.replace (QRegExp ("[^0-9]+"), "");
+ int num = l.toInt ();
+ if (num >= max) max = num + 1;
+ }
+ pickupWidget->addTab (ow, QString ("&%1 %2") .arg (max) .arg (ow->custName->text ()));
+ ow->itemGroup->setFocus ();
+ pickupWidget->showPage (ow);
}
void MainForm::createNewOrder ()
{
- PO_NewOrderWidget *ow = new PO_NewOrderWidget ();
- pickupWidget->addTab (ow, tr ("Ne&w Order"));
- pickupWidget->showPage (ow);
- ow->custNumEdit->setFocus ();
+ PO_NewOrderWidget *ow = new PO_NewOrderWidget ();
+ pickupWidget->addTab (ow, tr ("Ne&w Order"));
+ pickupWidget->showPage (ow);
+ ow->custNumEdit->setFocus ();
}
void MainForm::cancelOrder (OrderWidget *ow)
{
- if (pickupWidget->count () <= 1)
- pickupWidget->addTab (new PO_NewOrderWidget (), tr ("Ne&w Order"));
- pickupWidget->removePage (ow);
- delete ow;
+ qDebug("Cancel order from main window");
+ if (pickupWidget->count() <= 1) {
+ qDebug("Last order tab closing - spawning new");
+ pickupWidget->addTab(new PO_NewOrderWidget(), tr("Ne&w Order"));
+ }
+ qDebug("Removing current order tab");
+ pickupWidget->removePage(ow);
+ qDebug("Deleting widget");
+ delete ow;
+ qDebug("Deleted - now returning");
}
void MainForm::createPreparedOrder (QString)
{
- //TODO NewOrderWidget anhand der Telefonnummer ausfüllen
+ //TODO NewOrderWidget anhand der Telefonnummer ausfüllen
}
Modified: trunk/src/orderwidget.ui
===================================================================
--- trunk/src/orderwidget.ui 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/src/orderwidget.ui 2010-06-13 08:47:15 UTC (rev 51)
@@ -690,6 +690,9 @@
<slot>nextButton_clicked()</slot>
</connection>
</connections>
+<signals>
+ <signal>cancelOrder(OrderWidget*)</signal>
+</signals>
<tabstops>
<tabstop>itemCount</tabstop>
<tabstop>itemName</tabstop>
Modified: trunk/src/orderwidget.ui.h
===================================================================
--- trunk/src/orderwidget.ui.h 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/src/orderwidget.ui.h 2010-06-13 08:47:15 UTC (rev 51)
@@ -20,6 +20,7 @@
#include <QSettings>
#include <QDateTime>
+#include "templatereader.h"
#include "mainform.h"
void OrderWidget::init ()
@@ -45,6 +46,8 @@
orderDateTime->setDateTime (QDateTime::currentDateTime ()); // FS#24
orderDateTime->setAutoAdvance (true);
+
+ QObject::connect(this, SIGNAL(cancelOrder(OrderWidget*)), qApp->mainWidget(), SLOT(cancelOrder(OrderWidget*)), Qt::QueuedConnection);
}
void OrderWidget::lookupField (QString t)
@@ -639,8 +642,8 @@
void OrderWidget::cancelButton_clicked()
{
- MainForm *mw = (MainForm *) qApp->mainWidget ();
- mw->cancelOrder (this);
+ qDebug("Cancel button clicked");
+ emit cancelOrder(this);
}
void OrderWidget::nextButton_clicked()
@@ -650,207 +653,202 @@
/* load static template settings */
QSettings settings("kaishome.de", "PhoneOrder"); // FS#14
- settings.beginGroup ("Printing");
- QString companyName = settings.readEntry ("CompanyName", tr ("Example Company"));
- QString companyStreet = settings.readEntry ("CompanyStreet", tr ("Example Street 123"));
- QString companyCity = settings.readEntry ("CompanyCity", tr ("12345 Some Place"));
- QString companyPhone = settings.readEntry ("CompanyPhone", tr ("012 / 34 56 7"));
- QString companyFax = settings.readEntry ("CompanyFax", tr ("012 / 34 56 8"));
- QString companySlogan = settings.readEntry ("CompanySlogan", tr ("Have a nice meal. It's always a pleasure to serve you!"));
- QString advertSlogan = settings.readEntry ("AdvertSlogan");
- double marginSize = settings.readDoubleEntry ("PrintMargin", 0.75); // 3/4 cm margin
- double marginLeft = settings.readDoubleEntry ("PrintMarginLeft", marginSize); // FS#46
- double marginRight = settings.readDoubleEntry ("PrintMarginRight", marginSize);
- double marginTop = settings.readDoubleEntry ("PrintMarginTop", marginSize);
- double marginBottom = settings.readDoubleEntry ("PrintMarginBottom", marginSize);
- QString day = QDate::currentDate ().toString ("yyyyMMdd"); // FS#49
+ settings.beginGroup("Template");
+ QString companyName = settings.value("CompanyName", tr("Example Company")).toString();
+ QString companyStreet = settings.value("CompanyStreet", tr("Example Street 123")).toString();
+ QString companyCity = settings.value("CompanyCity", tr("12345 Some Place")).toString();
+ QString companyPhone = settings.value("CompanyPhone", tr("012 / 34 56 7")).toString();
+ QString companyFax = settings.value("CompanyFax", tr("012 / 34 56 8")).toString();
+ QString companySlogan = settings.value("CompanySlogan", tr("Have a nice meal. It's always a pleasure to serve you!")).toString();
+ QString advertSlogan = settings.value("AdvertSlogan").toString();
+ settings.endGroup();
+
+ settings.beginGroup("Printing");
+ double marginSize = settings.value("PrintMargin", 0.75).toDouble(); // 3/4 cm margin
+ double marginLeft = settings.value("PrintMarginLeft", marginSize).toDouble(); // FS#46
+ double marginRight = settings.value("PrintMarginRight", marginSize).toDouble();
+ double marginTop = settings.value("PrintMarginTop", marginSize).toDouble();
+ double marginBottom = settings.value("PrintMarginBottom", marginSize).toDouble();
+ int fontSize = settings.value("FontSize", 10).toInt();
+ settings.endGroup();
+
+ QString day = QDate::currentDate().toString("yyyyMMdd"); // FS#49
int number = 0;
- QSqlQuery query = QSqlQuery (QString ("SELECT MAX(number) FROM invoices WHERE day = '%1'") .arg (day));
- if (query.first ())
+ QSqlQuery query = QSqlQuery(QString("SELECT MAX(number) FROM invoices WHERE day = '%1'").arg(day));
+ if (query.first())
{
- qDebug ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ());
- number = query.value (0).toInt ();
+ qDebug("QSqlQuery( \"%s\" )", query.executedQuery().ascii());
+ number = query.value(0).toInt();
}
number += 1;
- query = QSqlQuery (QString ("REPLACE INTO invoices SET number = '%1', day = '%2'") .arg (number) .arg (day));
- if (query.isActive ())
- qDebug ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ());
+ query = QSqlQuery(QString("REPLACE INTO invoices SET number = '%1', day = '%2'").arg(number).arg(day));
+ if (query.isActive())
+ qDebug("QSqlQuery( \"%s\" )", query.executedQuery().ascii());
else
- qFatal ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ());
+ qFatal("QSqlQuery( \"%s\" )", query.executedQuery().ascii());
QString invoiceNumber;
- invoiceNumber.sprintf ("RN%8s-%04d", day.ascii (), number);
+ invoiceNumber.sprintf("RN%8s-%04d", day.ascii(), number);
- int fontSize = settings.readNumEntry ("FontSize", 10);
- settings.endGroup ();
-
- qDebug ("Printing");
- printer->setFullPage (TRUE);
+ qDebug("Printing");
+ printer->setFullPage(TRUE);
QPainter p;
- if (!p.begin (printer))
+ if (!p.begin(printer))
{
- qDebug ("Printing aborted");
+ qDebug("Printing aborted");
return;
}
- Q3PaintDeviceMetrics metrics (p.device ());
- int dpiy = metrics.logicalDpiY ();
- int dpix = metrics.logicalDpiX (); // FS#46
+ Q3PaintDeviceMetrics metrics(p.device());
+ int dpiy = metrics.logicalDpiY();
+ int dpix = metrics.logicalDpiX(); // FS#46
int tmargin = (int) ((marginTop / 2.54) * dpiy);
int bmargin = (int) ((marginBottom / 2.54) * dpiy);
int lmargin = (int) ((marginLeft / 2.54) * dpix);
int rmargin = (int) ((marginRight / 2.54) * dpix);
- QRect body (lmargin, tmargin, metrics.width () - (lmargin + rmargin), metrics.height () - (tmargin + bmargin));
- QString document = QString (
- "<table width='100%' cellpadding='0' cellspacing='0'>"
- "<tr><td colspan='3'><font size='-2'>Kd-Nr</font></td></tr>"
- "<tr>"
- "<td rowspan='2' valign='top'>"
- "<font size='+3'><%custnum%> <%name%></font><br>"
- "<nobr>"
- "<font size='+2'><%street%><br><%city%><br></font>"
- "Telefon: <%phone%>"
- "</nobr>"
- "<%notes%>"
- "</td>"
- "<td> </td>"
- "<td valign='top' align='right'>"
- "<table cellpadding='0' cellspacing='0'>"
- "<tr>"
- "<td>"
- "<nobr>"
- "<font size='+2'><%companyname%></font><br>"
- "<%companystreet%><br>"
- "<%companycity%><br>"
- "<font size='-1'>Telefon: <%companyphone%><br>Telefax: <%companyfax%></font>"
- "</nobr>"
- "</td>"
- "</tr>"
- "</table>"
- "</td>"
- "</tr>"
- "<tr>"
- "<td colspan='2' align='right' valign='bottom'>" // FS#29
- "<font size='+3'>Rechnung</font><br>"
- "<nobr><%invoicenumber%></nobr><br>" // FS#49
- "<nobr><b><%date%></b></nobr>"
- "</td>"
- "</tr>"
- "<tr><td colspan='3'><hr></td></tr>"
- "</table>"
- "<table width='100%' cellpadding='0' cellspacing='0'>");
+ QRect body(lmargin, tmargin, metrics.width() - (lmargin + rmargin), metrics.height() - (tmargin + bmargin));
- /* replace placeholders */
- document.replace ("<%custnum%>", Q3StyleSheet::escape (custNum->text ()));
- document.replace ("<%name%>", Q3StyleSheet::escape (custName->text ()));
- document.replace ("<%street%>", Q3StyleSheet::escape (custStreet->text ()));
- document.replace ("<%city%>", Q3StyleSheet::escape (custCity->text ()));
- document.replace ("<%phone%>", Q3StyleSheet::escape (custPhone->text ()));
- document.replace ("<%companyname%>", companyName);
- document.replace ("<%companystreet%>", companyStreet);
- document.replace ("<%companycity%>", companyCity);
- document.replace ("<%companyphone%>", companyPhone);
- document.replace ("<%companyfax%>", companyFax);
- document.replace ("<%invoicenumber%>", invoiceNumber); // FS#49
+ TemplatePlaceholders vars;
- if (custNotes->text ().isEmpty ())
- document.replace ("<%notes%>", QString::null);
- else
- document.replace ("<%notes%>", "<br><br><u>Anmerkungen:</u><br>" + Q3StyleSheet::convertFromPlainText (custNotes->text ()).stripWhiteSpace ());
- if (orderDateTime->dateTime () > QDateTime::currentDateTime ())
- document.replace ("<%date%>", orderDateTime->dateTime ().toString ("<big><b>ddd, d. MMM. yyyy h:mm</b></big>")); // FS#29
- else
- document.replace ("<%date%>", orderDateTime->dateTime ().toString ("ddd, d. MMM. yyyy h:mm")); // FS#24
+ vars["custnum"] = Q3StyleSheet::escape(custNum->text());
+ vars["name"] = Q3StyleSheet::escape(custName->text());
+ vars["street"] = Q3StyleSheet::escape(custStreet->text());
+ vars["city"] = Q3StyleSheet::escape(custCity->text());
+ vars["phone"] = Q3StyleSheet::escape(custPhone->text());
+ vars["companyname"] = companyName;
+ vars["companystreet"] = companyStreet;
+ vars["companycity"] = companyCity;
+ vars["companyphone"] = companyPhone;
+ vars["companyfax"] = companyFax;
+ vars["invoicenumber"] = invoiceNumber; // FS#49
+ vars["notes"] = custNotes->text().trimmed().isEmpty()
+ ? QString::null
+ : Q3StyleSheet::convertFromPlainText(custNotes->text()).trimmed().prepend("<br><br><u>Anmerkungen:</u><br>");
+
+ vars["date"] = orderDateTime->dateTime() > QDateTime::currentDateTime()
+ ? orderDateTime->dateTime().toString("<big><b>ddd, d. MMM. yyyy h:mm</b></big>") // FS#29
+ : orderDateTime->dateTime().toString("ddd, d. MMM. yyyy h:mm"); // FS#24
+
+ TemplateReader documentHeader("DocumentHeader.html", this);
+ TemplateReader reportHeader("ReportHeader.html", this);
+ TemplateReader groupHeader("GroupHeader.html", this);
+ TemplateReader itemLine("ItemLine.html", this);
+ TemplateReader ingredientLine("IngredientLine.html", this);
+ TemplateReader reportFooter("ReportFooter.html", this);
+ TemplateReader advertBox("AdvertBox.html", this);
+ TemplateReader sloganBox("SloganBox.html", this);
+
+ QString document(documentHeader.getContents(&vars));
+ document += reportHeader.getContents(&vars);
+
Q3ListViewItemIterator it = Q3ListViewItemIterator (orderList);
double sum = 0.0;
int prevGroupId = -1;
- while (it.current ())
+ while (it.current())
{
- Q3ListViewItem *i = it.current ();
+ Q3ListViewItem *i = it.current();
- double price = i->text (3).replace (QChar (','), QChar ('.')).toDouble (); // FS#6
- if (i->text (4).isNull ()) // is ingredient
+ double price = i->text(3).replace(QChar(','), QChar('.')).toDouble(); // FS#6
+ if (i->text(4).isNull()) // is ingredient
{
double price1 = 0.0;
- QSqlQuery query (QString ("SELECT price FROM ingprices WHERE ipid = '%1'") .arg (i->text (5)));
- if (query.isActive ())
+ QSqlQuery query(QString("SELECT price FROM ingprices WHERE ipid = '%1'").arg(i->text(5)));
+ if (query.isActive())
{
- if (query.first ())
+ if (query.first())
{
- qDebug ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ());
- price1 = query.value (0).toDouble ();
+ qDebug("QSqlQuery( \"%s\" )", query.executedQuery().ascii());
+ price1 = query.value(0).toDouble();
}
}
else
- qDebug ("%s", query.lastError ().text ().ascii ());
- document += QString ("<tr>"
- "<td> </td>"
- "<td valign='top'>%1 %2</td>"
- "<td valign='top' align='right'>%L3</td>"
- "<td valign='top' align='right'><b>%L4</b></td>"
- "</tr>") .arg (i->text (1)) .arg (i->text (2));
+ qDebug("%s", query.lastError().text().ascii());
+
+ vars["itemType"] = i->text(1);
+ vars["itemName"] = i->text(2);
if (price != 0.0)
- document = document .arg (price1, 0, 'f', 2) .arg (price, 0, 'f', 2);
+ {
+ vars["itemPrice"] = QString("%L1").arg(price1, 0, 'f', 2);
+ vars["linePrice"] = QString("%L1").arg(price, 0, 'f', 2);
+ }
else
- document = document .arg (price1, 0, 'f', 2) .arg (" ");
+ {
+ vars["itemPrice"] = QString("%L1").arg(price1, 0, 'f', 2);
+ vars["linePrice"] = QString(" ");
+ }
+ document += ingredientLine.getContents(&vars);
}
else // is item
{
- QSqlQuery query (QString ("SELECT dp.groupid, `group`, dish, price FROM dishprices dp "
- "LEFT JOIN groups USING (groupid) LEFT JOIN dishes d ON (d.dishid = dp.dishid) "
- "WHERE dpid = '%1'") .arg (i->text (4)));
- if (query.isActive ())
+ QSqlQuery query(QString("SELECT dp.groupid, `group`, dish, price FROM dishprices dp "
+ "LEFT JOIN groups USING (groupid) LEFT JOIN dishes d ON (d.dishid = dp.dishid) "
+ "WHERE dpid = '%1'").arg(i->text(4)));
+ if (query.isActive())
{
- if (query.first ())
+ if (query.first())
{
- qDebug ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ());
- int groupId = query.value (0).toInt ();
+ qDebug("QSqlQuery( \"%s\" )", query.executedQuery().ascii());
+ int groupId = query.value(0).toInt();
if (prevGroupId != groupId)
{
prevGroupId = groupId;
- document += QString ("<tr><td colspan='4'><font size='+1'><u><i>%1</i></u></font></td></tr>") .arg (query.value (1).toString ());
+ vars["groupName"] = query.value(1).toString();
+ document += groupHeader.getContents(&vars);
}
}
- document += QString ("<tr>"
- "<td valign='top' align='right'>%1 </td>"
- "<td valign='top'>%2 %3</td>"
- "<td valign='top' align='right'>%L4</td>"
- "<td valign='top' align='right'><b>%L5</b></td>"
- "</tr>") .arg (i->text (0)) .arg (i->text (1)) .arg (query.value (2).toString ()) .arg (query.value (3).toDouble (), 0, 'f', 2) .arg (price, 0, 'f', 2);
+
+ vars["itemCount"] = i->text(0);
+ vars["itemNumber"] = i->text(1);
+ vars["itemName"] = query.value(2).toString();
+ vars["itemPrice"] = QString("%L1").arg(query.value(3).toDouble(), 0, 'f', 2);
+ vars["linePrice"] = QString("%L1").arg(price, 0, 'f', 2);
+
+ document += itemLine.getContents(&vars);
}
else
- qDebug ("%s", query.lastError ().text ().ascii ());
+ qDebug("%s", query.lastError().text().ascii());
}
sum += price;
it++;
}
- document += QString (
- "<tr><td colspan='4'><hr></td></tr>"
- "<tr><td colspan='2'>Inkl. gesetzliche MwSt. 7%</td><td align='right'>%L1</td><td rowspan='2' align='right' valign='top'><font size='+2'> <b><u>%L2</u></b></font></td></tr>"
- "<tr><td colspan='3'><b>Zu zahlende Summe in €</b></td></tr>"
- "</table>") .arg (sum * 0.07 / 1.07, 0, 'f', 2) .arg (sum, 0, 'f', 2); // FS#39
+ vars["taxTotal"] = QString("%L1").arg(sum * 0.07 / 1.07, 0, 'f', 2);
+ vars["linesTotal"] = QString("%L1").arg(sum, 0, 'f', 2); // FS#39
+ document += reportFooter.getContents(&vars);
- if (!advertSlogan.isEmpty ())
- document += QString ("<center><i><font size='+2'>%1</font></i></center><br />") .arg (advertSlogan);
+ if (!advertSlogan.isEmpty())
+ {
+ vars["advertSlogan"] = advertSlogan;
+ document += advertBox.getContents(&vars);
+ }
- document += QString ("<center><i><font size='+1'>%1</font></i></center>") .arg (companySlogan);
+ vars["companySlogan"] = companySlogan;
+ document += sloganBox.getContents(&vars);
- Q3SimpleRichText richText (QString ("<qt>%1</qt>") .arg (document), QFont ("Arial", fontSize));
- richText.setWidth (&p, body.width ());
- QRect view (body);
+ Q3SimpleRichText richText(QString("<qt>%1</qt>").arg(document), QFont("Arial", fontSize));
+ richText.setWidth(&p, body.width());
+
+ QRect view(body);
int page = 1;
do {
// draw text
- richText.draw (&p, body.left (), body.top (), view, colorGroup ());
- view.moveBy (0, body.height ()); // FS#15
- p.translate (0, -body.height ());
+ richText.draw(&p, body.left(), body.top(), view, colorGroup());
+ view.moveBy(0, body.height()); // FS#15
+ p.translate(0, -body.height());
+
// insert page number
- p.drawText (view.right () - p.fontMetrics ().width (QString::number (page)), view.bottom () + p.fontMetrics ().ascent () + 5, QString::number (page));
+ p.drawText(view.right() - p.fontMetrics().width(QString::number(page)),
+ view.bottom() + p.fontMetrics().ascent() + 5,
+ QString::number(page));
+
+ // exit loop on last page
if (view.top () >= richText.height ()) break;
- printer->newPage ();
+
+ printer->newPage();
page++;
} while (TRUE);
- cancelButton_clicked ();
+
+ qDebug("Closing form");
+ this->cancelButton_clicked();
}
Modified: trunk/src/src.pro
===================================================================
--- trunk/src/src.pro 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/src/src.pro 2010-06-13 08:47:15 UTC (rev 51)
@@ -1,41 +1,54 @@
-# Diese Datei wurde mit dem qmake-Manager von KDevelop erstellt.
-# -------------------------------------------
+# Diese Datei wurde mit dem qmake-Manager von KDevelop erstellt.
+# -------------------------------------------
# Unterordner relativ zum Projektordner: ./src
# Das Target ist eine Anwendung: ../bin/phoneorder
+LANGUAGE = C++
+DBFILE = src.db
+TARGET = ../bin/phoneorder
+CONFIG += debug \
+ warn_on \
+ qt \
+ thread
+TEMPLATE = app
-LANGUAGE = C++
-DBFILE = src.db
-TARGET = ../bin/phoneorder
-CONFIG += debug \
- warn_on \
- qt \
- thread
-TEMPLATE = app
-#The following line was changed from FORMS to FORMS3 by qt3to4
+# The following line was changed from FORMS to FORMS3 by qt3to4
FORMS3 += mainform.ui \
- orderwidget.ui \
- customereditor.ui \
- entrydialog.ui \
- po_priceseditorbase.ui \
- po_locationseditorbase.ui
+ orderwidget.ui \
+ customereditor.ui \
+ entrydialog.ui \
+ po_priceseditorbase.ui \
+ po_locationseditorbase.ui
HEADERS += mainform.ui.h \
- widgets/historylineedit.h \
- orderwidget.ui.h \
- po_customer.h \
- po_neworderwidget.h \
- customereditor.ui.h \
- po_fullcustomereditor.h \
- po_priceseditor.h \
- po_locationseditor.h
+ widgets/historylineedit.h \
+ orderwidget.ui.h \
+ po_customer.h \
+ po_neworderwidget.h \
+ customereditor.ui.h \
+ po_fullcustomereditor.h \
+ po_priceseditor.h \
+ po_locationseditor.h \
+ templatereader.h
SOURCES += main.cpp \
- widgets/historylineedit.cpp \
- po_customer.cpp \
- po_neworderwidget.cpp \
- po_fullcustomereditor.cpp \
- po_priceseditor.cpp \
- po_locationseditor.cpp
-#The following line was inserted by qt3to4
-QT += sql qt3support
-#The following line was inserted by qt3to4
+ widgets/historylineedit.cpp \
+ po_customer.cpp \
+ po_neworderwidget.cpp \
+ po_fullcustomereditor.cpp \
+ po_priceseditor.cpp \
+ po_locationseditor.cpp \
+ templatereader.cpp
+
+# The following line was inserted by qt3to4
+QT += sql \
+ qt3support
+
+# The following line was inserted by qt3to4
CONFIG += uic3
-
+FORMS +=
+OTHER_FILES += ../templates/DocumentHeader.html \
+ ../templates/ReportHeader.html \
+ ../templates/IngredientLine.html \
+ ../templates/GroupHeader.html \
+ ../templates/ItemLine.html \
+ ../templates/ReportFooter.html \
+ ../templates/AdvertBox.html \
+ ../templates/SloganBox.html
Added: trunk/src/templatereader.cpp
===================================================================
--- trunk/src/templatereader.cpp (rev 0)
+++ trunk/src/templatereader.cpp 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1,38 @@
+#include "templatereader.h"
+#include <QDir>
+#include <QTextStream>
+#include <QRegExp>
+
+TemplateReader::TemplateReader(const QString &name, QObject *parent)
+ : QFile(parent), cachedSource()
+{
+ QString path = QString("%1/.phoneorder/templates/%2").arg(QDir::homePath()).arg(name);
+ this->setFileName(path);
+}
+
+QString TemplateReader::getContents(const TemplatePlaceholders *placeholders)
+{
+ if (cachedSource.isNull())
+ {
+ if (!this->exists())
+ qFatal("phoneorder: cannot find template '%s'", qPrintable(this->fileName()));
+
+ if (!this->open(QIODevice::ReadOnly | QIODevice::Text))
+ qFatal("phoneorder: cannot read template '%s'", qPrintable(this->fileName()));
+
+ QTextStream html(this);
+ cachedSource = html.readAll();
+
+ this->close();
+ }
+
+ QString out = cachedSource;
+
+ foreach (QString key, placeholders->keys())
+ {
+ QRegExp subject(QString("<%=?\\s*").append(QRegExp::escape(key)).append("\\s*%>"));
+ out = out.replace(subject, placeholders->value(key));
+ }
+
+ return out;
+}
Added: trunk/src/templatereader.h
===================================================================
--- trunk/src/templatereader.h (rev 0)
+++ trunk/src/templatereader.h 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1,20 @@
+#ifndef TEMPLATEREADER_H
+#define TEMPLATEREADER_H
+
+#include <QFile>
+#include <QHash>
+
+typedef QHash<QString,QString> TemplatePlaceholders;
+
+class TemplateReader : public QFile {
+
+private:
+ QString cachedSource;
+
+public:
+ TemplateReader(const QString &name, QObject *parent);
+ QString getContents(const TemplatePlaceholders *placeholders);
+
+};
+
+#endif // TEMPLATEREADER_H
Modified: trunk/src/widgets/historylineedit.cpp
===================================================================
--- trunk/src/widgets/historylineedit.cpp 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/src/widgets/historylineedit.cpp 2010-06-13 08:47:15 UTC (rev 51)
@@ -4,32 +4,32 @@
#include <QKeyEvent>
HistoryLineEdit::HistoryLineEdit (QWidget *parent, const char *name)
- : QLineEdit (parent, name)
+ : QLineEdit (parent, name)
{
}
void
HistoryLineEdit::focusInEvent (QFocusEvent* e)
{
- QLineEdit::focusInEvent (e);
- if (e->gotFocus ()) emit gotFocus ();
+ QLineEdit::focusInEvent (e);
+ if (e->gotFocus ()) emit gotFocus ();
}
void
HistoryLineEdit::keyPressEvent (QKeyEvent* e)
{
- switch (e->key ())
- {
- case Qt::Key_Up:
- qDebug ("HistoryLineEdit::keyPressEvent( Qt::Key_Up )");
- emit upArrowPressed ();
- break;
- case Qt::Key_Down:
- qDebug ("HistoryLineEdit::keyPressEvent( Qt::Key_Down )");
- emit downArrowPressed ();
- break;
- default:
- QLineEdit::keyPressEvent (e);
- break;
- }
+ switch (e->key ())
+ {
+ case Qt::Key_Up:
+ qDebug ("HistoryLineEdit::keyPressEvent( Qt::Key_Up )");
+ emit upArrowPressed ();
+ break;
+ case Qt::Key_Down:
+ qDebug ("HistoryLineEdit::keyPressEvent( Qt::Key_Down )");
+ emit downArrowPressed ();
+ break;
+ default:
+ QLineEdit::keyPressEvent (e);
+ break;
+ }
}
Added: trunk/templates/AdvertBox.html
===================================================================
--- trunk/templates/AdvertBox.html (rev 0)
+++ trunk/templates/AdvertBox.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1 @@
+<center><i><font size="+2"><%=advertSlogan%></font></i></center><br/>
Added: trunk/templates/DocumentHeader.html
===================================================================
--- trunk/templates/DocumentHeader.html (rev 0)
+++ trunk/templates/DocumentHeader.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1,39 @@
+<table width="100%" cellpadding="0" cellspacing="0">
+ <tr><td colspan="3"><font size="-2">Kd-Nr</font></td></tr>
+ <tr>
+ <td rowspan="2" valign="top">
+ <font size="+3"><%custnum%> <%name%></font><br>
+ <nobr>
+ <font size="+2"><%street%><br><%city%><br></font>
+ Telefon: <%phone%>
+ </nobr>
+ <%notes%>
+ </td>
+ <td> </td>
+ <td valign="top" align="right">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <nobr>
+ <font size="+2"><%companyname%></font><br>
+ <%companystreet%><br>
+ <%companycity%><br>
+ <font size="-1">
+ Telefon: <%companyphone%><br>
+ Telefax: <%companyfax%>
+ </font>
+ </nobr>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="right" valign="bottom">
+ <font size='+3'>Rechnung</font><br>
+ <nobr><%invoicenumber%></nobr><br>
+ <nobr><b><%date%></b></nobr>
+ </td>
+ </tr>
+ <tr><td colspan='3'><hr></td></tr>
+</table>
Added: trunk/templates/GroupHeader.html
===================================================================
--- trunk/templates/GroupHeader.html (rev 0)
+++ trunk/templates/GroupHeader.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1,3 @@
+<tr>
+ <td colspan="4"><font size="+1"><u><i><%groupName%></i></u></font></td>
+</tr>
Added: trunk/templates/IngredientLine.html
===================================================================
--- trunk/templates/IngredientLine.html (rev 0)
+++ trunk/templates/IngredientLine.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1,6 @@
+<tr>
+ <td> </td>
+ <td valign="top"><%itemCount%> <%itemName%></td>
+ <td valign="top" align="right"><%itemPrice%></td>
+ <td valign="top" align="right"><b><%linePrice%></b></td>
+</tr>
Added: trunk/templates/ItemLine.html
===================================================================
--- trunk/templates/ItemLine.html (rev 0)
+++ trunk/templates/ItemLine.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1,6 @@
+<tr>
+ <td valign="top" align="right"><%itemCount%> </td>
+ <td valign="top"><%itemNumber%> <%itemName%></td>
+ <td valign="top" align="right"><%itemPrice%></td>
+ <td valign="top" align="right"><b><%linePrice%></b></td>
+</tr>
Added: trunk/templates/ReportFooter.html
===================================================================
--- trunk/templates/ReportFooter.html (rev 0)
+++ trunk/templates/ReportFooter.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1,12 @@
+ <tr>
+ <td colspan="4"><hr></td>
+ </tr>
+ <tr>
+ <td colspan="2">Inkl. gesetzliche MwSt. 7%</td>
+ <td align="right"><%taxTotal%></td>
+ <td rowspan="2" align="right" valign="top"><font size="+2"> <b><u><%linesTotal%></u></b></font></td>
+ </tr>
+ <tr>
+ <td colspan="3"><b>Zu zahlende Summe in €</b></td>
+ </tr>
+</table>
Added: trunk/templates/ReportHeader.html
===================================================================
--- trunk/templates/ReportHeader.html (rev 0)
+++ trunk/templates/ReportHeader.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1 @@
+<table width='100%' cellpadding='0' cellspacing='0'>
Added: trunk/templates/SloganBox.html
===================================================================
--- trunk/templates/SloganBox.html (rev 0)
+++ trunk/templates/SloganBox.html 2010-06-13 08:47:15 UTC (rev 51)
@@ -0,0 +1 @@
+<center><i><font size="+1"><%=companySlogan%></font></i></center>
Deleted: trunk/templates/cpp
===================================================================
--- trunk/templates/cpp 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/templates/cpp 2010-06-13 08:47:15 UTC (rev 51)
@@ -1,19 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2004 by Kai Krakow *
- * ka...@ka... *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
Deleted: trunk/templates/h
===================================================================
--- trunk/templates/h 2010-03-21 21:31:19 UTC (rev 50)
+++ trunk/templates/h 2010-06-13 08:47:15 UTC (rev 51)
@@ -1,19 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2004 by Kai Krakow *
- * ka...@ka... *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2007-08-04 21:40:52
|
Revision: 49
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=49&view=rev
Author: hurikhan
Date: 2007-08-04 14:21:54 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
* Fixes FS#52: price miscalculation
* Improves item selection
Modified Paths:
--------------
trunk/src/orderwidget.ui.h
Modified: trunk/src/orderwidget.ui.h
===================================================================
--- trunk/src/orderwidget.ui.h 2007-08-04 17:50:07 UTC (rev 48)
+++ trunk/src/orderwidget.ui.h 2007-08-04 21:21:54 UTC (rev 49)
@@ -412,11 +412,11 @@
i = new QListViewItem (orderList, j, QString::null, line.left (1), query.value (1).toString (),
QString ("%L1") .arg (sign * currentCount * query.value (2).toDouble (), 0, 'f', 2),
QString::null, QString ("%1") .arg (priceId));
+ orderList->setSelected (i, true);
orderList_currentChanged (orderList);
itemGroup->clear ();
itemName->clear ();
lookupView->clear ();
- orderList->setSelected (i, true);
}
}
else
@@ -579,6 +579,10 @@
{
if (lv->childCount () > 1)
{
+ QListViewItem *n = i->itemAbove ();
+ if (!n) n = i->itemBelow ();
+ if (n) lv->setSelected (n, true);
+ it++; // FS#52: Fixes possible crash and calc failures
delete i;
continue;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2007-08-04 17:50:06
|
Revision: 48
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=48&view=rev
Author: hurikhan
Date: 2007-08-04 10:50:07 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Added KDevelop project file
Added Paths:
-----------
trunk/phoneorder.kdevelop
Added: trunk/phoneorder.kdevelop
===================================================================
--- trunk/phoneorder.kdevelop (rev 0)
+++ trunk/phoneorder.kdevelop 2007-08-04 17:50:07 UTC (rev 48)
@@ -0,0 +1,228 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Kai Krakow</author>
+ <email>ka...@ka...</email>
+ <version>0.1</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description></description>
+ <ignoreparts>
+ <part>kdevvalgrind</part>
+ <part>kdevsnippet</part>
+ <part>kdevscripting</part>
+ <part>kdevdoxygen</part>
+ <part>kdevtools</part>
+ </ignoreparts>
+ <secondaryLanguages/>
+ <versioncontrol>kdevsubversion</versioncontrol>
+ <projectname>phoneorder</projectname>
+ <defaultencoding></defaultencoding>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidenonprojectfiles>true</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <showvcsfields>false</showvcsfields>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <breakpoints/>
+ <programargs/>
+ <gdbpath>/usr/bin/</gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ <breakpoints/>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <run>
+ <mainprogram>/home/users/kakra/svn/sourceforge/phoneorder/bin/phoneorder</mainprogram>
+ <programargs></programargs>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ <globaldebugarguments></globaldebugarguments>
+ <globalcwd>/home/users/kakra/svn/sourceforge/phoneorder</globalcwd>
+ <useglobalprogram>false</useglobalprogram>
+ <autoinstall>false</autoinstall>
+ <autokdesu>false</autokdesu>
+ </run>
+ <general>
+ <activedir>src</activedir>
+ </general>
+ <subclassing>
+ <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_neworderwidget.cpp" />
+ <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_neworderwidget.h" />
+ <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_fullcustomereditor.cpp" />
+ <subclass uifile="/src/customereditor.ui" sourcefile="/src/po_fullcustomereditor.h" />
+ </subclassing>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>3</numberofjobs>
+ <dontact>false</dontact>
+ <makebin></makebin>
+ <prio>0</prio>
+ <envvars/>
+ <runmultiplejobs>true</runmultiplejobs>
+ </make>
+ <qmake>
+ <savebehaviour>2</savebehaviour>
+ <replacePaths>true</replacePaths>
+ <disableDefaultOpts>true</disableDefaultOpts>
+ </qmake>
+ </kdevtrollproject>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="ts" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
+ <completionBoxItemOrder>0</completionBoxItemOrder>
+ <howEvaluationContextMenu>true</howEvaluationContextMenu>
+ <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
+ <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
+ <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
+ <processPrimaryTypes>true</processPrimaryTypes>
+ <processFunctionArguments>false</processFunctionArguments>
+ <preProcessAllHeaders>false</preProcessAllHeaders>
+ <parseMissingHeaders>false</parseMissingHeaders>
+ <resolveIncludePaths>true</resolveIncludePaths>
+ <alwaysParseInBackground>true</alwaysParseInBackground>
+ <usePermanentCaching>true</usePermanentCaching>
+ <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
+ <includePaths>.;</includePaths>
+ </codecompletion>
+ <designerintegration>
+ <qtdesigner>
+ <implementation class="PO_LocationsEditor" path="/home/users/kakra/svn/other/phoneorder/src/po_locationseditorbase.ui" implementationpath="/home/users/kakra/svn/other/phoneorder/src/po_locationseditor.h" />
+ <implementation class="PO_PricesEditor" path="/home/users/kakra/svn/other/phoneorder/src/po_priceseditorbase.ui" implementationpath="/home/users/kakra/svn/other/phoneorder/src/po_priceseditor.h" />
+ </qtdesigner>
+ </designerintegration>
+ <qt>
+ <used>true</used>
+ <version>3</version>
+ <root>/usr/qt/3</root>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ <qmake>/usr/qt/3/bin/qmake</qmake>
+ <designer>/usr/qt/3/bin/designer</designer>
+ <designerpluginpaths/>
+ </qt>
+ <creategettersetter>
+ <prefixGet></prefixGet>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <splitheadersource>
+ <enabled>false</enabled>
+ <synchronize>true</synchronize>
+ <orientation>Vertical</orientation>
+ </splitheadersource>
+ </kdevcppsupport>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem></docsystem>
+ <docurl></docurl>
+ <usermanualurl></usermanualurl>
+ </projectdoc>
+ </kdevdocumentation>
+ <ctagspart>
+ <customArguments></customArguments>
+ <customTagfilePath>/home/users/kakra/svn/sourceforge/phoneorder/tags</customTagfilePath>
+ <activeTagsFiles/>
+ </ctagspart>
+</kdevelop>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2007-08-04 17:49:40
|
Revision: 47
http://phoneorder.svn.sourceforge.net/phoneorder/?rev=47&view=rev
Author: hurikhan
Date: 2007-08-04 10:49:40 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Added MySQL schema for everyone's convenience
Added Paths:
-----------
trunk/db/
trunk/db/mysql-schema.sql
Added: trunk/db/mysql-schema.sql
===================================================================
--- trunk/db/mysql-schema.sql (rev 0)
+++ trunk/db/mysql-schema.sql 2007-08-04 17:49:40 UTC (rev 47)
@@ -0,0 +1,146 @@
+-- MySQL dump 10.11
+--
+-- Host: terra Database: phoneorder
+-- ------------------------------------------------------
+-- Server version 5.0.26
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `cities`
+--
+
+DROP TABLE IF EXISTS `cities`;
+CREATE TABLE `cities` (
+ `cityid` int(11) NOT NULL auto_increment,
+ `city` varchar(50) NOT NULL,
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`cityid`)
+) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='Cities Table';
+
+--
+-- Table structure for table `customers`
+--
+
+DROP TABLE IF EXISTS `customers`;
+CREATE TABLE `customers` (
+ `custid` int(11) NOT NULL auto_increment,
+ `name` varchar(100) NOT NULL,
+ `locid` int(11) NOT NULL default '0',
+ `number` varchar(10) default NULL,
+ `comments` text NOT NULL,
+ `phone` varchar(100) NOT NULL,
+ `custnum` varchar(8) NOT NULL,
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`custid`)
+) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='Customer Data';
+
+--
+-- Table structure for table `dishes`
+--
+
+DROP TABLE IF EXISTS `dishes`;
+CREATE TABLE `dishes` (
+ `dishid` int(11) NOT NULL auto_increment,
+ `dishnum` varchar(5) NOT NULL,
+ `dish` varchar(100) NOT NULL,
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`dishid`)
+) ENGINE=MyISAM AUTO_INCREMENT=126 DEFAULT CHARSET=utf8 COMMENT='Dish Names Table';
+
+--
+-- Table structure for table `dishprices`
+--
+
+DROP TABLE IF EXISTS `dishprices`;
+CREATE TABLE `dishprices` (
+ `dpid` int(11) NOT NULL auto_increment,
+ `dishid` int(11) NOT NULL default '0',
+ `groupid` int(11) NOT NULL default '0',
+ `price` float(6,2) NOT NULL default '0.00',
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`dpid`),
+ UNIQUE KEY `size` (`dishid`,`groupid`)
+) ENGINE=MyISAM AUTO_INCREMENT=262 DEFAULT CHARSET=utf8 COMMENT='Dish Prices Table';
+
+--
+-- Table structure for table `groups`
+--
+
+DROP TABLE IF EXISTS `groups`;
+CREATE TABLE `groups` (
+ `groupid` int(11) NOT NULL auto_increment,
+ `group` varchar(40) NOT NULL,
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`groupid`)
+) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='Dish Groups Table';
+
+--
+-- Table structure for table `ingprices`
+--
+
+DROP TABLE IF EXISTS `ingprices`;
+CREATE TABLE `ingprices` (
+ `ipid` int(11) NOT NULL auto_increment,
+ `groupid` int(11) NOT NULL default '0',
+ `ingid` int(11) NOT NULL default '0',
+ `price` float(6,2) NOT NULL default '0.00',
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`ipid`),
+ UNIQUE KEY `amount` (`groupid`,`ingid`)
+) ENGINE=MyISAM AUTO_INCREMENT=179 DEFAULT CHARSET=utf8 COMMENT='Ingredient Prices Table';
+
+--
+-- Table structure for table `ingredients`
+--
+
+DROP TABLE IF EXISTS `ingredients`;
+CREATE TABLE `ingredients` (
+ `ingid` int(11) NOT NULL auto_increment,
+ `ingnum` varchar(5) NOT NULL,
+ `ingredient` varchar(50) NOT NULL,
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`ingid`)
+) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COMMENT='Ingredient Names Table';
+
+--
+-- Table structure for table `locations`
+--
+
+DROP TABLE IF EXISTS `locations`;
+CREATE TABLE `locations` (
+ `locid` int(11) NOT NULL auto_increment,
+ `cityid` int(11) NOT NULL default '0',
+ `street` varchar(100) NOT NULL,
+ `distance` int(11) default '0',
+ `mdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `cdate` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`locid`)
+) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='Locations Table';
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2007-08-04 17:47:11
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2007-02-27 21:40:06
|
Revision: 46
http://svn.sourceforge.net/phoneorder/?rev=46&view=rev
Author: hurikhan
Date: 2007-02-27 13:39:56 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
Qmake .pro files changes/corrected
Modified Paths:
--------------
trunk/phoneorder.pro
trunk/src/mainform.ui.h
trunk/src/src.pro
Modified: trunk/phoneorder.pro
===================================================================
--- trunk/phoneorder.pro 2006-05-20 04:06:06 UTC (rev 45)
+++ trunk/phoneorder.pro 2007-02-27 21:39:56 UTC (rev 46)
@@ -1,11 +1,11 @@
# Diese Datei wurde mit dem qmake-Manager von KDevelop erstellt.
# -------------------------------------------
-# Unterverzeichnis relativ zum Projektverzeichnis: .
-# Das Target ist Projekt im Unterverzeichnis
+# Unterordner relativ zum Projektordner: .
+# Das Target ist Projekt im Unterordner
-SUBDIRS += src
-TEMPLATE = subdirs
CONFIG += debug \
warn_on \
qt \
thread
+TEMPLATE = subdirs
+SUBDIRS += src
Modified: trunk/src/mainform.ui.h
===================================================================
--- trunk/src/mainform.ui.h 2006-05-20 04:06:06 UTC (rev 45)
+++ trunk/src/mainform.ui.h 2007-02-27 21:39:56 UTC (rev 46)
@@ -58,5 +58,5 @@
void MainForm::createPreparedOrder (QString)
{
- //TODO: NewOrderWidget anhand der Telefonnummer ausfüllen
+ //TODO NewOrderWidget anhand der Telefonnummer ausfüllen
}
Modified: trunk/src/src.pro
===================================================================
--- trunk/src/src.pro 2006-05-20 04:06:06 UTC (rev 45)
+++ trunk/src/src.pro 2007-02-27 21:39:56 UTC (rev 46)
@@ -1,8 +1,16 @@
# Diese Datei wurde mit dem qmake-Manager von KDevelop erstellt.
# -------------------------------------------
-# Unterverzeichnis relativ zum Projektverzeichnis: ./src
+# Unterordner relativ zum Projektordner: ./src
# Das Target ist eine Anwendung: ../bin/phoneorder
+LANGUAGE = C++
+DBFILE = src.db
+TARGET = ../bin/phoneorder
+CONFIG += debug \
+ warn_on \
+ qt \
+ thread
+TEMPLATE = app
FORMS += mainform.ui \
orderwidget.ui \
customereditor.ui \
@@ -25,13 +33,3 @@
po_fullcustomereditor.cpp \
po_priceseditor.cpp \
po_locationseditor.cpp
-LANGUAGE = C++
-DBFILE = src.db
-TEMPLATE = app
-customereditor.ui.target = customereditor.ui
-customereditor.ui.commands = $$IDL_COMPILER $$IDL_OPTIONS $$customereditor.ui.target
-CONFIG += debug \
-warn_on \
-qt \
-thread
-TARGET = ../bin/phoneorder
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hur...@us...> - 2006-05-20 04:06:23
|
Revision: 45 Author: hurikhan Date: 2006-05-19 21:06:06 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/phoneorder/?rev=45&view=rev Log Message: ----------- - Finishing touch for FS#49 (Invoice Numbers) - Minor print layout fixes Modified Paths: -------------- trunk/src/main.cpp trunk/src/orderwidget.ui.h Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-05-13 15:12:50 UTC (rev 44) +++ trunk/src/main.cpp 2006-05-20 04:06:06 UTC (rev 45) @@ -74,7 +74,7 @@ mw->createNewOrder (); mw->printer = new QPrinter (); - mw->printer->setPageSize (QPrinter::A4); // FS#46 + mw->printer->setPageSize (QPrinter::A5); // FS#46 mw->printer->setNumCopies (2); mw->printer->setup (mw); Modified: trunk/src/orderwidget.ui.h =================================================================== --- trunk/src/orderwidget.ui.h 2006-05-13 15:12:50 UTC (rev 44) +++ trunk/src/orderwidget.ui.h 2006-05-20 04:06:06 UTC (rev 45) @@ -684,6 +684,7 @@ QRect body (lmargin, tmargin, metrics.width () - (lmargin + rmargin), metrics.height () - (tmargin + bmargin)); QString document = QString ( "<table width='100%' cellpadding='0' cellspacing='0'>" + "<tr><td colspan='3'><font size='-2'>Kd-Nr</font></td></tr>" "<tr>" "<td rowspan='2' valign='top'>" "<font size='+3'><%custnum%> <%name%></font><br>" @@ -702,7 +703,7 @@ "<font size='+2'><%companyname%></font><br>" "<%companystreet%><br>" "<%companycity%><br>" - "<font size='-2'>Telefon: <%companyphone%><br>Telefax: <%companyfax%></font>" + "<font size='-1'>Telefon: <%companyphone%><br>Telefax: <%companyfax%></font>" "</nobr>" "</td>" "</tr>" @@ -713,7 +714,7 @@ "<td colspan='2' align='right' valign='bottom'>" // FS#29 "<font size='+3'>Rechnung</font><br>" "<nobr><%invoicenumber%></nobr><br>" // FS#49 - "<nobr><%date%></nobr>" + "<nobr><b><%date%></b></nobr>" "</td>" "</tr>" "<tr><td colspan='3'><hr></td></tr>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <hur...@us...> - 2006-05-13 16:23:47
|
Revision: 44 Author: hurikhan Date: 2006-05-13 08:12:50 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/phoneorder/?rev=44&view=rev Log Message: ----------- Implemented FS#49: Invoice Numbers Modified Paths: -------------- trunk/src/orderwidget.ui.h Modified: trunk/src/orderwidget.ui.h =================================================================== --- trunk/src/orderwidget.ui.h 2006-03-18 00:36:59 UTC (rev 43) +++ trunk/src/orderwidget.ui.h 2006-05-13 15:12:50 UTC (rev 44) @@ -17,6 +17,7 @@ #include <qpaintdevicemetrics.h> #include <qsimplerichtext.h> #include <qsettings.h> +#include <qdatetime.h> #include "mainform.h" @@ -645,6 +646,23 @@ double marginTop = settings.readDoubleEntry ("/PrintMarginTop", marginSize); double marginBottom = settings.readDoubleEntry ("/PrintMarginBottom", marginSize); + QString day = QDate::currentDate ().toString ("yyyyMMdd"); // FS#49 + int number = 0; + QSqlQuery query = QSqlQuery (QString ("SELECT MAX(number) FROM invoices WHERE day = '%1'") .arg (day)); + if (query.first ()) + { + qDebug ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ()); + number = query.value (0).toInt (); + } + number += 1; + query = QSqlQuery (QString ("REPLACE INTO invoices SET number = '%1', day = '%2'") .arg (number) .arg (day)); + if (query.isActive ()) + qDebug ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ()); + else + qFatal ("QSqlQuery( \"%s\" )", query.executedQuery ().ascii ()); + QString invoiceNumber; + invoiceNumber.sprintf ("RN%8s-%04d", day.ascii (), number); + int fontSize = settings.readNumEntry ("/FontSize", 10); settings.endGroup (); @@ -668,8 +686,8 @@ "<table width='100%' cellpadding='0' cellspacing='0'>" "<tr>" "<td rowspan='2' valign='top'>" + "<font size='+3'><%custnum%> <%name%></font><br>" "<nobr>" - "<font size='+3'><%custnum%> <%name%></font><br>" "<font size='+2'><%street%><br><%city%><br></font>" "Telefon: <%phone%>" "</nobr>" @@ -694,6 +712,7 @@ "<tr>" "<td colspan='2' align='right' valign='bottom'>" // FS#29 "<font size='+3'>Rechnung</font><br>" + "<nobr><%invoicenumber%></nobr><br>" // FS#49 "<nobr><%date%></nobr>" "</td>" "</tr>" @@ -712,6 +731,7 @@ document.replace ("<%companycity%>", companyCity); document.replace ("<%companyphone%>", companyPhone); document.replace ("<%companyfax%>", companyFax); + document.replace ("<%invoicenumber%>", invoiceNumber); // FS#49 if (custNotes->text ().isEmpty ()) document.replace ("<%notes%>", QString::null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |