summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-26 18:39:30 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-26 18:39:30 +0300
commitd3f61bb7da045c7d0a955a3859aac713d1bfc6e7 (patch)
tree15242373dccaea3352cdf1ae23449105e4f681ae
parent19c49d794657f87cf07790b3fad6dae09f8005df (diff)
downloadmanaverse-d3f61bb7da045c7d0a955a3859aac713d1bfc6e7.tar.gz
manaverse-d3f61bb7da045c7d0a955a3859aac713d1bfc6e7.tar.bz2
manaverse-d3f61bb7da045c7d0a955a3859aac713d1bfc6e7.tar.xz
manaverse-d3f61bb7da045c7d0a955a3859aac713d1bfc6e7.zip
In mail view window show buttons for get attach and money.
Also fix default window height.
-rw-r--r--src/gui/windows/mailviewwindow.cpp25
-rw-r--r--src/gui/windows/mailviewwindow.h1
2 files changed, 21 insertions, 5 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp
index 2f6c1c28b..56367ef78 100644
--- a/src/gui/windows/mailviewwindow.cpp
+++ b/src/gui/windows/mailviewwindow.cpp
@@ -60,8 +60,11 @@ MailViewWindow::MailViewWindow(const MailMessage *const message,
Window(_("View mail"), Modal_false, nullptr, "mailview.xml"),
ActionListener(),
mMessage(message),
- // TRANSLATORS: mail view attach button
- mGetAttachButton(new Button(this, _("Get attach"), "attach", this)),
+ mGetAttachButton(new Button(this,
+ // TRANSLATORS: mail view attach / items button
+ settings.enableNewMailSystem ? _("Get items") : _("Get attach"),
+ "attach", this)),
+ mGetMoneyButton(nullptr),
// TRANSLATORS: mail view window button
mCloseButton(new Button(this, _("Close"), "close", this)),
mPrevButton(new Button(this, "<", "prev", this)),
@@ -95,12 +98,11 @@ MailViewWindow::MailViewWindow(const MailMessage *const message,
setStickyButtonLock(true);
setVisible(Visible_true);
- setDefaultSize(380, 230, ImagePosition::CENTER);
+ setDefaultSize(380, 370, ImagePosition::CENTER);
setMinWidth(200);
setMinHeight(100);
center();
mItemScrollArea->setHeight(100);
- mItemScrollArea->setWidth(100);
mItemScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
@@ -121,6 +123,14 @@ MailViewWindow::MailViewWindow(const MailMessage *const message,
placer(0, n++, mMessageLabel);
placer(0, n++, mItemScrollArea);
+ if (mUseMail2 && message->money != 0)
+ {
+ mGetMoneyButton = new Button(this,
+ // TRANSLATORS: mail view attached money button
+ _("Get money"),
+ "attach", this);
+ placer(0, n++, mGetMoneyButton);
+ }
placer(0, n++, mGetAttachButton);
updateAttachButton();
@@ -139,9 +149,14 @@ MailViewWindow::MailViewWindow(const MailMessage *const message,
MailViewWindow::~MailViewWindow()
{
if (mUseMail2)
+ {
mMessage = nullptr;
+ }
else
+ {
delete2(mMessage);
+ delete2(mGetMoneyButton);
+ }
delete2(mInventory);
mailViewWindow = nullptr;
}
@@ -189,7 +204,7 @@ Inventory *MailViewWindow::getInventory() const
void MailViewWindow::updateAttachButton()
{
- if (mMessage->money != 0 ||
+ if ((mMessage->money != 0 && !mUseMail2) ||
mMessage->itemId != 0 ||
mInventory->getLastUsedSlot() != -1)
{
diff --git a/src/gui/windows/mailviewwindow.h b/src/gui/windows/mailviewwindow.h
index 9f09bb9a7..524c029d4 100644
--- a/src/gui/windows/mailviewwindow.h
+++ b/src/gui/windows/mailviewwindow.h
@@ -56,6 +56,7 @@ class MailViewWindow final : public Window,
const MailMessage *mMessage;
Button *mGetAttachButton;
+ Button *mGetMoneyButton;
Button *mCloseButton;
Button *mPrevButton;
Button *mNextButton;