finish the banner part of ISOProperties.cpp

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2241 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-02-14 17:32:03 +00:00
parent 7c638f3a51
commit 5e80ca1526
2 changed files with 43 additions and 50 deletions

View File

@ -17,12 +17,12 @@
#include "Globals.h"
#include "ISOFile.h"
#include "VolumeCreator.h"
#include "Filesystem.h"
#include "ISOProperties.h"
#include "PatchAddEdit.h"
#include "ARCodeAddEdit.h"
#include "ConfigManager.h"
DiscIO::IVolume *OpenISO = NULL;
@ -49,6 +49,7 @@ BEGIN_EVENT_TABLE(CISOProperties, wxDialog)
EVT_TREE_ITEM_RIGHT_CLICK(ID_TREECTRL, CISOProperties::OnRightClickOnTree)
EVT_MENU(IDM_EXTRACTFILE, CISOProperties::OnExtractFile)
EVT_MENU(IDM_EXTRACTDIR, CISOProperties::OnExtractDir)
EVT_CHOICE(ID_LANG, CISOProperties::OnChangeBannerLang)
END_EVENT_TABLE()
CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
@ -59,9 +60,9 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
pFileSystem->GetFileList(Our_Files);
GameListItem OpenISO_(fileName);
OpenGameListItem = new GameListItem(fileName);
bRefreshList = false;
bRefreshList = false;
CreateGUIControls();
@ -109,19 +110,8 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
m_FST->SetValue(wxString::Format(_T("%u"), OpenISO->GetFSTSize()));
// Banner
// ...all the BannerLoader functions are bool...gross
//m_Version;
//if (OpenISO_.GetBNRVersion() == "BNR1")
m_Lang->Enable(false);
// hyperiris: temp fix, need real work
m_ShortName->SetValue(wxString(OpenISO_.GetName(0).c_str(), wxConvUTF8));
//m_LongName->SetValue(wxString(OpenISO_.GetLongName().c_str(), wxConvUTF8));
m_Maker->SetValue(wxString(OpenISO_.GetCompany().c_str(), wxConvUTF8));//dev too
// hyperiris: temp fix, need real work
m_Comment->SetValue(wxString(OpenISO_.GetDescription(0).c_str(), wxConvUTF8));
m_Banner->SetBitmap(OpenISO_.GetImage());
ChangeBannerDetails((int)SConfig::GetInstance().m_InterfaceLanguage);
m_Banner->SetBitmap(OpenGameListItem->GetImage());
m_Banner->Connect(wxID_ANY, wxEVT_RIGHT_DOWN,
wxMouseEventHandler(CISOProperties::RightClickOnBanner), (wxObject*)NULL, this);
@ -134,7 +124,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
SplitPath(fileName, 0, &filename, &extension);
// hyperiris: temp fix, need real work
SetTitle(wxString::Format(_("%s%s: %s - %s"), filename.c_str(), extension.c_str(), OpenISO_.GetUniqueID().c_str(), OpenISO_.GetName(0).c_str()));
SetTitle(wxString::Format(_("%s%s: %s - %s"), filename.c_str(), extension.c_str(), OpenGameListItem->GetUniqueID().c_str(), OpenGameListItem->GetName(0).c_str()));
}
CISOProperties::~CISOProperties()
@ -216,13 +206,6 @@ void CISOProperties::CreateGUIControls()
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(m_Close, 0, wxALL, 5);
wxBoxSizer* sMain;
sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(m_Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5);
this->SetSizer(sMain);
this->Layout();
// GameConfig editing - Core overrides and emulation state
sbCoreOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Game-Specific Settings"));
@ -335,8 +318,6 @@ void CISOProperties::CreateGUIControls()
sbBannerDetails = new wxStaticBoxSizer(wxVERTICAL, m_Information, _("Banner Details"));
sBannerDetails = new wxGridBagSizer(0, 0);
sBannerDetails->AddGrowableCol(1); sBannerDetails->AddGrowableCol(2); sBannerDetails->AddGrowableCol(3);
m_VersionText = new wxStaticText(m_Information, ID_VERSION_TEXT, _("Version:"), wxDefaultPosition, wxDefaultSize);
m_Version = new wxTextCtrl(m_Information, ID_VERSION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_LangText = new wxStaticText(m_Information, ID_LANG_TEXT, _("Show Language:"), wxDefaultPosition, wxDefaultSize);
arrayStringFor_Lang.Add(_("English"));
arrayStringFor_Lang.Add(_("German"));
@ -345,11 +326,9 @@ void CISOProperties::CreateGUIControls()
arrayStringFor_Lang.Add(_("Italian"));
arrayStringFor_Lang.Add(_("Dutch"));
m_Lang = new wxChoice(m_Information, ID_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_Lang, 0, wxDefaultValidator);
m_Lang->SetSelection(0);
m_Lang->SetSelection((int)SConfig::GetInstance().m_InterfaceLanguage);
m_ShortText = new wxStaticText(m_Information, ID_SHORTNAME_TEXT, _("Short Name:"), wxDefaultPosition, wxDefaultSize);
m_ShortName = new wxTextCtrl(m_Information, ID_SHORTNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_LongText = new wxStaticText(m_Information, ID_LONGNAME_TEXT, _("Long Name:"), wxDefaultPosition, wxDefaultSize);
m_LongName = new wxTextCtrl(m_Information, ID_LONGNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_MakerText = new wxStaticText(m_Information, ID_MAKER_TEXT, _("Maker:"), wxDefaultPosition, wxDefaultSize);
m_Maker = new wxTextCtrl(m_Information, ID_MAKER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_CommentText = new wxStaticText(m_Information, ID_COMMENT_TEXT, _("Comment:"), wxDefaultPosition, wxDefaultSize);
@ -373,20 +352,16 @@ void CISOProperties::CreateGUIControls()
sISODetails->Add(m_FST, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sbISODetails->Add(sISODetails, 0, wxEXPAND, 5);
sBannerDetails->Add(m_VersionText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_Version, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_LangText, wxGBPosition(0, 2), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_Lang, wxGBPosition(0, 3), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_LangText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_Lang, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_ShortText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_ShortName, wxGBPosition(1, 1), wxGBSpan(1, 3), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_LongText, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_LongName, wxGBPosition(2, 1), wxGBSpan(1, 3), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_MakerText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_Maker, wxGBPosition(3, 1), wxGBSpan(1, 3), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_CommentText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
sBannerDetails->Add(m_Comment, wxGBPosition(4, 1), wxGBSpan(1, 3), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_BannerText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
sBannerDetails->Add(m_Banner, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_ShortName, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_MakerText, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sBannerDetails->Add(m_Maker, wxGBPosition(2, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_CommentText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5);
sBannerDetails->Add(m_Comment, wxGBPosition(3, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBannerDetails->Add(m_BannerText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
sBannerDetails->Add(m_Banner, wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sbBannerDetails->Add(sBannerDetails, 0, wxEXPAND, 0);
sInfoPage->Add(sbISODetails, 0, wxEXPAND|wxALL, 5);
sInfoPage->Add(sbBannerDetails, 0, wxEXPAND|wxALL, 5);
@ -406,7 +381,12 @@ void CISOProperties::CreateGUIControls()
m_Filesystem->SetSizer(sTreePage);
sTreePage->Layout();
Fit();
wxBoxSizer* sMain;
sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(m_Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5);
sMain->SetMinSize(wxSize(400,550));
SetSizerAndFit(sMain);
}
void CISOProperties::OnClose(wxCloseEvent& WXUNUSED (event))
@ -765,3 +745,15 @@ void CISOProperties::ActionReplayButtonClicked(wxCommandEvent& event)
EditCheat->Enable(false);
RemoveCheat->Enable(false);
}
void CISOProperties::OnChangeBannerLang(wxCommandEvent& event)
{
ChangeBannerDetails(event.GetSelection());
}
void CISOProperties::ChangeBannerDetails(int lang)
{
m_ShortName->SetValue(wxString(OpenGameListItem->GetName(lang).c_str(), wxConvUTF8));
m_Maker->SetValue(wxString(OpenGameListItem->GetCompany().c_str(), wxConvUTF8));//dev too
m_Comment->SetValue(wxString(OpenGameListItem->GetDescription(lang).c_str(), wxConvUTF8));
}

View File

@ -29,6 +29,7 @@
#include <wx/mimetype.h>
#include <string>
#include "ISOFile.h"
#include "Filesystem.h"
#include "IniFile.h"
#include "PatchEngine.h"
@ -44,7 +45,7 @@ class CISOProperties : public wxDialog
const wxString& title = wxT("Properties"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE);
long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
virtual ~CISOProperties();
bool bRefreshList;
@ -110,10 +111,8 @@ class CISOProperties : public wxDialog
wxStaticText *m_MakerIDText;
wxStaticText *m_DateText;
wxStaticText *m_FSTText;
wxStaticText *m_VersionText;
wxStaticText *m_LangText;
wxStaticText *m_ShortText;
wxStaticText *m_LongText;
wxStaticText *m_MakerText;
wxStaticText *m_CommentText;
wxStaticText *m_BannerText;
@ -123,11 +122,9 @@ class CISOProperties : public wxDialog
wxTextCtrl *m_MakerID;
wxTextCtrl *m_Date;
wxTextCtrl *m_FST;
wxTextCtrl *m_Version;
wxArrayString arrayStringFor_Lang;
wxChoice *m_Lang;
wxTextCtrl *m_ShortName;
wxTextCtrl *m_LongName;
wxTextCtrl *m_Maker;
wxTextCtrl *m_Comment;
wxStaticBitmap *m_Banner;
@ -212,6 +209,9 @@ class CISOProperties : public wxDialog
void OnExtractFile(wxCommandEvent& event);
void OnExtractDir(wxCommandEvent& event);
void SetRefresh(wxCommandEvent& event);
void OnChangeBannerLang(wxCommandEvent& event);
GameListItem *OpenGameListItem;
std::vector<const DiscIO::SFileInfo *> Our_Files;
typedef std::vector<const DiscIO::SFileInfo *>::iterator fileIter;
@ -229,5 +229,6 @@ class CISOProperties : public wxDialog
void PatchList_Save();
void ActionReplayList_Load();
void ActionReplayList_Save();
void ChangeBannerDetails(int lang);
};
#endif