OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_assist.cpp versions 1.102 and 1.103
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

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

CVSTrac 2.0.1