# HG changeset patch
# User Stefan Mahr <dac922@gmx.de>
# Date 1425052069 -3600
#      Fri Feb 27 16:47:49 2015 +0100
# Node ID e4c0efa2fb9eda5b28b7ebff302d3c685742cea4
# Parent  c7c50030e76c6110ca47571e785f8699f68cbb95
qt menu

diff -r c7c50030e76c -r e4c0efa2fb9e libgui/graphics/Figure.cc
--- a/libgui/graphics/Figure.cc	Fri Feb 27 09:44:58 2015 -0500
+++ b/libgui/graphics/Figure.cc	Fri Feb 27 16:47:49 2015 +0100
@@ -29,8 +29,8 @@
 #include <QActionGroup>
 #include <QApplication>
 #include <QEvent>
-#include <QFileDialog>
-#include <QFileInfo>
+//#include <QFileDialog>
+//#include <QFileInfo>
 #include <QFrame>
 #include <QMainWindow>
 #include <QMenu>
@@ -47,9 +47,9 @@
 #include "MouseModeActionGroup.h"
 #include "QtHandlesUtils.h"
 
-#include "octave-qt-link.h"
+//#include "octave-qt-link.h"
 
-#include "builtin-defun-decls.h"
+//#include "builtin-defun-decls.h"
 
 namespace QtHandles
 {
@@ -221,6 +221,7 @@
     return NoMode;
 }
 
+#if 0
 QString Figure::fileName (void)
 {
   gh_manager::auto_lock lock;
@@ -240,6 +241,7 @@
 
   fp.set_filename (name.toStdString ());
 }
+#endif
 
 MouseMode Figure::mouseMode (void)
 {
@@ -285,6 +287,7 @@
   m_menuBar = new MenuBar (win);
   win->setMenuBar (m_menuBar);
 
+#if 0
   QMenu* fileMenu = m_menuBar->addMenu (tr ("&File"));
   fileMenu->menuAction ()->setObjectName ("builtinMenu");
   fileMenu->addAction (tr ("&Save"), this, SLOT (fileSaveFigure (bool)));
@@ -309,6 +312,7 @@
   helpMenu->addAction (tr ("&About QtHandles"), this,
                        SLOT (helpAboutQtHandles (void)));
   helpMenu->addAction (tr ("About &Qt"), qApp, SLOT (aboutQt (void)));
+#endif
 
   m_menuBar->addReceiver (this);
 }
@@ -732,6 +736,7 @@
     canvas->setCursor (mode);
 }
 
+#if 0
 void Figure::fileSaveFigure (bool prompt)
 {
   QString file = fileName ();
@@ -773,6 +778,7 @@
 {
   fileSaveFigure (true);
 }
+#endif
 
 void Figure::fileCloseFigure (void)
 {
diff -r c7c50030e76c -r e4c0efa2fb9e libgui/graphics/Figure.h
--- a/libgui/graphics/Figure.h	Fri Feb 27 09:44:58 2015 -0500
+++ b/libgui/graphics/Figure.h	Fri Feb 27 16:47:49 2015 +0100
@@ -71,8 +71,8 @@
 
   static Figure* create (const graphics_object& go);
 
-  QString fileName (void);
-  void setFileName (const QString& name);
+  //QString fileName (void);
+  //void setFileName (const QString& name);
 
   MouseMode mouseMode (void);
 
@@ -108,12 +108,12 @@
 
   static void updateBoundingBoxHelper (void*);
 
-  void save_figure_callback (const std::string& file);
+  //void save_figure_callback (const std::string& file);
 
 private slots:
   void setMouseMode (MouseMode mode);
-  void fileSaveFigure (bool prompt = false);
-  void fileSaveFigureAs (void);
+  //void fileSaveFigure (bool prompt = false);
+  //void fileSaveFigureAs (void);
   void fileCloseFigure (void);
   void editCopy (void);
   void editCut (void);
diff -r c7c50030e76c -r e4c0efa2fb9e scripts/gui/private/__get_funcname__.m
--- a/scripts/gui/private/__get_funcname__.m	Fri Feb 27 09:44:58 2015 -0500
+++ b/scripts/gui/private/__get_funcname__.m	Fri Feb 27 16:47:49 2015 +0100
@@ -32,7 +32,7 @@
     tk = graphics_toolkit ();
     funcname = strcat ("__", basename, "_", tk, "__");
     if (numel (tk) > 0 && ! strcmp (tk, "fltk")
-        && ! __is_function__ (funcname)))
+        && ! __is_function__ (funcname))
       warning ("%s: no implementation for toolkit '%s', using 'fltk' instead",
                basename, tk);
     endif
diff -r c7c50030e76c -r e4c0efa2fb9e scripts/plot/util/private/__add_default_menu__.m
--- a/scripts/plot/util/private/__add_default_menu__.m	Fri Feb 27 09:44:58 2015 -0500
+++ b/scripts/plot/util/private/__add_default_menu__.m	Fri Feb 27 16:47:49 2015 +0100
@@ -27,7 +27,8 @@
 function __add_default_menu__ (fig)
 
   ## Only FLTK toolkit currently provides menubar
-  if (! strcmp (get (fig, "__graphics_toolkit__"), "fltk"))
+  tk = get (fig, "__graphics_toolkit__");
+  if (! any (strcmp (tk, {"fltk", "qt"})))
     return;
   endif
 
@@ -45,7 +46,9 @@
       uimenu (__e, "label", "Show grid on all axes", "tag", "on", "callback", @grid_cb);
       uimenu (__e, "label", "Hide grid on all axes", "tag", "off", "callback", @grid_cb);
       uimenu (__e, "label", "Auto&scale all axes", "callback", @autoscale_cb);
-      gm = uimenu (__e, "label", "GUI &Mode (on all axes)");
+
+      if (strcmp (tk, "fltk"))
+        gm = uimenu (__e, "label", "GUI &Mode (on all axes)");
         uimenu (gm, "label", "Pan x and y", "tag", "pan_on", "callback", @guimode_cb);
         uimenu (gm, "label", "Pan x only", "tag", "pan_xon", "callback", @guimode_cb);
         uimenu (gm, "label", "Pan y only", "tag", "pan_yon", "callback", @guimode_cb);
@@ -53,6 +56,7 @@
         uimenu (gm, "label", "Rotate on", "tag", "rotate3d", "callback", @guimode_cb);
         uimenu (gm, "label", "Enable mousezoom", "tag", "zoom_on", "callback", @guimode_cb);
         uimenu (gm, "label", "Disable mousezoom", "tag", "zoom_off", "callback", @guimode_cb);
+      endif
 
   endif
 
