Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
SVNInside : development of another SVN plugin for CodeBlocks
stahta01:
A patch that might help others to compile
--- Code: ---Index: post_build_step.bat
===================================================================
--- post_build_step.bat (revision 5)
+++ post_build_step.bat (working copy)
@@ -1,10 +1,7 @@
-f:
-cd\
-cd "dev\CBPlugins\SVNInside_svn\trunk"
zip -j9 -r SVNInside.zip resources\manifest.xml resources\*.xrc
cd resources
zip -0 -q ../SVNInside.zip images\*.ico images\*.png
cd ..
zip -j9 SVNInside.cbplugin SVNInside.dll SVNInside.zip
-xcopy /Y SVNInside.dll "F:\dev\CB_SVN\src\devel\share\CodeBlocks\plugins"
-xcopy /Y SVNInside.zip "F:\dev\CB_SVN\src\devel\share\codeblocks"
+xcopy /Y SVNInside.dll "..\..\..\devel\share\CodeBlocks\plugins\*"
+xcopy /Y SVNInside.zip "..\..\..\devel\share\codeblocks\*"
Index: SVNInside.cbp
===================================================================
--- SVNInside.cbp (revision 5)
+++ SVNInside.cbp (working copy)
@@ -36,7 +36,6 @@
<Option compiler="gcc" />
<Option host_application="codeblocks.exe" />
<Compiler>
- <Add option="-O3" />
<Add option="-pipe" />
<Add option="-mthreads" />
<Add option="-fmessage-length=0" />
@@ -57,12 +56,16 @@
</Linker>
</Target>
</Build>
+ <VirtualTargets>
+ <Add alias="All" targets="debug;" />
+ </VirtualTargets>
<Compiler>
<Add directory="$(#cb)\include" />
<Add directory="$(#cb)\include\wxscintilla\include" />
<Add directory="$(#wx.include)" />
<Add directory="$(#wx.lib)\gcc_dll\mswu" />
<Add directory="$(#cb)\include\wxFlatNotebook\include" />
+ <Add directory="$(#cb)\include\tinyxml" />
<Add directory="src" />
<Add directory="src\SVNCommand" />
<Add directory="src\Dialogs" />
--- End code ---
thomas:
--- Quote from: killerbot on October 09, 2007, 09:22:31 pm ---Since you are calling the command line svn, wxExecute should be fine for the job.
--- End quote ---
It is not. That's what I've been using in my RC2 Subversion plugin.
orel:
--- Quote from: thomas on October 10, 2007, 02:11:18 am ---
--- Quote from: killerbot on October 09, 2007, 09:22:31 pm ---Since you are calling the command line svn, wxExecute should be fine for the job.
--- End quote ---
It is not. That's what I've been using in my RC2 Subversion plugin.
--- End quote ---
i am currently in the process of making some tests to see if i can replace my win32 (CreateProcess, DuplicateHandle, etc.) CConsoleProc implementation with one calling wxExecute. I'm not having too much problems for the moment although some little things seems stranges, particularly when configuring it to be asynchronous and working with a wxProcess.
What kinf of problem did you have with it? on unix-linux or windows?
if ::wxExecute is only working fine on linux, it's useless for me to rewrite the window implementation of my console output redirection.
JGM:
--- Quote from: orel on October 10, 2007, 03:14:01 am ---if ::wxExecute is only working fine on linux, it's useless for me to rewrite the window implementation of my console output redirection.
--- End quote ---
I use it on windows and linux and it works fine. I don't know what could go wrong since for me is working. :?
--- Code: ---bool QuerySvn(const wxString& workingDir, wxString& revision, wxString& date)
{
revision = _T("0");
date = _T("unknown date");
wxString svncmd = _T("svn info --xml --non-interactive ");
svncmd.Append(_T("\"") + workingDir + _T("\""));
wxArrayString xmlOutput;
if (wxExecute(svncmd, xmlOutput) != -1)
{
wxString buf = _T("");
for(unsigned int i=0; i<xmlOutput.GetCount(); ++i){
buf << xmlOutput[i];
}
TiXmlDocument doc;
doc.Parse(ws2s(buf).c_str());
if (doc.Error())
return 0;
TiXmlHandle hCommit(&doc);
hCommit = hCommit.FirstChildElement("info").FirstChildElement("entry").FirstChildElement("commit");
if(const TiXmlElement* e = hCommit.ToElement())
{
revision = e->Attribute("revision") ? s2ws(e->Attribute("revision")) : _T("");
const TiXmlElement* d = e->FirstChildElement("date");
if(d && d->GetText())
date = s2ws(d->GetText());
return 1;
}
}
return 0;
}
--- End code ---
thats a function to retrieve the svn revision using wxExecute and it works pretty well on both platforms.
Biplab:
--- Quote from: orel on October 08, 2007, 11:31:10 pm ---And i have a question to ask : i am trying to implement a way to block modifications on a file locked by another person. My wish is to add a msgbox when the cbEVT_EDITOR_MODIFIED event is sent that kind of file, asking for the user to choose among two options :
* continue modyfing the file locally as if it wasn't locked, despite the fact that it won't be able to be commited until it is unlocked
* revert the modification which generated the event and wait until the file it is unlocked
For the second option, i can't manage to undo the action just after the messazge box has been closed, i tried different ways :
--- Code: ---cbStyledTextCtrl* pControl = pEditor->GetControl();
if (pControl)
{
//pControl->BeginUndoAction(); with those 2 lines commented or not
pControl->Undo();
//pControl->EndUndoAction();
}
--- End code ---
And i tried this:
--- Code: ---EditorBase* ed = Manager::Get()->GetEditorManager()->GetActiveEditor();
if (ed) ed->Undo();
--- End code ---
with no success, can someone help me about that ?
--- End quote ---
EditorBase::Undo() is an empty virtual function which has been implemented in cbEditor. Try the following code.
--- Code: ---// Code to catch cbEVT_EDITOR_MODIFIED event
void foo::OnEditorModified(CodeBlocksEvent& event)
{
cbEditor* ed = (cbEditor*)event.GetEditor();
ed->Undo();
}
--- End code ---
Or
--- Code: ---cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
ed->Undo();
--- End code ---
HTH. :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version