From aa31d006fa0f00db2382b54447afd56a0c56dca3 Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 15 May 2010 08:39:55 +0000 Subject: [PATCH] move tr() dummy into PACK override client side transaction base class move waitcursor into MagicSmoke GUI git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@454 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/misc/misc.pri | 6 ++++-- src/misc/waitcursor.cpp | 26 ++++++++++++++++++++++++++ src/misc/waitcursor.h | 27 +++++++++++++++++++++++++++ src/wext/MTransaction.cpp | 26 ++++++++++++++++++++++++++ src/wext/MTransaction.h | 30 ++++++++++++++++++++++++++++++ src/wext/wext.pri | 6 ++++-- wob/magicsmoke.wolf | 2 +- www/inc/loader.php | 2 +- www/inc/tr.php | 25 ------------------------- 9 files changed, 119 insertions(+), 31 deletions(-) create mode 100644 src/misc/waitcursor.cpp create mode 100644 src/misc/waitcursor.h create mode 100644 src/wext/MTransaction.cpp create mode 100644 src/wext/MTransaction.h delete mode 100644 www/inc/tr.php diff --git a/src/misc/misc.pri b/src/misc/misc.pri index 1be2fbf..d4fb061 100644 --- a/src/misc/misc.pri +++ b/src/misc/misc.pri @@ -1,10 +1,12 @@ HEADERS += \ misc/debug.h \ - misc/misc.h + misc/misc.h \ + misc/waitcursor.h SOURCES += \ misc/code39.cpp \ misc/debug.cpp \ - misc/misc.cpp + misc/misc.cpp \ + misc/waitcursor.cpp INCLUDEPATH += ./misc \ No newline at end of file diff --git a/src/misc/waitcursor.cpp b/src/misc/waitcursor.cpp new file mode 100644 index 0000000..09959b8 --- /dev/null +++ b/src/misc/waitcursor.cpp @@ -0,0 +1,26 @@ +// +// C++ Implementation: waitcursor +// +// Description: +// +// +// Author: Konrad Rosenbaum , (C) 2009 +// +// Copyright: See README/COPYING files that come with this distribution +// +// + +#include "waitcursor.h" + +#include +#include + +WaitCursor::WaitCursor() +{ + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); +} + +WaitCursor::~WaitCursor() +{ + QApplication::restoreOverrideCursor(); +} diff --git a/src/misc/waitcursor.h b/src/misc/waitcursor.h new file mode 100644 index 0000000..fa69615 --- /dev/null +++ b/src/misc/waitcursor.h @@ -0,0 +1,27 @@ +// +// C++ Interface: waitcursor +// +// Description: +// +// +// Author: Konrad Rosenbaum , (C) 2009 +// +// Copyright: See README/COPYING files that come with this distribution +// +// + +#ifndef MAGICSMOKE_WAITCURSOR_H +#define MAGICSMOKE_WAITCURSOR_H + +/**simple class to show a busy-cursor while an instance of it exists*/ +class WaitCursor +{ + public: + /**displays a wait cursor (Qt::WaitCursor)*/ + WaitCursor(); + /**restores the last normal cursor*/ + ~WaitCursor(); +}; + + +#endif diff --git a/src/wext/MTransaction.cpp b/src/wext/MTransaction.cpp new file mode 100644 index 0000000..482abd2 --- /dev/null +++ b/src/wext/MTransaction.cpp @@ -0,0 +1,26 @@ +// +// C++ Implementation: MTransaction +// +// Description: +// +// +// Author: Konrad Rosenbaum , (C) 2010 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "MTransaction.h" +#include "waitcursor.h" + +QByteArray MTransaction::executeQuery(QString hreq,QByteArray data) +{ + //show the user we are waiting + WaitCursor wc; + //call parent + return WTransaction::executeQuery(hreq,data); +} + +MTransaction::MTransaction(QString iface):WTransaction(iface){} +MTransaction::MTransaction(const WTransaction&t):WTransaction(t){} +MTransaction::MTransaction(const MTransaction&t):WTransaction(t){} diff --git a/src/wext/MTransaction.h b/src/wext/MTransaction.h new file mode 100644 index 0000000..c90705c --- /dev/null +++ b/src/wext/MTransaction.h @@ -0,0 +1,30 @@ +// +// C++ Interface: MTransaction +// +// Description: +// +// +// Author: Konrad Rosenbaum , (C) 2010 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef MSMOKE_MTRANSACTION_H +#define MSMOKE_MTRANSACTION_H + +#include "WTransaction.h" + +class MTransaction:public WTransaction{ + protected: + /**internal: construct the transaction*/ + MTransaction(QString iface=QString()); + /**internal: copy the transaction*/ + MTransaction(const WTransaction&); + /**internal: copy the transaction*/ + MTransaction(const MTransaction&); + /**internal: extend executeQuery to show a wait cursor*/ + QByteArray executeQuery(QString,QByteArray); +}; + +#endif diff --git a/src/wext/wext.pri b/src/wext/wext.pri index 0e85fd6..910210d 100644 --- a/src/wext/wext.pri +++ b/src/wext/wext.pri @@ -8,7 +8,8 @@ HEADERS += \ wext/MOTicket.h \ wext/MOAddress.h \ wext/MOEvent.h \ - wext/MOCustomer.h + wext/MOCustomer.h \ + wext/MTransaction.h SOURCES += \ wext/MOCustomerInfo.cpp \ @@ -16,4 +17,5 @@ SOURCES += \ wext/MOTicket.cpp \ wext/MOAddress.cpp \ wext/MOEvent.cpp \ - wext/MOCustomer.cpp \ No newline at end of file + wext/MOCustomer.cpp \ + wext/MTransaction.cpp diff --git a/wob/magicsmoke.wolf b/wob/magicsmoke.wolf index 618c3bb..e14b455 100644 --- a/wob/magicsmoke.wolf +++ b/wob/magicsmoke.wolf @@ -27,7 +27,7 @@ - + diff --git a/www/inc/loader.php b/www/inc/loader.php index 8ff61af..9fd54ad 100644 --- a/www/inc/loader.php +++ b/www/inc/loader.php @@ -1,6 +1,6 @@ , (C) 2008 -// -// Copyright: See README/COPYING files that come with this distribution -// -// - -/** tr() assumes the context is set with a C++ class statement (won't find any here) -or with a special comment, please include / * TRANSLATOR php:: * / in all files using it */ -function tr($str,$comment=""){return $str;} - -/** translate() also takes a context*/ -function translate($context,$str,$comment=""){return $str;} - - -/**XML translation: & -> &, < -> < etc.pp.*/ -function xq($str){return htmlspecialchars($str,ENT_NOQUOTES,"UTF-8");} - -?> \ No newline at end of file -- 1.7.2.5