OSSP CVS Repository

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

Check-in Number: 2899
Date: 2002-Nov-26 21:25:16 (local)
2002-Nov-26 20:25:16 (UTC)
User:ms
Branch:
Comment: Toolbar showing and hiding on demand.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_assist.cpp      1.23 -> 1.24     49 inserted, 41 deleted
ossp-pkg/as/as-gui/as_const.h      1.5 -> 1.6     11 inserted, 6 deleted
ossp-pkg/as/as-gui/as_gui.h      1.26 -> 1.27     3 inserted, 0 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.18 -> 1.19     30 inserted, 12 deleted
ossp-pkg/titraq/titassist.cpp      1.23 -> 1.24     49 inserted, 41 deleted
ossp-pkg/titraq/titconst.h      1.5 -> 1.6     11 inserted, 6 deleted
ossp-pkg/titraq/titraq.h      1.26 -> 1.27     3 inserted, 0 deleted
ossp-pkg/titraq/titslot.cpp      1.18 -> 1.19     30 inserted, 12 deleted

ossp-pkg/as/as-gui/as_assist.cpp 1.23 -> 1.24

--- as_assist.cpp        2002/11/26 19:41:17     1.23
+++ as_assist.cpp        2002/11/26 20:25:16     1.24
@@ -257,52 +257,54 @@
     pEditpopup->insertSeparator();
     pEditpopup->insertItem("Preferences...", this, SLOT(configPrefs()));
 
-    // Construct the view menu
-    QPopupMenu *pViewpopup = new QPopupMenu(this);
-    QPopupMenu *pTbarspopup = new QPopupMenu(this);
-    pTbarspopup->insertTearOffHandle();
-    pTbarspopup->setCheckable(true);
-    QPopupMenu *pColspopup = new QPopupMenu(this);
-    pColspopup->insertTearOffHandle();
-    pColspopup->setCheckable(true);
+    // Construct the view menu and submenus
+    m_pViewpopup = new QPopupMenu(this);
+    m_pTbarspopup = new QPopupMenu(this);
+    m_pColspopup = new QPopupMenu(this);
+
+    // Give the new menus krass attributes
+    m_pTbarspopup->insertTearOffHandle();
+    m_pTbarspopup->setCheckable(true);
+    m_pColspopup->insertTearOffHandle();
+    m_pColspopup->setCheckable(true);
 
     // Major sanity check wrapped in one call
-    if (!(pViewpopup && pTbarspopup && pColspopup))
+    if (!(m_pViewpopup && m_pTbarspopup && m_pColspopup))
         throw Genexcept("Main window view popups creation failed.");
 
     // Populate the view menu with subitems
-    m_pMenubar->insertItem(trUtf8("&View"), pViewpopup);
-    pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
-    nMenuid = pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
-    pViewpopup->setItemEnabled(nMenuid, false);
-    pViewpopup->insertSeparator();
-    pViewpopup->insertItem(trUtf8("&Toolbars"), pTbarspopup);
-    nMenuid = pTbarspopup->insertItem(trUtf8("&File"), this, SLOT(showFilebar()));
-    pTbarspopup->setItemChecked(nMenuid, true);
-    nMenuid = pTbarspopup->insertItem(trUtf8("&Edit"), this, SLOT(showEditbar()));
-    pTbarspopup->setItemChecked(nMenuid, true);
-    nMenuid = pTbarspopup->insertItem(trUtf8("&Whats this"), this, SLOT(showWhatsbar()));
-    pTbarspopup->setItemChecked(nMenuid, true);
-    pViewpopup->insertSeparator();
-    pViewpopup->insertItem(trUtf8("&Columns"), pColspopup);
-    nMenuid = pColspopup->insertItem(trUtf8("&Line number"), this, SLOT(showLinecol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&GUID"), this, SLOT(showGuidcol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&Date"), this, SLOT(showDatecol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&User"), this, SLOT(showUsercol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&Task"), this, SLOT(showTaskcol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&Start time"), this, SLOT(showStartcol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&Finish time"), this, SLOT(showFinishcol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&Amount time"), this, SLOT(showAmountcol()));
-    pColspopup->setItemEnabled(nMenuid, false);
-    nMenuid = pColspopup->insertItem(trUtf8("&Remark"), this, SLOT(showRemarkcol()));
-    pColspopup->setItemEnabled(nMenuid, false);
+    m_pMenubar->insertItem(trUtf8("&View"), m_pViewpopup);
+    m_pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
+    nMenuid = m_pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
+    m_pViewpopup->setItemEnabled(nMenuid, false);
+    m_pViewpopup->insertSeparator();
+    m_pViewpopup->insertItem(trUtf8("&Toolbars"), m_pTbarspopup);
+    nMenuid = m_pTbarspopup->insertItem(trUtf8("&File"), this, SLOT(showFilebar()));
+    m_pTbarspopup->setItemChecked(nMenuid, true);
+    nMenuid = m_pTbarspopup->insertItem(trUtf8("&Edit"), this, SLOT(showEditbar()));
+    m_pTbarspopup->setItemChecked(nMenuid, true);
+    nMenuid = m_pTbarspopup->insertItem(trUtf8("&Whats this"), this, SLOT(showWhatsbar()));
+    m_pTbarspopup->setItemChecked(nMenuid, true);
+    m_pViewpopup->insertSeparator();
+    m_pViewpopup->insertItem(trUtf8("&Columns"), m_pColspopup);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&Line number"), this, SLOT(showLinecol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&GUID"), this, SLOT(showGuidcol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&Date"), this, SLOT(showDatecol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&User"), this, SLOT(showUsercol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&Task"), this, SLOT(showTaskcol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&Start time"), this, SLOT(showStartcol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&Finish time"), this, SLOT(showFinishcol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&Amount time"), this, SLOT(showAmountcol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
+    nMenuid = m_pColspopup->insertItem(trUtf8("&Remark"), this, SLOT(showRemarkcol()));
+    m_pColspopup->setItemEnabled(nMenuid, false);
 
     // Pad spacing to force help menu to appear far right
     m_pMenubar->insertSeparator();
@@ -331,6 +333,8 @@
     if (m_pFiletools == NULL)                   // Sanity check
         throw Genexcept("File tool bar creation failed.");
     m_pFiletools->setLabel(trUtf8("File Ops"));
+    m_pFiletools->setOpaqueMoving(true);
+    m_pFiletools->setCloseMode(QDockWindow::Never);
     m_pFilenewact->addTo(m_pFiletools);
     m_pFileopenact->addTo(m_pFiletools);
     m_pFilesaveact->addTo(m_pFiletools);
@@ -340,6 +344,8 @@
     if (m_pEdittools == NULL)                   // Sanity check
         throw Genexcept("Edit tool bar creation failed.");
     m_pEdittools->setLabel(trUtf8("Edit Ops"));
+    m_pEdittools->setOpaqueMoving(true);
+    m_pEdittools->setCloseMode(QDockWindow::Never);
     m_pCutact->addTo(m_pEdittools);
     m_pCopyact->addTo(m_pEdittools);
     m_pPasteact->addTo(m_pEdittools);
@@ -352,6 +358,8 @@
     if (m_pWhatstools == NULL)                  // Sanity check
         throw Genexcept("Whats this tool bar creation failed.");
     m_pWhatstools->setLabel(trUtf8("Whats this"));
+    m_pWhatstools->setOpaqueMoving(true);
+    m_pWhatstools->setCloseMode(QDockWindow::Never);
     QWhatsThis::whatsThisButton(m_pWhatstools); // Preconfigured whats this button
 }
 


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

--- as_const.h   2002/11/26 19:33:37     1.5
+++ as_const.h   2002/11/26 20:25:16     1.6
@@ -13,12 +13,17 @@
 #define TITRAQ_DEFLOCALLOG      "no"
 
 // Indexes of table columns
-#define TITRAQ_INDEXDATE        0
-#define TITRAQ_INDEXSTART       1
-#define TITRAQ_INDEXFINISH      2
-#define TITRAQ_INDEXAMOUNT      3
-#define TITRAQ_INDEXTASK        4
-#define TITRAQ_INDEXREMARK      5
+#define TITRAQ_IDXDATE          0
+#define TITRAQ_IDXSTART         1
+#define TITRAQ_IDXFINISH        2
+#define TITRAQ_IDXAMOUNT        3
+#define TITRAQ_IDXTASK          4
+#define TITRAQ_IDXREMARK        5
+
+// Indexes of popup menu submenus
+#define TITRAQ_IDXFILEBAR       1
+#define TITRAQ_IDXEDITBAR       2
+#define TITRAQ_IDXWHATBAR       3
 
 // Values
 #define TITRAQ_MAXAMOUNT        960         // Maximum valid amount


ossp-pkg/as/as-gui/as_gui.h 1.26 -> 1.27

--- as_gui.h     2002/11/26 17:23:51     1.26
+++ as_gui.h     2002/11/26 20:25:16     1.27
@@ -127,6 +127,9 @@
 private:
     // Owned by QMainWindow
     QMenuBar    *m_pMenubar;
+    QPopupMenu  *m_pViewpopup;          // Saved for manipulating views
+    QPopupMenu  *m_pTbarspopup;         // Saved for manipulating toolbars
+    QPopupMenu  *m_pColspopup;          // Saved for manipulating columns
     QStatusBar  *m_pStatbar;
 
     // Belong to us


ossp-pkg/as/as-gui/as_slot.cpp 1.18 -> 1.19

--- as_slot.cpp  2002/11/26 19:33:37     1.18
+++ as_slot.cpp  2002/11/26 20:25:16     1.19
@@ -199,12 +199,12 @@
     QRegExp Shorten("/(\\w+)$");    // For stripping prefix off the current task
 
     // Field strings to check for validity and process
-    QString Textdate(m_pMaintable->text(nRow, TITRAQ_INDEXDATE));
-    QString Textstart(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT));
-    QString Textfinish(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT));
-    QString Textamount(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT));
-    QString Texttask(m_pMaintable->text(nRow, TITRAQ_INDEXTASK));
-    QString Textremark(m_pMaintable->text(nRow, TITRAQ_INDEXREMARK));
+    QString Textdate(m_pMaintable->text(nRow, TITRAQ_IDXDATE));
+    QString Textstart(m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT));
+    QString Textfinish(m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT));
+    QString Textamount(m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT));
+    QString Texttask(m_pMaintable->text(nRow, TITRAQ_IDXTASK));
+    QString Textremark(m_pMaintable->text(nRow, TITRAQ_IDXREMARK));
 
     if (!Textdate.isEmpty())
         m_pDateedit->setDate(QDate::fromString(Textdate, Qt::ISODate));
@@ -262,8 +262,14 @@
 //
 void Titraqform::showFilebar(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    if (m_pFiletools->isVisible()) {
+        m_pFiletools->hide();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXFILEBAR), false);
+    }
+    else {
+        m_pFiletools->show();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXFILEBAR), true);
+    }
 }
 
 //
@@ -271,8 +277,14 @@
 //
 void Titraqform::showEditbar(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    if (m_pEdittools->isVisible()) {
+        m_pEdittools->hide();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXEDITBAR), false);
+    }
+    else {
+        m_pEdittools->show();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXEDITBAR), true);
+    }
 }
 
 //
@@ -280,8 +292,14 @@
 //
 void Titraqform::showWhatsbar(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    if (m_pWhatstools->isVisible()) {
+        m_pWhatstools->hide();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXWHATBAR), false);
+    }
+    else {
+        m_pWhatstools->show();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXWHATBAR), true);
+    }
 }
 
 //





CVSTrac 2.0.1