-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI|Client: Added a stub from the alerts dialog
- Loading branch information
Showing
7 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** @file alertdialog.h Dialog for listing recent alerts. | ||
* | ||
* @authors Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#ifndef DENG_CLIENT_ALERTDIALOG_H | ||
#define DENG_CLIENT_ALERTDIALOG_H | ||
|
||
#include "ui/widgets/dialogwidget.h" | ||
|
||
/** | ||
* Dialog for listing recent alerts. | ||
*/ | ||
class AlertDialog : public DialogWidget | ||
{ | ||
public: | ||
AlertDialog(de::String const &name = "alerts"); | ||
|
||
/** | ||
* Returns the notification area widget with which the dialog can be opened. | ||
*/ | ||
GuiWidget ¬ification(); | ||
|
||
private: | ||
DENG2_PRIVATE(d) | ||
}; | ||
|
||
#endif // DENG_CLIENT_ALERTDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** @file alertdialog.cpp Dialog for listing recent alerts. | ||
* | ||
* @authors Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#include "ui/dialogs/alertdialog.h" | ||
#include "ui/widgets/notificationwidget.h" | ||
#include "ui/clientwindow.h" | ||
|
||
using namespace de; | ||
|
||
DENG_GUI_PIMPL(AlertDialog) | ||
{ | ||
ButtonWidget *notification; | ||
|
||
Instance(Public *i) : Base(i) | ||
{ | ||
notification = new ButtonWidget; | ||
notification->setSizePolicy(ui::Expand, ui::Expand); | ||
notification->setImage(style().images().image("alert")); | ||
notification->setOverrideImageSize(style().fonts().font("default").height().value()); | ||
} | ||
|
||
NotificationWidget ¬ifs() | ||
{ | ||
return ClientWindow::main().notifications(); | ||
} | ||
}; | ||
|
||
AlertDialog::AlertDialog(String const &name) : d(new Instance(this)) | ||
{ | ||
d->notifs().showOrHide(d->notification, true); | ||
} | ||
|
||
GuiWidget &AlertDialog::notification() | ||
{ | ||
return *d->notification; | ||
} |