OSSP CVS Repository

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

Check-in Number: 4031
Date: 2003-Feb-13 20:49:02 (local)
2003-Feb-13 19:49:02 (UTC)
User:ms
Branch:
Comment: Lots of small changes and improvements to RPC options, menus, and action, resulting in better usability and more stable RPC functionality.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_assist.cpp      1.102 -> 1.103     27 inserted, 50 deleted
ossp-pkg/as/as-gui/as_gui.h      1.72 -> 1.73     1 inserted, 1 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.119 -> 1.120     22 inserted, 12 deleted

ossp-pkg/as/as-gui/as_assist.cpp 1.102 -> 1.103

--- as_assist.cpp        2003/02/12 19:40:17     1.102
+++ as_assist.cpp        2003/02/13 19:49:02     1.103
@@ -186,11 +186,10 @@
     QMimeSourceFactory::defaultFactory()->setPixmap("rowadd", QPixmap(s_kpcRowadd_xpm));
     QMimeSourceFactory::defaultFactory()->setPixmap("rowdel", QPixmap(s_kpcRowdel_xpm));
     QMimeSourceFactory::defaultFactory()->setPixmap("refresh", QPixmap(s_kpcRefresh_xpm));
-    QMimeSourceFactory::defaultFactory()->setPixmap("synciiop", QPixmap(s_kpcSync_xpm));
-    QMimeSourceFactory::defaultFactory()->setPixmap("syncsoap", QPixmap(s_kpcSync_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("syncrpc", QPixmap(s_kpcSync_xpm));
 
     // File new action
-    m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New..."), CTRL+Key_N, this, "New");
+    m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New"), CTRL+Key_N, this, "New");
     if (m_pFilenewact == NULL)  // Sanity check
         throw Genexcept("Main window file new action creation failed.");
     connect(m_pFilenewact, SIGNAL(activated()), this, SLOT(newDoc()));
@@ -311,33 +310,18 @@
                                  "from the <b>View</b> menu.</p>";
     m_pRefreshact->setWhatsThis(kszRefreshtext);
 
-#ifdef HAVE_MICO
-    // Syncronize data with remote server over IIOP action
-    m_pSynciiopact = new QAction(trUtf8("Synchronize over IIOP"), Synciset, trUtf8("&Synchronize IIOP"), CTRL+Key_E, this, "Synchronizeiiop");
-    if (m_pSynciiopact == NULL) // Sanity check
-        throw Genexcept("Main window synchronize IIOP action creation failed.");
-    connect(m_pSynciiopact, SIGNAL(activated()), this, SLOT(syncIiop()));
-    const char *kszSynciioptext = "<p><img source=\"synciiop\"> "
-                                  "Click this button to <em>synchronize the data</em>. "
-                                  "Your changed entries will be sent to the server. "
-                                  "You can also select the <b>Synchronize</b> command "
-                                  "from the <b>Report</b> menu.</p>";
-    m_pSynciiopact->setWhatsThis(kszSynciioptext);
-#endif // HAVE_MICO
-
-#ifdef HAVE_ESOAP
-    // Syncronize data with remote server over SOAP action
-    m_pSyncsoapact = new QAction(trUtf8("Synchronize over SOAP"), Synciset, trUtf8("&Synchronize SOAP"), CTRL+Key_E, this, "Synchronizesoap");
-    if (m_pSyncsoapact == NULL) // Sanity check
-        throw Genexcept("Main window synchronize SOAP action creation failed.");
-    connect(m_pSyncsoapact, SIGNAL(activated()), this, SLOT(syncSoap()));
-    const char *kszSyncsoaptext = "<p><img source=\"syncsoap\"> "
-                                  "Click this button to <em>synchronize the data</em>. "
-                                  "Your changed entries will be sent to the server. "
-                                  "You can also select the <b>Synchronize</b> command "
-                                  "from the <b>Report</b> menu.</p>";
-    m_pSyncsoapact->setWhatsThis(kszSyncsoaptext);
-#endif // HAVE_ESOAP
+    // Syncronize data with remote server over IIOP or SOAP action
+    m_pSyncact = new QAction(trUtf8("Synchronize with server"), Synciset, trUtf8("&Synchronize"), CTRL+Key_E, this, "Synchronize");
+    if (m_pSyncact == NULL) // Sanity check
+        throw Genexcept("Main window synchronize RPC action creation failed.");
+    connect(m_pSyncact, SIGNAL(activated()), this, SLOT(syncIiop()));
+    connect(m_pSyncact, SIGNAL(activated()), this, SLOT(syncSoap()));
+    const char *kszSynctext = "<p><img source=\"syncrpc\"> "
+                              "Click this button to <em>synchronize the data</em>. "
+                              "Your changed entries will be sent to the server. "
+                              "You can also select the <b>Synchronize</b> command "
+                              "from the <b>Report</b> menu.</p>";
+    m_pSyncact->setWhatsThis(kszSynctext);
 }
 
 //
@@ -400,8 +384,7 @@
 
     // Populate the view menu with subitems
     m_pMenubar->insertItem(trUtf8("&View"), m_pViewpopup);
-    nMenuid = m_pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView()));
-    m_pViewpopup->setItemEnabled(nMenuid, false);
+    m_pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView()));
     nMenuid = m_pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
     m_pViewpopup->setItemEnabled(nMenuid, false);
     nMenuid = m_pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
@@ -450,18 +433,11 @@
     if (pReportpopup == NULL) // Sanity check
         throw Genexcept("Main window report popup creation failed.");
     m_pMenubar->insertItem(trUtf8("&Report"), pReportpopup);
-#ifdef HAVE_MICO
-#define HAS_RPC
-    m_pSynciiopact->addTo(pReportpopup);
-#endif // HAVE_MICO
-#ifdef HAVE_ESOAP
-#define HAS_RPC
-    m_pSyncsoapact->addTo(pReportpopup);
-#endif // HAVE_ESOAP
-#ifdef HAS_RPC
-    // We only want to add a separator if its needed
-    pReportpopup->insertSeparator();
-#endif // HAS_RPC
+#if defined HAVE_MICO || defined HAVE_ESOAP
+    m_pSyncact->addTo(pReportpopup);
+    m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON)
+        | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON));
+#endif // defined HAVE_MICO || defined HAVE_ESOAP
     nMenuid = pReportpopup->insertItem(trUtf8("&Local Report"), this, SLOT(genReport()));
     pReportpopup->setItemEnabled(nMenuid, false);
 
@@ -1011,12 +987,13 @@
     m_pCutact->setEnabled(bTurned);
     m_pCopyact->setEnabled(bTurned);
     m_pPasteact->setEnabled(bTurned);
-#ifdef HAVE_MICO
-    m_pSynciiopact->setEnabled(bTurned);
-#endif // HAVE_MICO
-#ifdef HAVE_ESOAP
-    m_pSyncsoapact->setEnabled(bTurned);
-#endif // HAVE_ESOAP
+#if defined HAVE_MICO || defined HAVE_ESOAP
+    if (bTurned)
+        m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON)
+            | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON));
+    else
+        m_pSyncact->setEnabled(false);
+#endif // defined HAVE_MICO || defined HAVE_ESOAP
 
     // Unconditional settings
     m_pMaintable->setDirty(false);                  // Reset to clean data


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

--- as_gui.h     2003/02/11 14:19:57     1.72
+++ as_gui.h     2003/02/13 19:49:02     1.73
@@ -205,7 +205,7 @@
     QAction     *m_pAddrowact,    *m_pDelrowact;
     QAction     *m_pRefreshact,   *m_pCutact;
     QAction     *m_pCopyact,      *m_pPasteact;
-    QAction     *m_pSynciiopact,  *m_pSyncsoapact;
+    QAction     *m_pSyncact;
 
     // Table, cells, and entries in package layout
     TiTable     *m_pMaintable;


ossp-pkg/as/as-gui/as_slot.cpp 1.119 -> 1.120

--- as_slot.cpp  2003/02/13 18:22:32     1.119
+++ as_slot.cpp  2003/02/13 19:49:02     1.120
@@ -227,12 +227,10 @@
         m_pRemark->setEnabled(true);
 
         // And optionally the RPC actions, too
-#ifdef HAVE_MICO
-        m_pSynciiopact->setEnabled(true);
-#endif // HAVE_MICO
-#ifdef HAVE_ESOAP
-        m_pSyncsoapact->setEnabled(true);
-#endif // HAVE_ESOAP
+#if defined HAVE_MICO || defined HAVE_ESOAP
+        m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON)
+            | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON));
+#endif // HAVE_MICO || defined HAVE_ESOAP
     }
 }
 
@@ -287,12 +285,9 @@
         m_pRemark->setEnabled(false);
 
         // And optionally dim the RPC actions
-#ifdef HAVE_MICO
-        m_pSynciiopact->setEnabled(false);
-#endif // HAVE_MICO
-#ifdef HAVE_ESOAP
-        m_pSyncsoapact->setEnabled(false);
-#endif // HAVE_ESOAP
+#if defined HAVE_MICO || defined HAVE_ESOAP
+        m_pSyncact->setEnabled(false);
+#endif // HAVE_MICO || defined HAVE_ESOAP
     }
 }
 
@@ -1173,6 +1168,13 @@
         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);
+
         // Get the selected style which can be more complicated due to mapping...
         if (pUserpanel->getStyle() == TITRAQ_STRCDE)
             m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
@@ -1558,6 +1560,10 @@
 void Titraqform::syncIiop(void)
 {
 #ifdef HAVE_MICO
+    // Short circuit if user has disabled CORBA transmission in prefs
+    if (!m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON))
+        return;
+
     char **ppcInargv = NULL;    // Parameters to the ORB
     CORBA::ORB_var Orb;         // The ORB iself
 
@@ -1691,6 +1697,10 @@
 void Titraqform::syncSoap(void)
 {
 #ifdef HAVE_ESOAP
+    // Short circuit if user has disabled SOAP transmission in prefs
+    if (!m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON))
+        return;
+
     USING_EASYSOAP_NAMESPACE
 
     try {

CVSTrac 2.0.1