summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 13:40:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 13:40:14 +0300
commit2cb9f5c3d47077a459fabf15800b1c45cfdacb3a (patch)
treead6eba1142495acd31dc8a50b56988a26350f2d5 /src/gui/windows
parent829cd57e021ea85cffdbd3f3a7b18da835e00b7c (diff)
downloadplus-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.tar.gz
plus-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.tar.bz2
plus-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.tar.xz
plus-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.zip
Remove proxy methods used for access popup menu.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp11
-rw-r--r--src/gui/windows/equipmentwindow.cpp9
-rw-r--r--src/gui/windows/inventorywindow.cpp5
-rw-r--r--src/gui/windows/minimap.cpp5
-rw-r--r--src/gui/windows/ministatuswindow.cpp6
-rw-r--r--src/gui/windows/npcdialog.cpp10
-rw-r--r--src/gui/windows/outfitwindow.cpp8
-rw-r--r--src/gui/windows/whoisonline.cpp13
8 files changed, 47 insertions, 20 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 2cee38db7..363af7284 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -45,9 +45,12 @@
#include "gui/gui.h"
#include "gui/popupmanager.h"
#include "gui/skin.h"
+#include "gui/viewport.h"
#include "gui/models/colorlistmodel.h"
+#include "gui/popups/popupmenu.h"
+
#include "gui/windows/emotewindow.h"
#include "gui/windows/setupwindow.h"
#include "gui/widgets/tabbedarea.h"
@@ -657,7 +660,7 @@ void ChatWindow::mousePressed(MouseEvent &event)
if (event.getButton() == MouseButton::RIGHT)
{
- if (popupManager)
+ if (popupMenu)
{
Tab *const tab = mChatTabs->getSelectedTab();
if (tab)
@@ -674,7 +677,11 @@ void ChatWindow::mousePressed(MouseEvent &event)
{
ChatTab *const cTab = dynamic_cast<ChatTab*>(tab);
if (cTab)
- popupManager->showChatPopup(cTab);
+ {
+ popupMenu->showChatPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ cTab);
+ }
}
}
}
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index a760f49c8..5600de741 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -32,10 +32,9 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
-#include "gui/popupmanager.h"
-
#include "gui/fonts/font.h"
+#include "gui/popups/popupmenu.h"
#include "gui/popups/itempopup.h"
#include "gui/windows/setupwindow.h"
@@ -358,13 +357,13 @@ void EquipmentWindow::mousePressed(MouseEvent& event)
*/
const int mx = x + getX();
const int my = y + getY();
- if (popupManager)
+ if (popupMenu)
{
event.consume();
if (mForing)
- popupManager->showUndressPopup(mx, my, mBeing, item);
+ popupMenu->showUndressPopup(mx, my, mBeing, item);
else
- popupManager->showPopup(this, mx, my, item, true);
+ popupMenu->showPopup(this, mx, my, item, true);
return;
}
}
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 5d12c95d4..d148d4d7d 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -40,6 +40,7 @@
#include "gui/models/sortlistmodelinv.h"
+#include "gui/popups/popupmenu.h"
#include "gui/popups/textpopup.h"
#include "gui/windows/equipmentwindow.h"
@@ -467,8 +468,8 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
const int mx = event.getX() + getX();
const int my = event.getY() + getY();
- if (popupManager)
- popupManager->showPopup(this, mx, my, item, isMainInventory());
+ if (popupMenu)
+ popupMenu->showPopup(this, mx, my, item, isMainInventory());
}
if (!mInventory)
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index 615db0d85..16e18fe35 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -32,6 +32,7 @@
#include "gui/popupmanager.h"
#include "gui/viewport.h"
+#include "gui/popups/popupmenu.h"
#include "gui/popups/textpopup.h"
#include "gui/windows/setupwindow.h"
@@ -459,7 +460,9 @@ void Minimap::mouseReleased(MouseEvent &event)
int x = event.getX();
int y = event.getY();
screenToMap(x, y);
- popupManager->showMapPopup(x, y);
+ popupMenu->showMapPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ x, y);
}
}
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 6536617f3..ebbb90119 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -33,9 +33,9 @@
#include "gui/popupmanager.h"
#include "gui/skin.h"
-#include "gui/popups/textpopup.h"
-
+#include "gui/popups/popupmenu.h"
#include "gui/popups/statuspopup.h"
+#include "gui/popups/textpopup.h"
#include "gui/windows/statuswindow.h"
@@ -452,7 +452,7 @@ void MiniStatusWindow::mousePressed(MouseEvent &event)
event.consume();
if (popupManager)
{
- popupManager->showPopup(getX() + event.getX(),
+ popupMenu->showPopup(getX() + event.getX(),
getY() + event.getY(), bar);
}
}
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index d11dca0a9..8b7a938b0 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -38,6 +38,8 @@
#include "gui/fonts/font.h"
+#include "gui/popups/popupmenu.h"
+
#include "gui/windows/inventorywindow.h"
#include "gui/widgets/browserbox.h"
@@ -948,8 +950,12 @@ void NpcDialog::mousePressed(MouseEvent &event)
&& event.getSource() == mTextBox)
{
event.consume();
- if (popupManager)
- popupManager->showNpcDialogPopup(mNpcId);
+ if (popupMenu)
+ {
+ popupMenu->showNpcDialogPopup(mNpcId,
+ viewport->getMouseX(),
+ viewport->getMouseY());
+ }
}
}
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index a74967bb4..0cd35e289 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -34,6 +34,9 @@
#include "input/inputmanager.h"
#include "gui/popupmanager.h"
+#include "gui/viewport.h"
+
+#include "gui/popups/popupmenu.h"
#include "gui/windows/setupwindow.h"
@@ -421,9 +424,10 @@ void OutfitWindow::mouseDragged(MouseEvent &event)
void OutfitWindow::mousePressed(MouseEvent &event)
{
const int index = getIndexFromGrid(event.getX(), event.getY());
- if (event.getButton() == MouseButton::RIGHT && popupManager)
+ if (event.getButton() == MouseButton::RIGHT && popupMenu)
{
- popupManager->showOutfitsPopup();
+ popupMenu->showOutfitsPopup(viewport->getMouseX(),
+ viewport->getMouseY());
event.consume();
return;
}
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index f19f2662c..c30f19b8e 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -31,6 +31,9 @@
#include "gui/onlineplayer.h"
#include "gui/popupmanager.h"
+#include "gui/viewport.h"
+
+#include "gui/popups/popupmenu.h"
#include "gui/windows/chatwindow.h"
#include "gui/windows/setupwindow.h"
@@ -197,7 +200,7 @@ void WhoIsOnline::handleLink(const std::string& link, MouseEvent *event)
if (localPlayer && link == localPlayer->getName())
return;
- if (popupManager)
+ if (popupMenu)
{
if (actorManager)
{
@@ -207,11 +210,15 @@ void WhoIsOnline::handleLink(const std::string& link, MouseEvent *event)
if (being && popupManager)
{
- popupManager->showPopup(being);
+ popupMenu->showPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ being);
return;
}
}
- popupManager->showPlayerPopup(link);
+ popupMenu->showPlayerPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ link);
}
}
}