diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-08-16 18:25:55 +0200 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-08-16 18:25:55 +0200 |
commit | 4263962e947b4914de8d1750f21cc7cc82567b4d (patch) | |
tree | 32340098913c302fdb33f88ffea65fb36920db75 /src/gui/skilldialog.cpp | |
parent | dd0844b6ac01293e7afd0dd85e695b8d77b8e4be (diff) | |
parent | 7e2673a3b9460fdcd646e23c3bd9039de854565f (diff) | |
download | mana-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.gz mana-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.bz2 mana-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.xz mana-4263962e947b4914de8d1750f21cc7cc82567b4d.zip |
More merges and conflict resolves
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 14e0e5a4..6e7b3e70 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -47,7 +47,6 @@ #include "utils/xml.h" #include <string> -#include <vector> class SkillEntry; @@ -96,7 +95,7 @@ SkillDialog::SkillDialog(): mPointsLabel = new Label("0"); place(0, 0, mTabs, 5, 5); - place(0, 5, mPointsLabel); + place(0, 5, mPointsLabel, 2); setLocationRelativeTo(getParent()); loadWindowState(); @@ -104,7 +103,8 @@ SkillDialog::SkillDialog(): SkillDialog::~SkillDialog() { - //delete_all(mTabs); + // Clear gui + loadSkills(""); } void SkillDialog::action(const gcn::ActionEvent &event) @@ -122,36 +122,6 @@ void SkillDialog::action(const gcn::ActionEvent &event) } } -void SkillDialog::adjustTabSize() -{ - gcn::Widget *content = mTabs->getCurrentWidget(); - if (content) { - int width = mTabs->getWidth() - 2 * content->getFrameSize() - 2 * mTabs->getFrameSize(); - int height = mTabs->getContainerHeight() - 2 * content->getFrameSize(); - content->setSize(width, height); - content->setVisible(true); - content->logic(); - } -} - -void SkillDialog::widgetResized(const gcn::Event &event) -{ - Window::widgetResized(event); - - adjustTabSize(); -} - -void SkillDialog::logic() -{ - Window::logic(); - - Tab *tab = dynamic_cast<Tab*>(mTabs->getSelectedTab()); - if (tab != mCurrentTab) { - mCurrentTab = tab; - adjustTabSize(); - } -} - std::string SkillDialog::update(int id) { SkillMap::iterator i = mSkills.find(id); @@ -182,9 +152,21 @@ void SkillDialog::update() void SkillDialog::loadSkills(const std::string &file) { // TODO: mTabs->clear(); + while (mTabs->getSelectedTabIndex() != -1) + { + mTabs->removeTabWithIndex(mTabs->getSelectedTabIndex()); + } + + for (SkillMap::iterator it = mSkills.begin(); it != mSkills.end(); it++) + { + delete (*it).second->display; + } delete_all(mSkills); mSkills.clear(); + if (file.length() == 0) + return; + XML::Document doc(file); xmlNodePtr root = doc.rootNode(); @@ -236,8 +218,6 @@ void SkillDialog::loadSkills(const std::string &file) } } } - - adjustTabSize(); update(); } |