Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'external-theme'
  • Loading branch information
jordan-woyak committed Jan 17, 2013
2 parents 0ef3bd9 + 8456f2e commit 3cb4300
Show file tree
Hide file tree
Showing 61 changed files with 84 additions and 16,295 deletions.
1 change: 1 addition & 0 deletions Data/User/Themes/Boomy/README.txt
@@ -0,0 +1 @@
Boomy: Milosz Wlazlo [miloszwl@miloszwl.com]
Binary file added Data/User/Themes/Boomy/browse.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/config.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/dsp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/fullscreen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/gcpad.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/graphics.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/help.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/open.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/pause.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/play.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/refresh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/stop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/User/Themes/Boomy/wiimote.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Source/Core/Common/Src/CommonPaths.h
Expand Up @@ -89,6 +89,7 @@
#define MAIL_LOGS_DIR LOGS_DIR DIR_SEP "Mail"
#define SHADERS_DIR "Shaders"
#define WII_SYSCONF_DIR "shared2" DIR_SEP "sys"
#define THEMES_DIR "Themes"

// Filenames
// Files in the directory returned by GetUserPath(D_CONFIG_IDX)
Expand Down
35 changes: 18 additions & 17 deletions Source/Core/Common/Src/FileSearch.cpp
Expand Up @@ -25,6 +25,7 @@
#endif

#include <string>
#include <algorithm>

#include "FileSearch.h"

Expand Down Expand Up @@ -72,36 +73,36 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&


#else
size_t dot_pos = _searchString.rfind(".");
// TODO: super lame/broken

if (dot_pos == std::string::npos)
return;
auto end_match(_searchString);

// assuming we have a "*.blah"-like pattern
if (!end_match.empty() && end_match[0] == '*')
end_match.erase(0, 1);

// ugly
if (end_match == ".*")
end_match.clear();

std::string ext = _searchString.substr(dot_pos);
DIR* dir = opendir(_strPath.c_str());

if (!dir)
return;

dirent* dp;

while (true)
while (auto const dp = readdir(dir))
{
dp = readdir(dir);

if (!dp)
break;

std::string s(dp->d_name);
std::string found(dp->d_name);

if ( (!ext.compare(".*") && s.compare(".") && s.compare("..")) ||
((s.size() > ext.size()) && (!strcasecmp(s.substr(s.size() - ext.size()).c_str(), ext.c_str())) ))
if ((found != ".") && (found != "..")
&& (found.size() >= end_match.size())
&& std::equal(end_match.rbegin(), end_match.rend(), found.rbegin()))
{
std::string full_name;
if (_strPath.c_str()[_strPath.size()-1] == DIR_SEP_CHR)
full_name = _strPath + s;
full_name = _strPath + found;
else
full_name = _strPath + DIR_SEP + s;
full_name = _strPath + DIR_SEP + found;

m_FileNames.push_back(full_name);
}
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Src/FileUtil.cpp
Expand Up @@ -678,6 +678,7 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
paths[D_DUMPDSP_IDX] = paths[D_USER_IDX] + DUMP_DSP_DIR DIR_SEP;
paths[D_LOGS_IDX] = paths[D_USER_IDX] + LOGS_DIR DIR_SEP;
paths[D_MAILLOGS_IDX] = paths[D_USER_IDX] + MAIL_LOGS_DIR DIR_SEP;
paths[D_THEMES_IDX] = paths[D_USER_IDX] + THEMES_DIR DIR_SEP;
paths[D_WIISYSCONF_IDX] = paths[D_WIIUSER_IDX] + WII_SYSCONF_DIR DIR_SEP;
paths[F_DOLPHINCONFIG_IDX] = paths[D_CONFIG_IDX] + DOLPHIN_CONFIG;
paths[F_DSPCONFIG_IDX] = paths[D_CONFIG_IDX] + DSP_CONFIG;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Src/FileUtil.h
Expand Up @@ -50,6 +50,7 @@ enum {
D_LOGS_IDX,
D_MAILLOGS_IDX,
D_WIISYSCONF_IDX,
D_THEMES_IDX,
F_DOLPHINCONFIG_IDX,
F_DSPCONFIG_IDX,
F_DEBUGGERCONFIG_IDX,
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/ConfigManager.cpp
Expand Up @@ -164,7 +164,6 @@ void SConfig::SaveSettings()
ini.Set("Interface", "OnScreenDisplayMessages", m_LocalCoreStartupParameter.bOnScreenDisplayMessages);
ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor);
ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor);
ini.Set("Interface", "Theme", m_LocalCoreStartupParameter.iTheme);
ini.Set("Interface", "MainWindowPosX", (m_LocalCoreStartupParameter.iPosX == -32000) ? 0 : m_LocalCoreStartupParameter.iPosX); // TODO - HAX
ini.Set("Interface", "MainWindowPosY", (m_LocalCoreStartupParameter.iPosY == -32000) ? 0 : m_LocalCoreStartupParameter.iPosY); // TODO - HAX
ini.Set("Interface", "MainWindowWidth", m_LocalCoreStartupParameter.iWidth);
Expand All @@ -175,6 +174,7 @@ void SConfig::SaveSettings()
ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow);
ini.Set("Interface", "ShowLogConfigWindow", m_InterfaceLogConfigWindow);
ini.Set("Interface", "ShowConsole", m_InterfaceConsole);
ini.Set("Interface", "ThemeName", m_LocalCoreStartupParameter.theme_name);

// Hotkeys
for (int i = 0; i < NUM_HOTKEYS; i++)
Expand Down Expand Up @@ -303,7 +303,6 @@ void SConfig::LoadSettings()
ini.Get("Interface", "OnScreenDisplayMessages", &m_LocalCoreStartupParameter.bOnScreenDisplayMessages, true);
ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false);
ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false);
ini.Get("Interface", "Theme", &m_LocalCoreStartupParameter.iTheme, 0);
ini.Get("Interface", "MainWindowPosX", &m_LocalCoreStartupParameter.iPosX, 100);
ini.Get("Interface", "MainWindowPosY", &m_LocalCoreStartupParameter.iPosY, 100);
ini.Get("Interface", "MainWindowWidth", &m_LocalCoreStartupParameter.iWidth, 800);
Expand All @@ -314,6 +313,7 @@ void SConfig::LoadSettings()
ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false);
ini.Get("Interface", "ShowLogConfigWindow", &m_InterfaceLogConfigWindow, false);
ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false);
ini.Get("Interface", "ThemeName", &m_LocalCoreStartupParameter.theme_name, "Boomy");

// Hotkeys
for (int i = 0; i < NUM_HOTKEYS; i++)
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/Src/CoreParameter.cpp
Expand Up @@ -59,7 +59,6 @@ SCoreStartupParameter::SCoreStartupParameter()
bRenderWindowAutoSize(false), bKeepWindowOnTop(false),
bFullscreen(false), bRenderToMain(false),
bProgressive(false), bDisableScreenSaver(false),
iTheme(0),
iPosX(100), iPosY(100), iWidth(800), iHeight(600)
{
LoadDefaults();
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/CoreParameter.h
Expand Up @@ -125,6 +125,7 @@ struct SCoreStartupParameter

// Interface settings
bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers, bOnScreenDisplayMessages;
std::string theme_name;

// Hotkeys
int iHotkey[NUM_HOTKEYS];
Expand All @@ -138,7 +139,6 @@ struct SCoreStartupParameter
bool bFullscreen, bRenderToMain;
bool bProgressive, bDisableScreenSaver;

int iTheme;
int iPosX, iPosY, iWidth, iHeight;

enum EBootBS2
Expand Down
60 changes: 38 additions & 22 deletions Source/Core/DolphinWX/Src/ConfigMain.cpp
Expand Up @@ -17,10 +17,12 @@

#include <string> // System
#include <vector>
#include <algorithm>
#include <wx/spinbutt.h>

#include "Common.h"
#include "CommonPaths.h"
#include "FileSearch.h"

#include "Core.h" // Core
#include "HW/EXI.h"
Expand All @@ -40,6 +42,14 @@
#include "Main.h"
#include "VideoBackendBase.h"

#if defined(__APPLE__)
#include <tr1/functional>
using std::tr1::function;
#else
#include <functional>
using std::function;
#endif

#define TEXT_BOX(page, text) new wxStaticText(page, wxID_ANY, text, wxDefaultPosition, wxDefaultSize)

extern CFrame* main_frame;
Expand Down Expand Up @@ -126,7 +136,6 @@ EVT_SLIDER(ID_VOLUME, CConfigMain::AudioSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::DisplaySettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_USEPANICHANDLERS, CConfigMain::DisplaySettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_ONSCREENDISPLAYMESSAGES, CConfigMain::DisplaySettingsChanged)
EVT_CHOICE(ID_INTERFACE_THEME, CConfigMain::DisplaySettingsChanged)
EVT_CHOICE(ID_INTERFACE_LANG, CConfigMain::DisplaySettingsChanged)
EVT_BUTTON(ID_HOTKEY_CONFIG, CConfigMain::DisplaySettingsChanged)

Expand Down Expand Up @@ -253,14 +262,6 @@ void CConfigMain::InitializeGUILists()
arrayStringFor_DSPEngine.Add(_("DSP LLE recompiler"));
arrayStringFor_DSPEngine.Add(_("DSP LLE interpreter (slow)"));


// Display page
// Themes
arrayStringFor_Themes.Add(wxT("Boomy"));
arrayStringFor_Themes.Add(wxT("Vista"));
arrayStringFor_Themes.Add(wxT("X-Plastik"));
arrayStringFor_Themes.Add(wxT("KDE"));

// Gamecube page
// GC Language arrayStrings
arrayStringFor_GCSystemLang.Add(_("English"));
Expand Down Expand Up @@ -339,7 +340,6 @@ void CConfigMain::InitializeGUIValues()
ConfirmStop->SetValue(startup_params.bConfirmStop);
UsePanicHandlers->SetValue(startup_params.bUsePanicHandlers);
OnScreenDisplayMessages->SetValue(startup_params.bOnScreenDisplayMessages);
Theme->SetSelection(startup_params.iTheme);
// need redesign
for (unsigned int i = 0; i < sizeof(langIds) / sizeof(wxLanguage); i++)
{
Expand Down Expand Up @@ -500,9 +500,6 @@ void CConfigMain::InitializeGUITooltips()
UsePanicHandlers->SetToolTip(_("Show a message box when a potentially serious error has occured.\nDisabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin suddenly crashes without any explanation at all."));
OnScreenDisplayMessages->SetToolTip(_("Show messages on the emulation screen area.\nThese messages include memory card writes, video backend and CPU information, and JIT cache clearing."));

// Display - Themes: Copyright notice
Theme->SetToolTip(_("Boomy: Milosz Wlazlo [miloszwl@miloszwl.com]\nVista: VistaIcons.com\nX-Plastik: black_rider [ForumW.org]\nKDE: KDE-Look.org"));

InterfaceLang->SetToolTip(_("Change the language of the user interface.\nRequires restart."));

// Audio tooltips
Expand Down Expand Up @@ -584,9 +581,6 @@ void CConfigMain::CreateGUIControls()
// Hotkey configuration
HotkeyConfig = new wxButton(DisplayPage, ID_HOTKEY_CONFIG, _("Hotkeys"),
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, wxDefaultValidator);
// Themes
Theme = new wxChoice(DisplayPage, ID_INTERFACE_THEME, wxDefaultPosition,
wxDefaultSize, arrayStringFor_Themes, 0, wxDefaultValidator);
// Interface settings
ConfirmStop = new wxCheckBox(DisplayPage, ID_INTERFACE_CONFIRMSTOP, _("Confirm on Stop"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
Expand All @@ -600,10 +594,36 @@ void CConfigMain::CreateGUIControls()
sInterface->Add(InterfaceLang, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
sInterface->AddStretchSpacer();
sInterface->Add(HotkeyConfig, 0, wxALIGN_RIGHT | wxALL, 5);
wxBoxSizer* scInterface = new wxBoxSizer(wxHORIZONTAL);

// theme selection
auto const theme_selection = new wxChoice(DisplayPage, wxID_ANY);

CFileSearch cfs(CFileSearch::XStringVector(1, "*"), CFileSearch::XStringVector(1, File::GetUserPath(D_THEMES_IDX)));
auto const& sv = cfs.GetFileNames();
std::for_each(sv.begin(), sv.end(), [theme_selection](const std::string& filename)
{
std::string name, ext;
SplitPath(filename, NULL, &name, &ext);

name += ext;
theme_selection->Append(name);

if (SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name == name)
theme_selection->SetSelection(theme_selection->GetCount() - 1);
});

// std::function = avoid error on msvc
theme_selection->Bind(wxEVT_COMMAND_CHOICE_SELECTED, function<void(wxEvent&)>([this,theme_selection](wxEvent&)
{
SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name = theme_selection->GetStringSelection();
main_frame->InitBitmaps();
}));

auto const scInterface = new wxBoxSizer(wxHORIZONTAL);
scInterface->Add(TEXT_BOX(DisplayPage, _("Theme:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
scInterface->Add(Theme, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
scInterface->Add(theme_selection, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
scInterface->AddStretchSpacer();

sbInterface = new wxStaticBoxSizer(wxVERTICAL, DisplayPage, _("Interface Settings"));
sbInterface->Add(ConfirmStop, 0, wxALL, 5);
sbInterface->Add(UsePanicHandlers, 0, wxALL, 5);
Expand Down Expand Up @@ -895,10 +915,6 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event)
SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages = OnScreenDisplayMessages->IsChecked();
SetEnableAlert(OnScreenDisplayMessages->IsChecked());
break;
case ID_INTERFACE_THEME:
SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme = Theme->GetSelection();
main_frame->InitBitmaps();
break;
case ID_INTERFACE_LANG:
if (SConfig::GetInstance().m_InterfaceLanguage != langIds[InterfaceLang->GetSelection()])
SuccessAlertT("You must restart Dolphin in order for the change to take effect.");
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/DolphinWX/Src/ConfigMain.h
Expand Up @@ -87,7 +87,6 @@ class CConfigMain : public wxDialog
ID_INTERFACE_CONFIRMSTOP,
ID_INTERFACE_USEPANICHANDLERS,
ID_INTERFACE_ONSCREENDISPLAYMESSAGES,
ID_INTERFACE_THEME,
ID_INTERFACE_LANG,
ID_HOTKEY_CONFIG,

Expand Down Expand Up @@ -165,7 +164,6 @@ class CConfigMain : public wxDialog
wxCheckBox* ConfirmStop;
wxCheckBox* UsePanicHandlers;
wxCheckBox* OnScreenDisplayMessages;
wxChoice* Theme;
wxChoice* InterfaceLang;
wxButton* HotkeyConfig;

Expand Down Expand Up @@ -227,7 +225,6 @@ class CConfigMain : public wxDialog
wxArrayString arrayStringFor_CPUEngine;
wxArrayString arrayStringFor_DSPEngine;
wxArrayString arrayStringFor_FullscreenResolution;
wxArrayString arrayStringFor_Themes;
wxArrayString arrayStringFor_InterfaceLang;
wxArrayString arrayStringFor_GCSystemLang;
wxArrayString arrayStringFor_WiiSensBarPos;
Expand Down
11 changes: 3 additions & 8 deletions Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp
Expand Up @@ -52,10 +52,7 @@

extern "C" // Bitmaps
{
#include "../../resources/toolbar_play.c"
#include "../../resources/toolbar_pause.c"
#include "../../resources/toolbar_add_memorycheck.c"
#include "../../resources/toolbar_debugger_delete.c"
#include "../../resources/toolbar_add_breakpoint.c"
}

Expand Down Expand Up @@ -563,23 +560,21 @@ bool CCodeWindow::JITBlockLinking()
void CCodeWindow::InitBitmaps()
{
// load original size 48x48
m_Bitmaps[Toolbar_DebugGo] = wxGetBitmapFromMemory(toolbar_play_png);
m_Bitmaps[Toolbar_Step] = wxGetBitmapFromMemory(toolbar_add_breakpoint_png);
m_Bitmaps[Toolbar_StepOver] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_DebugPause] = wxGetBitmapFromMemory(toolbar_pause_png);

// scale to 24x24 for toolbar
for (size_t n = Toolbar_DebugGo; n < ToolbarDebugBitmapMax; n++)
for (size_t n = 0; n < ToolbarDebugBitmapMax; n++)
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(24, 24));
}

void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar)
{
int w = m_Bitmaps[Toolbar_DebugGo].GetWidth(),
h = m_Bitmaps[Toolbar_DebugGo].GetHeight();
int w = m_Bitmaps[0].GetWidth(),
h = m_Bitmaps[0].GetHeight();

toolBar->SetToolBitmapSize(wxSize(w, h));
toolBar->AddTool(IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step]);
Expand Down
9 changes: 0 additions & 9 deletions Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
Expand Up @@ -54,15 +54,6 @@

#include "ConfigManager.h"

extern "C" // Bitmaps
{
#include "../../resources/toolbar_play.c"
#include "../../resources/toolbar_pause.c"
#include "../../resources/toolbar_add_memorycheck.c"
#include "../../resources/toolbar_debugger_delete.c"
#include "../../resources/toolbar_add_breakpoint.c"
}

// Save and load settings
// -----------------------------
void CCodeWindow::Load()
Expand Down
16 changes: 0 additions & 16 deletions Source/Core/DolphinWX/Src/Frame.cpp
Expand Up @@ -52,22 +52,6 @@

extern "C" {
#include "../resources/Dolphin.c" // Dolphin icon
#include "../resources/toolbar_browse.c"
#include "../resources/toolbar_file_open.c"
#include "../resources/toolbar_fullscreen.c"
#include "../resources/toolbar_help.c"
#include "../resources/toolbar_pause.c"
#include "../resources/toolbar_play.c"
#include "../resources/toolbar_plugin_dsp.c"
#include "../resources/toolbar_plugin_gfx.c"
#include "../resources/toolbar_plugin_options.c"
#include "../resources/toolbar_plugin_pad.c"
#include "../resources/toolbar_refresh.c"
#include "../resources/toolbar_stop.c"
#include "../resources/Boomy.h" // Theme packages
#include "../resources/Vista.h"
#include "../resources/X-Plastik.h"
#include "../resources/KDE.h"
};


Expand Down
9 changes: 0 additions & 9 deletions Source/Core/DolphinWX/Src/Frame.h
Expand Up @@ -210,15 +210,6 @@ class CFrame : public CRenderFrame
EToolbar_Max
};

enum EBitmapsThemes
{
BOOMY,
VISTA,
XPLASTIK,
KDE,
THEMES_MAX
};

wxBitmap m_Bitmaps[EToolbar_Max];
wxBitmap m_BitmapsMenu[EToolbar_Max];

Expand Down

0 comments on commit 3cb4300

Please sign in to comment.