summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-03 02:57:47 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-03 02:57:47 +0300
commitb1d2dc573da58236e8a972bbab7a52345aeee8c1 (patch)
tree6493c7de529b6cce7a3cee38b23b58b7e2da3711
parent51ff8587d3a008e9c4867b18034640f58063d4a8 (diff)
downloadmanaverse-b1d2dc573da58236e8a972bbab7a52345aeee8c1.tar.gz
manaverse-b1d2dc573da58236e8a972bbab7a52345aeee8c1.tar.bz2
manaverse-b1d2dc573da58236e8a972bbab7a52345aeee8c1.tar.xz
manaverse-b1d2dc573da58236e8a972bbab7a52345aeee8c1.zip
Add option clear to context menu in drops window.
-rw-r--r--src/dropshortcut.cpp13
-rw-r--r--src/dropshortcut.h2
-rw-r--r--src/gui/popupmenu.cpp10
3 files changed, 15 insertions, 10 deletions
diff --git a/src/dropshortcut.cpp b/src/dropshortcut.cpp
index 4deb8901d..c3ba98a27 100644
--- a/src/dropshortcut.cpp
+++ b/src/dropshortcut.cpp
@@ -43,9 +43,7 @@ DropShortcut::DropShortcut():
mItemSelected(-1),
mItemColorSelected(1)
{
- for (int i = 0; i < DROP_SHORTCUT_ITEMS; i++)
- mItems[i] = -1;
-
+ clear();
load();
mLastDropIndex = 0;
}
@@ -225,3 +223,12 @@ void DropShortcut::setItem(int index)
mItemColors[index] = mItemColorSelected;
save();
}
+
+void DropShortcut::clear()
+{
+ for (int i = 0; i < DROP_SHORTCUT_ITEMS; i++)
+ {
+ mItems[i] = -1;
+ mItemColors[i] = 1;
+ }
+}
diff --git a/src/dropshortcut.h b/src/dropshortcut.h
index 6a0ef49e9..ea11f34e0 100644
--- a/src/dropshortcut.h
+++ b/src/dropshortcut.h
@@ -141,6 +141,8 @@ class DropShortcut
*/
void dropItems(int cnt = 1);
+ void clear();
+
private:
/**
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index d37e8f351..d896b9420 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -1403,13 +1403,10 @@ void PopupMenu::handleLink(const std::string &link,
}
}
}
- else if (link == "load old drop shortcuts")
+ else if (link == "clear drops")
{
if (dropShortcut)
- {
- dropShortcut->load(true);
- dropShortcut->save();
- }
+ dropShortcut->clear();
}
else if (link == "edit spell" && mSpell)
{
@@ -2022,8 +2019,7 @@ void PopupMenu::showDropPopup(int x, int y, Item *item)
mBrowserBox->addRow("chat", _("Add to chat"));
mBrowserBox->addRow("##3---");
}
- mBrowserBox->addRow("load old drop shortcuts",
- _("Load old drop shortcuts"));
+ mBrowserBox->addRow("clear drops", _("Clear drop window"));
mBrowserBox->addRow("##3---");
mBrowserBox->addRow("cancel", _("Cancel"));