News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Plugin Settings Icons

Started by Pecan, July 02, 2007, 01:45:39 PM

Previous topic - Next topic

dmoore

i haven't checked the sdk code, but perhaps you need to match the directory structure inside your zip file (e.g. put your images in image/ThreadSearch in the .cbplugin zip). otherwise, bug in the sdk?
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

dje

Hi all !

So, there were 2 errors.

The first:
my cbplugin did not contain path info, in my case images\ThreadSearch\

The second:
there is a bug.
Sorry for not submitting a patch but I'm not at home and pc A is my dev pc and pc B has internet...

in PluginManager::ExtractFile, the expression:
wxFileName(dst_filename).GetPath(wxPATH_GET_SEPARATOR)
returns on my PC \Dev\codeblocks\src\devel\share\codeblocks\images\ThreadSearch\
The problem is that the volume is missing in the string.

CreateDirRecursively fails at line 399 in globals.cpp because currdir value is :\Dev due to missing volume.

I hope it helps and it is clear enough to be useful.
I'll submit a bug and a patch when I'm back at home if problem is not solved.

My conf:
WinXP SP2, dev SVN 0 on my built C::B ??
It is recent (less than one week).

Dje


dje

Hi !

Problem :
during plugin install, directories are not created on windows.

Solution:
Still not at home so I give the line instead of the patch:
Replace line 629 in pluginmanager.cpp in bool PluginManager::ExtractFile(...)
    CreateDirRecursively(wxFileName(dst_filename).GetPath(wxPATH_GET_SEPARATOR));
by
    CreateDirRecursively(wxFileName(dst_filename).GetPath(wxPATH_GET_SEPARATOR|wxPATH_GET_VOLUME));

That works on windows and was not tested on other OSs.

Dje

mandrav

QuoteThat works on windows and was not tested on other OSs.

Done, thanks Dje.
Be patient!
This bug will be fixed soon...

dje

Hi all !

I found a bug related to this topic.
It concerns extra icons relative path during plugin export.

In my SVN environment, my plugin extra icons are located in :
C:\Dev\codeblocks\src\devel\share\codeblocks\images\ThreadSearch

I export ThreadSearch plugin in
C:\Dev\codeblocks\src\plugins\contrib\ThreadSearchBin\Win

The .cbplugin contains all files, but if I unzip it, extra icons are extracted in
D:\tmp\ThreadSearch-0.8\Dev\codeblocks\src\devel\share\codeblocks\images\ThreadSearch
instead of
D:\tmp\ThreadSearch-0.8\images\ThreadSearch

I'll put it on BerliOS this evening.

Dje

MortenMacFly

Quote from: mandrav on July 08, 2007, 10:11:28 AM
QuoteThat works on windows and was not tested on other OSs.
Done, thanks Dje.
Please notice: This kind of issue we had several times recently. A quick search revealed even more candidates for this kind of bug (e.g. codecompletion.cpp). We should really carefully use the GetPath() method.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

dje

Quote from: dje on July 19, 2007, 10:31:43 AM
Hi all !

I found a bug related to this topic.
It concerns extra icons relative path during plugin export.

In my SVN environment, my plugin extra icons are located in :
C:\Dev\codeblocks\src\devel\share\codeblocks\images\ThreadSearch

I export ThreadSearch plugin in
C:\Dev\codeblocks\src\plugins\contrib\ThreadSearchBin\Win

The .cbplugin contains all files, but if I unzip it, extra icons are extracted in
D:\tmp\ThreadSearch-0.8\Dev\codeblocks\src\devel\share\codeblocks\images\ThreadSearch
instead of
D:\tmp\ThreadSearch-0.8\images\ThreadSearch

I'll put it on BerliOS this evening.

Dje


Done : Bug #11585

Dje

Biplab

OK. I have a fix. This should solve the issue. :)

Index: src/sdk/pluginmanager.cpp
===================================================================
--- src/sdk/pluginmanager.cpp (revision 4337)
+++ src/sdk/pluginmanager.cpp (working copy)
@@ -335,8 +335,9 @@
ReadExtraFilesFromManifestFile(localName, extraFiles);
for (size_t i = 0; i < extraFiles.GetCount(); ++i)
{
+ wxFileName extraFileName(extraFiles[i]);
ExtractFile(actualName,
- extraFiles[i],
+ extraFileName.GetFullName(),
resourceDir + _T("/") + extraFiles[i],
false);
}
@@ -592,13 +593,9 @@

         wxFileInputStream in(extrafiles[i]);

-        wxString f = extrafiles[i];
-        if (f.StartsWith(ConfigManager::GetFolder(sdDataUser)))
- f.Remove(0, ConfigManager::GetFolder(sdDataUser).Length());
-        else if (f.StartsWith(ConfigManager::GetFolder(sdDataGlobal)))
- f.Remove(0, ConfigManager::GetFolder(sdDataGlobal).Length());
+        wxFileName extraFileName(extrafiles[i]);

-        zip.PutNextEntry(f);
+        zip.PutNextEntry(extraFileName.GetFullName());
         zip << in;
     }
     zip.SetComment(_T("This is a redistributable plugin for the Code::Blocks IDE.\n"


You have to keep all the icon files (extra) in the root of zip file just as you do with the setting icons. But in the manifest.xml file, you should provide the relative output dir.

I'm not sure if this method is correct or not and I've to get it confirmed from Yiannis before I put it in repo. :)

Best Regards,

Biplab
Be a part of the solution, not a part of the problem.

dje

Hi Biplab !

It seems the correction does not work...

manifest.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_plugin_manifest_file>
    <SdkVersion major="1" minor="11"  release="10" />
    <Plugin name="ThreadSearch">
        <Value title="ThreadSearch" />
        <Value version="0.8beta" />
        <Value description="Multi-threaded 'Search in files' with preview window." />
        <Value author="Jerome ANTOINE" />
        <Value authorEmail="" />
        <Value authorWebsite="" />
        <Value thanksTo="wxWidgets team
Code::Blocks team
wxGlade team" />
        <Value license="GPL" />
    </Plugin>
    <Extra file="images/ThreadSearch/findf.png" />
    <Extra file="images/ThreadSearch/findfdisabled.png" />
    <Extra file="images/ThreadSearch/options.png" />
    <Extra file="images/ThreadSearch/optionsdisabled.png" />
    <Extra file="images/ThreadSearch/stop.png" />
    <Extra file="images/ThreadSearch/stopdisabled.png" />
</CodeBlocks_plugin_manifest_file>


zip content, see picture

After plugin install, the directory is created but is empty.

Sorry for late feedback...

Dje


[attachment deleted by admin]

Biplab

Hi dje,

Sorry for not updating this thread. Actually after a discussion with Yiannis, I committed a different patch. The only difference is that the extra files Source and Destination path will be used from the manifest file.

E.g., if a file is specified as <Extra file="images/ThreadSearch/findf.png" />
1) While installing this file from Zip file, C::B will search at images/ThreadSearch/findf.png folder inside zip file.
2) While exporting as a Zip C::B will again read the path from manifest file.

So your folder structure in zip file should look like-

Quote|- plugin.dll
|- plugin.manifest
|- images
    |- ThreadSearch
         |- findf.png

Try this one and post your feedback. :)

Best Regards,

Biplab
Be a part of the solution, not a part of the problem.

dje

Hi all !

@Biplab
OK for me, it works  :D !

Dje