Bug 117535 - View Object creation impossible w/out plots created first
Summary: View Object creation impossible w/out plots created first
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-02 20:40 UTC by Netterfield
Modified: 2005-12-04 00:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Netterfield 2005-12-02 20:40:08 UTC
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.
Comment 1 George Staikos 2005-12-02 21:05:14 UTC
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?)
Comment 2 Netterfield 2005-12-02 21:15:31 UTC
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?)

Comment 3 George Staikos 2005-12-02 22:02:16 UTC
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();
   //}
Comment 4 Andrew Walker 2005-12-03 02:36:37 UTC
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.
Comment 5 George Staikos 2005-12-04 00:27:27 UTC
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();