OSSP CVS Repository

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

Check-in Number: 2859
Date: 2002-Nov-20 12:06:32 (local)
2002-Nov-20 11:06:32 (UTC)
User:ms
Branch:
Comment: Save time and resources by loading pixmaps on demand only. Removed some icons to unclutter the screen estate.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/Makefile.in      1.9 -> 1.10     0 inserted, 1 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.5 -> 1.6     15 inserted, 38 deleted
ossp-pkg/as/as-gui/as_gui.cpp      1.16 -> 1.17     0 inserted, 1 deleted
ossp-pkg/as/as-gui/as_gui.h      1.14 -> 1.15     2 inserted, 12 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.4 -> 1.5     16 inserted, 3 deleted
ossp-pkg/titraq/Makefile.in      1.9 -> 1.10     0 inserted, 1 deleted
ossp-pkg/titraq/titassist.cpp      1.5 -> 1.6     15 inserted, 38 deleted
ossp-pkg/titraq/titraq.cpp      1.16 -> 1.17     0 inserted, 1 deleted
ossp-pkg/titraq/titraq.h      1.14 -> 1.15     2 inserted, 12 deleted
ossp-pkg/titraq/titslot.cpp      1.4 -> 1.5     16 inserted, 3 deleted

ossp-pkg/as/as-gui/Makefile.in 1.9 -> 1.10

--- Makefile.in  2002/11/18 22:38:04     1.9
+++ Makefile.in  2002/11/20 11:06:32     1.10
@@ -149,7 +149,6 @@
 
 check: test
 test: titraq
-        $(CHMOD) 755 titraq_test.sh > /dev/null 2>&1
         ./titraq_test.sh
 
 .PHONY: install uninstall clean distclean realclean check test


ossp-pkg/as/as-gui/as_assist.cpp 1.5 -> 1.6

--- as_assist.cpp        2002/11/19 20:29:08     1.5
+++ as_assist.cpp        2002/11/20 11:06:32     1.6
@@ -11,38 +11,14 @@
 #include "titrex.h"             // Exception classes
 
 // Icon pixel maps
-#include "gfx/cwlogo.xpm"       // static const char *s_kpcCwlogo_xpm[]
-#include "gfx/osspicon.xpm"     // static const char *s_kpcOsspicon_xpm[]
-#include "gfx/ossplogo.xpm"     // static const char *s_kpcOssplogo_xpm[]
-#include "gfx/qticon.xpm"       // static const char *s_kpcQticon_xpm[]
 #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/osspicon.xpm"     // static const char *s_kpcOsspicon_xpm[]
 #include "gfx/whatsthis.xpm"    // static const char *s_kpcWhatsthis_xpm[]
 
 
 //
-// Construct the icon images
-//
-void Titraqform::setupIcons(void)
-{
-    // Initialize icon images
-    m_pCwlogo = new QImage(s_kpcCwlogo_xpm);
-    m_pOsspicon = new QImage(s_kpcOsspicon_xpm);
-    m_pOssplogo = new QImage(s_kpcOssplogo_xpm);
-    m_pQticon = new QImage(s_kpcQticon_xpm);
-    m_pNewicon = new QImage(s_kpcFilenew_xpm);
-    m_pOpenicon = new QImage(s_kpcFileopen_xpm);
-    m_pSaveicon = new QImage(s_kpcFilesave_xpm);
-    m_pWhatsicon = new QImage(s_kpcWhatsthis_xpm);
-
-    // Lets test out our sanity
-    if (!(m_pOsspicon && m_pQticon && m_pNewicon && m_pNewicon && \
-          m_pOpenicon && m_pSaveicon && m_pWhatsicon))
-        throw Genexcept("Main window icon creation failed.");
-}
-
-//
 // Construct the menu bar
 //
 void Titraqform::setupMenubar(void)
@@ -101,12 +77,13 @@
     if (pHelppopup == NULL) // Sanity check
         throw Genexcept("Main window help popup creation failed.");
     m_pMenubar->insertItem(trUtf8("&Help"), pHelppopup);
-    pHelppopup->insertItem(trUtf8("&About"), this, SLOT(about()), Key_F1);
+    pHelppopup->insertItem(trUtf8("&Contents"), this, SLOT(helpContents()), Key_F1);
     pHelppopup->insertSeparator();
-    pHelppopup->insertItem(QPixmap(*m_pOsspicon), trUtf8("About &OSSP"), this, SLOT(aboutOSSP()));
-    pHelppopup->insertItem(QPixmap(*m_pQticon), trUtf8("About &Qt"), this, SLOT(aboutQt()));
+    pHelppopup->insertItem(trUtf8("About &Titraq"), this, SLOT(aboutTitraq()));
+    pHelppopup->insertItem(trUtf8("About &OSSP"), this, SLOT(aboutOSSP()));
+    pHelppopup->insertItem(trUtf8("About &Qt"), this, SLOT(aboutQt()));
     pHelppopup->insertSeparator();
-    pHelppopup->insertItem(QPixmap(*m_pWhatsicon), trUtf8("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1);
+    pHelppopup->insertItem(QPixmap(s_kpcWhatsthis_xpm), trUtf8("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1);
 }
 
 //
@@ -114,12 +91,17 @@
 //
 void Titraqform::setupActions(void)
 {
+    // First associate the graphics with MIME types
+    QMimeSourceFactory::defaultFactory()->setPixmap("osspicon", QPixmap(s_kpcOsspicon_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("filenew", QPixmap(s_kpcFilenew_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("fileopen", QPixmap(s_kpcFileopen_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("filesave", QPixmap(s_kpcFilesave_xpm));
+
     // File new action
     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()));
-    QMimeSourceFactory::defaultFactory()->setPixmap("filenew", m_pFilenewact->iconSet().pixmap());
     const char *kszFilenewtext = trUtf8("<p><img source=\"filenew\"> "
                                  "Click this button to make a <em>blank file</em>."
                                  "You can also select the <b>New</b> command "
@@ -131,7 +113,6 @@
     if (m_pFileopenact == NULL) // Sanity check
         throw Genexcept("Main window file open action creation failed.");
     connect(m_pFileopenact, SIGNAL(activated()), this, SLOT(choose()));
-    QMimeSourceFactory::defaultFactory()->setPixmap("fileopen", m_pFileopenact->iconSet().pixmap());
     const char *kszFileopentext = trUtf8("<p><img source=\"fileopen\"> "
                                   "Click this button to open a <em>new file</em>."
                                   "You can also select the <b>Open</b> command "
@@ -143,7 +124,6 @@
     if (m_pFilesaveact == NULL) // Sanity check
         throw Genexcept("Main window file save action creation failed.");
     connect(m_pFilesaveact, SIGNAL(activated()), this, SLOT(save()));
-    QMimeSourceFactory::defaultFactory()->setPixmap("filesave", m_pFilesaveact->iconSet().pixmap());
     const char *kszFilesavetext = trUtf8("<p><img source=\"filesave\"> "
                                   "Click this button to <em>save</em> the file you "
                                   "are editing. You will be prompted for a file name.\n"
@@ -171,11 +151,10 @@
     connect(m_pFilequitact, SIGNAL(activated()), qApp, SLOT(quit()));
 
     // Add data row action
-    m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcOssplogo_xpm), trUtf8("Add &row"), 0, this, "Addrow");
+    m_pAddrowact = new QAction(trUtf8("Add Row"), 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()));
-    QMimeSourceFactory::defaultFactory()->setPixmap("ossplogo", m_pAddrowact->iconSet().pixmap());
     const char *kszAddrowtext = trUtf8("<p><img source=\"ossplogo\"> "
                                 "Click this button to add a <em>new row</em>."
                                 "You can also select the <b>Add row</b> command "
@@ -183,11 +162,10 @@
     m_pAddrowact->setWhatsThis(kszAddrowtext);
 
     // Delete data row action
-    m_pDeleterowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcOssplogo_xpm), trUtf8("Add &row"), 0, this, "Deleterow");
+    m_pDeleterowact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 0, this, "Deleterow");
     if (m_pDeleterowact == NULL) // Sanity check
         throw Genexcept("Main window delete row action creation failed.");
     connect(m_pDeleterowact, SIGNAL(activated()), this, SLOT(delEntry()));
-    QMimeSourceFactory::defaultFactory()->setPixmap("ossplogo", m_pDeleterowact->iconSet().pixmap());
     const char *kszDeleterowtext = trUtf8("<p><img source=\"ossplogo\"> "
                                    "Click this button to delete a <em>row</em>."
                                    "You can also select the <b>Delete row</b> command "
@@ -195,11 +173,10 @@
     m_pDeleterowact->setWhatsThis(kszDeleterowtext);
 
     // Write data action
-    m_pWritedataact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcOssplogo_xpm), trUtf8("Add &row"), 0, this, "Writedata");
+    m_pWritedataact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 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()));
-    QMimeSourceFactory::defaultFactory()->setPixmap("ossplogo", m_pWritedataact->iconSet().pixmap());
     const char *kszWritedatatext = trUtf8("<p><img source=\"ossplogo\"> "
                                    "Click this button to <em>write out</em> your accounting data."
                                    "You can also select the <b>Write data</b> command "


ossp-pkg/as/as-gui/as_gui.cpp 1.16 -> 1.17

--- as_gui.cpp   2002/11/19 19:42:14     1.16
+++ as_gui.cpp   2002/11/20 11:06:32     1.17
@@ -38,7 +38,6 @@
 
     // Abstractly build main widgets
     try {
-        setupIcons();
         setupActions();
         setupMenubar();
         setupFiletools();


ossp-pkg/as/as-gui/as_gui.h 1.14 -> 1.15

--- as_gui.h     2002/11/19 20:29:08     1.14
+++ as_gui.h     2002/11/20 11:06:32     1.15
@@ -44,16 +44,6 @@
     QHeader     *m_pTablehead;
     QStringList *m_pTaskentries;
 
-    // Reusable graphics
-    QImage      *m_pCwlogo;
-    QImage      *m_pOsspicon;
-    QImage      *m_pOssplogo;
-    QImage      *m_pQticon;
-    QImage      *m_pNewicon;
-    QImage      *m_pOpenicon;
-    QImage      *m_pSaveicon;
-    QImage      *m_pWhatsicon;
-
     // Edition widgets
     QDateEdit   *m_pDateedit;
     QTimeEdit   *m_pStarttime;
@@ -78,7 +68,8 @@
     void load(const QString &);         // Load accounting data into main window
     void save(void);                    // Serialize to the current file
     void saveAs(void);                  // Serialize to a selected file
-    void about(void);                   // Learn more about this program itself
+    void helpContents(void);            // Use the help contents
+    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
@@ -118,7 +109,6 @@
     bool isDirty(void);                 // Check for changed state danger
 
     // Constructor helpers
-    void setupIcons(void);              // Icons
     void setupActions(void);            // Actions
     void setupMenubar(void);            // Menu bar
     void setupFiletools(void);          // Tool bar


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

--- as_slot.cpp  2002/11/19 20:29:08     1.4
+++ as_slot.cpp  2002/11/20 11:06:32     1.5
@@ -6,6 +6,10 @@
 #include "titraq.h"             // Main classes
 #include "generic.h"            // Generic classes
 
+// Icon pixel maps
+#include "gfx/cwlogo.xpm"       // static const char *s_kpcCwlogo_xpm[]
+#include "gfx/ossplogo.xpm"     // static const char *s_kpcOssplogo_xpm[]
+
 
 //
 // Add a blank row entry to the current data window
@@ -240,9 +244,18 @@
 }
 
 //
+// Get help on Titraq functionality
+//
+void Titraqform::helpContents(void)
+{
+    Prototype Unimp;
+    Unimp.doMbox();
+}
+
+//
 // Learn more about this program itself
 //
-void Titraqform::about(void)
+void Titraqform::aboutTitraq(void)
 {
     QMessageBox *pCwmsg = new QMessageBox("OSSP titraq",
         QObject::trUtf8("OSSP titraq is a time and task-based\n"
@@ -254,7 +267,7 @@
         QMessageBox::NoButton, QMessageBox::NoButton,
         NULL, "Titraqmessage", true, Qt::WStyle_NormalBorder);
 
-    pCwmsg->setIconPixmap(QPixmap(*m_pCwlogo));
+    pCwmsg->setIconPixmap(QPixmap(s_kpcCwlogo_xpm));
     pCwmsg->exec();
 }
 
@@ -274,7 +287,7 @@
         QMessageBox::NoButton, QMessageBox::NoButton,
         NULL, "Osspmessage", true, Qt::WStyle_NormalBorder);
 
-    pOsspmsg->setIconPixmap(QPixmap(*m_pOssplogo));
+    pOsspmsg->setIconPixmap(QPixmap(s_kpcOssplogo_xpm));
     pOsspmsg->exec();
 }
 






CVSTrac 2.0.1