OSSP CVS Repository

ossp - Check-in [4041]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4041
Date: 2003-Feb-14 18:31:54 (local)
2003-Feb-14 17:31:54 (UTC)
User:ms
Branch:
Comment: Moved preference data application from panel items to own method, added applyPrefs logic, and a new proxy method to handle applied signals, and reorganized file incusion in throughout to loosen source file coupling.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.86 -> 1.87     2 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.105 -> 1.106     5 inserted, 0 deleted
ossp-pkg/as/as-gui/as_dataop.cpp      1.47 -> 1.48     2 inserted, 0 deleted
ossp-pkg/as/as-gui/as_gui.cpp      1.39 -> 1.40     3 inserted, 0 deleted
ossp-pkg/as/as-gui/as_gui.h      1.73 -> 1.74     9 inserted, 5 deleted
ossp-pkg/as/as-gui/as_panel.cpp      1.7 -> 1.8     5 inserted, 14 deleted
ossp-pkg/as/as-gui/as_panel.h      1.7 -> 1.8     3 inserted, 1 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.124 -> 1.125     68 inserted, 46 deleted
ossp-pkg/as/as-gui/as_table.cpp      1.20 -> 1.21     2 inserted, 0 deleted

ossp-pkg/as/as-gui/TODO 1.86 -> 1.87

--- TODO 2003/02/13 18:22:32     1.86
+++ TODO 2003/02/14 17:31:54     1.87
@@ -39,6 +39,8 @@
 Check for outdated config file version
 Make status bar message, qWarning, qDebug, and Popup messages consistent
   For which purposes do messages go in each category?
+Label methods and parameters throughout as const ... const, use &
+Yank out all #include from headers, replace with class ...; protos
 
 Bugs (? = unverified)
 ---------------------


ossp-pkg/as/as-gui/as_assist.cpp 1.105 -> 1.106

--- as_assist.cpp        2003/02/14 09:18:25     1.105
+++ as_assist.cpp        2003/02/14 17:31:54     1.106
@@ -50,6 +50,11 @@
 #include "as_gui.h"             // Main classes
 #include "as_amount.h"          // AmountBox class
 #include "as_user.h"            // User class
+#include "as_const.h"           // Application constants
+#include "as_table.h"           // Class TiTable
+#include "as_pref.h"            // Class Preferences
+#include "as_panel.h"           // Class Prefpanel
+#include "as_datedit.h"         // Class Daydateedit
 
 // Icon pixel maps
 #include "as_gfx/filenew.xpm"   // static const char *s_kpcFilenew_xpm[]


ossp-pkg/as/as-gui/as_dataop.cpp 1.47 -> 1.48

--- as_dataop.cpp        2003/02/11 22:17:17     1.47
+++ as_dataop.cpp        2003/02/14 17:31:54     1.48
@@ -40,9 +40,11 @@
 
 // User interface
 #include "as_gui.h"             // Main classes
+#include "as_const.h"           // Application constants
 #include "as_tableitem.h"       // For class RtTableItem
 #include "as_crc.h"             // For quality strings
 #include "as_uuid.h"            // UUID classes
+#include "as_table.h"           // TiTable class
 
 // Icon pixel maps
 #include "as_gfx/statok.xpm"    // static const char *s_kpcStatokay_xpm[]


ossp-pkg/as/as-gui/as_gui.cpp 1.39 -> 1.40

--- as_gui.cpp   2003/02/04 19:30:31     1.39
+++ as_gui.cpp   2003/02/14 17:31:54     1.40
@@ -32,6 +32,9 @@
 // User interface
 #include "as_gui.h"     // Main classes
 #include "as_except.h"  // Exception classes
+#include "as_table.h"   // Class TiTable
+#include "as_const.h"   // Application constants
+#include "as_pref.h"    // Class Preferences
 
 
 //


ossp-pkg/as/as-gui/as_gui.h 1.73 -> 1.74

--- as_gui.h     2003/02/13 19:49:02     1.73
+++ as_gui.h     2003/02/14 17:31:54     1.74
@@ -53,17 +53,19 @@
 #endif
 
 #include "as_except.h"  // Exception classes
-#include "as_const.h"   // For general constants
-#include "as_pref.h"    // For class Preferences
-#include "as_amount.h"  // For class AmountBox
-#include "as_table.h"   // For class TiTable
-#include "as_datedit.h" // For class Daydatedit
 
 // Version information
 #define _AS_VERSION_CPP_AS_HEADER_
 #include "as_version.cpp"
 #undef  _AS_VERSION_CPP_AS_HEADER_
 
+// Method prototypes
+// class AmountBox; // Warning: Might be replaced with QTimeEdit
+class Daydatedit;
+class TiTable;
+class Preferences;
+class Prefpanel;
+
 // Intentional no operation
 #define TITRAQ_NOP ((void)0)
 
@@ -290,6 +292,8 @@
     void showRemarkcol(void);           // View menu show Remarks column
     void genReport(void);               // Generate a local formatted report
     void savePrefs(void);               // Save user preferences
+    void applyPrefs(void);              // Apply preferences from applied()
+    void applyPrefs(Prefpanel *);       // Apply preferences from accept()
 
 protected:
     // Application main events


ossp-pkg/as/as-gui/as_panel.cpp 1.7 -> 1.8

--- as_panel.cpp 2003/02/13 22:05:30     1.7
+++ as_panel.cpp 2003/02/14 17:31:55     1.8
@@ -208,11 +208,11 @@
     m_pVlayout->addLayout(m_pButtlay);
 
     // Connect our signals to slots, accept() and reject() are Qt implicit
-    connect(m_pOkaybutton, SIGNAL(clicked()), this, SLOT(accept()));
-    connect(m_pApplybutton, SIGNAL(clicked()), this, SLOT(apply()));
-    connect(m_pCancelbutton, SIGNAL(clicked()), this, SLOT(reject()));
-    connect(m_pCorbacheck, SIGNAL(toggled(bool)), this, SLOT(enableCorba(bool)));
-    connect(m_pSoapcheck, SIGNAL(toggled(bool)), this, SLOT(enableSoap(bool)));
+    connect(m_pOkaybutton, SIGNAL(clicked(void)), SLOT(accept(void)));
+    connect(m_pApplybutton, SIGNAL(clicked(void)), SIGNAL(applied(void)));
+    connect(m_pCancelbutton, SIGNAL(clicked(void)), SLOT(reject(void)));
+    connect(m_pCorbacheck, SIGNAL(toggled(bool)), SLOT(enableCorba(bool)));
+    connect(m_pSoapcheck, SIGNAL(toggled(bool)), SLOT(enableSoap(bool)));
     this->textChange();
     this->resize(QSize(400, 264).expandedTo(minimumSizeHint()));
 }
@@ -272,12 +272,3 @@
 //    QToolTip::add(m_pSwitchgroup, tr("Tooltip for Switchbox", "Comment for toolTip Switchbox"));
 //    QWhatsThis::add(m_pSwitchgroup, tr("Whatsthis for Switchbutton", "Comment for whatsThis Switchbox"));
 }
-
-//
-// Applies changes user selected from this class
-//
-void Prefpanel::apply(void)
-{
-    Prototype Unimp;
-    Unimp.doMbox();
-}


ossp-pkg/as/as-gui/as_panel.h 1.7 -> 1.8

--- as_panel.h   2003/02/13 18:22:32     1.7
+++ as_panel.h   2003/02/14 17:31:55     1.8
@@ -128,9 +128,11 @@
 
 protected slots:
     virtual void textChange(void);
-    void apply(void);
     void enableCorba(bool bOn) {m_pCorbaline->setEnabled(bOn);};
     void enableSoap(bool bOn) {m_pSoapline->setEnabled(bOn);};
+
+signals:
+    void applied(void);
 };
 
 #endif // PREFPANEL_H


ossp-pkg/as/as-gui/as_slot.cpp 1.124 -> 1.125

--- as_slot.cpp  2003/02/14 09:18:25     1.124
+++ as_slot.cpp  2003/02/14 17:31:55     1.125
@@ -50,14 +50,17 @@
 
 // User interface
 #include "as_gui.h"             // Main classes
+#include "as_const.h"           // Application constants
 #include "as_except.h"          // Exception classes
 #include "as_tableitem.h"       // For our custom table items
 #include "as_generic.h"         // Generic classes
 #include "as_uuid.h"            // UUID classes
 #include "as_datedit.h"         // Derived from QDateEdit
 #include "as_crc.h"             // Useful Qualistring class
+#include "as_pref.h"            // For Preferences class
 #include "as_panel.h"           // For Prefpanel class
 #include "as_sfile.h"           // For Simplefile class
+#include "as_table.h"           // For TiTable class
 
 // RPC headers
 #ifdef HAVE_ESOAP
@@ -1123,6 +1126,7 @@
 
     // Create a new preferences panel window
     pUserpanel = new Prefpanel(this, "Userprefpanel");
+    connect(pUserpanel, SIGNAL(applied(void)), SLOT(applyPrefs(void)));
 
     // Set default values to appear in initialized panel widgets
     pUserpanel->setAccounts(m_pPrefs->getString(TITRAQ_PREFACCOUNTS, TITRAQ_DEFACCOUNTS));
@@ -1172,53 +1176,10 @@
     }
 
     // Modal panel handler
-    if (pUserpanel->exec() == QDialog::Accepted) {
-        m_pPrefs->setString(TITRAQ_PREFACCOUNTS, pUserpanel->getAccounts());
-        m_pPrefs->setString(TITRAQ_PREFASDIR, pUserpanel->getEvents());
-        m_pPrefs->setString(TITRAQ_PREFUSER, pUserpanel->getUser());
-        m_pPrefs->setString(TITRAQ_PREFHOME, pUserpanel->getHome());
-        m_pPrefs->setString(TITRAQ_PREFCORBHOST, pUserpanel->getCorbahost());
-        m_pPrefs->setString(TITRAQ_PREFSOAPHOST, pUserpanel->getSoaphost());
-        m_pPrefs->setBool(TITRAQ_PREFCORBON, pUserpanel->getCorbaon());
-        m_pPrefs->setBool(TITRAQ_PREFSOAPON, pUserpanel->getSoapon());
-        m_pPrefs->setBool(TITRAQ_PREFBAKON, pUserpanel->getBackon());
-        m_pPrefs->setBool(TITRAQ_PREFEXTENDON, pUserpanel->getExtendon());
-
-        // Dim the lights if no RPC transports are available
-        if (this->isOpen())
-            m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON)
-                | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON));
-        else
-            m_pSyncact->setEnabled(false);
+    if (pUserpanel->exec() == QDialog::Accepted)
+        this->applyPrefs(pUserpanel);
 
-        // Get the selected style which can be more complicated due to mapping...
-        if (pUserpanel->getStyle() == TITRAQ_STRCDE) {
-            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
-            qApp->setStyle(new QCDEStyle);
-        }
-        else if (pUserpanel->getStyle() == TITRAQ_STRSGI) {
-            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLESGI);
-            qApp->setStyle(new QSGIStyle);
-        }
-        else if (pUserpanel->getStyle() == TITRAQ_STRMOTIF) {
-            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMOTIF);
-            qApp->setStyle(new QMotifStyle);
-        }
-        else if (pUserpanel->getStyle() == TITRAQ_STRMPLUS) {
-            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMPLUS);
-            qApp->setStyle(new QMotifPlusStyle);
-        }
-        else if (pUserpanel->getStyle() == TITRAQ_STRPLAT) {
-            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEPLAT);
-            qApp->setStyle(new QPlatinumStyle);
-        }
-        else if (pUserpanel->getStyle() == TITRAQ_STRMSOFT) {
-            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMSOFT);
-            qApp->setStyle(new QWindowsStyle);
-        }
-        else // My personal favourite ;-)
-            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
-    }
+    // Dispose Panel object
     delete pUserpanel;
 }
 
@@ -1890,3 +1851,64 @@
 {
     QMessageBox::aboutQt(this, QString(TITRAQ_APPTITLE) + ' ' + asgui_version.v_short);
 }
+
+//
+// Apply preference values from a signal emitting object
+//
+void Titraqform::applyPrefs(void)
+{
+    Prefpanel *pPan = (Prefpanel *)QObject::sender();
+    this->applyPrefs(pPan);
+}
+
+//
+// Accept preference values from a inbound Panel object
+//
+void Titraqform::applyPrefs(Prefpanel *pPrefpanel)
+{
+    m_pPrefs->setString(TITRAQ_PREFACCOUNTS, pPrefpanel->getAccounts());
+    m_pPrefs->setString(TITRAQ_PREFASDIR, pPrefpanel->getEvents());
+    m_pPrefs->setString(TITRAQ_PREFUSER, pPrefpanel->getUser());
+    m_pPrefs->setString(TITRAQ_PREFHOME, pPrefpanel->getHome());
+    m_pPrefs->setString(TITRAQ_PREFCORBHOST, pPrefpanel->getCorbahost());
+    m_pPrefs->setString(TITRAQ_PREFSOAPHOST, pPrefpanel->getSoaphost());
+    m_pPrefs->setBool(TITRAQ_PREFCORBON, pPrefpanel->getCorbaon());
+    m_pPrefs->setBool(TITRAQ_PREFSOAPON, pPrefpanel->getSoapon());
+    m_pPrefs->setBool(TITRAQ_PREFBAKON, pPrefpanel->getBackon());
+    m_pPrefs->setBool(TITRAQ_PREFEXTENDON, pPrefpanel->getExtendon());
+
+    // Dim the lights if no RPC transports are available
+    if (this->isOpen())
+        m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON)
+            | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON));
+    else
+        m_pSyncact->setEnabled(false);
+
+    // Get the selected style which can be more complicated due to mapping...
+    if (pPrefpanel->getStyle() == TITRAQ_STRCDE) {
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
+        qApp->setStyle(new QCDEStyle);
+    }
+    else if (pPrefpanel->getStyle() == TITRAQ_STRSGI) {
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLESGI);
+        qApp->setStyle(new QSGIStyle);
+    }
+    else if (pPrefpanel->getStyle() == TITRAQ_STRMOTIF) {
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMOTIF);
+        qApp->setStyle(new QMotifStyle);
+    }
+    else if (pPrefpanel->getStyle() == TITRAQ_STRMPLUS) {
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMPLUS);
+        qApp->setStyle(new QMotifPlusStyle);
+    }
+    else if (pPrefpanel->getStyle() == TITRAQ_STRPLAT) {
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEPLAT);
+        qApp->setStyle(new QPlatinumStyle);
+    }
+    else if (pPrefpanel->getStyle() == TITRAQ_STRMSOFT) {
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMSOFT);
+        qApp->setStyle(new QWindowsStyle);
+    }
+    else // My personal favourite ;-)
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
+}


ossp-pkg/as/as-gui/as_table.cpp 1.20 -> 1.21

--- as_table.cpp 2002/12/20 18:19:12     1.20
+++ as_table.cpp 2003/02/14 17:31:55     1.21
@@ -32,6 +32,8 @@
 #include <qheader.h>
 
 #include "as_gui.h"
+#include "as_const.h"
+#include "as_table.h"
 
 
 // Implements an event filter for catching header double click events

CVSTrac 2.0.1