mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
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.
This commit is contained in:
parent
c431d376f8
commit
d08336e59b
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user