comparison libgui/graphics/Figure.cc @ 24209:92acdcf72c46

use .ofig instead of .fig in "save as" figure menu * Figure.cc (Figure::fileSaveFigure, Figure::save_figure_callback): Use .ofig instead of .fig. * __add_default_menu__.m (__save_as__, save_cb): Use .ofig instead of .fig.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Nov 2017 12:00:07 -0500
parents 68c4ee9545b2
children d26b8f30ee4b
comparison
equal deleted inserted replaced
24208:eec262017c6a 24209:92acdcf72c46
865 865
866 if (file.isEmpty ()) 866 if (file.isEmpty ())
867 { 867 {
868 prompt = true; 868 prompt = true;
869 869
870 file = "untitled.fig"; 870 file = "untitled.ofig";
871 } 871 }
872 872
873 if (prompt || file.isEmpty ()) 873 if (prompt || file.isEmpty ())
874 { 874 {
875 QFileInfo finfo (file); 875 QFileInfo finfo (file);
876 876
877 file = QFileDialog::getSaveFileName (qWidget<FigureWindow> (), 877 file = QFileDialog::getSaveFileName (qWidget<FigureWindow> (),
878 tr ("Save Figure As"), 878 tr ("Save Figure As"),
879 finfo.absoluteFilePath (), 879 finfo.absoluteFilePath (),
880 tr ("Figure File (*.fig);;Vector Image Formats (*.eps *.epsc *.pdf *.svg *.ps *.tikz);;Bitmap Image Formats (*.gif *.jpg *.png *.tiff)"), 880 tr ("Octave Figure File (*.ofig);;Vector Image Formats (*.eps *.epsc *.pdf *.svg *.ps *.tikz);;Bitmap Image Formats (*.gif *.jpg *.png *.tiff)"),
881 nullptr, 881 nullptr,
882 QFileDialog::DontUseNativeDialog); 882 QFileDialog::DontUseNativeDialog);
883 } 883 }
884 884
885 if (! file.isEmpty ()) 885 if (! file.isEmpty ())
899 figure::properties& fp = properties<figure> (); 899 figure::properties& fp = properties<figure> ();
900 octave_value fnum = fp.get___myhandle__ ().as_octave_value (); 900 octave_value fnum = fp.get___myhandle__ ().as_octave_value ();
901 901
902 size_t flen = file.length (); 902 size_t flen = file.length ();
903 903
904 if (flen > 4 && file.substr (flen-4, 4) == ".fig") 904 if (flen > 4 && file.substr (flen-4, 4) == ".ofig")
905 Ffeval (ovl ("hgsave", fnum, file)); 905 Ffeval (ovl ("hgsave", fnum, file));
906 else 906 else
907 Ffeval (ovl ("print", fnum, file)); 907 Ffeval (ovl ("print", fnum, file));
908 } 908 }
909 909