[LINUX] Add option to disable the online updater.

Add option to remove all configuration related to checking for updates
online. Although it is not implemented at the moment, these options
appeared on our menu `Options` > `General ...`.

- Fix need of patch on #140.
This commit is contained in:
Edênis Freindorfer Azevedo 2019-07-10 20:47:16 -03:00 committed by Rafael Kitover
parent dbb5914fa4
commit 060da968eb
6 changed files with 41 additions and 2 deletions

View File

@ -110,6 +110,8 @@ endif()
option(ENABLE_FFMPEG "Enable ffmpeg A/V recording" ${FFMPEG_DEFAULT})
option(ENABLE_ONLINEUPDATES "Enable online update checks" ON)
set(LTO_DEFAULT ON)
# lto produces buggy binaries for 64 bit win32
@ -293,6 +295,10 @@ if(ENABLE_FFMPEG)
endif()
endif()
if(NOT ENABLE_ONLINEUPDATES)
add_definitions(-DNO_ONLINEUPDATES)
endif()
if(NOT ENABLE_FFMPEG)
add_definitions(-DNO_FFMPEG)
endif()
@ -444,7 +450,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
if(X86_32 OR AMD64)
set(MY_C_OPT_FLAGS ${MY_C_OPT_FLAGS} -mtune=generic)
endif()
# common debug flags
if(CMAKE_COMPILER_IS_GNUCXX)
set(MY_C_DBG_FLAGS -ggdb3 -Og -fno-omit-frame-pointer)

View File

@ -166,6 +166,7 @@ Here is the complete list:
| ENABLE_LINK | Enable GBA linking functionality (requires SFML) | ON |
| ENABLE_LIRC | Enable LIRC support | OFF |
| ENABLE_FFMPEG | Enable ffmpeg A/V recording | OFF |
| ENABLE_ONLINEUPDATES | Enable online update checks | ON |
| ENABLE_LTO | Compile with Link Time Optimization (gcc and clang only) | ON for release build |
| ENABLE_GBA_LOGGING | Enable extended GBA logging | ON |
| ENABLE_DIRECT3D | Direct3D rendering for wxWidgets (Windows, **NOT IMPLEMENTED!!!**) | ON |

View File

@ -3330,10 +3330,36 @@ bool MainFrame::BindControls()
sc->SetValidator(wxUIntValidator(&o)); \
} while (0)
{
#ifndef NO_ONLINEUPDATES
// Online Auto Update check frequency
getrbi("UpdateNever", gopts.onlineupdates, 0);
getrbi("UpdateDaily", gopts.onlineupdates, 1);
getrbi("UpdateWeekly", gopts.onlineupdates, 7);
#else
wxWindowList &children = d->GetChildren();
std::vector<wxWindow*> forDeletion;
for (wxWindowList::Node *node = children.GetFirst(); node; node = node->GetNext())
{
wxWindow *current = (wxWindow *)node->GetData();
if (dynamic_cast<wxStaticText*>(current))
{
if (((wxStaticText *)current)->GetName() == wxT("OnlineUpdates"))
forDeletion.push_back(current);
}
else if (dynamic_cast<wxRadioButton*>(current))
{
wxString tmp = ((wxRadioButton *)current)->GetName();
if (tmp == wxT("UpdateNever") ||
tmp == wxT("UpdateDaily") ||
tmp == wxT("UpdateWeekly"))
forDeletion.push_back(current);
}
}
for (unsigned i = 0; i < forDeletion.size(); ++i)
{
delete forDeletion[i];
}
#endif // NO_ONLINEUPDATES
getrbi("PNG", captureFormat, 0);
getrbi("BMP", captureFormat, 1);
getsc("RewindInterval", gopts.rewind_interval);

View File

@ -225,7 +225,9 @@ opt_desc opts[] = {
BOOLOPT("General/AutoLoadLastState", "", wxTRANSLATE("Automatically load last saved state"), gopts.autoload_state),
STROPT("General/BatteryDir", "", wxTRANSLATE("Directory to store game save files (relative paths are relative to ROM; blank is config dir)"), gopts.battery_dir),
BOOLOPT("General/FreezeRecent", "", wxTRANSLATE("Freeze recent load list"), gopts.recent_freeze),
#ifndef NO_ONLINEUPDATES
ENUMOPT("General/OnlineUpdates", "", wxTRANSLATE("Automatically check for online updates"), gopts.onlineupdates, wxTRANSLATE("never|daily|weekly")),
#endif // NO_ONLINEUPDATES
STROPT("General/RecordingDir", "", wxTRANSLATE("Directory to store A/V and game recordings (relative paths are relative to ROM)"), gopts.recording_dir),
INTOPT("General/RewindInterval", "", wxTRANSLATE("Number of seconds between rewind snapshots (0 to disable)"), gopts.rewind_interval, 0, 600),
STROPT("General/ScreenshotDir", "", wxTRANSLATE("Directory to store screenshots (relative paths are relative to ROM)"), gopts.scrshot_dir),
@ -350,7 +352,9 @@ opts_t::opts_t()
autofire_rate = 1;
print_auto_page = true;
autoPatch = true;
#ifndef NO_ONLINEUPDATES
onlineupdates = 1;
#endif // NO_ONLINEUPDATES
// quick fix for issues #48 and #445
link_host = "127.0.0.1";
}

View File

@ -42,7 +42,9 @@ extern struct opts_t {
/// General
bool autoload_state, autoload_cheats;
wxString battery_dir;
#ifndef NO_ONLINEUPDATES
int onlineupdates;
#endif // NO_ONLINEUPDATES
long last_update;
wxString last_updated_filename;
bool recent_freeze;

View File

@ -22,7 +22,7 @@
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<object class="wxStaticText" name="OnlineUpdates">
<label>Check for updates:</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>