Bug 87002

Summary: File->Close does not work as expected, and File->New Window is located strangely
Product: [Applications] kst Reporter: Rick Chern <rchern>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Rick Chern 2004-08-11 23:41:11 UTC
Version:           0.99-devel (using KDE KDE 3.2.1)
Installed from:    Compiled From Sources
OS:                Linux

File->Close closes the current window, and does not delete any data objects, so it behaves identically to Window->Close. It may be confusing to have two menu items that work identically.  In addition, closing a window is not really a "File" function.

File->New Window would seem to be more comfortably located in Window as Window->New.

(wishlist only)
Comment 1 Andrew Walker 2004-08-13 01:08:40 UTC
I would agree that File->Close should close all open windows, after querying the user if they want to save. This makes the Close option on the same level as Open and Open Recent.

For the New Window... item unfortunately the kmdi library has total control of this.
Comment 2 Rick Chern 2004-08-13 01:41:18 UTC
Would it be possible to not add the KMDI Window menu to the menubar, and create a custom one for kst?  Then connect the aboutToShow() signal for this custom menu to a slot that duplicates the current items in the KMDI Window menu, and adds any additional items (like New Window)?
Comment 3 Andrew Walker 2004-08-16 18:34:08 UTC
I have a fix for this and will check it in once 0.99 is released.
Comment 4 Andrew Walker 2004-08-17 18:28:39 UTC
CVS commit by arwalker: 

Moved the File->New Window... menu item to Window->New... which is the more logical location for it. Fix for 87002.

CCMAIL: 87002-done@bugs.kde.org


  M +9 -2      kst.cpp   1.211
  M +1 -0      kst.h   1.99


--- kdeextragear-2/kst/kst/kst.cpp  #1.210:1.211
@@ -208,7 +208,15 @@ KstApp::KstApp(QWidget *parent, const ch
       menuBar()->insertItem(i18n("&Window"), windowMenu());
     }
+    QObject::connect( windowMenu(), SIGNAL(aboutToShow()), this, SLOT(addNewWindowMenu()) );
   }
 }
 
+
+void KstApp::addNewWindowMenu() {
+  int id = windowMenu()->insertItem(i18n("&New..."), this, SLOT(slotFileNewWindow()), 0, -1, 0);
+  windowMenu()->setWhatsThis(id, i18n("Create a new plot window."));
+}
+
+
 void KstApp::checkFontPresent(const QString& font) {
   QFont f(font);
@@ -273,10 +281,9 @@ KstApp::~KstApp() {
 
 void KstApp::initActions() {
-
+#if 0
   fileNewWindow = new KAction(i18n("New &Window..."), 0, 0,
                               this, SLOT(slotFileNewWindow()),
                               actionCollection(),"file_new_window");
 
-#if 0
   fileOpenNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection());
   fileOpenNew->setWhatsThis(i18n("Open Kst plot file."));

--- kdeextragear-2/kst/kst/kst.h  #1.98:1.99
@@ -170,4 +170,5 @@ class KstApp : public KMdiMainFrm {
 
     void slotSettingsChanged();
+    void addNewWindowMenu();
 
   public slots: