2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:43:35 +00:00
|
|
|
// Refer to the license.txt file included.
|
2009-02-06 18:04:24 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/bitmap.h>
|
|
|
|
#include <wx/dialog.h>
|
2016-06-24 08:43:46 +00:00
|
|
|
#include <wx/generic/statbmpg.h>
|
2015-02-05 02:12:18 +00:00
|
|
|
#include <wx/hyperlink.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/image.h>
|
|
|
|
#include <wx/mstream.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/stattext.h>
|
2015-02-05 02:12:18 +00:00
|
|
|
#include <wx/textctrl.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
|
2017-09-09 19:52:35 +00:00
|
|
|
#include "Common/Version.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DolphinWX/AboutDolphin.h"
|
2015-12-19 10:34:01 +00:00
|
|
|
#include "DolphinWX/WxUtils.h"
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
AboutDolphin::AboutDolphin(wxWindow* parent, wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& position, const wxSize& size, long style)
|
|
|
|
: wxDialog(parent, id, title, position, size, style)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2016-08-02 06:20:46 +00:00
|
|
|
wxGenericStaticBitmap* const sbDolphinLogo = new wxGenericStaticBitmap(
|
|
|
|
this, wxID_ANY, WxUtils::LoadScaledResourceBitmap("dolphin_logo", this));
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
const wxString DolphinText = _("Dolphin");
|
2017-09-09 19:52:35 +00:00
|
|
|
const wxString RevisionText = Common::scm_desc_str;
|
2016-06-24 08:43:46 +00:00
|
|
|
const wxString CopyrightText =
|
|
|
|
_("(c) 2003-2015+ Dolphin Team. \"GameCube\" and \"Wii\" are trademarks of Nintendo. Dolphin "
|
|
|
|
"is not affiliated with Nintendo in any way.");
|
2017-09-09 19:52:35 +00:00
|
|
|
const wxString BranchText = wxString::Format(_("Branch: %s"), Common::scm_branch_str.c_str());
|
|
|
|
const wxString BranchRevText =
|
|
|
|
wxString::Format(_("Revision: %s"), Common::scm_rev_git_str.c_str());
|
2016-06-24 08:43:46 +00:00
|
|
|
const wxString CheckUpdateText = _("Check for updates: ");
|
|
|
|
const wxString Text =
|
|
|
|
_("\n"
|
|
|
|
"Dolphin is a free and open-source GameCube and Wii emulator.\n"
|
|
|
|
"\n"
|
|
|
|
"This software should not be used to play games you do not legally own.\n");
|
|
|
|
const wxString LicenseText = _("License");
|
|
|
|
const wxString AuthorsText = _("Authors");
|
|
|
|
const wxString SupportText = _("Support");
|
|
|
|
|
|
|
|
wxStaticText* const Dolphin = new wxStaticText(this, wxID_ANY, DolphinText);
|
|
|
|
wxStaticText* const Revision = new wxStaticText(this, wxID_ANY, RevisionText);
|
|
|
|
|
|
|
|
wxStaticText* const Copyright = new wxStaticText(this, wxID_ANY, CopyrightText);
|
|
|
|
wxStaticText* const Branch =
|
|
|
|
new wxStaticText(this, wxID_ANY, BranchText + "\n" + BranchRevText + "\n");
|
|
|
|
wxStaticText* const Message = new wxStaticText(this, wxID_ANY, Text);
|
|
|
|
wxStaticText* const UpdateText = new wxStaticText(this, wxID_ANY, CheckUpdateText);
|
|
|
|
wxStaticText* const FirstSpacer = new wxStaticText(this, wxID_ANY, " | ");
|
|
|
|
wxStaticText* const SecondSpacer = new wxStaticText(this, wxID_ANY, " | ");
|
|
|
|
wxHyperlinkCtrl* const Download = new wxHyperlinkCtrl(this, wxID_ANY, "dolphin-emu.org/download",
|
|
|
|
"https://dolphin-emu.org/download/");
|
|
|
|
wxHyperlinkCtrl* const License =
|
|
|
|
new wxHyperlinkCtrl(this, wxID_ANY, LicenseText,
|
|
|
|
"https://github.com/dolphin-emu/dolphin/blob/master/license.txt");
|
|
|
|
wxHyperlinkCtrl* const Authors = new wxHyperlinkCtrl(
|
|
|
|
this, wxID_ANY, AuthorsText, "https://github.com/dolphin-emu/dolphin/graphs/contributors");
|
|
|
|
wxHyperlinkCtrl* const Support =
|
|
|
|
new wxHyperlinkCtrl(this, wxID_ANY, SupportText, "https://forums.dolphin-emu.org/");
|
|
|
|
|
|
|
|
wxFont DolphinFont = Dolphin->GetFont();
|
|
|
|
wxFont RevisionFont = Revision->GetFont();
|
|
|
|
wxFont CopyrightFont = Copyright->GetFont();
|
|
|
|
wxFont BranchFont = Branch->GetFont();
|
|
|
|
|
|
|
|
DolphinFont.SetPointSize(36);
|
|
|
|
Dolphin->SetFont(DolphinFont);
|
|
|
|
|
|
|
|
RevisionFont.SetWeight(wxFONTWEIGHT_BOLD);
|
|
|
|
Revision->SetFont(RevisionFont);
|
|
|
|
|
|
|
|
BranchFont.SetPointSize(7);
|
|
|
|
Branch->SetFont(BranchFont);
|
|
|
|
|
|
|
|
CopyrightFont.SetPointSize(7);
|
|
|
|
Copyright->SetFont(CopyrightFont);
|
|
|
|
Copyright->SetFocus();
|
|
|
|
|
2016-07-17 20:48:26 +00:00
|
|
|
wxSizerFlags center_flag;
|
|
|
|
center_flag.Center();
|
2016-08-02 06:20:46 +00:00
|
|
|
const int space5 = FromDIP(5);
|
|
|
|
const int space10 = FromDIP(10);
|
|
|
|
const int space15 = FromDIP(15);
|
|
|
|
const int space30 = FromDIP(30);
|
|
|
|
const int space40 = FromDIP(40);
|
|
|
|
const int space75 = FromDIP(75);
|
2016-07-17 20:48:26 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
wxBoxSizer* const sCheckUpdates = new wxBoxSizer(wxHORIZONTAL);
|
2016-07-17 20:48:26 +00:00
|
|
|
sCheckUpdates->Add(UpdateText, center_flag);
|
|
|
|
sCheckUpdates->Add(Download, center_flag);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
wxBoxSizer* const sLinks = new wxBoxSizer(wxHORIZONTAL);
|
2016-07-17 20:48:26 +00:00
|
|
|
sLinks->Add(License, center_flag);
|
|
|
|
sLinks->Add(FirstSpacer, center_flag);
|
|
|
|
sLinks->Add(Authors, center_flag);
|
|
|
|
sLinks->Add(SecondSpacer, center_flag);
|
|
|
|
sLinks->Add(Support, center_flag);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
wxBoxSizer* const sInfo = new wxBoxSizer(wxVERTICAL);
|
|
|
|
sInfo->Add(Dolphin);
|
2016-08-02 06:20:46 +00:00
|
|
|
sInfo->AddSpacer(space5);
|
2016-06-24 08:43:46 +00:00
|
|
|
sInfo->Add(Revision);
|
2016-08-02 06:20:46 +00:00
|
|
|
sInfo->AddSpacer(space10);
|
2016-06-24 08:43:46 +00:00
|
|
|
sInfo->Add(Branch);
|
|
|
|
sInfo->Add(sCheckUpdates);
|
|
|
|
sInfo->Add(Message);
|
|
|
|
sInfo->Add(sLinks);
|
|
|
|
|
|
|
|
wxBoxSizer* const sLogo = new wxBoxSizer(wxVERTICAL);
|
2016-08-02 06:20:46 +00:00
|
|
|
sLogo->AddSpacer(space75);
|
2016-06-24 08:43:46 +00:00
|
|
|
sLogo->Add(sbDolphinLogo);
|
2016-08-02 06:20:46 +00:00
|
|
|
sLogo->AddSpacer(space40);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
wxBoxSizer* const sMainHor = new wxBoxSizer(wxHORIZONTAL);
|
2016-08-02 06:20:46 +00:00
|
|
|
sMainHor->AddSpacer(space30);
|
2016-06-24 08:43:46 +00:00
|
|
|
sMainHor->Add(sLogo);
|
2016-08-02 06:20:46 +00:00
|
|
|
sMainHor->AddSpacer(space30);
|
2016-06-24 08:43:46 +00:00
|
|
|
sMainHor->Add(sInfo);
|
2016-08-02 06:20:46 +00:00
|
|
|
sMainHor->AddSpacer(space30);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
wxBoxSizer* const sFooter = new wxBoxSizer(wxVERTICAL);
|
2016-08-02 06:20:46 +00:00
|
|
|
sFooter->AddSpacer(space15);
|
2016-06-26 05:25:29 +00:00
|
|
|
sFooter->Add(Copyright, 0, wxALIGN_CENTER_HORIZONTAL);
|
2016-08-02 06:20:46 +00:00
|
|
|
sFooter->AddSpacer(space5);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
wxBoxSizer* const sMain = new wxBoxSizer(wxVERTICAL);
|
|
|
|
sMain->Add(sMainHor, 1, wxEXPAND);
|
|
|
|
sMain->Add(sFooter, 0, wxEXPAND);
|
|
|
|
|
|
|
|
SetSizerAndFit(sMain);
|
|
|
|
Center();
|
|
|
|
SetFocus();
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|