Index: ossp-pkg/as/as-gui/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v' 2>/dev/null --- 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 Index: ossp-pkg/as/as-gui/as_assist.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- 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("

" "Click this button to make a blank file." "You can also select the New 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("

" "Click this button to open a new file." "You can also select the Open 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("

" "Click this button to save 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("

" "Click this button to add a new row." "You can also select the Add row 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("

" "Click this button to delete a row." "You can also select the Delete row 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("

" "Click this button to write out your accounting data." "You can also select the Write data command " Index: ossp-pkg/as/as-gui/as_gui.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v rcsdiff -q -kk '-r1.16' '-r1.17' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v' 2>/dev/null --- 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(); Index: ossp-pkg/as/as-gui/as_gui.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- 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 Index: ossp-pkg/as/as-gui/as_slot.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- 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(); }