diff options
-rw-r--r-- | src/gui/serverdialog.cpp | 11 | ||||
-rw-r--r-- | src/gui/serverdialog.h | 3 | ||||
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 40 |
4 files changed, 4 insertions, 59 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 09ba7cd1..c8a16b35 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -213,7 +213,6 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): mServersListModel = new ServersListModel(&mServers, this); mServersList = new ServersListBox(mServersListModel); - mServersList->addMouseListener(this); ScrollArea *usedScroll = new ScrollArea(mServersList); usedScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); @@ -414,16 +413,6 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &) mDeleteButton->setEnabled(myServer.save); } -void ServerDialog::mouseClicked(gcn::MouseEvent &mouseEvent) -{ - if (mouseEvent.getClickCount() == 2 && - mouseEvent.getSource() == mServersList) - { - action(gcn::ActionEvent(mConnectButton, - mConnectButton->getActionEventId())); - } -} - void ServerDialog::logic() { { diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index 03ed0f7a..ed733f9c 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -32,7 +32,6 @@ #include <guichan/actionlistener.hpp> #include <guichan/keylistener.hpp> #include <guichan/listmodel.hpp> -#include <guichan/mouselistener.hpp> #include <guichan/selectionlistener.hpp> #include <string> @@ -136,8 +135,6 @@ class ServerDialog : public Window, */ void valueChanged(const gcn::SelectionEvent &event); - void mouseClicked(gcn::MouseEvent &mouseEvent); - void logic(); protected: diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 6ec4d1e8..cc2c7d6a 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -22,7 +22,6 @@ #include "graphics.h" -#include "gui/chat.h" #include "gui/gui.h" #include "gui/palette.h" #include "gui/theme.h" @@ -139,14 +138,6 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) int y = event.getY(); setSelected(y / getFont()->getHeight()); distributeActionEvent(); - - if (event.getClickCount() == 2 && mListModel) - { - int selected = getSelected(); - AvatarListModel *model = static_cast<AvatarListModel*>(mListModel); - chatWindow->addWhisperTab(model->getAvatarAt(selected)->getName(), - true); - } } // TODO: Add support for context menu else if (event.getButton() == gcn::MouseEvent::RIGHT) diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 7648eb24..fb5105b2 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -255,46 +255,14 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) if (mSelectedIndex == index) { - if(event.getClickCount() == 2) - { - if (item->isEquipment()) - { - if (item->isEquipped()) - Net::getInventoryHandler()->unequipItem(item); - else - Net::getInventoryHandler()->equipItem(item); - } - else - Net::getInventoryHandler()->useItem(item); - - } - else - { - mSelectionStatus = SEL_DESELECTING; - } + mSelectionStatus = SEL_DESELECTING; } else if (item && item->getId()) { - if(event.getClickCount() == 2) - { - if (item->isEquipment()) - { - if (item->isEquipped()) - Net::getInventoryHandler()->unequipItem(item); - else - Net::getInventoryHandler()->equipItem(item); - } - else - Net::getInventoryHandler()->useItem(item); + setSelectedIndex(index); + mSelectionStatus = SEL_SELECTING; + itemShortcut->setItemSelected(item->getId()); - } - else - { - setSelectedIndex(index); - mSelectionStatus = SEL_SELECTING; - - itemShortcut->setItemSelected(item->getId()); - } if (item->isEquipment()) outfitWindow->setItemSelected(item->getId()); } |