Skip to content

Commit

Permalink
Ignore "wgnuplot" if not on Windows platform.
Browse files Browse the repository at this point in the history
No need to save the gnuplot/wgnuplot preference or log
the preference, if the platform is not Windows.
  • Loading branch information
daute committed Jan 17, 2025
1 parent 2e4cd7c commit d200d33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,9 @@ void Configuration::WriteSettings(const wxString &file) {
config->Write(wxS("suppressYellowMarkerMessages"),
hideMessagesConfigString);
}
config->Write("usewgnuplot", m_useWgnuplot);
#ifdef __WXMSW__
config->Write("usewgnuplot", m_useWgnuplot);
#endif
config->Write("maximaHelpFormat", static_cast<long>(m_maximaHelpFormat));
config->Write(wxS("Print/Margin/Top"), m_printMargin_Top);
config->Write(wxS("Print/Margin/Bot"), m_printMargin_Bot);
Expand Down
7 changes: 3 additions & 4 deletions src/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,8 @@ class Configuration
void Display2d_Unicode(bool unicode){m_display2d_Unicode = unicode;}
bool Display2d_Unicode() const {return m_display2d_Unicode;}

bool UseWGnuplot() const {return m_useWgnuplot;}
#ifdef __WXMSW__
bool UseWGnuplot() const {return m_useWgnuplot;}
void UseWGnuplot(bool usewgnuplot) {m_useWgnuplot = usewgnuplot;}
#endif
wxString TexPreamble() const {return m_texPreamble;}
Expand Down Expand Up @@ -1259,10 +1259,9 @@ class Configuration
wxBrush m_BackgroundBrush;
wxBrush m_tooltipBrush;
bool m_greekSidebar_ShowLatinLookalikes;
#ifndef __WXMSW__
const
#endif
#ifdef __WXMSW__
bool m_useWgnuplot = false;
#endif
bool m_greekSidebar_Show_mu;
wxString m_symbolPaneAdditionalChars;
bool m_invertBackground;
Expand Down
4 changes: 3 additions & 1 deletion src/wxMaxima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3612,6 +3612,7 @@ void wxMaxima::GnuplotCommandName(wxString gnuplot) {
pathlist.Add(OSX_MACPORTS_PREFIX "/bin");
#endif

#ifdef __WXMSW__
wxString wgnuplot = gnuplot;
if(m_configuration.UseWGnuplot())
{
Expand All @@ -3629,7 +3630,6 @@ void wxMaxima::GnuplotCommandName(wxString gnuplot) {
{
wxLogMessage(_("Instructed to prefer gnuplot over wgnuplot"));
}
#ifdef __WXMSW__
if (m_gnuplotcommand.IsEmpty())
m_gnuplotcommand = pathlist.FindAbsoluteValidPath(gnuplot);
m_gnuplotcommand_commandline = pathlist.FindAbsoluteValidPath(wxS("gnuplot.exe"));
Expand All @@ -3656,6 +3656,7 @@ void wxMaxima::GnuplotCommandName(wxString gnuplot) {
// If not successful, use the original command (better than empty for error
// messages)
if (m_gnuplotcommand.IsEmpty()) {
#ifdef __WXMSW__
if(m_configuration.UseWGnuplot())
{
m_gnuplotcommand = wgnuplot;
Expand All @@ -3666,6 +3667,7 @@ void wxMaxima::GnuplotCommandName(wxString gnuplot) {
m_gnuplotcommand = gnuplot;
wxLogMessage(_("Gnuplot not found, using the default: %s"), gnuplot.mb_str());
}
#endif
} else {
wxLogMessage(_("Gnuplot found at: %s"), m_gnuplotcommand.mb_str());
#ifdef __WINDOWS__
Expand Down

0 comments on commit d200d33

Please sign in to comment.