More plugin stuff

This commit is contained in:
Henrik Rydgard committed 2013-06-02 14:38:22 +02:00
1 parent 68e75ae134
commit e5090e36c2
3 files changed
+29 -6

No files matched your search

+17 -4
View File
@@ -24,9 +24,19 @@
#include "ui/view.h"
#include "ui/viewgroup.h"
#include "ui/ui_context.h"
#include "Core/HW/atrac3plus.h"
void UIScreen::update(InputState &input) {
if (!root_) {
CreateViews();
}
if (orientationChanged_) {
delete root_;
root_ = 0;
CreateViews();
}
UpdateViewHierarchy(input, root_);
}
@@ -46,7 +56,9 @@ void UIScreen::touch(const TouchInput &touch) {
PluginScreen::PluginScreen() {
// Let's start by downloading the json. We'll find out in Update when it's finished.
json_ = downloader_.StartDownload("http://www.ppsspp.org/update/at3plusdecoder.json", "");
}
void PluginScreen::CreateViews() {
I18NCategory *c = GetI18NCategory("Plugin");
// Build the UI.
@@ -54,7 +66,6 @@ PluginScreen::PluginScreen() {
root_ = new LinearLayout(ORIENT_VERTICAL);
Margins textMargins(20,17);
tvDescription_ = root_->Add(new TextView(0, "Audio decoding support", ALIGN_HCENTER, 1.0f, new LinearLayoutParams(textMargins)));
@@ -64,12 +75,14 @@ PluginScreen::PluginScreen() {
"reverse engineered code in the US and some other countries.\n"
"Choose \"More Information\" for more info.\n", ALIGN_LEFT, 1.0f, new LinearLayoutParams(1.0, textMargins)));
progress_ = root_->Add(new ProgressBar());
ViewGroup *buttonBar = new LinearLayout(ORIENT_HORIZONTAL);
root_->Add(buttonBar);
buttonDownload_ = new Button(c->T("Download"), new LinearLayoutParams(1.0));
buttonBar->Add(buttonDownload_)->OnClick.Add(std::bind(&PluginScreen::OnDownload, this, p::_1));
buttonBar->Add(new Button(c->T("More Information"), new LinearLayoutParams(1.0)))->OnClick.Add(std::bind(&PluginScreen::OnInformation, this, p::_1));
buttonBar->Add(buttonDownload_)->OnClick.Add(std::bind(&PluginScreen::OnDownload, this, placeholder::_1));
buttonBar->Add(new Button(c->T("More Information"), new LinearLayoutParams(1.0)))->OnClick.Add(std::bind(&PluginScreen::OnInformation, this, placeholder::_1));
}
void PluginScreen::update(InputState &input) {