Skip to content
Permalink
Browse files

stop showing "wrote battery" msg on panel #318

Remove the "wrote battery" system message that is painted on the panel,
because it annoys people, and show errors writing the battery with
`wxLogError()`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information...
rkitover committed Mar 2, 2019
1 parent 646557e commit d2922cfc5d8e5679ebaae4abfd5bd8a769388a03
Showing with 5 additions and 11 deletions.
  1. +4 −10 src/wx/panel.cpp
  2. +1 −1 src/wx/wxvbam.h
@@ -503,7 +503,7 @@ void GameArea::UnloadGame(bool destruct)
// if timer was counting down for save, go ahead and save
// this might not be safe, though..
if (systemSaveUpdateCounter > SYSTEM_SAVE_NOT_UPDATED) {
SaveBattery(destruct);
SaveBattery();
}

MainFrame* mf = wxGetApp().frame;
@@ -633,7 +633,7 @@ bool GameArea::SaveState(const wxFileName& fname)
return ret;
}

void GameArea::SaveBattery(bool quiet)
void GameArea::SaveBattery()
{
// MakeInstanceFilename doesn't do wxString, so just add slave ID here
wxString bname = game_name();
@@ -653,20 +653,14 @@ void GameArea::SaveBattery(bool quiet)
// auto-conversion of wxCharBuffer to const char * seems broken
// so save underlying wxCharBuffer (or create one of none is used)
wxCharBuffer fnb = fn.mb_fn_str();
wxString msg;

// FIXME: add option to support ring of backups
// of course some games just write battery way too often for such
// a thing to be useful
if (emusys->emuWriteBattery(fnb.data()))
msg.Printf(_("Wrote battery %s"), fn.mb_str());
else
msg.Printf(_("Error writing battery %s"), fn.mb_str());
if (!emusys->emuWriteBattery(fnb.data()))
wxLogError(wxT("Error writing battery %s"), fn);

systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;

if (!quiet)
systemScreenMessage(msg);
}

void GameArea::AddBorder()
@@ -513,7 +513,7 @@ class GameArea : public wxPanel, public HiDPIAware {
bool SaveState(const wxFileName& fname);

// save to default location
void SaveBattery(bool quiet = false);
void SaveBattery();

// true if file at default location may not match memory
bool cheats_dirty;

0 comments on commit d2922cf

Please sign in to comment.
You can’t perform that action at this time.