Index: ossp-pkg/as/as-gui/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/ChangeLog,v rcsdiff -q -kk '-r1.16' '-r1.17' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/ChangeLog,v' 2>/dev/null --- ChangeLog 2003/01/28 16:41:15 1.16 +++ ChangeLog 2003/01/29 17:05:31 1.17 @@ -1,5 +1,7 @@ Geschichte des OSSP titraq in Vorwaerts Cronordnung +030129 Fixed the autoscroll before show bug, causing wrong data position + 030128 Added missing MIME icon entries for synciiop and syncsoap Implemented initial file loading by shell argument 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.87' '-r1.88' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- as_assist.cpp 2003/01/28 17:33:55 1.87 +++ as_assist.cpp 2003/01/29 17:05:31 1.88 @@ -1036,47 +1036,31 @@ } // -// Check command line arguments, and parse for an existing filename -// Returns the number of unhandled arguments, possibly multiple filenames +// Parse command line arguments for an existing filename, and +// open it to edit the intended (but optional) initial data // -int Titraqform::setupCmdargs(void) +void Titraqform::loadInit(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 = 0; // Holds the return value + int nValid = 0; // Holds the return value + QFile Initial; // Initial event data file 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 this->setFilename(qApp->argv()[nIter]); // Store inital filename - if (QFile::exists(*getFilename())) - return ++nRet; // Handled the filename - else - ++nRet; + Initial.setName(*this->getFilename()); // Initial file to load + if (Initial.exists(*getFilename())) { + this->loadData(Initial); // Pass to helper method + enableIface(true); // Turn on the lights + m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename()); + } + else // The inital file name does not correspond to a file + m_pStatbar->message(trUtf8(QString("The file ") + *this->getFilename() + QString(" does not exist."))); } } - if (nRet > 0) - return -1; // Return a general initial file error } - return nRet; // Return the number of unhandled arguments -} - -// -// Opens an inital event data file if one exists -// -void Titraqform::setupInitdata(int nFilearg) -{ - // Logic left over from setupCmdargs to help decide what our cmd parsing did - if (nFilearg == 0) // Args handled, no initial file + else m_pStatbar->message(trUtf8("Ready")); // Signal a ready condition - else if (nFilearg > 0) { // Args handled, found initial file - QFile Initial; // Initial event data file to edit - 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()); - } - else // The inital file name does not correspond to a file - m_pStatbar->message(trUtf8(QString("The file ") + *this->getFilename() + QString(" does not exist."))); - } 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.36' '-r1.37' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v' 2>/dev/null --- as_gui.cpp 2003/01/28 17:33:55 1.36 +++ as_gui.cpp 2003/01/29 17:05:31 1.37 @@ -51,7 +51,6 @@ // Atenzione! Order is very important in the following sequence. // FIXME: Reorganize this procedural mess into self contained objects try { - int nUnhandled; // Holds number of unhandled cmd args setupPrefs(); // Load general preferences setupActions(); // Create and initialize actions setupMenubar(); // Create and initialize menu bar @@ -62,9 +61,6 @@ 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 - setupInitdata(nUnhandled); // Possibly open an inital event data file } catch (Genexcept& Genex) { Genex.reportErr(); 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.64' '-r1.65' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2003/01/28 17:33:55 1.64 +++ as_gui.h 2003/01/29 17:05:31 1.65 @@ -116,6 +116,9 @@ m_szFilename = new QString(Fname); }; + // Utility members + void loadInit(void); // Parse cmds and open initial file + // Top level members Preferences *m_pPrefs; @@ -246,8 +249,6 @@ 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 - void setupInitdata(int); // Opens an inital event data file // 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.12' '-r1.13' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_main.cpp,v' 2>/dev/null --- as_main.cpp 2003/01/28 16:41:16 1.12 +++ as_main.cpp 2003/01/29 17:05:31 1.13 @@ -39,5 +39,6 @@ Titraqform Mainform; // Main app window App.setMainWidget(&Mainform); Mainform.show(); // Finally start the show + Mainform.loadInit(); // Start with initial data return App.exec(); }