Skip to content

Commit

Permalink
UI|Client: Added a 'gauge' popup for Audio Settings dialog
Browse files Browse the repository at this point in the history
Like Renderer Settings, the Audio Settings dialog now has a 'gauge'
button for additional settings that are intended for instrumentation
and aiding development.
  • Loading branch information
skyjake committed Sep 20, 2013
1 parent df614d6 commit 89b75e7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions doomsday/client/include/ui/dialogs/audiosettingsdialog.h
Expand Up @@ -33,6 +33,7 @@ class AudioSettingsDialog : public DialogWidget

public slots:
void resetToDefaults();
void showDeveloperPopup();

private:
DENG2_PRIVATE(d)
Expand Down
25 changes: 20 additions & 5 deletions doomsday/client/src/ui/dialogs/audiosettingsdialog.cpp
Expand Up @@ -20,6 +20,7 @@
#include "ui/widgets/cvarsliderwidget.h"
#include "ui/widgets/cvartogglewidget.h"
#include "ui/widgets/cvarchoicewidget.h"
#include "ui/widgets/gridpopupwidget.h"

#include "clientapp.h"
#include "de_audio.h"
Expand All @@ -39,6 +40,7 @@ DENG_GUI_PIMPL(AudioSettingsDialog)
CVarChoiceWidget *sampleRate;
CVarChoiceWidget *musicSource;
CVarToggleWidget *soundInfo;
GridPopupWidget *devPopup;

Instance(Public *i) : Base(i)
{
Expand All @@ -51,7 +53,12 @@ DENG_GUI_PIMPL(AudioSettingsDialog)
area.add(sound16bit = new CVarToggleWidget("sound-16bit"));
area.add(sampleRate = new CVarChoiceWidget("sound-rate"));
area.add(musicSource = new CVarChoiceWidget("music-source"));
area.add(soundInfo = new CVarToggleWidget("sound-info"));

// Developer options.
self.add(devPopup = new GridPopupWidget);
soundInfo = new CVarToggleWidget("sound-info", tr("Sound Channel Status"));
*devPopup << soundInfo;
devPopup->commit();
}

void fetch()
Expand Down Expand Up @@ -93,7 +100,6 @@ AudioSettingsDialog::AudioSettingsDialog(String const &name)
<< new ChoiceItem(tr("External files"), MUSP_EXT)
<< new ChoiceItem(tr("CD"), MUSP_CD);

d->soundInfo->setText(tr("Developer Info"));

// Layout.
GridLayout layout(area().contentRule().left(), area().contentRule().top());
Expand All @@ -105,15 +111,19 @@ AudioSettingsDialog::AudioSettingsDialog(String const &name)
<< Const(0) << *d->sound3D
<< *musSrcLabel << *d->musicSource
<< *rateLabel << *d->sampleRate
<< Const(0) << *d->sound16bit
<< Const(0) << *d->soundInfo;
<< Const(0) << *d->sound16bit;

area().setContentSize(layout.width(), layout.height());

buttons()
<< new DialogButtonItem(DialogWidget::Default | DialogWidget::Accept, tr("Close"))
<< new DialogButtonItem(DialogWidget::Action, tr("Reset to Defaults"),
new SignalAction(this, SLOT(resetToDefaults())));
new SignalAction(this, SLOT(resetToDefaults())))
<< new DialogButtonItem(DialogWidget::Action | Id1,
style().images().image("gauge"),
new SignalAction(this, SLOT(showDeveloperPopup())));

d->devPopup->setAnchorAndOpeningDirection(buttonWidget(Id1)->rule(), ui::Up);

d->fetch();
}
Expand All @@ -124,3 +134,8 @@ void AudioSettingsDialog::resetToDefaults()

d->fetch();
}

void AudioSettingsDialog::showDeveloperPopup()
{
d->devPopup->open();
}

0 comments on commit 89b75e7

Please sign in to comment.