diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-30 00:07:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-30 00:07:54 +0300 |
commit | a93d1e06f928f6e4e1c7f3c58ddb7ae3676c1c63 (patch) | |
tree | 2d85d112997176e9ab765e638b0e7f2e16677b83 /src/gui/widgets/tabs | |
parent | 5c83a96b8ad85ad0562542b9720a0df6c5fb550c (diff) | |
parent | 8983700f6c8cc6496626ed3af235e1ec31fe5501 (diff) | |
download | plus-a93d1e06f928f6e4e1c7f3c58ddb7ae3676c1c63.tar.gz plus-a93d1e06f928f6e4e1c7f3c58ddb7ae3676c1c63.tar.bz2 plus-a93d1e06f928f6e4e1c7f3c58ddb7ae3676c1c63.tar.xz plus-a93d1e06f928f6e4e1c7f3c58ddb7ae3676c1c63.zip |
Merge branch 'master' into stable
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r-- | src/gui/widgets/tabs/chattab.cpp | 7 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_audio.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_colors.cpp | 11 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_input.cpp | 21 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_joystick.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_other.cpp | 18 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_perfomance.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_players.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_relations.cpp | 14 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_theme.cpp | 28 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_touch.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 13 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_visual.cpp | 19 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setuptabscroll.cpp | 7 | ||||
-rw-r--r-- | src/gui/widgets/tabs/tab.cpp | 18 | ||||
-rw-r--r-- | src/gui/widgets/tabs/tab.h | 4 |
16 files changed, 76 insertions, 112 deletions
diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index 8fe9d707b..e52f935b3 100644 --- a/src/gui/widgets/tabs/chattab.cpp +++ b/src/gui/widgets/tabs/chattab.cpp @@ -45,6 +45,7 @@ #include "resources/db/itemdb.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "debug.h" @@ -85,10 +86,8 @@ ChatTab::~ChatTab() if (chatWindow) chatWindow->removeTab(this); - delete mTextOutput; - mTextOutput = nullptr; - delete mScrollArea; - mScrollArea = nullptr; + delete2(mTextOutput); + delete2(mScrollArea); } void ChatTab::chatLog(std::string line, Own own, diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp index 6cf675635..89a9594c1 100644 --- a/src/gui/widgets/tabs/setup_audio.cpp +++ b/src/gui/widgets/tabs/setup_audio.cpp @@ -35,6 +35,7 @@ #include "gui/widgets/layouthelper.h" #include "gui/widgets/scrollarea.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "debug.h" @@ -160,11 +161,8 @@ Setup_Audio::Setup_Audio(const Widget2 *const widget) : Setup_Audio::~Setup_Audio() { - delete mSoundModel; - mSoundModel = nullptr; - - delete mChannelsList; - mChannelsList = nullptr; + delete2(mSoundModel); + delete2(mChannelsList); } void Setup_Audio::apply() diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index eb7e695f4..00537ad05 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -34,6 +34,7 @@ #include "gui/widgets/textfield.h" #include "gui/widgets/textpreview.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "utils/stringutils.h" @@ -198,15 +199,9 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) : Setup_Colors::~Setup_Colors() { if (mPreviewBox && mPreviewBox->getContent() == mPreview) - { - delete mTextPreview; - mTextPreview = nullptr; - } + delete2(mTextPreview) else - { - delete mPreview; - mPreview = nullptr; - } + delete2(mPreview) } void Setup_Colors::action(const ActionEvent &event) diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index b04937881..a29e0d797 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -41,6 +41,8 @@ #include "gui/models/listmodel.h" +#include "utils/delete2.h" + #include "debug.h" static int selectedData = 0; @@ -169,21 +171,14 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : Setup_Input::~Setup_Input() { - delete mKeyList; - mKeyList = nullptr; - delete mKeyListModel; - mKeyListModel = nullptr; - - delete mAssignKeyButton; - mAssignKeyButton = nullptr; - delete mUnassignKeyButton; - mUnassignKeyButton = nullptr; - delete mResetKeysButton; - mResetKeysButton = nullptr; + delete2(mKeyList); + delete2(mKeyListModel); + delete2(mAssignKeyButton); + delete2(mUnassignKeyButton); + delete2(mResetKeysButton); delete [] mActionDataSize; mActionDataSize = nullptr; - delete mScrollArea; - mScrollArea = nullptr; + delete2(mScrollArea); } void Setup_Input::apply() diff --git a/src/gui/widgets/tabs/setup_joystick.cpp b/src/gui/widgets/tabs/setup_joystick.cpp index b3d7b78b9..4d2845656 100644 --- a/src/gui/widgets/tabs/setup_joystick.cpp +++ b/src/gui/widgets/tabs/setup_joystick.cpp @@ -34,6 +34,7 @@ #include "gui/widgets/label.h" #include "gui/widgets/layouthelper.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "debug.h" @@ -99,8 +100,7 @@ Setup_Joystick::Setup_Joystick(const Widget2 *const widget) : Setup_Joystick::~Setup_Joystick() { - delete mNamesModel; - mNamesModel = nullptr; + delete2(mNamesModel); } void Setup_Joystick::action(const ActionEvent &event) diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index e4801506c..ed8ba11ad 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -31,6 +31,7 @@ #include "configuration.h" #include "map.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "debug.h" @@ -182,6 +183,10 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : "autofixPos", this, "autofixPosEvent"); // TRANSLATORS: settings option + new SetupItemCheckBox(_("Show server side position"), "", + "showserverpos", this, "showserverposEvent"); + + // TRANSLATORS: settings option new SetupItemCheckBox(_("Attack while moving"), "", "attackMoving", this, "attackMovingEvent"); @@ -334,6 +339,10 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : "serverAttack", this, "serverAttackEvent"); // TRANSLATORS: settings option + new SetupItemCheckBox(_("Hide support page link on error"), "", + "hidesupport", this, "hidesupportEvent"); + + // TRANSLATORS: settings option new SetupItemCheckBox(_("Enable double clicks"), "", "doubleClick", this, "doubleClickEvent"); @@ -396,12 +405,9 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : Setup_Other::~Setup_Other() { - delete mProxyTypeList; - mProxyTypeList = nullptr; - delete mShortcutsList; - mShortcutsList = nullptr; - delete mDensityList; - mDensityList = nullptr; + delete2(mProxyTypeList); + delete2(mShortcutsList); + delete2(mDensityList); } void Setup_Other::apply() diff --git a/src/gui/widgets/tabs/setup_perfomance.cpp b/src/gui/widgets/tabs/setup_perfomance.cpp index 5a0566ec2..dad054e83 100644 --- a/src/gui/widgets/tabs/setup_perfomance.cpp +++ b/src/gui/widgets/tabs/setup_perfomance.cpp @@ -28,6 +28,7 @@ #include "gui/widgets/scrollarea.h" #include "gui/widgets/setupitem.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "debug.h" @@ -159,6 +160,5 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : Setup_Perfomance::~Setup_Perfomance() { - delete mTexturesList; - mTexturesList = nullptr; + delete2(mTexturesList); } diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp index b04a25e22..441ebba58 100644 --- a/src/gui/widgets/tabs/setup_players.cpp +++ b/src/gui/widgets/tabs/setup_players.cpp @@ -102,7 +102,7 @@ Setup_Players::Setup_Players(const Widget2 *const widget) : // TRANSLATORS: settings option new SetupItemCheckBox(_("Emulate right mouse button by long mouse click" - " (usefull for touch interfaces)"), + " (useful for touch interfaces)"), "", "longmouseclick", this, "longmouseclickEvent"); setDimension(Rect(0, 0, 550, 350)); diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index ca060477f..77a758cb4 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -37,6 +37,7 @@ #include "gui/widgets/scrollarea.h" #include "gui/widgets/guitable.h" +#include "utils/delete2.h" #include "utils/dtor.h" #include "utils/gettext.h" @@ -81,10 +82,8 @@ public: ~PlayerTableModel() { freeWidgets(); - delete mListModel; - mListModel = nullptr; - delete mPlayers; - mPlayers = nullptr; + delete2(mListModel) + delete2(mPlayers) } int getRows() const override final @@ -159,9 +158,7 @@ public: void freeWidgets() { - delete mPlayers; - mPlayers = nullptr; - + delete2(mPlayers) delete_all(mWidgets); mWidgets.clear(); } @@ -266,8 +263,7 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : Setup_Relations::~Setup_Relations() { player_relations.removeListener(this); - delete mIgnoreActionChoicesModel; - mIgnoreActionChoicesModel = nullptr; + delete2(mIgnoreActionChoicesModel); } diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index 424828694..9b23fc3c3 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -37,6 +37,7 @@ #include "configuration.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "resources/resourcemanager.h" @@ -371,26 +372,13 @@ Setup_Theme::Setup_Theme(const Widget2 *const widget) : Setup_Theme::~Setup_Theme() { - delete mInfo; - mInfo = nullptr; - - delete mThemesModel; - mThemesModel = nullptr; - - delete mFontsModel; - mFontsModel = nullptr; - - delete mFontSizeListModel; - mFontSizeListModel = nullptr; - - delete mNpcFontSizeListModel; - mNpcFontSizeListModel = nullptr; - - delete mLangListModel; - mLangListModel = nullptr; - - delete mInfo; - mInfo = nullptr; + delete2(mInfo); + delete2(mThemesModel); + delete2(mFontsModel); + delete2(mFontSizeListModel); + delete2(mNpcFontSizeListModel); + delete2(mLangListModel); + delete2(mInfo); } void Setup_Theme::updateInfo() diff --git a/src/gui/widgets/tabs/setup_touch.cpp b/src/gui/widgets/tabs/setup_touch.cpp index fb50ab4d5..eab39ccb0 100644 --- a/src/gui/widgets/tabs/setup_touch.cpp +++ b/src/gui/widgets/tabs/setup_touch.cpp @@ -27,6 +27,7 @@ #include "gui/widgets/setuptouchitem.h" #include "gui/widgets/scrollarea.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "utils/stringutils.h" @@ -126,10 +127,7 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) : Setup_Touch::~Setup_Touch() { - delete mSizeList; - mSizeList = nullptr; - delete mFormatList; - mFormatList = nullptr; - delete mActionsList; - mActionsList = nullptr; + delete2(mSizeList); + delete2(mFormatList); + delete2(mActionsList); } diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index 416ae8c3c..dfe14fa2c 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -41,6 +41,7 @@ #include "render/rendererslistsdl.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "utils/sdlhelper.h" @@ -309,14 +310,10 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : Setup_Video::~Setup_Video() { - delete mModeListModel; - mModeListModel = nullptr; - delete mModeList; - mModeList = nullptr; - delete mOpenGLListModel; - mOpenGLListModel = nullptr; - delete mDialog; - mDialog = nullptr; + delete2(mModeListModel); + delete2(mModeList); + delete2(mOpenGLListModel); + delete2(mDialog); } void Setup_Video::apply() diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp index 860b1d516..eb6591f9f 100644 --- a/src/gui/widgets/tabs/setup_visual.cpp +++ b/src/gui/widgets/tabs/setup_visual.cpp @@ -28,6 +28,7 @@ #include "client.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "debug.h" @@ -215,18 +216,12 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) : Setup_Visual::~Setup_Visual() { - delete mSpeachList; - mSpeachList = nullptr; - delete mAmbientFxList; - mAmbientFxList = nullptr; - delete mParticleList; - mParticleList = nullptr; - delete mParticleTypeList; - mParticleTypeList = nullptr; - delete mVSyncList; - mVSyncList = nullptr; - delete mScaleList; - mScaleList = nullptr; + delete2(mSpeachList); + delete2(mAmbientFxList); + delete2(mParticleList); + delete2(mParticleTypeList); + delete2(mVSyncList); + delete2(mScaleList); } void Setup_Visual::apply() diff --git a/src/gui/widgets/tabs/setuptabscroll.cpp b/src/gui/widgets/tabs/setuptabscroll.cpp index 9c185b2bb..cd169e0bf 100644 --- a/src/gui/widgets/tabs/setuptabscroll.cpp +++ b/src/gui/widgets/tabs/setuptabscroll.cpp @@ -24,6 +24,8 @@ #include "gui/widgets/setupitem.h" #include "gui/widgets/vertcontainer.h" +#include "utils/delete2.h" + #include "debug.h" SetupTabScroll::SetupTabScroll(const Widget2 *const widget) : @@ -41,10 +43,7 @@ SetupTabScroll::SetupTabScroll(const Widget2 *const widget) : SetupTabScroll::~SetupTabScroll() { mScroll = nullptr; - - delete mContainer; - mContainer = nullptr; - + delete2(mContainer); removeItems(); } diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index ede69619e..c2a6c0207 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -75,6 +75,8 @@ #include "resources/image.h" +#include "utils/delete2.h" + #include "debug.h" int Tab::mInstances = 0; @@ -123,23 +125,20 @@ Tab::~Tab() gui->removeDragged(this); mInstances--; - if (mInstances == 0 && Theme::instance()) + if (mInstances == 0 && theme) { - Theme *const theme = Theme::instance(); for (int mode = 0; mode < TAB_COUNT; mode ++) theme->unload(tabImg[mode]); } - delete mLabel; - mLabel = nullptr; + delete2(mLabel); if (mImage) { mImage->decRef(); mImage = nullptr; } - delete mVertexes; - mVertexes = nullptr; + delete2(mVertexes); } void Tab::init() @@ -154,7 +153,6 @@ void Tab::init() if (mInstances == 0) { // Load the skin - Theme *const theme = Theme::instance(); if (theme) { for (int mode = 0; mode < TAB_COUNT; mode ++) @@ -177,7 +175,7 @@ void Tab::init() void Tab::updateAlpha() { const float alpha = std::max(client->getGuiAlpha(), - Theme::instance()->getMinimumOpacity()); + theme->getMinimumOpacity()); if (alpha != mAlpha) { @@ -373,12 +371,12 @@ const std::string &Tab::getCaption() const return mLabel->getCaption(); } -void Tab::mouseEntered(MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void Tab::mouseExited(MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h index 246d90650..a0afa6fcd 100644 --- a/src/gui/widgets/tabs/tab.h +++ b/src/gui/widgets/tabs/tab.h @@ -189,9 +189,9 @@ class Tab : public BasicContainer, const std::string &getCaption() const A_WARN_UNUSED; - void mouseEntered(MouseEvent &mouseEvent) override final; + void mouseEntered(MouseEvent &event) override final; - void mouseExited(MouseEvent &mouseEvent) override final; + void mouseExited(MouseEvent &event) override final; void setImage(Image *const image); |