Skip to content
Permalink
Browse files

Add capability to trigger restart to ConfigDialog

With this patch ConfigWidgets can set the new requireRestartToApply
variable to true to cause the ConfigDialog to ask the user wheter
he wants to restart to apply the settings immediatly. If the
user agrees we exit the event loop with the special
MUMBLE_EXIT_CODE_RESTART causing a relaunch of the client and
safe application of the new settings.
  • Loading branch information...
hacst committed Jun 13, 2015
1 parent c431d37 commit d08336e59b971094c467d4e64efc265dbefdf5a5
Showing with 13 additions and 0 deletions.
  1. +9 −0 src/mumble/ConfigDialog.cpp
  2. +2 −0 src/mumble/Settings.cpp
  3. +2 −0 src/mumble/Settings.h
@@ -215,6 +215,15 @@ void ConfigDialog::apply() {

foreach(ConfigWidget *cw, qmWidgets)
cw->accept();

if (g.s.requireRestartToApply && QMessageBox::question(
this,
tr("Restart Mumble?"),
tr("Some settings will only apply after a restart of Mumble. Restart Mumble now?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {

qApp->exit(MUMBLE_EXIT_CODE_RESTART);
}

if (!g.s.bAttenuateOthersOnTalk)
g.bAttenuateOthers = false;
@@ -404,6 +404,8 @@ Settings::Settings() {
#endif
dPacketLoss = 0;
dMaxPacketDelay = 0.0f;

requireRestartToApply = false;

iMaxLogBlocks = 0;

@@ -338,6 +338,8 @@ struct Settings {
LoopMode lmLoopMode;
float dPacketLoss;
float dMaxPacketDelay;
/// If true settings in this structure require a client restart to apply fully
bool requireRestartToApply;

bool doEcho() const;
bool doPositionalAudio() const;

0 comments on commit d08336e

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