Skip to content
Permalink
Browse files

Add config options for disabling specific overlay helpers.

This adds hidden config options for disabling arch-specific
overlay helpers.

This is useful for people that only want the overlay for a
specific architecture, and also for debugging and troubleshooting
arch-specific overlay problems.
  • Loading branch information...
mkrautz committed Feb 22, 2015
1 parent bb0ccc4 commit b1880294df43d16ff03e927fba1572a027dac6aa
Showing with 31 additions and 6 deletions.
  1. +21 −5 src/mumble/Overlay_win.cpp
  2. +2 −1 src/mumble/Overlay_win.h
  3. +6 −0 src/mumble/Settings.cpp
  4. +2 −0 src/mumble/Settings.h
@@ -72,7 +72,6 @@ static bool canRun64BitPrograms() {
}

OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) {
m_allow64bit = canRun64BitPrograms();
m_active = false;

m_helper_exe_path = QString::fromLatin1("%1/mumble_ol.exe").arg(qApp->applicationDirPath());
@@ -92,6 +91,11 @@ OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) {
m_helper_restart_timer->setSingleShot(true);
connect(m_helper_restart_timer, SIGNAL(timeout()), this, SLOT(onDelayedRestartTimerTriggered()));

if (!g.s.bOverlayWinHelperX86Enable) {
qWarning("OverlayPrivateWin: mumble_ol.exe (32-bit overlay helper) disabled via 'overlay_win/enable_x86_helper' config option.");
m_helper_enabled = false;
}

m_helper64_exe_path = QString::fromLatin1("%1/mumble_ol_x64.exe").arg(qApp->applicationDirPath());
m_helper64_exe_args = m_helper_exe_args;
m_helper64_process = new QProcess(this);
@@ -108,6 +112,14 @@ OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) {
m_helper64_restart_timer = new QTimer(this);
m_helper64_restart_timer->setSingleShot(true);
connect(m_helper64_restart_timer, SIGNAL(timeout()), this, SLOT(onDelayedRestartTimerTriggered()));

if (!canRun64BitPrograms()) {
qWarning("OverlayPrivateWin: mumble_ol_x64.exe (64-bit overlay helper) disabled because the host is not x64 capable.");
m_helper64_enabled = false;
} else if (!g.s.bOverlayWinHelperX64Enable) {
qWarning("OverlayPrivateWin: mumble_ol_x64.exe (64-bit overlay helper) disabled via 'overlay_win/enable_x64_helper' config option.");
m_helper64_enabled = false;
}
}

OverlayPrivateWin::~OverlayPrivateWin() {
@@ -133,13 +145,17 @@ void OverlayPrivateWin::setActive(bool active) {
m_active = active;

if (m_active) {
startHelper(m_helper_process);
if (m_allow64bit) {
if (m_helper_enabled) {
startHelper(m_helper_process);
}
if (m_helper64_enabled) {
startHelper(m_helper64_process);
}
} else {
m_helper_process->terminate();
if (m_allow64bit) {
if (m_helper_enabled) {
m_helper_process->terminate();
}
if (m_helper64_enabled) {
m_helper64_process->terminate();
}
}
@@ -62,15 +62,16 @@ class OverlayPrivateWin : public OverlayPrivate {
QStringList m_helper_exe_args;
QElapsedTimer m_helper_start_time;
QTimer *m_helper_restart_timer;
bool m_helper_enabled;

QProcess *m_helper64_process;
QString m_helper64_exe_path;
QStringList m_helper64_exe_args;
QElapsedTimer m_helper64_start_time;
QTimer *m_helper64_restart_timer;
bool m_helper64_enabled;

bool m_active;
bool m_allow64bit;

void startHelper(QProcess *helper);
};
@@ -347,6 +347,8 @@ Settings::Settings() {

// OverlayPrivateWin
iOverlayWinHelperRestartCooldownMsec = 10000;
bOverlayWinHelperX86Enable = true;
bOverlayWinHelperX64Enable = true;

iLCDUserViewMinColWidth = 50;
iLCDUserViewSplitterWidth = 2;
@@ -702,6 +704,8 @@ void Settings::load(QSettings* settings_ptr) {

// OverlayPrivateWin
SAVELOAD(iOverlayWinHelperRestartCooldownMsec, "overlay_win/helper/restart_cooldown_msec");
SAVELOAD(bOverlayWinHelperX86Enable, "overlay_win/helper/x86/enable");
SAVELOAD(bOverlayWinHelperX64Enable, "overlay_win/helper/x64/enable");

// LCD
SAVELOAD(iLCDUserViewMinColWidth, "lcd/userview/mincolwidth");
@@ -997,6 +1001,8 @@ void Settings::save() {

// OverlayPrivateWin
SAVELOAD(iOverlayWinHelperRestartCooldownMsec, "overlay_win/helper/restart_cooldown_msec");
SAVELOAD(bOverlayWinHelperX86Enable, "overlay_win/helper/x86/enable");
SAVELOAD(bOverlayWinHelperX64Enable, "overlay_win/helper/x64/enable");

// LCD
SAVELOAD(iLCDUserViewMinColWidth, "lcd/userview/mincolwidth");
@@ -231,6 +231,8 @@ struct Settings {
OverlaySettings os;

int iOverlayWinHelperRestartCooldownMsec;
bool bOverlayWinHelperX86Enable;
bool bOverlayWinHelperX64Enable;

int iLCDUserViewMinColWidth;
int iLCDUserViewSplitterWidth;

0 comments on commit b188029

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