mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-25 15:54:00 +00:00
Fixes Atlas error when using the map open/save dialog on Linux, based on patch by njm, fixes #2858
This was SVN commit r15885.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2013 Wildfire Games.
|
||||
/* Copyright (C) 2014 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -35,12 +35,12 @@ enum {
|
||||
static const wxString scenarioPath(L"maps/scenarios/");
|
||||
static const wxString skirmishPath(L"maps/skirmishes/");
|
||||
|
||||
MapDialog::MapDialog(wxWindow* parent, MapDialogType type)
|
||||
MapDialog::MapDialog(wxWindow* parent, MapDialogType type, const wxIcon& icon)
|
||||
: wxDialog(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(600,400), wxCAPTION|wxRESIZE_BORDER|wxCLOSE_BOX|wxSYSTEM_MENU), m_Type(type)
|
||||
{
|
||||
Freeze();
|
||||
|
||||
SetIcon(wxIcon(_T("ICON_ScenarioEditor"))); // load from atlas.rc
|
||||
SetIcon(icon);
|
||||
|
||||
if (m_Type == MAPDIALOG_OPEN)
|
||||
SetTitle(_("Choose map to open"));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2013 Wildfire Games.
|
||||
/* Copyright (C) 2014 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -31,7 +31,7 @@ enum MapDialogType { MAPDIALOG_OPEN, MAPDIALOG_SAVE };
|
||||
class MapDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
MapDialog(wxWindow* parent, MapDialogType type);
|
||||
MapDialog(wxWindow* parent, MapDialogType type, const wxIcon& icon);
|
||||
|
||||
/**
|
||||
* Returns VFS path of selected map with .xml extension, else empty string
|
||||
|
||||
@@ -380,15 +380,16 @@ ScenarioEditor::ScenarioEditor(wxWindow* parent)
|
||||
SetOpenFilename(_T(""));
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
SetIcon(wxIcon(_T("ICON_ScenarioEditor"))); // load from atlas.rc
|
||||
m_Icon = wxIcon(_T("ICON_ScenarioEditor")); // load from atlas.rc
|
||||
#else
|
||||
{
|
||||
const wxString relativePath (_T("tools/atlas/icons/ScenarioEditor.ico"));
|
||||
wxFileName filename (relativePath, wxPATH_UNIX);
|
||||
filename.MakeAbsolute(Datafile::GetDataDirectory());
|
||||
SetIcon(wxIcon(filename.GetFullPath(), wxBITMAP_TYPE_ICO));
|
||||
m_Icon = wxIcon(filename.GetFullPath(), wxBITMAP_TYPE_ICO);
|
||||
}
|
||||
#endif
|
||||
SetIcon(m_Icon);
|
||||
|
||||
wxToolTip::Enable(true);
|
||||
|
||||
@@ -663,7 +664,7 @@ bool ScenarioEditor::OpenFile(const wxString& name, const wxString& filename)
|
||||
|
||||
void ScenarioEditor::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
MapDialog dlg (NULL, MAPDIALOG_OPEN);
|
||||
MapDialog dlg (NULL, MAPDIALOG_OPEN, m_Icon);
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxString filename = dlg.GetFilename();
|
||||
@@ -740,7 +741,7 @@ void ScenarioEditor::OnSave(wxCommandEvent& event)
|
||||
|
||||
void ScenarioEditor::OnSaveAs(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
MapDialog dlg(NULL, MAPDIALOG_SAVE);
|
||||
MapDialog dlg(NULL, MAPDIALOG_SAVE, m_Icon);
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxString filename(dlg.GetFilename());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2011 Wildfire Games.
|
||||
/* Copyright (C) 2014 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -86,6 +86,8 @@ private:
|
||||
wxString m_OpenFilename;
|
||||
FileHistory m_FileHistory;
|
||||
|
||||
wxIcon m_Icon;
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user