Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Plugin Settings Icons

<< < (5/6) > >>

MortenMacFly:

--- Quote from: mandrav on July 08, 2007, 10:11:28 am ---
--- Quote ---That works on windows and was not tested on other OSs.
--- End quote ---
Done, thanks Dje.

--- End quote ---
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.

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


--- End quote ---

Done : Bug #11585

Dje

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


--- Code: ---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"

--- End code ---

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

dje:
Hi Biplab !

It seems the correction does not work...

manifest.xml:

--- Code: ---<?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>

--- End code ---

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
--- End quote ---

Try this one and post your feedback. :)

Best Regards,

Biplab

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version