Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2858 closed defect (fixed)

[PATCH] Error: Failed to load image from file "ICON_ScenarioEditor"

Reported by: StanW Owned by: njm
Priority: Must Have Milestone: Alpha 18
Component: Atlas editor Keywords: ICON_ScenarioEditor patch
Cc: Patch:

Description

When I try to open/save as any file in the Scenario Editor, I get the following message (with timestamp):

12:37:57: can't open file 'ICON_ScenarioEditor' (error 2: No such file or directory) 12:37:57: Failed to load image from file "ICON_ScenarioEditor".

I am running fresh install of Linux Mint 17 on a Dell D820 This error was also in versions 15, 16, and 16 build Oct 2, 2014 (15829 development). The error was also before the fresh install.

I verified the file path for "tools/atlas/icons/ScenarioEditor.ico"

0AD run fine, only the Scenario Editor throwing errors.

Thanks, Stan

Attachments (2)

ScenarioEditor.png (199.2 KB ) - added by StanW 10 years ago.
ScenarioEditorDialogsIcon.patch (3.6 KB ) - added by njm 10 years ago.
njm's first patch for the error that says that ICON_ScenarioEditor could not be loaded.

Download all attachments as: .zip

Change History (18)

by StanW, 10 years ago

Attachment: ScenarioEditor.png added

comment:1 by agentx, 10 years ago

I had that too on Ubuntu Gnome A16/A17SVN, but it's gone since recompilation with wxWidgets 2.8. related: http://trac.wildfiregames.com/ticket/2805

There seems to be a race condition, because if the open/save dialog appears in front of the crash dialog the editor remains usable.

Last edited 10 years ago by agentx (previous) (diff)

comment:2 by StanW, 10 years ago

I ran wx-config --version and I got:

The program 'wx-config' can be found in the following packages:

  • libwxbase2.8-dbg
  • libwxbase2.8-dev
  • libwxbase3.0-dev
  • libwxgtk2.8-dbg
  • libwxgtk2.8-dev
  • libwxgtk3.0-dev

For kicks, I Installed: libwxbase2.8-dev, libwxgtk2.8-dev, wx2.8-headers, and reinstalled 0AD but it did not fix the issue

I also forgot to mention that the editor crashes/locks up with the error and then I have to kill it manually.

Thanks, Stan

Last edited 10 years ago by StanW (previous) (diff)

comment:3 by agentx, 10 years ago

IIRC, I had to clean the workspaces ...

comment:4 by StanW, 10 years ago

Please explain, "clean the workspaces..." I'm not sure I understand. Thanks, Stan

comment:5 by njm, 10 years ago

This error appears in the dialog but not in the ScenarioEditor, because there is a platform dependent handling for this icon in the main frame, but not in the MapDialog. ScenarioEditor.cpp:

#if defined(__WXMSW__)
	SetIcon(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));
	}
#endif

Some questions:

  1. Is it really necessary to load the icon in the MapDialog or is it inherited from the main frame?
  2. Is this platform dependent handling necessary or can this be solved by compiling with different versions of wxWidgets?

by njm, 10 years ago

njm's first patch for the error that says that ICON_ScenarioEditor could not be loaded.

comment:6 by njm, 10 years ago

Keywords: review patch added
Milestone: BacklogAlpha 17
Owner: set to njm
Summary: Error: Failed to load image from file "ICON_ScenarioEditor"[PATCH] Error: Failed to load image from file "ICON_ScenarioEditor"

comment:7 by njm, 10 years ago

I compiled under Kubuntu 14.04 with wxWidgets 3.0.2 that got released on 2014-10-06. This is my very first patch. :-)

comment:8 by njm, 10 years ago

Milestone: Alpha 17Alpha 18

comment:9 by agentx, 10 years ago

Great, does the colorpicker work too?

in reply to:  9 comment:10 by njm, 10 years ago

Replying to agentx:

Great, does the colorpicker work too?

The icon of the colorpicker is not yet shown. If wished for, I'll also do it at this ticket here.

in reply to:  5 ; comment:11 by historic_bruno, 10 years ago

Replying to njm:

This error appears in the dialog but not in the ScenarioEditor, because there is a platform dependent handling for this icon in the main frame, but not in the MapDialog.

That was a mistake on my part, I don't even remember encountering that code, so perhaps I wanted something to work quickly and forget to change it after testing. It certainly wasn't intentional.

in reply to:  8 ; comment:12 by StanW, 10 years ago

Replying to njm: Does this mean that if I want the fix that I need to compile now or wait until Alpha 18?

in reply to:  12 comment:13 by njm, 10 years ago

Replying to Stan:

Replying to njm: Does this mean that if I want the fix that I need to compile now or wait until Alpha 18?

Yes. You can apply my patch with svn and compile the game.

in reply to:  11 comment:14 by njm, 10 years ago

Replying to historic_bruno:

Replying to njm:

This error appears in the dialog but not in the ScenarioEditor, because there is a platform dependent handling for this icon in the main frame, but not in the MapDialog.

That was a mistake on my part, I don't even remember encountering that code, so perhaps I wanted something to work quickly and forget to change it after testing. It certainly wasn't intentional.

Is atlas mostly your work? Thanks for that! :-)

comment:15 by ben, 10 years ago

Resolution: fixed
Status: newclosed

In 15885:

Fixes Atlas error when using the map open/save dialog on Linux, based on patch by njm, fixes #2858

comment:16 by historic_bruno, 10 years ago

Keywords: review removed

Thanks for the patch. I didn't like having to call SetIcon on each instance of the dialog, so I made it a required constructor parameter instead.

At least on Windows, only the standard file open/save dialogs use the app icon, so I wouldn't worry about the other dialogs in Atlas.

Note: See TracTickets for help on using tickets.