--- as_assist.cpp 2003/01/24 18:22:03 1.84
+++ as_assist.cpp 2003/01/28 16:41:15 1.85
@@ -211,6 +211,8 @@
QMimeSourceFactory::defaultFactory()->setPixmap("rowadd", QPixmap(s_kpcRowadd_xpm));
QMimeSourceFactory::defaultFactory()->setPixmap("rowdel", QPixmap(s_kpcRowdel_xpm));
QMimeSourceFactory::defaultFactory()->setPixmap("refresh", QPixmap(s_kpcRefresh_xpm));
+ QMimeSourceFactory::defaultFactory()->setPixmap("synciiop", QPixmap(s_kpcSync_xpm));
+ QMimeSourceFactory::defaultFactory()->setPixmap("syncsoap", QPixmap(s_kpcSync_xpm));
// File new action
m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New..."), CTRL+Key_N, this, "New");
@@ -341,7 +343,7 @@
if (m_pSynciiopact == NULL) // Sanity check
throw Genexcept("Main window synchronize IIOP action creation failed.");
connect(m_pSynciiopact, SIGNAL(activated()), this, SLOT(syncIiop()));
- const char *kszSynciioptext = "<p><img source=\"synchronize\"> "
+ const char *kszSynciioptext = "<p><img source=\"synciiop\"> "
"Click this button to <em>synchronize the data</em>. "
"Your changed entries will be sent to the server. "
"You can also select the <b>Synchronize</b> command "
@@ -355,7 +357,7 @@
if (m_pSyncsoapact == NULL) // Sanity check
throw Genexcept("Main window synchronize SOAP action creation failed.");
connect(m_pSyncsoapact, SIGNAL(activated()), this, SLOT(syncSoap()));
- const char *kszSyncsoaptext = "<p><img source=\"synchronize\"> "
+ const char *kszSyncsoaptext = "<p><img source=\"syncsoap\"> "
"Click this button to <em>synchronize the data</em>. "
"Your changed entries will be sent to the server. "
"You can also select the <b>Synchronize</b> command "
@@ -1032,3 +1034,35 @@
this->updEdit(m_pMaintable->currentRow()); // Update edit controls
m_pMaintable->setDirty(false); // Reset to clean data
}
+
+//
+// Check command line arguments, and parse for an existing filename
+// Returns the number of unhandled arguments, possibly multiple filenames
+//
+int Titraqform::setupCmdargs(void)
+{
+ // If the user gives a filename argument to the shell, then open that file
+ int nNumargs = qApp->argc(); // Holds the number of cmd arguments
+ int nRet = qApp->argc() - 1; // Holds the return value
+ QFile Initial; // Initial event data file to edit
+
+ if (nNumargs > 1) { // Warm up a nice cascade, to set my mind on four weeks of vacation
+ for (int nIter = 1; nIter < nNumargs; nIter++) { // Salad in New Zealand
+ if (QChar(*qApp->argv()[nIter]) != '-') { // Bunuelos in Colombia
+ if (QFile::exists(qApp->argv()[nIter])) {
+ this->setFilename(qApp->argv()[nIter]); // Store inital filename
+ Initial.setName(*this->getFilename()); // Initial file to load
+ this->loadData(Initial); // Pass to helper method
+ enableIface(true); // Turn on the lights
+ m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename(), 4000);
+ m_pMaintable->ensureCellVisible(m_pMaintable->currentRow(), 0);
+ }
+ else { // The inital file name does not correspond to a file
+// qWarning((QString("The file ") + qApp->argv()[nIter] + QString(" does not exist.")).ascii());
+ m_pStatbar->message(trUtf8(QString("The file ") + qApp->argv()[nIter] + QString(" does not exist.")));
+ }
+ }
+ }
+ }
+ return nRet; // Return the number of unhandled arguments
+}
|