move tr() dummy into PACK
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 15 May 2010 08:39:55 +0000 (08:39 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 15 May 2010 08:39:55 +0000 (08:39 +0000)
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
src/misc/waitcursor.cpp [new file with mode: 0644]
src/misc/waitcursor.h [new file with mode: 0644]
src/wext/MTransaction.cpp [new file with mode: 0644]
src/wext/MTransaction.h [new file with mode: 0644]
src/wext/wext.pri
wob/magicsmoke.wolf
www/inc/loader.php
www/inc/tr.php [deleted file]

index 1be2fbf..d4fb061 100644 (file)
@@ -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 (file)
index 0000000..09959b8
--- /dev/null
@@ -0,0 +1,26 @@
+//
+// C++ Implementation: waitcursor
+//
+// Description: 
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2009
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include "waitcursor.h"
+
+#include <QApplication>
+#include <QCursor>
+
+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 (file)
index 0000000..fa69615
--- /dev/null
@@ -0,0 +1,27 @@
+//
+// C++ Interface: waitcursor
+//
+// Description: 
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (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 (file)
index 0000000..482abd2
--- /dev/null
@@ -0,0 +1,26 @@
+//
+// C++ Implementation: MTransaction
+//
+// Description: 
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (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 (file)
index 0000000..c90705c
--- /dev/null
@@ -0,0 +1,30 @@
+//
+// C++ Interface: MTransaction
+//
+// Description: 
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (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
index 0e85fd6..910210d 100644 (file)
@@ -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
index 618c3bb..e14b455 100644 (file)
@@ -27,7 +27,7 @@
        </DataBase>
        
        <!-- configure output -->
-       <QtClientOutput sourceDir="src" subDir="wob" priInclude="wob.pri" classPrefix="M" clean="yes"/>
+       <QtClientOutput sourceDir="src" subDir="wob" priInclude="wob.pri" classPrefix="M" clean="yes" transactionBase="MTransaction"/>
        <PHPServerOutput sourceDir="www" subDir="inc/wob" extension=".php" clean="yes" transactionBase="MSmokeTransaction">
        </PHPServerOutput>
        <HtmlOutput sourceDir="doc" subDir="wob" clean="yes"/>
index 8ff61af..9fd54ad 100644 (file)
@@ -1,6 +1,6 @@
 <?
 //load the linguist dummies, since we use them quite often
-include_once("inc/tr.php");
+include_once("inc/wbase/tr.php");
 //load WOB data
 include('./inc/wbase/autoload.php');
 include('./inc/wob/autoload.php');
diff --git a/www/inc/tr.php b/www/inc/tr.php
deleted file mode 100644 (file)
index 92dbaf7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?
-//
-// PHP Implementation: tr
-//
-// Description: dummy implementation for Qt's tr and transalate to make the PHP code
-//  compatible with linguist
-//
-// Author: Konrad Rosenbaum <konrad@silmor.de>, (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: & -> &amp;, < -> &lt; etc.pp.*/
-function xq($str){return htmlspecialchars($str,ENT_NOQUOTES,"UTF-8");}
-
-?>
\ No newline at end of file