Skip to content

Commit

Permalink
Merge branch 'ui-alerts'
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 8, 2014
2 parents d856172 + 9621515 commit 6febdd1
Show file tree
Hide file tree
Showing 209 changed files with 2,690 additions and 1,141 deletions.
2 changes: 2 additions & 0 deletions distrib/win32/setup.iss.template
Expand Up @@ -132,7 +132,9 @@ Source: "modules\appconfig.de"; DestDir: "{app}\modules"; Components: Engine
Source: "modules\bootstrap.de"; DestDir: "{app}\modules"; Components: Engine
Source: "modules\Config.de"; DestDir: "{app}\modules"; Components: Engine
Source: "modules\gui.de"; DestDir: "{app}\modules"; Components: Engine
Source: "modules\Log.de"; DestDir: "{app}\modules"; Components: Engine
Source: "modules\recutil.de"; DestDir: "{app}\modules"; Components: Engine
Source: "modules\Updater.de"; DestDir: "{app}\modules"; Components: Engine
Source: "data\doomsday.pk3"; DestDir: "{app}\data"; Components: Engine
Source: "data\graphics\background.pcx"; DestDir: "{app}\data\graphics"; Components: Engine
Source: "data\graphics\loading1.png"; DestDir: "{app}\data\graphics"; Components: Engine
Expand Down
6 changes: 1 addition & 5 deletions doomsday/api/api_wad.h
Expand Up @@ -49,13 +49,10 @@ DENG_API_TYPEDEF(W) // v1
boolean (*LumpIsCustom)(lumpnum_t lumpNum);

/**
* @param name Name of the lump to search for.
* @param silent Do not print results to the console.
* @param name Name of the lump to search for.
*
* @return Unique index of the found lump in the primary lump directory else @c -1 if not found.
*/
lumpnum_t (*CheckLumpNumForName2)(char const* name, boolean silent);

lumpnum_t (*CheckLumpNumForName)(char const* name);

/// @note As per W_CheckLumpNumForName but results in a fatal error if not found.
Expand Down Expand Up @@ -108,7 +105,6 @@ DENG_API_TYPEDEF(W) // v1
#define W_LumpLastModified _api_W.LumpLastModified
#define W_LumpSourceFile _api_W.LumpSourceFile
#define W_LumpIsCustom _api_W.LumpIsCustom
#define W_CheckLumpNumForName2 _api_W.CheckLumpNumForName2
#define W_CheckLumpNumForName _api_W.CheckLumpNumForName
#define W_GetLumpNumForName _api_W.GetLumpNumForName
#define W_ReadLump _api_W.ReadLump
Expand Down
3 changes: 2 additions & 1 deletion doomsday/api/apis.h
Expand Up @@ -138,7 +138,8 @@ enum {
DE_API_URI = DE_API_URI_v1,

DE_API_WAD_v1 = 2400, // 1.10
DE_API_WAD = DE_API_WAD_v1
DE_API_WAD_v2 = 2401, // 1.14
DE_API_WAD = DE_API_WAD_v2
};

/**
Expand Down
10 changes: 9 additions & 1 deletion doomsday/client/client.pro
Expand Up @@ -195,6 +195,7 @@ DENG_CONVENIENCE_HEADERS += \
# Private headers.
DENG_HEADERS += \
$$DENG_CONVENIENCE_HEADERS \
include/alertmask.h \
include/audio/audiodriver.h \
include/audio/audiodriver_music.h \
include/audio/m_mus2midi.h \
Expand Down Expand Up @@ -390,6 +391,7 @@ DENG_HEADERS += \
include/ui/dialogs/coloradjustmentdialog.h \
include/ui/dialogs/inputdialog.h \
include/ui/dialogs/inputsettingsdialog.h \
include/ui/dialogs/logsettingsdialog.h \
include/ui/dialogs/messagedialog.h \
include/ui/dialogs/networksettingsdialog.h \
include/ui/dialogs/renderersettingsdialog.h \
Expand Down Expand Up @@ -470,6 +472,7 @@ DENG_HEADERS += \
include/ui/widgets/sliderwidget.h \
include/ui/widgets/taskbarwidget.h \
include/ui/widgets/togglewidget.h \
include/ui/widgets/variablechoicewidget.h \
include/ui/widgets/variabletogglewidget.h \
include/ui/windowsystem.h \
include/ui/windowtransform.h \
Expand Down Expand Up @@ -578,6 +581,7 @@ else:unix {

# Platform-independent sources.
SOURCES += \
src/alertmask.cpp \
src/api_uri.cpp \
src/audio/audiodriver.cpp \
src/audio/audiodriver_music.cpp \
Expand Down Expand Up @@ -756,6 +760,7 @@ SOURCES += \
src/ui/dialogs/coloradjustmentdialog.cpp \
src/ui/dialogs/inputdialog.cpp \
src/ui/dialogs/inputsettingsdialog.cpp \
src/ui/dialogs/logsettingsdialog.cpp \
src/ui/dialogs/messagedialog.cpp \
src/ui/dialogs/networksettingsdialog.cpp \
src/ui/dialogs/videosettingsdialog.cpp \
Expand Down Expand Up @@ -826,6 +831,7 @@ SOURCES += \
src/ui/widgets/sliderwidget.cpp \
src/ui/widgets/taskbarwidget.cpp \
src/ui/widgets/togglewidget.cpp \
src/ui/widgets/variablechoicewidget.cpp \
src/ui/widgets/variabletogglewidget.cpp \
src/ui/windowsystem.cpp \
src/ui/windowtransform.cpp \
Expand Down Expand Up @@ -886,7 +892,8 @@ SOURCES += \

DOOMSDAY_SCRIPTS += \
modules/appconfig.de \
modules/bootstrap.de
modules/bootstrap.de \
modules/Updater.de

OTHER_FILES += \
$$DOOMSDAY_SCRIPTS \
Expand All @@ -904,6 +911,7 @@ mod.files = \
$$DOOMSDAY_SCRIPTS \
$$DENG_MODULES_DIR/Config.de \
$$DENG_MODULES_DIR/gui.de \
$$DENG_MODULES_DIR/Log.de \
$$DENG_MODULES_DIR/recutil.de

# These fonts may be needed during the initial startup busy mode.
Expand Down
41 changes: 41 additions & 0 deletions doomsday/client/include/alertmask.h
@@ -0,0 +1,41 @@
/** @file alertmask.h
*
* @authors Copyright (c) 2014 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_ALERTMASK_H
#define DENG_CLIENT_ALERTMASK_H

#include <de/LogFilter>

class AlertMask
{
public:
AlertMask();

/**
* Begins observing the Config.alert.* variables and updating the mask
* accordingly.
*/
void init();

bool shouldRaiseAlert(de::duint32 entryMetadata) const;

private:
DENG2_PRIVATE(d)
};

#endif // DENG_CLIENT_ALERTMASK_H
3 changes: 2 additions & 1 deletion doomsday/client/include/clientapp.h
Expand Up @@ -59,11 +59,12 @@ class ClientApp : public de::GuiApp
* @param msg Message to show. May contain style escapes.
* @param level Importance of the message.
*/
static void alert(de::String const &msg, de::LogEntry::Level level = de::LogEntry::MESSAGE);
static void alert(de::String const &msg, de::LogEntry::Level level = de::LogEntry::Message);

public:
static ClientApp &app();
static Updater &updater();
static SettingsRegister &logSettings();
static SettingsRegister &audioSettings(); ///< @todo Belongs in AudioSystem.
static ServerLink &serverLink();
static InputSystem &inputSystem();
Expand Down
14 changes: 0 additions & 14 deletions doomsday/client/include/dd_main.h
Expand Up @@ -43,20 +43,6 @@
#include <de/String>
#include "resourceclass.h"

// Verbose messages.
#define VERBOSE(code) { if(verbose >= 1) { code; } }
#define VERBOSE2(code) { if(verbose >= 2) { code; } }

#ifdef _DEBUG
# define DEBUG_Message(code) {Con_Message code;}
# define DEBUG_VERBOSE_Message(code) {if(verbose >= 1) {Con_Message code;}}
# define DEBUG_VERBOSE2_Message(code) {if(verbose >= 2) {Con_Message code;}}
#else
# define DEBUG_Message(code)
# define DEBUG_VERBOSE_Message(code)
# define DEBUG_VERBOSE2_Message(code)
#endif

struct game_s;

extern int verbose;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/filesys/fileid.h
Expand Up @@ -78,7 +78,7 @@ class FileId : public LogEntry::Arg::Base
String asText() const;

// Implements LogEntry::Arg::Base.
LogEntry::Arg::Type logEntryArgType() const { return LogEntry::Arg::STRING; }
LogEntry::Arg::Type logEntryArgType() const { return LogEntry::Arg::StringArgument; }

/// @return Md5hash for this FileId.
Md5Hash const& md5() const { return md5_; }
Expand Down
3 changes: 3 additions & 0 deletions doomsday/client/include/settingsregister.h
Expand Up @@ -74,6 +74,9 @@ class SettingsRegister
/**
* Defines a new setting in the profile.
*
* The default values of Config variables are taken from Config (so it must already
* be initialized).
*
* @param type Type of setting.
* @param settingName Name of the setting.
* @param defaultValue Default value of the setting (for cvars).
Expand Down
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
42 changes: 42 additions & 0 deletions doomsday/client/include/ui/dialogs/logsettingsdialog.h
@@ -0,0 +1,42 @@
/** @file logsettingsdialog.h Dialog for Log settings.
*
* @authors Copyright (c) 2014 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_LOGSETTINGSDIALOG_H
#define DENG_CLIENT_LOGSETTINGSDIALOG_H

#include "ui/widgets/dialogwidget.h"

/**
* Dialog for modifying log filter and alert settings.
*/
class LogSettingsDialog : public DialogWidget
{
Q_OBJECT

public:
LogSettingsDialog(de::String const &name = "logsettings");

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

private:
DENG2_PRIVATE(d)
};

#endif // DENG_CLIENT_LOGSETTINGSDIALOG_H
20 changes: 20 additions & 0 deletions doomsday/client/include/ui/widgets/choicewidget.h
Expand Up @@ -60,13 +60,33 @@ class ChoiceWidget : public ButtonWidget

ui::Data &items();

/**
* Sets the data model of the choice widget to some existing one. The data must
* remain in existence until the ChoiceWidget is deleted.
*
* @param items Ownership not taken.
*/
void setItems(ui::Data const &items);

void useDefaultItems();

PopupMenuWidget &popup();

void setSelected(ui::Data::Pos pos);

ui::Data::Pos selected() const;
ui::Item const &selectedItem() const;

/**
* Returns a rule that determines what is the maximum width of the widget. This is
* the length of the longest item plus margins.
*
* A choice widget keeps changing its size depending on the selected item. Also, only
* the selected item uses the "choice.selected" font, so the maximum width depends on
* what is the widest item using that font.
*/
de::Rule const &maximumWidth() const;

public slots:
void openPopup();

Expand Down
20 changes: 11 additions & 9 deletions doomsday/client/include/ui/widgets/labelwidget.h
Expand Up @@ -112,15 +112,7 @@ class LabelWidget : public GuiWidget

void setTextLineAlignment(ui::Alignment const &textLineAlign);

/**
* Sets the alignment of the image when there is both an image
* and a text in the label.
*
* @param imageAlign Alignment for the image.
*/
void setImageAlignment(ui::Alignment const &imageAlign);

void setImageFit(ui::ContentFit const &fit);
void setTextModulationColorf(de::Vector4f const &colorf);

/**
* Sets the maximum width used for text. By default, the maximum width is determined
Expand All @@ -138,6 +130,16 @@ class LabelWidget : public GuiWidget
*/
void setTextStyle(de::Font::RichFormat::IStyle const *richStyle);

/**
* Sets the alignment of the image when there is both an image
* and a text in the label.
*
* @param imageAlign Alignment for the image.
*/
void setImageAlignment(ui::Alignment const &imageAlign);

void setImageFit(ui::ContentFit const &fit);

/**
* The image's actual size will be overridden by this size.
* @param size Image size.
Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/include/ui/widgets/menuwidget.h
Expand Up @@ -87,6 +87,8 @@ class MenuWidget : public ScrollAreaWidget
*/
void setItems(ui::Data const &items);

void useDefaultItems();

ChildWidgetOrganizer &organizer();
ChildWidgetOrganizer const &organizer() const;

Expand Down
3 changes: 3 additions & 0 deletions doomsday/client/include/ui/widgets/popupwidget.h
Expand Up @@ -91,4 +91,7 @@ class PopupWidget : public PanelWidget
DENG2_PRIVATE(d)
};

template <typename ClassName>
PopupWidget *makePopup() { return new ClassName; }

#endif // DENG_CLIENT_POPUPWIDGET_H
52 changes: 52 additions & 0 deletions doomsday/client/include/ui/widgets/variablechoicewidget.h
@@ -0,0 +1,52 @@
/** @file variablechoicewidget.h Choice widget for Variable values.
*
* @authors Copyright (c) 2014 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_VARIABLECHOICEWIDGET_H
#define DENG_CLIENT_VARIABLECHOICEWIDGET_H

#include <de/Variable>

#include "choicewidget.h"

/**
* Widget for choosing the value of a variable from a set of possible values.
*/
class VariableChoiceWidget : public ChoiceWidget
{
Q_OBJECT

public:
/// Thrown when the variable is gone and someone tries to access it. @ingroup errors
DENG2_ERROR(VariableMissingError);

public:
VariableChoiceWidget(de::Variable &variable, de::String const &name = "");

de::Variable &variable() const;

public slots:
void updateFromVariable();

protected slots:
void setVariableFromWidget();

private:
DENG2_PRIVATE(d)
};

#endif // DENG_CLIENT_VARIABLECHOICEWIDGET_H

0 comments on commit 6febdd1

Please sign in to comment.