Skip to content

Commit

Permalink
Merge pull request #5678 from Memphiz/xbmchelper
Browse files Browse the repository at this point in the history
[osx] - fixed XBMCHelper was never updated
  • Loading branch information
Memphiz committed Nov 12, 2014
2 parents 89dc834 + 2ca303c commit bec2747
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
Expand Up @@ -148,6 +148,8 @@
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
};
buildConfigurationList = 1DEB924B08733DCA0010E9CD /* Build configuration list for PBXProject "XBMCHelper" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
Expand Down Expand Up @@ -186,7 +188,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = ../../../osx;
CONFIGURATION_BUILD_DIR = ../../../darwin/runtime;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
Expand All @@ -195,26 +197,30 @@
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_VERSION = "";
INSTALL_PATH = /usr/local/bin;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = XBMCHelper;
SDKROOT = macosx;
STRIP_STYLE = debugging;
VALID_ARCHS = i386;
};
name = Debug;
};
1DEB924908733DCA0010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = ../../../osx;
CONFIGURATION_BUILD_DIR = ../../../darwin/runtime;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_VERSION = "";
INSTALL_PATH = /usr/local/bin;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = XBMCHelper;
SDKROOT = macosx;
STRIP_STYLE = debugging;
VALID_ARCHS = i386;
};
name = Release;
};
Expand Down
Binary file removed tools/darwin/runtime/XBMCHelper
Binary file not shown.
15 changes: 13 additions & 2 deletions xbmc/osx/XBMCHelper.cpp
Expand Up @@ -132,6 +132,11 @@ bool XBMCHelper::OnSettingChanging(const CSetting *setting)
}
}

if (settingId == "input.appleremotealwayson")
{
HandleLaunchAgent();
}

return true;
}

Expand Down Expand Up @@ -166,14 +171,12 @@ void XBMCHelper::Configure()
{
int oldMode = m_mode;
int oldDelay = m_sequenceDelay;
int oldAlwaysOn = m_alwaysOn;
int oldPort = m_port;

// Read the new configuration.
m_errorStarting = false;
m_mode = CSettings::Get().GetInt("input.appleremotemode");
m_sequenceDelay = CSettings::Get().GetInt("input.appleremotesequencetime");
m_alwaysOn = CSettings::Get().GetBool("input.appleremotealwayson");
m_port = CSettings::Get().GetInt("services.esport");


Expand Down Expand Up @@ -254,6 +257,14 @@ void XBMCHelper::Configure()
if (oldMode == APPLE_REMOTE_DISABLED && m_mode != APPLE_REMOTE_DISABLED)
Start();

HandleLaunchAgent();
}

void XBMCHelper::HandleLaunchAgent()
{
int oldAlwaysOn = m_alwaysOn;
m_alwaysOn = CSettings::Get().GetBool("input.appleremotealwayson");

// Installation/uninstallation.
if (oldAlwaysOn == false && m_alwaysOn == true)
Install();
Expand Down
1 change: 1 addition & 0 deletions xbmc/osx/XBMCHelper.h
Expand Up @@ -57,6 +57,7 @@ class XBMCHelper : public ISettingCallback
XBMCHelper(XBMCHelper const& );
XBMCHelper& operator=(XBMCHelper const&);

void HandleLaunchAgent();
void Install();
void Uninstall();

Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/Settings.cpp
Expand Up @@ -818,6 +818,7 @@ void CSettings::InitializeISettingCallbacks()
#if defined(TARGET_DARWIN_OSX)
settingSet.clear();
settingSet.insert("input.appleremotemode");
settingSet.insert("input.appleremotealwayson");
m_settingsManager->RegisterCallback(&XBMCHelper::GetInstance(), settingSet);
#endif
}
Expand Down

0 comments on commit bec2747

Please sign in to comment.