OSSP CVS Repository

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

Check-in Number: 2894
Date: 2002-Nov-26 18:23:51 (local)
2002-Nov-26 17:23:51 (UTC)
User:ms
Branch:
Comment: Add several missing edit actions, icons for them, and restructure view menu according to thl+ms mui+gui brainstorming.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_assist.cpp      1.19 -> 1.20     118 inserted, 24 deleted
ossp-pkg/as/as-gui/as_gui.h      1.25 -> 1.26     19 inserted, 6 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.14 -> 1.15     134 inserted, 35 deleted
ossp-pkg/titraq/titassist.cpp      1.19 -> 1.20     118 inserted, 24 deleted
ossp-pkg/titraq/titraq.h      1.25 -> 1.26     19 inserted, 6 deleted
ossp-pkg/titraq/titslot.cpp      1.14 -> 1.15     134 inserted, 35 deleted

ossp-pkg/as/as-gui/as_assist.cpp 1.19 -> 1.20

--- as_assist.cpp        2002/11/26 14:15:05     1.19
+++ as_assist.cpp        2002/11/26 17:23:51     1.20
@@ -23,6 +23,11 @@
 #include "gfx/filenew.xpm"      // static const char *s_kpcFilenew_xpm[]
 #include "gfx/fileopen.xpm"     // static const char *s_kpcFileopen_xpm[]
 #include "gfx/filesave.xpm"     // static const char *s_kpcFilesave_xpm[]
+#include "gfx/cut.xpm"          // static const char *s_kpcCut_xpm[]
+#include "gfx/copy.xpm"         // static const char *s_kpcCopy_xpm[]
+#include "gfx/paste.xpm"        // static const char *s_kpcPaste_xpm[]
+#include "gfx/rowadd.xpm"       // static const char *s_kpcRowadd_xpm[]
+#include "gfx/rowdel.xpm"       // static const char *s_kpcRowdel_xpm[]
 #include "gfx/osspicon.xpm"     // static const char *s_kpcOsspicon_xpm[]
 #include "gfx/whatsthis.xpm"    // static const char *s_kpcWhatsthis_xpm[]
 
@@ -80,6 +85,11 @@
     QMimeSourceFactory::defaultFactory()->setPixmap("filenew", QPixmap(s_kpcFilenew_xpm));
     QMimeSourceFactory::defaultFactory()->setPixmap("fileopen", QPixmap(s_kpcFileopen_xpm));
     QMimeSourceFactory::defaultFactory()->setPixmap("filesave", QPixmap(s_kpcFilesave_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("cut", QPixmap(s_kpcCut_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("copy", QPixmap(s_kpcCopy_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("paste", QPixmap(s_kpcPaste_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("rowadd", QPixmap(s_kpcRowadd_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("rowdel", QPixmap(s_kpcRowdel_xpm));
 
     // File new action
     m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New..."), CTRL+Key_N, this, "New");
@@ -127,41 +137,74 @@
 
     // File close current action
     m_pFilecloseact = new QAction(trUtf8("Close"), trUtf8("&Close"), CTRL+Key_W, this, "Close");
-    if (m_pFilecloseact == NULL) // Sanity check
+    if (m_pFilecloseact == NULL)    // Sanity check
         throw Genexcept("Main window file close action creation failed.");
     connect(m_pFilecloseact, SIGNAL(activated()), this, SLOT(close()));
 
     // File quit action
     m_pFilequitact = new QAction(trUtf8("Exit"), trUtf8("E&xit"), CTRL+Key_Q, this, "Exit");
-    if (m_pFilequitact == NULL) // Sanity check
+    if (m_pFilequitact == NULL)     // Sanity check
         throw Genexcept("Main window file quit action creation failed.");
     connect(m_pFilequitact, SIGNAL(activated()), qApp, SLOT(quit()));
 
+    // Cut action
+    m_pCutact = new QAction(trUtf8("Cut"), QPixmap(s_kpcCut_xpm), trUtf8("&Cut"), 0, this, "Cut");
+    if (m_pCutact == NULL)          // Sanity check
+        throw Genexcept("Main window cut edit action creation failed.");
+    connect(m_pCutact, SIGNAL(activated()), this, SLOT(cutEntry()));
+    const char *kszCuttext = "<p><img source=\"cut\"> "
+                                   "Click this button to cut an <em>entry</em>."
+                                   "You can also select the <b>Cut</b> command "
+                                   "from the <b>Edit</b> menu.</p>";
+    m_pCutact->setWhatsThis(kszCuttext);
+
+    // Copy action
+    m_pCopyact = new QAction(trUtf8("Copy"), QPixmap(s_kpcCopy_xpm), trUtf8("&Copy"), 0, this, "Copy");
+    if (m_pCopyact == NULL)         // Sanity check
+        throw Genexcept("Main window copy edit action creation failed.");
+    connect(m_pCopyact, SIGNAL(activated()), this, SLOT(copyEntry()));
+    const char *kszCopytext = "<p><img source=\"copy\"> "
+                                   "Click this button to copy an <em>entry</em>."
+                                   "You can also select the <b>Copy</b> command "
+                                   "from the <b>Edit</b> menu.</p>";
+    m_pCopyact->setWhatsThis(kszCopytext);
+
+    // Paste action
+    m_pPasteact = new QAction(trUtf8("Paste"), QPixmap(s_kpcPaste_xpm), trUtf8("&Paste"), 0, this, "Paste");
+    if (m_pPasteact == NULL)         // Sanity check
+        throw Genexcept("Main window paste edit action creation failed.");
+    connect(m_pPasteact, SIGNAL(activated()), this, SLOT(pasteEntry()));
+    const char *kszPastetext = "<p><img source=\"paste\"> "
+                                   "Click this button to paste an <em>entry</em>."
+                                   "You can also select the <b>Paste</b> command "
+                                   "from the <b>Edit</b> menu.</p>";
+    m_pPasteact->setWhatsThis(kszPastetext);
+
     // Add data row action
-    m_pAddrowact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 0, this, "Addrow");
-    if (m_pAddrowact == NULL) // Sanity check
+    m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcRowadd_xpm), trUtf8("&Add row"), 0, this, "Addrow");
+    if (m_pAddrowact == NULL)       // Sanity check
         throw Genexcept("Main window add row action creation failed.");
     connect(m_pAddrowact, SIGNAL(activated()), this, SLOT(addEntry()));
-    const char *kszAddrowtext = "<p><img source=\"ossplogo\"> "
+    const char *kszAddrowtext = "<p><img source=\"rowadd\"> "
                                 "Click this button to add a <em>new row</em>."
                                 "You can also select the <b>Add</b> command "
                                 "from the <b>Edit</b> menu.</p>";
     m_pAddrowact->setWhatsThis(kszAddrowtext);
 
     // Delete data row action
-    m_pDeleterowact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 0, this, "Deleterow");
-    if (m_pDeleterowact == NULL) // Sanity check
+    m_pDelrowact = new QAction(trUtf8("Del Row"), QPixmap(s_kpcRowdel_xpm), trUtf8("&Delete row"), 0, this, "Delrow");
+    if (m_pDelrowact == NULL)       // Sanity check
         throw Genexcept("Main window delete row action creation failed.");
-    connect(m_pDeleterowact, SIGNAL(activated()), this, SLOT(delEntry()));
-    const char *kszDeleterowtext = "<p><img source=\"ossplogo\"> "
+    connect(m_pDelrowact, SIGNAL(activated()), this, SLOT(delEntry()));
+    const char *kszDelrowtext = "<p><img source=\"rowdel\"> "
                                    "Click this button to delete a <em>row</em>."
                                    "You can also select the <b>Delete</b> command "
                                    "from the <b>Edit</b> menu.</p>";
-    m_pDeleterowact->setWhatsThis(kszDeleterowtext);
+    m_pDelrowact->setWhatsThis(kszDelrowtext);
 
     // Write data action
-    m_pWritedataact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 0, this, "Writedata");
-    if (m_pWritedataact == NULL) // Sanity check
+    m_pWritedataact = new QAction(trUtf8("Write Data"), trUtf8("&Write data"), 0, this, "Writedata");
+    if (m_pWritedataact == NULL)    // Sanity check
         throw Genexcept("Main window write data action creation failed.");
     connect(m_pWritedataact, SIGNAL(activated()), this, SLOT(writeEntry()));
     const char *kszWritedatatext = "<p><img source=\"ossplogo\"> "
@@ -176,6 +219,8 @@
 //
 void Titraqform::setupMenubar(void)
 {
+    int nMenuid = 0;        // Used to store id during menu item creation
+
     m_pMenubar = menuBar(); // Grab menu bar owned by QMainWindow
     if (m_pMenubar == NULL) // Sanity check
         throw Genexcept("Main window menu bar nonexistant.");
@@ -203,24 +248,61 @@
     if (pEditpopup == NULL) // Sanity check
         throw Genexcept("Main window edit popup creation failed.");
     m_pMenubar->insertItem(trUtf8("&Edit"), pEditpopup);
-    pEditpopup->insertItem("Cu&t", this, SLOT(cut()), CTRL+Key_X);
-    pEditpopup->insertItem("&Copy", this, SLOT(copy()), CTRL+Key_C);
-    pEditpopup->insertItem("&Paste", this, SLOT(paste()), CTRL+Key_V);
+    m_pCutact->addTo(pEditpopup);
+    m_pCopyact->addTo(pEditpopup);
+    m_pPasteact->addTo(pEditpopup);
     pEditpopup->insertSeparator();
-    pEditpopup->insertItem("&Add", this, SLOT(addEntry()), CTRL+Key_A);
-    pEditpopup->insertItem("&Delete", this, SLOT(delEntry()), Key_Delete);
-    pEditpopup->insertItem("Select &All", this, SLOT(selAll()), CTRL+Key_A);
+    m_pAddrowact->addTo(pEditpopup);
+    m_pDelrowact->addTo(pEditpopup);
     pEditpopup->insertSeparator();
     pEditpopup->insertItem("Preferences...", this, SLOT(configPrefs()));
 
-    // Construct and populate the view menu with subitems
+    // Construct the view menu
     QPopupMenu *pViewpopup = new QPopupMenu(this);
-    if (pViewpopup == NULL) // Sanity check
-        throw Genexcept("Main window view popup creation failed.");
+    QPopupMenu *pTbarspopup = new QPopupMenu(this);
+    pTbarspopup->insertTearOffHandle();
+    pTbarspopup->setCheckable(true);
+    QPopupMenu *pColspopup = new QPopupMenu(this);
+    pColspopup->insertTearOffHandle();
+    pColspopup->setCheckable(true);
+
+    // Major sanity check wrapped in one call
+    if (!(pViewpopup && pTbarspopup && pColspopup))
+        throw Genexcept("Main window view popups creation failed.");
+
+    // Populate the view menu with subitems
     m_pMenubar->insertItem(trUtf8("&View"), pViewpopup);
-    pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView()));
     pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
-    pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
+    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);
 
     // Pad spacing to force help menu to appear far right
     m_pMenubar->insertSeparator();
@@ -252,13 +334,25 @@
     m_pFilenewact->addTo(m_pFiletools);
     m_pFileopenact->addTo(m_pFiletools);
     m_pFilesaveact->addTo(m_pFiletools);
-    QWhatsThis::whatsThisButton(m_pFiletools);  // Preconfigured whats this button
 
     // Construct and populate the edit tool bar
     m_pEdittools = new QToolBar("Tooledit", this, DockTop);
     if (m_pEdittools == NULL)                   // Sanity check
         throw Genexcept("Edit tool bar creation failed.");
     m_pEdittools->setLabel(trUtf8("Edit Ops"));
+    m_pCutact->addTo(m_pEdittools);
+    m_pCopyact->addTo(m_pEdittools);
+    m_pPasteact->addTo(m_pEdittools);
+    m_pEdittools->addSeparator();
+    m_pAddrowact->addTo(m_pEdittools);
+    m_pDelrowact->addTo(m_pEdittools);
+
+    // Construct and populate the lonely whatsthis tool bar
+    m_pWhatstools = new QToolBar("Toolwhats", this, DockTop);
+    if (m_pWhatstools == NULL)                  // Sanity check
+        throw Genexcept("Whats this tool bar creation failed.");
+    m_pWhatstools->setLabel(trUtf8("Whats this"));
+    QWhatsThis::whatsThisButton(m_pWhatstools); // Preconfigured whats this button
 }
 
 //


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

--- as_gui.h     2002/11/26 14:10:32     1.25
+++ as_gui.h     2002/11/26 17:23:51     1.26
@@ -55,8 +55,9 @@
     QAction     *m_pFilenewact,   *m_pFileopenact;
     QAction     *m_pFilesaveact,  *m_pFilesaveasact;
     QAction     *m_pFilecloseact, *m_pFilequitact;
-    QAction     *m_pAddrowact, *m_pDeleterowact;
-    QAction     *m_pWritedataact;
+    QAction     *m_pAddrowact,    *m_pDelrowact;
+    QAction     *m_pCutact,       *m_pCopyact;
+    QAction     *m_pPasteact,     *m_pWritedataact;
 
     // Table, cells, and entries in package layout
     QTable      *m_pMaintable;
@@ -79,6 +80,9 @@
 
 protected slots:
     virtual void init(void);            // Override init to include custom controls
+    void cutEntry(void);                // Cut a task entry from the list
+    void copyEntry(void);               // Copy a task entry from the list
+    void pasteEntry(void);              // Paste a task entry to the list
     void addEntry(void);                // Add a task entry to the list
     void delEntry(void);                // Delete a task entry from the list
     void writeEntry(void);              // Write the task list to a filedescriptor
@@ -90,15 +94,23 @@
     void aboutTitraq(void);             // Learn more about this program itself
     void aboutOSSP(void);               // Learn more about the OSSP
     void aboutQt(void);                 // Learn more about Qt
-    void cut(void);                     // Edit menu cut
-    void copy(void);                    // Edit menu copy
-    void paste(void);                   // Edit menu paste
     void selAll(void);                  // Edit menu select all
     void updEdit(int, int);             // Update edit controls
     void configPrefs(void);             // Edit menu configure preferences
-    void normalView(void);              // View menu normal
     void editingView(void);             // View menu editing
     void timingView(void);              // View menu timing
+    void showFilebar(void);             // View menu show file toolbar
+    void showEditbar(void);             // View menu show edit toolbar
+    void showWhatsbar(void);            // View menu show whats this toolbar
+    void showLinecol(void);             // View menu show line numbers column
+    void showGuidcol(void);             // View menu show GUIDs column
+    void showDatecol(void);             // View menu show Dates column
+    void showUsercol(void);             // View menu show Users column
+    void showTaskcol(void);             // View menu show Tasks column
+    void showStartcol(void);            // View menu show Start time column
+    void showFinishcol(void);           // View menu show Finish time column
+    void showAmountcol(void);           // View menu show Amounts column
+    void showRemarkcol(void);           // View menu show Remarks column
 
 protected:
     // Application main events
@@ -120,6 +132,7 @@
     // Belong to us
     QToolBar    *m_pFiletools;
     QToolBar    *m_pEdittools;
+    QToolBar    *m_pWhatstools;
     QString     *m_szFilename;
 
     // Standard members


ossp-pkg/as/as-gui/as_slot.cpp 1.14 -> 1.15

--- as_slot.cpp  2002/11/26 14:10:32     1.14
+++ as_slot.cpp  2002/11/26 17:23:51     1.15
@@ -15,7 +15,34 @@
 
 
 //
-// Add a blank row entry to the current data window
+// Cut an entry
+//
+void Titraqform::cutEntry(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// Copy an entry
+//
+void Titraqform::copyEntry(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// Paste an entry
+//
+void Titraqform::pasteEntry(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// Append a blank row entry
 //
 void Titraqform::addEntry(void)
 {
@@ -31,7 +58,7 @@
 }
 
 //
-// Delete a row entry from the current data window
+// Delete a row entry
 //
 void Titraqform::delEntry(void)
 {
@@ -152,33 +179,6 @@
 }
 
 //
-// Edit menu cut
-//
-void Titraqform::cut(void)
-{
-    Prototype Unimp;
-    Unimp.doMbox();
-}
-
-//
-// Edit menu copy
-//
-void Titraqform::copy(void)
-{
-    Prototype Unimp;
-    Unimp.doMbox();
-}
-
-//
-// Edit menu paste
-//
-void Titraqform::paste(void)
-{
-    Prototype Unimp;
-    Unimp.doMbox();
-}
-
-//
 // Edit menu select all entries
 //
 void Titraqform::selAll(void)
@@ -232,27 +232,126 @@
 }
 
 //
-// View menu normal
+// View menu editing
 //
-void Titraqform::normalView(void)
+void Titraqform::editingView(void)
 {
     Prototype Unimp;
     Unimp.doMbox();
 }
 
 //
-// View menu editing
+// View menu timing
 //
-void Titraqform::editingView(void)
+void Titraqform::timingView(void)
 {
     Prototype Unimp;
     Unimp.doMbox();
 }
 
 //
-// View menu timing
+// View menu show file toolbar
 //
-void Titraqform::timingView(void)
+void Titraqform::showFilebar(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show edit toolbar
+//
+void Titraqform::showEditbar(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show whats this toolbar
+//
+void Titraqform::showWhatsbar(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show line numbers column
+//
+void Titraqform::showLinecol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show GUIDs column
+//
+void Titraqform::showGuidcol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show Dates column
+//
+void Titraqform::showDatecol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show Users column
+//
+void Titraqform::showUsercol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show Tasks column
+//
+void Titraqform::showTaskcol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show Start time column
+//
+void Titraqform::showStartcol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show Finish time column
+//
+void Titraqform::showFinishcol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show Amounts column
+//
+void Titraqform::showAmountcol(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
+// View menu show Remarks column
+//
+void Titraqform::showRemarkcol(void)
 {
     Prototype Unimp;
     Unimp.doMbox();




CVSTrac 2.0.1