Author Topic: ShellExtensions deprecated, forked into FileManager and PowerShell plugins  (Read 16633 times)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
As part of a push to get the file manager and custom command functionality of my ShellExtensions plugin into the official Code::Block's contrib plugin repository, I've decided to split the plugin into two: FileManager, which as the name suggests has the file manager; and PowerShell, which handles customizable commands that will be offered to the user every time they right click on a file (whether it be in the editor, project manager or file manager) and the dockable console output window.

the new plugins are available in the branches folder of my repo:

PowerShell

Code: [Select]
svn checkout http://svn.berlios.de/svnroot/repos/cbilplugin/branches/PowerShell
FileManager

Code: [Select]
svn checkout http://svn.berlios.de/svnroot/repos/cbilplugin/branches/FileManager
note that both sets of source are supposed to be installed into plugins/contrib of your C::B source. I will make win32 binary builds of both plugins available shortly.

I will be committing new features to those plugins to those repositories. I am unlikely to continue to support the old ShellExtensions plugin (it will remain available in the cbilplugin repository).

The latest new feature is drag and drop support for editor tabs: drag a file tab to a directory in the file manager and you will be given a save as feature (be aware that C::B will update any projects associated with the file)

For linux users: if you want to build these plugins alongside the codeblocks source with makefiles, you will need to patch your codeblocks sources with the attached file (courtesy of jens)

[attachment deleted by admin]
« Last Edit: March 02, 2009, 05:26:43 pm by dmoore »

Offline mmkider

  • Almost regular
  • **
  • Posts: 150
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #1 on: February 07, 2009, 12:44:17 pm »
FileManager is good.
Thank you.
 :D

Offline Cryogen

  • Regular
  • ***
  • Posts: 260

 Hi,

I think that changes in the IDE src may have broken these plug-ins over the last year. Neither will compile out of the box. I found the following:

-Instances of the path "..\..\..\include\wxscintilla\include" in both projects' build options need to be changed to "..\..\..\sdk\wxscintilla\include".
-In File Manager, "#include <iostream>" needs to be added to the includes at the top of FileExplorerUpdater.cpp, for me. You may have it declared somewhere else but, for me, line 17

Code: [Select]
    std::cout<<"destructor file explorer updater"<<std::endl;

fails due to the lack of it.

Once compiled, I found that File Manager seemed to work OK, except that the SVN decorators only ever show a green flash, which looks like it means that the file is up-to-date, and that's often wrong. I presume that PowerShell is needed to provide the functionality. PowerShell itself runs and gives me the Extensions menu. Using that opens a new window entitled "Shells" but I can't make it do anything. It remains grey and there is no context menu and no indication of what it's meant to do. I can't find any docs anywhere, either.

Can you advise what's supposed to be happening and I'll have a play around with it some more?

Thanks.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
I think that changes in the IDE src may have broken these plug-ins over the last year. Neither will compile out of the box. I found the following:

It worked for me until recently, but thanks for the tips.

Quote
Once compiled, I found that File Manager seemed to work OK, except that the SVN decorators only ever show a green flash, which looks like it means that the file is up-to-date, and that's often wrong. I presume that PowerShell is needed to provide the functionality.

no the feature is provided within the FileManager by munging the output of the "svn stat" command.

Quote
PowerShell itself runs and gives me the Extensions menu. Using that opens a new window entitled "Shells" but I can't make it do anything. It remains grey and there is no context menu and no indication of what it's meant to do. I can't find any docs anywhere, either.

I think Mario provided some basic documentation in the official C::B manual. The basic concept is that it offers a more flexible version of the tools menu that can be run on the active editor, or on files in the project manager or file manager with the option to redirect output to notepages in the dockable window. To setup powershell, open the clunky panel in settings->environment. It's not particularly clear, but the tooltips will give you an idea.

I'm sorry to say that I have been neglecting these plugins for a while now because I'm too busy at work (or in my spare time, with other projects). I'll try to devote some more time soon. There is a plan to eventually get these plugins into the codeblocks repo, which will make it easier to keep them up to date.


Offline Cryogen

  • Regular
  • ***
  • Posts: 260
I think that changes in the IDE src may have broken these plug-ins over the last year. Neither will compile out of the box. I found the following:

It worked for me until recently, but thanks for the tips.

Happy to help. :-)
I think they must have moved wxscintilla from "include" to "sdk" some time recently. I guess that will break a few things until everyone catches up.

I think Mario provided some basic documentation in the official C::B manual. The basic concept is that it offers a more flexible version of the tools menu that can be run on the active editor, or on files in the project manager or file manager with the option to redirect output to notepages in the dockable window. To setup powershell, open the clunky panel in settings->environment. It's not particularly clear, but the tooltips will give you an idea.

I did eventually find the help and make progress, thanks. It's working now.

I'm sorry to say that I have been neglecting these plugins for a while now because I'm too busy at work (or in my spare time, with other projects). I'll try to devote some more time soon. There is a plan to eventually get these plugins into the codeblocks repo, which will make it easier to keep them up to date.

That's life, alright. ;-)
I hope you do get them there.

Cheers.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
I just did a small update of the plugins to fix the build problems (for win32). I've also re-enabled the styling of filename links and error output in the powershell plugin. see attached png

Once compiled, I found that File Manager seemed to work OK, except that the SVN decorators only ever show a green flash

I'm unable to reproduce the problem with svn decorators. Is svn in your path?

[attachment deleted by admin]
« Last Edit: April 23, 2010, 07:56:14 pm by dmoore »

Offline Cryogen

  • Regular
  • ***
  • Posts: 260

 Hi,

I'm unable to reproduce the problem with svn decorators. Is svn in your path?

Sorry, I didn't see this earlier. I can't remember if it was then and I haven't looked at it recently. Busy with other things, at present. ;-)

Thanks.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6665
    • My Best Post
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #7 on: February 02, 2011, 04:38:46 pm »
This is a wxWidgets 2.8 without using 2.6 Compatible mode Patch to PowerShell Plugin
Code: [Select]
Index: PowerShell.cpp
===================================================================
--- PowerShell.cpp (revision 347)
+++ PowerShell.cpp (working copy)
@@ -200,7 +200,7 @@
 #else
         wild=_T("*");
 #endif
-    wxFileDialog *fd=new wxFileDialog(NULL,_T("Choose the Command Target"),_T(""),_T(""),wild,wxOPEN|wxFILE_MUST_EXIST);
+    wxFileDialog *fd=new wxFileDialog(NULL,_T("Choose the Command Target"),_T(""),_T(""),wild,wxFD_OPEN|wxFD_FILE_MUST_EXIST);
     if(fd->ShowModal()==wxID_OK)
     {
         m_RunTarget=fd->GetPath();
@@ -218,7 +218,7 @@
 #else
         wild=_T("*");
 #endif
-    wxFileDialog *fd=new wxFileDialog(NULL,_T("Choose the Command Targets"),_T(""),_T(""),wild,wxOPEN|wxFILE_MUST_EXIST|wxMULTIPLE);
+    wxFileDialog *fd=new wxFileDialog(NULL,_T("Choose the Command Targets"),_T(""),_T(""),wild,wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_MULTIPLE);
     if(fd->ShowModal()==wxID_OK)
     {
         wxArrayString paths;
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6665
    • My Best Post
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #8 on: February 02, 2011, 04:46:09 pm »
Patch needed to compile PowerShell plugin without using Pre-Compiled Headers(PCH) under Windows.

Tim S.

Code: [Select]
Index: se_globals.h
===================================================================
--- se_globals.h (revision 347)
+++ se_globals.h (working copy)
@@ -10,7 +10,18 @@
 #endif
 
 #include <sdk.h>
+#ifndef CB_PRECOMP
+    #include <wx/filename.h>
 
+    #include <logmanager.h>
+    #include <manager.h>
+    #include <editorbase.h>
+    #include <editormanager.h>
+    #include <macrosmanager.h>
+    #include <configmanager.h>
+    #include <cbproject.h>
+#endif
+
 wxString GetParentDir(const wxString &path);
 
 bool DirIsChildOf(const wxString &path, const wxString &child);
Index: shellproperties.cpp
===================================================================
--- shellproperties.cpp (revision 347)
+++ shellproperties.cpp (working copy)
@@ -1,5 +1,7 @@
 #include "shellproperties.h"
 
+#include <configmanager.h>
+
 #include <wx/arrimpl.cpp> // this is a magic incantation which must be done!
 //WX_DEFINE_OBJARRAY(ShellCommandMenuVec);
 WX_DEFINE_OBJARRAY(ShellCommandVec);
Index: PipedProcessCtrl.cpp
===================================================================
--- PipedProcessCtrl.cpp (revision 347)
+++ PipedProcessCtrl.cpp (working copy)
@@ -3,6 +3,7 @@
 #include <wx/regex.h>
 #include "PipedProcessCtrl.h"
 #include <globals.h>
+#include <cbeditor.h>
 
 ////////////////////////////////////// PipedProcessCtrl /////////////////////////////////////////////
 #define PP_ERROR_STYLE 1
Index: PipedProcessCtrl.h
===================================================================
--- PipedProcessCtrl.h (revision 347)
+++ PipedProcessCtrl.h (working copy)
@@ -15,6 +15,9 @@
 #endif
 
 #include <sdk.h>
+#ifndef CB_PRECOMP
+    #include <wx/wxscintilla.h>
+#endif
 #include "ShellCtrlBase.h"
 
 class PipedProcessCtrl;
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6665
    • My Best Post
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #9 on: February 02, 2011, 04:48:27 pm »
Patch needed to compile FileManager plugin without using Pre-Compiled Headers(PCH) under Windows.

Tim S.

Code: [Select]
Index: FileExplorer.cpp
===================================================================
--- FileExplorer.cpp (revision 347)
+++ FileExplorer.cpp (working copy)
@@ -11,7 +11,15 @@
 
 
 #include <sdk.h>
+#ifndef CB_PRECOMP
+    #include <wx/dnd.h>
 
+    #include <cbproject.h>
+    #include <configmanager.h>
+    #include <projectmanager.h>
+#endif
+
+#include <list>
 #include <vector>
 #include <iostream>
 
Index: FileManager.cpp
===================================================================
--- FileManager.cpp (revision 347)
+++ FileManager.cpp (working copy)
@@ -4,6 +4,11 @@
     #include <wx/wxFlatNotebook/wxFlatNotebook.h>
 #endif
 #include <sdk.h> // Code::Blocks SDK
+#ifndef CB_PRECOMP
+    #include <cbauibook.h>
+    #include <cbproject.h>
+    #include <projectmanager.h>
+#endif
 //#include <configurationpanel.h>
 
 #include "FileManager.h"
Index: se_globals.h
===================================================================
--- se_globals.h (revision 347)
+++ se_globals.h (working copy)
@@ -8,7 +8,17 @@
 #endif
 
 #include <sdk.h>
+#ifndef CB_PRECOMP
+    #include <wx/dir.h>
+    #include <wx/filename.h>
+    #include <wx/txtstrm.h>
 
+    #include <editorbase.h>
+    #include <editormanager.h>
+    #include <logmanager.h>
+    #include <manager.h>
+#endif
+
 wxString GetParentDir(const wxString &path);
 
 bool DirIsChildOf(const wxString &path, const wxString &child);
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline pebri86

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #10 on: February 03, 2011, 07:53:38 am »
i compiled PowerShell Plugin and work perfectly with current svn version

but SDK missmatch appeared for FileManager plugins,,,

i need advice from anyone knows the problem..

thank you
sorry for my bad english.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #11 on: February 06, 2011, 07:43:16 am »
but SDK missmatch appeared for FileManager plugins,,,

Are you building on linux or windows? If linux, try again on latest svn.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #12 on: February 06, 2011, 07:44:37 am »
Patch needed to compile ...

Thanks Tim. I've taken all of your patches, but please test to make sure I got it all correctly.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #13 on: February 06, 2011, 07:48:49 am »
***UPDATE***

I decided to rename PowerShell plugin ToolsPlus (because it offers the functionality of the "Tools"  menu "Plus" a bit more). I've also tweaked the user interface to make it mimic behavior of the Tools menu a little more (with the option to replace the standard "Tools" menu with the "Tools Plus" menu).

ToolsPlus

Code: [Select]
svn checkout http://svn.berlios.de/svnroot/repos/cbilplugin/branches/ToolsPlus
FileManager

Code: [Select]
svn checkout http://svn.berlios.de/svnroot/repos/cbilplugin/branches/FileManager
note that both sets of source are supposed to be installed into plugins/contrib of your C::B source.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6665
    • My Best Post
Re: ShellExtensions deprecated, forked into FileManager and PowerShell plugins
« Reply #14 on: February 06, 2011, 03:10:16 pm »
Patch to ToolsPlus Plugin for wxWidgets without 2.6 compatible mode

Code: [Select]
Index: ToolsPlus.cpp
===================================================================
--- ToolsPlus.cpp (revision 355)
+++ ToolsPlus.cpp (working copy)
@@ -230,7 +230,7 @@
 #else
         wild=_T("*");
 #endif
-    wxFileDialog *fd=new wxFileDialog(NULL,_T("Choose the Command Targets"),_T(""),_T(""),wild,wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxMULTIPLE);
+    wxFileDialog *fd=new wxFileDialog(NULL,_T("Choose the Command Targets"),_T(""),_T(""),wild,wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_MULTIPLE);
     if(fd->ShowModal()==wxID_OK)
     {
         wxArrayString paths;

Note: To build with trunk I also had to patch this; not sure when this change was needed or if you should do it.

Code: [Select]
Index: ToolsPlus.cbp
===================================================================
--- ToolsPlus.cbp (revision 355)
+++ ToolsPlus.cbp (working copy)
@@ -37,7 +37,7 @@
  <Linker>
  <Add library="codeblocks" />
  <Add library="wxmsw28$(WX_SUFFIX)" />
- <Add library="wxscintilla" />
+ <Add library="wxscintilla_cb" />
  <Add directory="..\..\..\devel" />
  <Add directory="$(#wx.lib)\gcc_dll$(WX_CFG)" />
  </Linker>

Neither plugins needed NON-PCH patches under windows.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org