Skip to content

Commit

Permalink
UI|Client|AlertDialog: Added a Gear button for alert settings
Browse files Browse the repository at this point in the history
It just shows the Log Filter & Alerts dialog, the same one that is
in the console menu.
  • Loading branch information
skyjake committed Jan 7, 2014
1 parent ce58192 commit a6f7808
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions doomsday/client/include/ui/dialogs/alertdialog.h
Expand Up @@ -64,6 +64,7 @@ class AlertDialog : public DialogWidget

public slots:
void showListOfAlerts();
void showLogFilterSettings();

protected:
void finish(int result);
Expand Down
18 changes: 16 additions & 2 deletions doomsday/client/src/ui/dialogs/alertdialog.cpp
Expand Up @@ -18,11 +18,12 @@

#include "ui/dialogs/alertdialog.h"
#include "ui/widgets/notificationwidget.h"
#include "ui/dialogs/logsettingsdialog.h"
#include "ui/clientwindow.h"
#include "ui/ListData"
#include "ui/ActionItem"
#include "clientapp.h"
#include "SignalAction"
#include "clientapp.h"

#include <de/FIFO>
#include <de/App>
Expand Down Expand Up @@ -225,7 +226,10 @@ AlertDialog::AlertDialog(String const &name) : d(new Instance(this))
setAnchorAndOpeningDirection(d->notification->rule(), ui::Down);

buttons() << new DialogButtonItem(DialogWidget::Accept | DialogWidget::Default,
tr("Clear All"));
tr("Clear All"))
<< new DialogButtonItem(DialogWidget::Action | DialogWidget::Id1,
style().images().image("gear"),
new SignalAction(this, SLOT(showLogFilterSettings())));
}

void AlertDialog::newAlert(String const &message, Level level)
Expand Down Expand Up @@ -254,6 +258,16 @@ void AlertDialog::showListOfAlerts()
open();
}

void AlertDialog::showLogFilterSettings()
{
LogSettingsDialog *st = new LogSettingsDialog;
st->setAnchorAndOpeningDirection(buttonWidget(DialogWidget::Id1)->rule(), ui::Left);
st->setDeleteAfterDismissed(true);
connect(this, SIGNAL(closed()), st, SLOT(close()));
root().add(st);
st->open();
}

void AlertDialog::finish(int result)
{
DialogWidget::finish(result);
Expand Down

0 comments on commit a6f7808

Please sign in to comment.