--- as_assist.cpp 2003/02/17 13:38:22 1.108
+++ as_assist.cpp 2003/02/17 17:18:24 1.109
@@ -85,6 +85,8 @@
#include "as_gfx/refreshd.xpm" // static const char *s_kpcDrefresh_xpm[]
#include "as_gfx/sync.xpm" // static const char *s_kpcSync_xpm[]
#include "as_gfx/syncd.xpm" // static const char *s_kpcDsync_xpm[]
+#include "as_gfx/report.xpm" // static const char *s_kpcReport_xpm[]
+#include "as_gfx/reportd.xpm" // static const char *s_kpcDreport_xpm[]
#include "as_gfx/prefs.xpm" // static const char *s_kpcPrefs_xpm[]
@@ -165,7 +167,8 @@
void Titraqform::setupActions(void)
{
QIconSet Saveiset, Cutiset, Copyiset, Pasteiset;
- QIconSet Rowaddiset, Rowdeliset, Refreshiset, Synciset;
+ QIconSet Rowaddiset, Rowdeliset, Refreshiset;
+ QIconSet Synciset, Reportiset;
// Construct iconsets to use later for multistate action images
Saveiset.setPixmap(QPixmap(s_kpcFilesave_xpm), QIconSet::Automatic, QIconSet::Normal);
@@ -184,6 +187,8 @@
Refreshiset.setPixmap(QPixmap(s_kpcDrefresh_xpm), QIconSet::Automatic, QIconSet::Disabled);
Synciset.setPixmap(QPixmap(s_kpcSync_xpm), QIconSet::Automatic, QIconSet::Normal);
Synciset.setPixmap(QPixmap(s_kpcDsync_xpm), QIconSet::Automatic, QIconSet::Disabled);
+ Reportiset.setPixmap(QPixmap(s_kpcReport_xpm), QIconSet::Automatic, QIconSet::Normal);
+ Reportiset.setPixmap(QPixmap(s_kpcDreport_xpm), QIconSet::Automatic, QIconSet::Disabled);
// First associate the graphics with MIME types
QMimeSourceFactory::defaultFactory()->setPixmap("osspicon", QPixmap(s_kpcOsspicon_xpm));
@@ -197,6 +202,7 @@
QMimeSourceFactory::defaultFactory()->setPixmap("rowdel", QPixmap(s_kpcRowdel_xpm));
QMimeSourceFactory::defaultFactory()->setPixmap("refresh", QPixmap(s_kpcRefresh_xpm));
QMimeSourceFactory::defaultFactory()->setPixmap("syncrpc", QPixmap(s_kpcSync_xpm));
+ QMimeSourceFactory::defaultFactory()->setPixmap("locreport", QPixmap(s_kpcReport_xpm));
QMimeSourceFactory::defaultFactory()->setPixmap("prefs", QPixmap(s_kpcPrefs_xpm));
// File new action
@@ -334,6 +340,18 @@
"from the <b>Report</b> menu.</p>";
m_pSyncact->setWhatsThis(kszSynctext);
+ // Local report generation action
+ m_pReportact = new QAction(trUtf8("Generate a local report"), Reportiset, trUtf8("&Report"), CTRL+Key_T, this, "LocalReport");
+ if (m_pReportact == NULL) // Sanity check
+ throw Genexcept("Main window local report action creation failed.");
+ connect(m_pReportact, SIGNAL(activated()), SLOT(genReport()));
+ const char *kszReporttext = "<p><img source=\"locreport\"> "
+ "Click this button to <em>report your data</em>. "
+ "A local report will be generated for you to view. "
+ "You can also select the <b>Local Report</b> command "
+ "from the <b>Report</b> menu.</p>";
+ m_pReportact->setWhatsThis(kszReporttext);
+
// Offer a formatted preferences panel for intuitive prefs object editing
m_pPrefsact = new QAction(trUtf8("Edit the preferences"), QPixmap(s_kpcPrefs_xpm), trUtf8("P&references..."), CTRL+Key_F, this, "Prefspanel");
if (m_pPrefsact == NULL) // Sanity check
@@ -462,8 +480,7 @@
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);
+ m_pReportact->addTo(pReportpopup);
// Pad spacing to force help menu to appear far right
m_pMenubar->insertSeparator();
@@ -521,6 +538,7 @@
m_pViewtools->setOpaqueMoving(false);
m_pViewtools->setCloseMode(QDockWindow::Never);
m_pRefreshact->addTo(m_pViewtools);
+ m_pReportact->addTo(m_pViewtools);
m_pSyncact->addTo(m_pViewtools);
// Construct and populate the lonely preferences tool bar
@@ -1020,6 +1038,7 @@
m_pCutact->setEnabled(bTurned);
m_pCopyact->setEnabled(bTurned);
m_pPasteact->setEnabled(bTurned);
+ m_pReportact->setEnabled(bTurned);
#if defined HAVE_MICO || defined HAVE_ESOAP
if (bTurned)
m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON)
|