Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icons of the cc list are not installed #14

Open
bluehazzard opened this issue Jul 23, 2017 · 1 comment
Open

icons of the cc list are not installed #14

bluehazzard opened this issue Jul 23, 2017 · 1 comment

Comments

@bluehazzard
Copy link

Hi, the icons of the cc list are not installed during the compiling/ installing process of the plugin.
The icons from ClangLib/images/clanglib have to be copied to $(#cb)/src/devel/share/CodeBlocks/images/clanglib
As far as i can remember the current installation process of plugins does not allow this kind of copy...
The current way how codeblocks fixes this is with the update script. This script copies the images.
I think the best way to handle this would be to distribute the images in the zip file and load them from there

greetings

@bluehazzard
Copy link
Author

Here is some code snippet to load the icons from the resource zip file:

wxBitmap LoadImageFromResourceFile(wxString name)
{
	wxFileSystem filesystem;
	wxString filename =  wxT("file:") + ConfigManager::GetDataFolder() + wxT("/clanglib.zip#zip:/") + name;
	wxFSFile *file = filesystem.OpenFile( filename);
	if(file == nullptr)
        throw bad_file_execp(_("File not found:") + filename);
	wxImage img;
	img.LoadFile(*file->GetStream(), wxBITMAP_TYPE_ANY
              );
	wxBitmap ret(img);
	if(!ret.IsOk())
        throw bad_file_execp(_("File not loaded correctly:") + filename);

	return ret;
}

yvesdm3000 added a commit that referenced this issue Feb 19, 2018
Load images from the resource archive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant