Skip to content

Commit

Permalink
Renamed AddonDialog to DownloadDialog, as it isn't AddonManager speci…
Browse files Browse the repository at this point in the history
…fic any more
  • Loading branch information
Grumbel committed Aug 26, 2014
1 parent bf346ce commit e9df7ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/supertux/menu/addon_menu.cpp
Expand Up @@ -25,7 +25,7 @@
#include "gui/menu.hpp"
#include "gui/menu_item.hpp"
#include "gui/menu_manager.hpp"
#include "supertux/menu/addon_dialog.hpp"
#include "supertux/menu/download_dialog.hpp"
#include "util/gettext.hpp"

namespace {
Expand Down Expand Up @@ -189,7 +189,7 @@ AddonMenu::menu_action(MenuItem* item)
MenuManager::instance().set_dialog({});
refresh();
});
std::unique_ptr<AddonDialog> dialog(new AddonDialog(status));
std::unique_ptr<DownloadDialog> dialog(new DownloadDialog(status));
dialog->set_title("Downloading Add-On Repository Index");
MenuManager::instance().set_dialog(std::move(dialog));
}
Expand Down Expand Up @@ -240,7 +240,7 @@ AddonMenu::menu_action(MenuItem* item)
refresh();
});

std::unique_ptr<AddonDialog> dialog(new AddonDialog(status));
std::unique_ptr<DownloadDialog> dialog(new DownloadDialog(status));
dialog->set_title("Downloading " + generate_menu_item_text(addon));
MenuManager::instance().set_dialog(std::move(dialog));
}
Expand Down
Expand Up @@ -14,14 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#include "supertux/menu/addon_dialog.hpp"
#include "supertux/menu/download_dialog.hpp"

#include <sstream>

#include "gui/menu_manager.hpp"
#include "util/gettext.hpp"

AddonDialog::AddonDialog(TransferStatusPtr status) :
DownloadDialog::DownloadDialog(TransferStatusPtr status) :
m_status(status),
m_title()
{
Expand All @@ -33,20 +33,20 @@ AddonDialog::AddonDialog(TransferStatusPtr status) :
}

void
AddonDialog::update()
DownloadDialog::update()
{
AddonManager::current()->update();
update_text();
}

void
AddonDialog::set_title(const std::string& title)
DownloadDialog::set_title(const std::string& title)
{
m_title = title;
}

void
AddonDialog::update_text()
DownloadDialog::update_text()
{
std::ostringstream out;
out << m_title << "\n";
Expand All @@ -65,7 +65,7 @@ AddonDialog::update_text()
}

void
AddonDialog::on_abort()
DownloadDialog::on_abort()
{
AddonManager::current()->abort_install();
}
Expand Down
Expand Up @@ -14,8 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#ifndef HEADER_SUPERTUX_SUPERTUX_MENU_ADDON_DIALOG_HPP
#define HEADER_SUPERTUX_SUPERTUX_MENU_ADDON_DIALOG_HPP
#ifndef HEADER_SUPERTUX_SUPERTUX_MENU_DOWNLOAD_DIALOG_HPP
#define HEADER_SUPERTUX_SUPERTUX_MENU_DOWNLOAD_DIALOG_HPP

#include "addon/addon_manager.hpp"
#include "addon/addon_manager.hpp"
Expand All @@ -24,14 +24,14 @@
class TransferStatus;
using TransferStatusPtr = std::shared_ptr<TransferStatus>;

class AddonDialog : public Dialog
class DownloadDialog : public Dialog
{
private:
TransferStatusPtr m_status;
std::string m_title;

public:
AddonDialog(TransferStatusPtr status);
DownloadDialog(TransferStatusPtr status);

void set_title(const std::string& title);
void update() override;
Expand All @@ -42,8 +42,8 @@ class AddonDialog : public Dialog
void update_text();

private:
AddonDialog(const AddonDialog&) = delete;
AddonDialog& operator=(const AddonDialog&) = delete;
DownloadDialog(const DownloadDialog&) = delete;
DownloadDialog& operator=(const DownloadDialog&) = delete;
};

#endif
Expand Down

0 comments on commit e9df7ac

Please sign in to comment.