Version: 1.2.0_devel (using KDE 3.4.2 Level "b" , SUSE 10.0) Compiler: Target: i586-suse-linux OS: Linux (i686) release 2.6.13-15-default Start KDE, cancel quickstart: now you have an empty kst. Select eg, box mode. Try to draw a box. Nothing happens. Create a plot. Now the box mode works, even outside of the plot. The view object modes should work, even if no plot has been created.
This is a quirk of MDI. There is no tab yet, so no-where to draw. In childframe or other mode, there will be a window created if we create a view. Do you want that to be the case? If so, it's a one-liner. (and what do we name that window then?)
We should start with a single view created, called i18n("default name of first window", "W1"); On December 2, 2005 12:05 pm, George Staikos wrote: > This is a quirk of MDI. There is no tab yet, so no-where to draw. In > childframe or other mode, there will be a window created if we create a > view. Do you want that to be the case? If so, it's a one-liner. (and what > do we name that window then?)
SVN commit 485093 by staikos: Create a default window on startup BUG:117535 M +1 -1 kst.cpp M +1 -0 kstdoc.cpp --- trunk/extragear/graphics/kst/kst/kst.cpp #485092:485093 @@ -917,7 +917,7 @@ void KstApp::initDocument() { doc = new KstDoc(this); - doc->newDocument(); + QTimer::singleShot(0, this, SLOT(slotFileNew())); } --- trunk/extragear/graphics/kst/kst/kstdoc.cpp #485092:485093 @@ -163,6 +163,7 @@ _modified = false; _absFilePath = QDir::homeDirPath(); _title = i18n("Untitled"); + KstApp::inst()->newWindow(i18n("default name of first window", "W1")); createScalars(); emit updateDialogs(); //}
After this change if I create some plots from the command line then I am first queried with "The current plot definition has been modified. Do you want to save it?". This should not happen.
SVN commit 485358 by staikos: Use more of a hack for the startup-with-window implementation so that the command-line still works. Only creates a window if one doesn't exist. BUG: 117535 M +9 -3 kst.cpp M +1 -0 kst.h --- trunk/extragear/graphics/kst/kst/kst.cpp #485357:485358 @@ -917,10 +917,17 @@ void KstApp::initDocument() { doc = new KstDoc(this); - QTimer::singleShot(0, this, SLOT(slotFileNew())); + QTimer::singleShot(0, this, SLOT(delayedDocInit())); } +void KstApp::delayedDocInit() { + if (!activeWindow()) { + doc->newDocument(); + } +} + + void KstApp::forceUpdate() { _updateThread->forceUpdate(); } @@ -1024,6 +1031,7 @@ config->sync(); } + void KstApp::readOptions() { config->setGroup("General Options"); _recent->loadEntries(config, "Recent Files"); @@ -1156,9 +1164,7 @@ slotFileSaveAs(); } else { slotUpdateStatusMsg(i18n("Saving file...")); - doc->saveDocument(doc->absFilePath()); - slotUpdateStatusMsg(i18n("Ready")); } } --- trunk/extragear/graphics/kst/kst/kst.h #485357:485358 @@ -222,6 +222,7 @@ void fixKMdi(); void showContextMenu(QWidget *w, const QPoint& pos); void showContextMenu(const QPoint& pos); + void delayedDocInit(); public slots: void fromEnd();