Index: ossp-pkg/as/as-gui/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/ChangeLog,v rcsdiff -q -kk '-r1.15' '-r1.16' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/ChangeLog,v' 2>/dev/null --- ChangeLog 2003/01/27 17:56:56 1.15 +++ ChangeLog 2003/01/28 16:41:15 1.16 @@ -1,5 +1,8 @@ Geschichte des OSSP titraq in Vorwaerts Cronordnung +030128 Added missing MIME icon entries for synciiop and syncsoap + Implemented initial file loading by shell argument + 030127 Changed date and time from ISO format to AS specific Added logic to dim and undim icons on (non)empty documents Improved intuitiveness of a newDoc operation by appending a default row Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.62' '-r1.63' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- TODO 2003/01/27 17:56:56 1.62 +++ TODO 2003/01/28 16:41:15 1.63 @@ -50,6 +50,7 @@ Soll mehr intuitive, mit sekondaer/dritte Keycolumn CRC und Rev sollen nicht in gleiche Methode berechnet No need to have upd slots for non-changeable upd controls +Use argc and argv to open a task file on startup Win32 ----- 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.84' '-r1.85' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- 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 = "

" + const char *kszSynciioptext = "

" "Click this button to synchronize the data. " "Your changed entries will be sent to the server. " "You can also select the Synchronize 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 = "

" + const char *kszSyncsoaptext = "

" "Click this button to synchronize the data. " "Your changed entries will be sent to the server. " "You can also select the Synchronize 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 +} 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.34' '-r1.35' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v' 2>/dev/null --- as_gui.cpp 2003/01/16 08:37:40 1.34 +++ as_gui.cpp 2003/01/28 16:41:15 1.35 @@ -41,6 +41,8 @@ Titraqform::Titraqform(QWidget *pParent, const char *kszName, WFlags Flags) : QMainWindow(pParent, kszName, Flags) { + int nUnhandled; // Holds the number of unhandled command line arguments + // Early initializations m_pFiletools = NULL; m_pEdittools = NULL; @@ -61,6 +63,7 @@ setupEditlay(); // Create and initialize edit controls setupColumns(); // Prepare columns for viewing, sorting enableIface(false); // Start things off in a empty state + nUnhandled = setupCmdargs(); // Parse the command line, and init file } catch (Genexcept& Genex) { Genex.reportErr(); @@ -85,7 +88,9 @@ // setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, // (QSizePolicy::SizeType)0, 0, 0, sizePolicy().hasHeightForWidth())); - m_pStatbar->message(trUtf8("Ready")); // Signal a ready condition + // Logic left over from setupCmdargs to help decide what our cmd parsing did + if (nUnhandled == 0) // Args handled, no initial file + m_pStatbar->message(trUtf8("Ready")); // Signal a ready condition } // 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.62' '-r1.63' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2003/01/24 16:32:18 1.62 +++ as_gui.h 2003/01/28 16:41:15 1.63 @@ -246,6 +246,7 @@ void setupPieces(void); // Assemble widget pieces void setupColumns(void); // Arrange and configure columns void enableIface(bool); // [En/dis]able most ui pieces + int setupCmdargs(void); // Parse the command line args // Data processing void loadAccounts(QFile &); // Load accounts from file Index: ossp-pkg/as/as-gui/as_main.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_main.cpp,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_main.cpp,v' 2>/dev/null --- as_main.cpp 2002/12/19 20:46:26 1.11 +++ as_main.cpp 2003/01/28 16:41:16 1.12 @@ -34,7 +34,7 @@ int main(int argc, char **argv) { - QApplication App(argc, argv); + QApplication App(argc, argv, QApplication::GuiClient); Titraqform Mainform; // Main app window App.setMainWidget(&Mainform); 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.90' '-r1.91' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- as_slot.cpp 2003/01/27 17:56:56 1.90 +++ as_slot.cpp 2003/01/28 16:41:16 1.91 @@ -373,6 +373,7 @@ // Fall through to implicit open code this->setCaption(Filestring); m_pStatbar->message(trUtf8("Loaded document ") + Filestring, 4000); + m_pMaintable->ensureCellVisible(m_pMaintable->currentRow(), 0); this->enableIface(true); // Turn on the lights } else