aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Gu <gyagp0@gmail.com>2010-10-01 01:52:24 +0800
committerDenis Kenzior <denkenz@gmail.com>2010-10-13 09:42:04 -0500
commit8c6924dcf1f27405a9df46eaa0e23873257ba8fd (patch)
tree1ceb55753f386ee294f645fd5ecaad7c2036038b
parent941ed7e5782162fd841e0b59e70d76ddf2a11dc9 (diff)
downloadphonesim-8c6924dcf1f27405a9df46eaa0e23873257ba8fd.tar.gz
Move def of class ControlWidget to header file
Currently any modification on control.cpp will result in some unrelated obj to be regenerated, because the definition of class ControlWidget is in this .cpp file. This patch wants to fix this problem.
-rw-r--r--Makefile.am5
-rw-r--r--src/control.cpp69
-rw-r--r--src/control.h70
3 files changed, 70 insertions, 74 deletions
diff --git a/Makefile.am b/Makefile.am
index 34198a5..f124b08 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -53,15 +53,12 @@ MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure depcomp missing install-sh
-$(src_phonesim_OBJECTS): src/control.moc src/ui_controlbase.h
+$(src_phonesim_OBJECTS): src/ui_controlbase.h
QT_V_MOC = $(QT_V_MOC_$(V))
QT_V_MOC_ = $(QT_V_MOC_$(AM_DEFAULT_VERBOSITY))
QT_V_MOC_0 = @echo " MOC " $@;
-src/control.moc: src/control.cpp
- $(QT_V_MOC)$(MOC) $(QT_CFLAGS) $(INCLUDES) $< -o $@
-
src/moc_%.cpp: src/%.h
$(QT_V_MOC)$(MOC) $< -o $@
diff --git a/src/control.cpp b/src/control.cpp
index 34a228f..458ee43 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -18,7 +18,6 @@
****************************************************************************/
#include "control.h"
-#include "ui_controlbase.h"
#include <qpushbutton.h>
#include <qslider.h>
#include <qcheckbox.h>
@@ -33,7 +32,6 @@
#include <QFile>
#include <QDir>
#include <QtGui/QHeaderView>
-#include "attranslator.h"
#define TWO_BYTE_MAX 65535
#define FOUR_CHAR 4
@@ -41,73 +39,6 @@
#define EIGHT_CHAR 8
#define HEX_BASE 16
-class ControlWidget : public QWidget
-{
-Q_OBJECT
-public:
- ControlWidget( const QString&, Control*);
-
- void handleFromData( const QString& );
- void handleToData( const QString& );
- void handleNewApp();
-
-private slots:
- void sendSQ();
- void sendBC();
- void chargingChanged(int state);
- void sendOPS();
- void sendREG();
- void sendCBM();
- void sendSMSMessage();
- void sendMGD();
- void selectFile();
- void sendSMSDatagram();
- void sendCall();
- void atChanged();
- void resetTranslator();
- void addVoicemail();
- void delVoicemail();
- void sendVMNotify( int type = 0 );
- void sendEVMNotify();
- void sendUSSD();
- void cancelUSSD();
- void simInsertRemove();
- void simAppStart();
- void simAppAbort();
-
-signals:
- void unsolicitedCommand(const QString &);
- void command(const QString &);
- void variableChanged(const QString &, const QString &);
- void switchTo(const QString &);
- void startIncomingCall(const QString &);
-
-protected:
- void closeEvent(QCloseEvent *event);
-
-private:
- Ui_ControlBase *ui;
- Control *p;
- AtTranslator *translator;
-
- class VoicemailItem {
- public:
- VoicemailItem( const QString &sender, bool urgent );
-
- QTableWidgetItem sender;
- QTableWidgetItem priority;
- QTableWidgetItem pending;
-
- bool notifyReceived;
- bool notifyDeleted;
- int id;
-
- static int nextId;
- };
- QList<VoicemailItem> mailbox;
-};
-#include "control.moc"
-
ControlWidget::ControlWidget(const QString &ruleFile, Control *parent)
: QWidget(), p(parent)
{
diff --git a/src/control.h b/src/control.h
index 32db57e..3577e8d 100644
--- a/src/control.h
+++ b/src/control.h
@@ -21,8 +21,76 @@
#define CONTROL_H
#include <hardwaremanipulator.h>
+#include "ui_controlbase.h"
+#include "attranslator.h"
-class ControlWidget;
+class Control;
+
+class ControlWidget : public QWidget
+{
+Q_OBJECT
+public:
+ ControlWidget( const QString&, Control*);
+
+ void handleFromData( const QString& );
+ void handleToData( const QString& );
+ void handleNewApp();
+
+private slots:
+ void sendSQ();
+ void sendBC();
+ void chargingChanged(int state);
+ void sendOPS();
+ void sendREG();
+ void sendCBM();
+ void sendSMSMessage();
+ void sendMGD();
+ void selectFile();
+ void sendSMSDatagram();
+ void sendCall();
+ void atChanged();
+ void resetTranslator();
+ void addVoicemail();
+ void delVoicemail();
+ void sendVMNotify( int type = 0 );
+ void sendEVMNotify();
+ void sendUSSD();
+ void cancelUSSD();
+ void simInsertRemove();
+ void simAppStart();
+ void simAppAbort();
+
+signals:
+ void unsolicitedCommand(const QString &);
+ void command(const QString &);
+ void variableChanged(const QString &, const QString &);
+ void switchTo(const QString &);
+ void startIncomingCall(const QString &);
+
+protected:
+ void closeEvent(QCloseEvent *event);
+
+private:
+ Ui_ControlBase *ui;
+ Control *p;
+ AtTranslator *translator;
+
+ class VoicemailItem {
+ public:
+ VoicemailItem( const QString &sender, bool urgent );
+
+ QTableWidgetItem sender;
+ QTableWidgetItem priority;
+ QTableWidgetItem pending;
+
+ bool notifyReceived;
+ bool notifyDeleted;
+ int id;
+
+ static int nextId;
+ };
+ QList<VoicemailItem> mailbox;
+};
class Control: public HardwareManipulator
{