Author Topic: Plugin Settings Icons  (Read 20372 times)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Plugin Settings Icons
« Reply #15 on: July 06, 2007, 01:38:49 am »
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?

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Plugin Settings Icons
« Reply #16 on: July 07, 2007, 12:38:34 am »
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:
Code
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


Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Plugin Settings Icons
« Reply #17 on: July 07, 2007, 10:43:57 pm »
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(...)
Code
    CreateDirRecursively(wxFileName(dst_filename).GetPath(wxPATH_GET_SEPARATOR));
by
Code
    CreateDirRecursively(wxFileName(dst_filename).GetPath(wxPATH_GET_SEPARATOR|wxPATH_GET_VOLUME));

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

Dje

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Plugin Settings Icons
« Reply #18 on: July 08, 2007, 10:11:28 am »
Quote
That works on windows and was not tested on other OSs.

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

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Plugin Settings Icons
« Reply #19 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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Plugin Settings Icons
« Reply #20 on: July 19, 2007, 01:10:06 pm »
Quote
That 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Plugin Settings Icons
« Reply #21 on: July 19, 2007, 11:37:59 pm »
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

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Plugin Settings Icons
« Reply #22 on: July 30, 2007, 05:49:58 pm »
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"

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.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Plugin Settings Icons
« Reply #23 on: August 13, 2007, 10:32:54 pm »
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>

zip content, see picture

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

Sorry for late feedback...

Dje


[attachment deleted by admin]

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Plugin Settings Icons
« Reply #24 on: August 27, 2007, 07:04:13 am »
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.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Plugin Settings Icons
« Reply #25 on: August 29, 2007, 01:09:12 am »
Hi all !

@Biplab
OK for me, it works  :D !

Dje