From 2e078b6120f4f283258d794dd39bb38155b87407 Mon Sep 17 00:00:00 2001
From: jpbl <jpbl>
Date: Wed, 21 Sep 2005 17:32:05 +0000
Subject: [PATCH] *** empty log message ***

---
 src/gui/official/JPushButton.cpp               | 18 +++++++-----------
 src/gui/official/JPushButton.hpp               |  4 +++-
 src/gui/official/SFLPhoneWindow.cpp            |  8 ++++++--
 src/gui/official/SFLPhoneWindow.hpp            |  1 +
 src/gui/official/globals.h                     |  8 ++++++++
 .../official/{official.pro => sflphone.pro}    |  4 ++--
 6 files changed, 27 insertions(+), 16 deletions(-)
 create mode 100644 src/gui/official/globals.h
 rename src/gui/official/{official.pro => sflphone.pro} (88%)

diff --git a/src/gui/official/JPushButton.cpp b/src/gui/official/JPushButton.cpp
index 511cea7d56..1377aa1dac 100644
--- a/src/gui/official/JPushButton.cpp
+++ b/src/gui/official/JPushButton.cpp
@@ -23,7 +23,6 @@
 
 #include <QEvent>
 #include <QMouseEvent>
-#include <QPixmap>
 
 #include "JPushButton.hpp"
 
@@ -33,29 +32,26 @@ JPushButton::JPushButton(const QPixmap &released,
 			 Qt::WFlags flags)
   : QLabel(parent, flags) 
 {
-  mImages[0] = new QPixmap(released);
-  mImages[1] = new QPixmap(pressed);
+  mImages[0] = released;
+  mImages[1] = pressed;
   release();
 }
 
 JPushButton::~JPushButton()
-{
-  delete mImages[0];
-  delete mImages[1];
-}
+{}
 
 void
 JPushButton::release() 
 {
-  resize(mImages[0]->size());
-  setPixmap (*mImages[0]);
+  resize(mImages[0].size());
+  setPixmap (mImages[0]);
 }
 
 void
 JPushButton::press() 
 {
-  resize(mImages[1]->size());
-  setPixmap (*mImages[1]);
+  resize(mImages[1].size());
+  setPixmap (mImages[1]);
 }
 
 // Mouse button released
diff --git a/src/gui/official/JPushButton.hpp b/src/gui/official/JPushButton.hpp
index 7c09ede48c..72bef609d6 100644
--- a/src/gui/official/JPushButton.hpp
+++ b/src/gui/official/JPushButton.hpp
@@ -25,6 +25,7 @@
 #define __J_PUSH_BUTTON_H__
 
 #include <QLabel>
+#include <QPixmap>
 
 /**
  * This class Emulate a PushButton but takes two
@@ -49,7 +50,7 @@ private:
 
 
 private:
-  QPixmap* mImages[2];
+  QPixmap mImages[2];
   
 protected:
   void mousePressEvent(QMouseEvent *);
@@ -58,6 +59,7 @@ protected:
   
 signals:
   void clicked(void);
+
 };
 
 #endif	// defined(__J_PUSH_BUTTON_H__)
diff --git a/src/gui/official/SFLPhoneWindow.cpp b/src/gui/official/SFLPhoneWindow.cpp
index 86f844d615..fb3117e86f 100644
--- a/src/gui/official/SFLPhoneWindow.cpp
+++ b/src/gui/official/SFLPhoneWindow.cpp
@@ -13,8 +13,6 @@ SFLPhoneWindow::SFLPhoneWindow()
   : QMainWindow(NULL, 0)
   //	Qt::FramelessWindowHint)
 {
-  setAttribute(Qt::WA_DeleteOnClose);
-
   QLabel *l = new QLabel(this);
   QPixmap main(":/images/main-img.png");
   l->setPixmap(main);
@@ -24,6 +22,11 @@ SFLPhoneWindow::SFLPhoneWindow()
   initLineButtons();
 }
 
+SFLPhoneWindow::~SFLPhoneWindow()
+{
+  int i = 0;
+  i++;
+}
 
 void 
 SFLPhoneWindow::initLineButtons()
@@ -32,6 +35,7 @@ SFLPhoneWindow::initLineButtons()
   int ypos = 151;
   int offset = 31;
   for(int i = 0; i < NBLINES; i++) {
+    std::cout << i << std::endl;
     JPushButton *line = new JPushButton(QPixmap(QString(":/images/line") + 
 						QString::number(i + 1) + 
 						"off-img.png"),
diff --git a/src/gui/official/SFLPhoneWindow.hpp b/src/gui/official/SFLPhoneWindow.hpp
index a0ecc2b0a5..792899515a 100644
--- a/src/gui/official/SFLPhoneWindow.hpp
+++ b/src/gui/official/SFLPhoneWindow.hpp
@@ -8,6 +8,7 @@ class SFLPhoneWindow : public QMainWindow
 {
 public:
   SFLPhoneWindow();
+  ~SFLPhoneWindow();
 
   void initLineButtons();
 
diff --git a/src/gui/official/globals.h b/src/gui/official/globals.h
new file mode 100644
index 0000000000..cfd5df0448
--- /dev/null
+++ b/src/gui/official/globals.h
@@ -0,0 +1,8 @@
+#ifndef SFLPHONE_GLOBAL_H
+#define SFLPHONE_GLOBAL_H
+
+#define PROGNAME "SFLPhone"
+#define VERSION "0.4.2"
+
+
+#endif
diff --git a/src/gui/official/official.pro b/src/gui/official/sflphone.pro
similarity index 88%
rename from src/gui/official/official.pro
rename to src/gui/official/sflphone.pro
index 267d1b6038..65628f8178 100644
--- a/src/gui/official/official.pro
+++ b/src/gui/official/sflphone.pro
@@ -6,10 +6,10 @@ TEMPLATE = app
 TARGET += 
 DEPENDPATH += .
 INCLUDEPATH += .
-
 # Input
 HEADERS += JPushButton.hpp \
-           SFLPhoneWindow.hpp
+           SFLPhoneWindow.hpp \
+           globals.h
 SOURCES += main.cpp \
            JPushButton.cpp \
            SFLPhoneWindow.cpp
-- 
GitLab