OSSP CVS Repository

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

Check-in Number: 4027
Date: 2003-Feb-12 20:33:05 (local)
2003-Feb-12 19:33:05 (UTC)
User:ms
Branch:
Comment: Completed working logic of preferences class Panel.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.84 -> 1.85     2 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.100 -> 1.101     8 inserted, 1 deleted
ossp-pkg/as/as-gui/as_const.h      1.49 -> 1.50     21 inserted, 1 deleted
ossp-pkg/as/as-gui/as_panel.cpp      1.4 -> 1.5     3 inserted, 1 deleted
ossp-pkg/as/as-gui/as_panel.h      1.5 -> 1.6     30 inserted, 6 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.117 -> 1.118     66 inserted, 4 deleted

ossp-pkg/as/as-gui/TODO 1.84 -> 1.85

--- TODO 2003/02/11 22:17:17     1.84
+++ TODO 2003/02/12 19:33:05     1.85
@@ -35,6 +35,8 @@
 Remove all exception raises from slot code
 New doc, new entry, change text in table, close... No verify save!
 Might not need classes Amount and Tableitem at all
+Mach mal mit den 'autobackup' und 'fextension' Optionen von prefs
+Check for outdated config file version
 
 Bugs (? = unverified)
 ---------------------


ossp-pkg/as/as-gui/as_assist.cpp 1.100 -> 1.101

--- as_assist.cpp        2003/02/12 17:47:51     1.100
+++ as_assist.cpp        2003/02/12 19:33:05     1.101
@@ -102,14 +102,21 @@
             m_pPrefs->setString(TITRAQ_PREFUSER, Username);
         else
             m_pPrefs->setString(TITRAQ_PREFUSER, TITRAQ_DEFUSER);
+
+        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
         m_pPrefs->setString(TITRAQ_PREFACCOUNTS, TITRAQ_DEFACCOUNTS);
         m_pPrefs->setString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE);
-        m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
         m_pPrefs->setString(TITRAQ_PREFVIEW, TITRAQ_DEFVIEW);
         m_pPrefs->setNumber(TITRAQ_PREFSORTCOL, TITRAQ_DEFSORTCOL);
         m_pPrefs->setBool(TITRAQ_PREFSORTDIR, TITRAQ_DEFSORTDIR);
         m_pPrefs->setString(TITRAQ_PREFREMOTELOG, TITRAQ_DEFREMOTELOG);
         m_pPrefs->setString(TITRAQ_PREFLOCALLOG, TITRAQ_DEFLOCALLOG);
+        m_pPrefs->setString(TITRAQ_PREFCORBHOST, TITRAQ_DEFCORBHOST);
+        m_pPrefs->setString(TITRAQ_PREFSOAPHOST, TITRAQ_DEFSOAPHOST);
+        m_pPrefs->setBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON);
+        m_pPrefs->setBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON);
+        m_pPrefs->setBool(TITRAQ_PREFBACKON, TITRAQ_DEFBACKON);
+        m_pPrefs->setBool(TITRAQ_PREFEXTENDON, TITRAQ_DEFEXTENDON);
         m_pPrefs->flush();  // Write the new conf file
         QTextStream cerr(stderr, IO_WriteOnly);
         cerr << trUtf8("Created new preferences file ") << Homedir << QChar('/')


ossp-pkg/as/as-gui/as_const.h 1.49 -> 1.50

--- as_const.h   2003/02/11 14:19:57     1.49
+++ as_const.h   2003/02/12 19:33:05     1.50
@@ -38,7 +38,7 @@
 #define TITRAQ_APPTITLE         "AS Accounting System"
 #define TITRAQ_STR_ID           "OSSPASGUI"                         /* APPID */
 #define TITRAQ_UID_ID           0x84fae747e1a64016bf049e98bbc4bd96  /* UUID */
-#define TITRAQ_PREFVER          "0.5"
+#define TITRAQ_PREFVER          "0.6"
 #define TITRAQ_PREFHOME         "homedir"
 #define TITRAQ_DEFHOME          "."
 #define TITRAQ_PREFUSER         "user"
@@ -54,6 +54,18 @@
 #define TITRAQ_DEFREMOTELOG     "no"
 #define TITRAQ_PREFLOCALLOG     "loglocal"
 #define TITRAQ_DEFLOCALLOG      "no"
+#define TITRAQ_PREFCORBHOST     "corbahost"
+#define TITRAQ_DEFCORBHOST      "localhost"
+#define TITRAQ_PREFSOAPHOST     "soaphost"
+#define TITRAQ_DEFSOAPHOST      "localhost"
+#define TITRAQ_PREFCORBON       "corbaenable"
+#define TITRAQ_DEFCORBON        0
+#define TITRAQ_PREFSOAPON       "soapenable"
+#define TITRAQ_DEFSOAPON        0
+#define TITRAQ_PREFBAKON        "autobackup"
+#define TITRAQ_DEFBAKON         1
+#define TITRAQ_PREFEXTENDON     "filextension"
+#define TITRAQ_DEFEXTENDON      1
 
 // Column show preferences
 #define TITRAQ_PREFSTATCOLON    "statcolshow"
@@ -138,6 +150,14 @@
 #define TITRAQ_ENVUSERNAME      "USER"
 #define TITRAQ_ENVHOMEDIR       "HOME"
 
+// Style string constants
+#define TITRAQ_STRCDE           "CDE"
+#define TITRAQ_STRSGI           "SGI"
+#define TITRAQ_STRMOTIF         "Motfi"
+#define TITRAQ_STRMPLUS         "MotifPlus"
+#define TITRAQ_STRPLAT          "Platinum"
+#define TITRAQ_STRMSOFT         "Windows"
+
 // Other string constants
 #define TITRAQ_SEPARATORTOK     " "
 #define TITRAQ_HOMEDIRTOK       "~/"


ossp-pkg/as/as-gui/as_panel.cpp 1.4 -> 1.5

--- as_panel.cpp 2003/02/12 16:31:43     1.4
+++ as_panel.cpp 2003/02/12 19:33:05     1.5
@@ -207,10 +207,12 @@
     m_pCancelbutton->setDefault(true);
     m_pVlayout->addLayout(m_pButtlay);
 
-    // Connect our signals to slots, the only one we write is 'apply(void)'
+    // 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)));
     this->textChange();
     this->resize(QSize(400, 264).expandedTo(minimumSizeHint()));
 }


ossp-pkg/as/as-gui/as_panel.h 1.5 -> 1.6

--- as_panel.h   2003/02/12 17:00:43     1.5
+++ as_panel.h   2003/02/12 19:33:05     1.6
@@ -50,6 +50,8 @@
 #include <qstylefactory.h>
 #include <qlayout.h>
 
+#include "as_gui.h" // For usage of style_t
+
 
 class Prefpanel : public QDialog
 {
@@ -87,24 +89,46 @@
 
 public:
     // Accessor get methods
+    QString getStyle(void)     {return (m_pStylegroup->selected()->text());};
     QString getAccounts(void)  {return (m_pAcctline->text());};
     QString getEvents(void)    {return (m_pEventline->text());};
     QString getUser(void)      {return (m_pUserline->text());};
     QString getHome(void)      {return (m_pHomeline->text());};
     QString getCorbahost(void) {return (m_pCorbaline->text());};
     QString getSoaphost(void)  {return (m_pSoapline->text());};
+    bool getCorbaon(void)      {return (m_pCorbacheck->isChecked());};
+    bool getSoapon(void)       {return (m_pSoapcheck->isChecked());};
+    bool getBackon(void)       {return (m_pBackupcheck->isChecked());};
+    bool getExtendon(void)     {return (m_pExtendcheck->isChecked());};
 
     // Accessor set methods
-    void setAccounts(const QString &Instr)  {m_pAcctline->setText(Instr);};
-    void setEvents(const QString &Instr)    {m_pEventline->setText(Instr);};
-    void setUser(const QString &Instr)      {m_pUserline->setText(Instr);};
-    void setHome(const QString &Instr)      {m_pHomeline->setText(Instr);};
-    void setCorbahost(const QString &Instr) {m_pCorbaline->setText(Instr);};
-    void setSoaphost(const QString &Instr)  {m_pSoapline->setText(Instr);};
+    void setAccounts(const QString &kInstr)  {m_pAcctline->setText(kInstr);};
+    void setEvents(const QString &kInstr)    {m_pEventline->setText(kInstr);};
+    void setUser(const QString &kInstr)      {m_pUserline->setText(kInstr);};
+    void setHome(const QString &kInstr)      {m_pHomeline->setText(kInstr);};
+    void setCorbahost(const QString &kInstr) {m_pCorbaline->setText(kInstr);};
+    void setSoaphost(const QString &kInstr)  {m_pSoapline->setText(kInstr);};
+    void setBackon(const bool &kbEnable = true)   {m_pBackupcheck->setChecked(kbEnable);};
+    void setExtendon(const bool &kbEnable = true) {m_pExtendcheck->setChecked(kbEnable);};
+    void setCorbaon(const bool &kbEnable = true) {
+        m_pCorbaline->setEnabled(kbEnable);
+        m_pCorbacheck->setChecked(kbEnable);
+    };
+    void setSoapon(const bool &kbEnable = true) {
+        m_pSoapline->setEnabled(kbEnable);
+        m_pSoapcheck->setChecked(kbEnable);
+    };
+    void setStyle(const char *pkszStyle) {
+        for (int nIter = 0; nIter < m_pStylegroup->count(); nIter++)
+            if (m_pStylegroup->find(nIter)->text() == pkszStyle)
+                m_pStylegroup->setButton(nIter);
+    };
 
 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);};
 };
 
 #endif // PREFPANEL_H


ossp-pkg/as/as-gui/as_slot.cpp 1.117 -> 1.118

--- as_slot.cpp  2003/02/11 14:19:57     1.117
+++ as_slot.cpp  2003/02/12 19:33:05     1.118
@@ -1106,15 +1106,77 @@
 //
 void Titraqform::configPrefs(void)
 {
-    Prefpanel *pUserpanel = NULL;
+    QString Templine;               // Used for preferences resetting
+    Prefpanel *pUserpanel = NULL;   // The user preferences panel itself
 
     // Create a new preferences panel window
     pUserpanel = new Prefpanel(this, "Userprefpanel");
 
-    // Handle panel modality
+    // Set default values to appear in initialized panel widgets
+    pUserpanel->setAccounts(m_pPrefs->getString(TITRAQ_PREFACCOUNTS, TITRAQ_DEFACCOUNTS));
+    pUserpanel->setEvents(m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE));
+    pUserpanel->setUser(m_pPrefs->getString(TITRAQ_PREFUSER, TITRAQ_DEFUSER));
+    pUserpanel->setHome(m_pPrefs->getString(TITRAQ_PREFHOME, TITRAQ_DEFHOME));
+    pUserpanel->setCorbahost(m_pPrefs->getString(TITRAQ_PREFCORBHOST, TITRAQ_DEFCORBHOST));
+    pUserpanel->setSoaphost(m_pPrefs->getString(TITRAQ_PREFSOAPHOST, TITRAQ_DEFSOAPHOST));
+    pUserpanel->setCorbaon(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON));
+    pUserpanel->setSoapon(m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON));
+    pUserpanel->setBackon(m_pPrefs->getBool(TITRAQ_PREFBAKON, TITRAQ_DEFBAKON));
+    pUserpanel->setExtendon(m_pPrefs->getBool(TITRAQ_PREFEXTENDON, TITRAQ_DEFEXTENDON));
+
+    // Set default style which can be more complicated due to mapping...
+    switch (m_pPrefs->getNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE)) {
+    case TITRAQ_STYLECDE:
+        pUserpanel->setStyle(TITRAQ_STRCDE);
+        break;
+    case TITRAQ_STYLESGI:
+        pUserpanel->setStyle(TITRAQ_STRSGI);
+        break;
+    case TITRAQ_STYLEMOTIF:
+        pUserpanel->setStyle(TITRAQ_STRMOTIF);
+        break;
+    case TITRAQ_STYLEMPLUS:
+        pUserpanel->setStyle(TITRAQ_STRMPLUS);
+        break;
+    case TITRAQ_STYLEPLAT:
+        pUserpanel->setStyle(TITRAQ_STRPLAT);
+        break;
+    case TITRAQ_STYLEMSOFT:
+        pUserpanel->setStyle(TITRAQ_STRMSOFT);
+        break;
+    default:
+        pUserpanel->setStyle(TITRAQ_STRCDE);    // My personal favourite ;-)
+        break;
+    }
+
+    // Modal panel handler
     if (pUserpanel->exec() == QDialog::Accepted) {
-//        pvData = pUserpanel->getData();
-//        setPrefs(pvData);
+        m_pPrefs->setString(TITRAQ_PREFACCOUNTS, pUserpanel->getAccounts());
+        m_pPrefs->setString(TITRAQ_PREFASFILE, 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());
+
+        // Get the selected style which can be more complicated due to mapping...
+        if (pUserpanel->getStyle() == TITRAQ_STRCDE)
+            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
+        else if (pUserpanel->getStyle() == TITRAQ_STRSGI)
+            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLESGI);
+        else if (pUserpanel->getStyle() == TITRAQ_STRMOTIF)
+            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMOTIF);
+        else if (pUserpanel->getStyle() == TITRAQ_STRMPLUS)
+            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMPLUS);
+        else if (pUserpanel->getStyle() == TITRAQ_STRPLAT)
+            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEPLAT);
+        else if (pUserpanel->getStyle() == TITRAQ_STRMSOFT)
+            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMSOFT);
+        else // My personal favourite ;-)
+            m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
     }
     delete pUserpanel;
 }

CVSTrac 2.0.1