Skip to content
Snippets Groups Projects
Commit 098fa21c authored by brad kittenbrink's avatar brad kittenbrink
Browse files

Work on CHOP-135: Hooking up setting UpdaterServiceActive to functionality. Paired with Mani.

Toggling the setting now calls LLUpdaterService::startChecking() and LLUpdaterService::stopChecking(), which enable and disable the service.
parent f4e27d21
Branches
Tags
No related merge requests found
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
#include "llpaneloutfitsinventory.h" #include "llpaneloutfitsinventory.h"
#include "llpanellogin.h" #include "llpanellogin.h"
#include "llpaneltopinfobar.h" #include "llpaneltopinfobar.h"
#include "llupdaterservice.h"
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER #ifdef TOGGLE_HACKED_GODLIKE_VIEWER
BOOL gHackGodmode = FALSE; BOOL gHackGodmode = FALSE;
...@@ -488,6 +489,18 @@ bool toggle_show_object_render_cost(const LLSD& newvalue) ...@@ -488,6 +489,18 @@ bool toggle_show_object_render_cost(const LLSD& newvalue)
return true; return true;
} }
void toggle_updater_service_active(LLControlVariable* control, const LLSD& new_value)
{
if(new_value.asBoolean())
{
LLUpdaterService().startChecking();
}
else
{
LLUpdaterService().stopChecking();
}
}
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
void settings_setup_listeners() void settings_setup_listeners()
...@@ -635,6 +648,7 @@ void settings_setup_listeners() ...@@ -635,6 +648,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2)); gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2));
gSavedSettings.getControl("ShowMiniLocationPanel")->getSignal()->connect(boost::bind(&toggle_show_mini_location_panel, _2)); gSavedSettings.getControl("ShowMiniLocationPanel")->getSignal()->connect(boost::bind(&toggle_show_mini_location_panel, _2));
gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2)); gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2));
gSavedSettings.getControl("UpdaterServiceActive")->getSignal()->connect(&toggle_updater_service_active);
gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2)); gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2));
} }
......
...@@ -175,12 +175,6 @@ void LLUpdaterServiceImpl::initialize(const std::string& protocol_version, ...@@ -175,12 +175,6 @@ void LLUpdaterServiceImpl::initialize(const std::string& protocol_version,
mPath = path; mPath = path;
mChannel = channel; mChannel = channel;
mVersion = version; mVersion = version;
// Check to see if an install is ready.
if(!checkForInstall())
{
checkForResume();
}
} }
void LLUpdaterServiceImpl::setCheckPeriod(unsigned int seconds) void LLUpdaterServiceImpl::setCheckPeriod(unsigned int seconds)
...@@ -198,6 +192,12 @@ void LLUpdaterServiceImpl::startChecking() ...@@ -198,6 +192,12 @@ void LLUpdaterServiceImpl::startChecking()
mIsChecking = true; mIsChecking = true;
// Check to see if an install is ready.
if(!checkForInstall())
{
checkForResume();
}
if(!mIsDownloading) if(!mIsDownloading)
{ {
// Checking can only occur during the mainloop. // Checking can only occur during the mainloop.
...@@ -214,6 +214,11 @@ void LLUpdaterServiceImpl::stopChecking() ...@@ -214,6 +214,11 @@ void LLUpdaterServiceImpl::stopChecking()
mIsChecking = false; mIsChecking = false;
mTimer.stop(); mTimer.stop();
} }
if(mIsDownloading)
{
this->mUpdateDownloader.cancel();
}
} }
bool LLUpdaterServiceImpl::isChecking() bool LLUpdaterServiceImpl::isChecking()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment