Check-in [6c1ccf6a0a]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added more files..
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6c1ccf6a0a496d88eddd3bf9729bd457375bb079
User & Date: isafam 2014-01-16 22:52:53
Context
2014-01-18
23:29
Simplified settings dialog & saving of working dir in workspace check-in: 82c55878e7 user: isafam tags: trunk
2014-01-16
22:52
Added more files.. check-in: 6c1ccf6a0a user: isafam tags: trunk
00:14
More cleaning up.. check-in: 9dd163b504 user: isafam tags: trunk
Changes

Changes to Fossil/Fossil.project.

9
10
11
12
13
14
15


16
17
18
19
20
21
22
..
23
24
25
26
27
28
29



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
269
270
271
272
273
274
275









276
277
    <File Name="fossil.cpp"/>
    <File Name="commitmessagescache.cpp"/>
    <File Name="fossil_view.cpp"/>
    <File Name="fossil_console.cpp"/>
    <File Name="fossil_ui.cpp"/>
    <File Name="fossil_settings_dialog.cpp"/>
    <File Name="commit_dialog.cpp"/>


  </VirtualDirectory>
  <VirtualDirectory Name="include">
    <File Name="fossil.h"/>
    <File Name="commitmessagescache.h"/>
    <File Name="fossilsettingsdata.h"/>
    <File Name="fossil_view.h"/>
    <File Name="fossil_console.h"/>
................................................................................
    <File Name="fossil_strings.h"/>
    <File Name="fossil_ui.h"/>
    <File Name="fossil_login_dialog.h"/>
    <File Name="fossil_settings_dialog.h"/>
    <File Name="fossilinfo.h"/>
    <File Name="fossiltreedata.h"/>
    <File Name="commit_dialog.h"/>



  </VirtualDirectory>
  <Dependencies/>
  <Dependencies Name="DebugUnicode"/>
  <Dependencies Name="ReleaseUnicode"/>
  <Dependencies Name="WinDebug_29"/>
  <Dependencies Name="WinDebugUnicode"/>
  <Dependencies Name="WinReleaseUnicode"/>
  <Settings Type="Dynamic Library">
    <GlobalSettings>
      <Compiler Options="">
        <IncludePath Value="."/>
      </Compiler>
      <Linker Options="">
        <LibraryPath Value="."/>
      </Linker>
      <ResourceCompiler Options=""/>
    </GlobalSettings>
    <Configuration Name="DebugUnicode" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
      <Compiler Options="-g;$(shell wx-config --cxxflags --debug=yes --unicode=yes)" Required="yes" PreCompiledHeader="">
        <IncludePath Value="."/>
        <IncludePath Value="../Interfaces"/>
        <IncludePath Value="../CodeLite"/>
        <IncludePath Value="../Plugin"/>
        <IncludePath Value="../sqlite3"/>
................................................................................
        <WorkingDirectory/>
      </CustomBuild>
      <AdditionalRules>
        <CustomPostBuild/>
        <CustomPreBuild/>
      </AdditionalRules>
    </Configuration>









  </Settings>
</CodeLite_Project>







>
>







 







>
>
>








<
<
<
<
<
<
<
<
<







 







>
>
>
>
>
>
>
>
>


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42









43
44
45
46
47
48
49
...
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
    <File Name="fossil.cpp"/>
    <File Name="commitmessagescache.cpp"/>
    <File Name="fossil_view.cpp"/>
    <File Name="fossil_console.cpp"/>
    <File Name="fossil_ui.cpp"/>
    <File Name="fossil_settings_dialog.cpp"/>
    <File Name="commit_dialog.cpp"/>
    <File Name="fossilstatushandler.cpp"/>
    <File Name="fossilcommand.cpp"/>
  </VirtualDirectory>
  <VirtualDirectory Name="include">
    <File Name="fossil.h"/>
    <File Name="commitmessagescache.h"/>
    <File Name="fossilsettingsdata.h"/>
    <File Name="fossil_view.h"/>
    <File Name="fossil_console.h"/>
................................................................................
    <File Name="fossil_strings.h"/>
    <File Name="fossil_ui.h"/>
    <File Name="fossil_login_dialog.h"/>
    <File Name="fossil_settings_dialog.h"/>
    <File Name="fossilinfo.h"/>
    <File Name="fossiltreedata.h"/>
    <File Name="commit_dialog.h"/>
    <File Name="fossilcommandhandler.h"/>
    <File Name="fossilcommand.h"/>
    <File Name="fossilstatushandler.h"/>
  </VirtualDirectory>
  <Dependencies/>
  <Dependencies Name="DebugUnicode"/>
  <Dependencies Name="ReleaseUnicode"/>
  <Dependencies Name="WinDebug_29"/>
  <Dependencies Name="WinDebugUnicode"/>
  <Dependencies Name="WinReleaseUnicode"/>
  <Settings Type="Dynamic Library">









    <Configuration Name="DebugUnicode" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
      <Compiler Options="-g;$(shell wx-config --cxxflags --debug=yes --unicode=yes)" Required="yes" PreCompiledHeader="">
        <IncludePath Value="."/>
        <IncludePath Value="../Interfaces"/>
        <IncludePath Value="../CodeLite"/>
        <IncludePath Value="../Plugin"/>
        <IncludePath Value="../sqlite3"/>
................................................................................
        <WorkingDirectory/>
      </CustomBuild>
      <AdditionalRules>
        <CustomPostBuild/>
        <CustomPreBuild/>
      </AdditionalRules>
    </Configuration>
    <GlobalSettings>
      <Compiler Options="">
        <IncludePath Value="."/>
      </Compiler>
      <Linker Options="">
        <LibraryPath Value="."/>
      </Linker>
      <ResourceCompiler Options=""/>
    </GlobalSettings>
  </Settings>
</CodeLite_Project>

Changes to Fossil/fossil.cpp.

2
3
4
5
6
7
8

9
10
11
12
13
14
15
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
...
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
...
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377

378
379
380
381
382
383
384
385
386
387
...
817
818
819
820
821
822
823
824

825
826
827
828
829
830
831
#include <wx/filefn.h>
//#include "fossilversion_password_db.h"
#include <wx/tokenzr.h>
#include "detachedpanesinfo.h"
#include "dockablepane.h"
#include "fossil.h"
#include "procutils.h"

#include <wx/ffile.h>
#include <wx/stdpaths.h>
#include "fossil_login_dialog.h"
//#include "fossil_command_handlers.h"
#include <wx/textdlg.h>
#include "commit_dialog.h"
//#include "fossilstatushandler.h"
................................................................................
{
	return PLUGIN_INTERFACE_VERSION;
}

Fossil::Fossil(IManager *manager)
		: IPlugin           (manager)
		, m_explorerSepItem (NULL)
		//, m_simpleCommand   (this)
		//, m_diffCommand     (this)
		//, m_blameCommand    (this)
		, m_fossilClientVersion(0.0)
{
	m_longName = wxT("Fossil plugin for codelite2.0 based on the fossil command line tool");
	m_shortName = wxT("Fossil");

................................................................................
	GetManager()->GetTheApp()->Disconnect(XRCID("fossil_explorer_ignore_file_pattern"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(Fossil::OnIgnoreFilePattern), NULL, this);
	GetManager()->GetTheApp()->Disconnect(XRCID("fossil_explorer_set_as_view"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(Fossil::OnSelectAsView),      NULL, this);
	GetManager()->GetTheApp()->Disconnect(wxEVT_GET_ADDITIONAL_COMPILEFLAGS, wxCommandEventHandler(Fossil::OnGetCompileLine), NULL, this);
*/

	m_fossilView->DisconnectEvents();

	// Remove the tab pined to the workspcae pane
	size_t index(Notebook::npos);
	FossilSettingsData ssd = GetSettings();
	index = m_mgr->GetWorkspacePaneNotebook()->GetPageIndex(m_fossilView);
	if (index != Notebook::npos) {
		m_mgr->GetWorkspacePaneNotebook()->RemovePage(index, false);
	}
	ssd.SetFossilTabIndex(index);
	SetSettings(ssd);

	// Remove the tab pined to the output pane
	for (size_t i=0; i<m_mgr->GetOutputPaneNotebook()->GetPageCount(); i++) {
		if (m_fossilConsole == m_mgr->GetOutputPaneNotebook()->GetPage(i)) {
			m_mgr->GetOutputPaneNotebook()->RemovePage(i);
			break;
		}
	}

................................................................................

	configDir << wxFileName::GetPathSeparator() << wxT("fossil");
	return configDir;
}

wxString Fossil::GetFossilExeName(bool nonInteractive)
{
	//__asm__("int $3"); //trace M.Isa
	FossilSettingsData ssd = GetSettings();
	wxString executeable;
	bool encloseQuotations = false;
	wxString exeName = ssd.GetExecutable();
	exeName.Trim().Trim(false);
	encloseQuotations = (exeName.Find(wxT(" ")) != wxNOT_FOUND);
	if (encloseQuotations) {
		executeable << wxT("\"") << ssd.GetExecutable() << wxT("\" ");
	} else {
		executeable << ssd.GetExecutable() << wxT(" ");
	}

	if(nonInteractive)
		executeable << wxT(" --non-interactive ");

	// --trust-server-cert was introduced in version >=1.6
	// but it also requires --non-interactive mode enabled
	if(GetFossilClientVersion() >= 1.6 && nonInteractive) {
		executeable << wxT(" --trust-server-cert ");

	}

	executeable << wxT(" --config-dir \"") << GetUserConfigDir() << wxT("\" ");
	return executeable;
}


////////////////////////////////////////////////
// File Explorer FOSSIL command handlers
////////////////////////////////////////////////
................................................................................
}

void Fossil::DoGetFossilInfoSync(FossilInfo& fossilInfo, const wxString &workingDirectory)
{
	wxString fossilInfoCommand;
	wxString xmlStr;

	fossilInfoCommand << GetFossilExeName() << wxT(" info --xml ");

	if(workingDirectory.Find(wxT(" ")))
		fossilInfoCommand << wxT("\"") << workingDirectory << wxT("\"");
	else
		fossilInfoCommand << workingDirectory;

	wxArrayString xmlArr;








>







 







|







 







|









|







 







<
|


|



|

|


|
|



|
|
>
|
<
|







 







|
>







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
...
352
353
354
355
356
357
358

359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379

380
381
382
383
384
385
386
387
...
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
#include <wx/filefn.h>
//#include "fossilversion_password_db.h"
#include <wx/tokenzr.h>
#include "detachedpanesinfo.h"
#include "dockablepane.h"
#include "fossil.h"
#include "procutils.h"
#include "workspace.h"
#include <wx/ffile.h>
#include <wx/stdpaths.h>
#include "fossil_login_dialog.h"
//#include "fossil_command_handlers.h"
#include <wx/textdlg.h>
#include "commit_dialog.h"
//#include "fossilstatushandler.h"
................................................................................
{
	return PLUGIN_INTERFACE_VERSION;
}

Fossil::Fossil(IManager *manager)
		: IPlugin           (manager)
		, m_explorerSepItem (NULL)
		, m_simpleCommand   (this)
		//, m_diffCommand     (this)
		//, m_blameCommand    (this)
		, m_fossilClientVersion(0.0)
{
	m_longName = wxT("Fossil plugin for codelite2.0 based on the fossil command line tool");
	m_shortName = wxT("Fossil");

................................................................................
	GetManager()->GetTheApp()->Disconnect(XRCID("fossil_explorer_ignore_file_pattern"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(Fossil::OnIgnoreFilePattern), NULL, this);
	GetManager()->GetTheApp()->Disconnect(XRCID("fossil_explorer_set_as_view"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(Fossil::OnSelectAsView),      NULL, this);
	GetManager()->GetTheApp()->Disconnect(wxEVT_GET_ADDITIONAL_COMPILEFLAGS, wxCommandEventHandler(Fossil::OnGetCompileLine), NULL, this);
*/

	m_fossilView->DisconnectEvents();

	// Remove the tab pinned to the workspace pane
	size_t index(Notebook::npos);
	FossilSettingsData ssd = GetSettings();
	index = m_mgr->GetWorkspacePaneNotebook()->GetPageIndex(m_fossilView);
	if (index != Notebook::npos) {
		m_mgr->GetWorkspacePaneNotebook()->RemovePage(index, false);
	}
	ssd.SetFossilTabIndex(index);
	SetSettings(ssd);

	// Remove the tab pinned to the output pane
	for (size_t i=0; i<m_mgr->GetOutputPaneNotebook()->GetPageCount(); i++) {
		if (m_fossilConsole == m_mgr->GetOutputPaneNotebook()->GetPage(i)) {
			m_mgr->GetOutputPaneNotebook()->RemovePage(i);
			break;
		}
	}

................................................................................

	configDir << wxFileName::GetPathSeparator() << wxT("fossil");
	return configDir;
}

wxString Fossil::GetFossilExeName(bool nonInteractive)
{

	FossilSettingsData fsd = GetSettings();
	wxString executeable;
	bool encloseQuotations = false;
	wxString exeName = fsd.GetExecutable();
	exeName.Trim().Trim(false);
	encloseQuotations = (exeName.Find(wxT(" ")) != wxNOT_FOUND);
	if (encloseQuotations) {
		executeable << wxT("\"") << fsd.GetExecutable() << wxT("\" ");
	} else {
		executeable << fsd.GetExecutable() << wxT(" ");
	}

	//if(nonInteractive)
	//	executeable << wxT(" --non-interactive ");

	// --trust-server-cert was introduced in version >=1.6
	// but it also requires --non-interactive mode enabled
	//if(GetFossilClientVersion() >= 1.6 && nonInteractive) {
	//	executeable << wxT(" --trust-server-cert ");
	//}


	//executeable << wxT(" --config-dir \"") << GetUserConfigDir() << wxT("\" ");
	return executeable;
}


////////////////////////////////////////////////
// File Explorer FOSSIL command handlers
////////////////////////////////////////////////
................................................................................
}

void Fossil::DoGetFossilInfoSync(FossilInfo& fossilInfo, const wxString &workingDirectory)
{
	wxString fossilInfoCommand;
	wxString xmlStr;

	//fossilInfoCommand << GetFossilExeName() << wxT(" info --xml ");
	fossilInfoCommand << GetFossilExeName() << wxT(" info ");
	if(workingDirectory.Find(wxT(" ")))
		fossilInfoCommand << wxT("\"") << workingDirectory << wxT("\"");
	else
		fossilInfoCommand << workingDirectory;

	wxArrayString xmlArr;

Changes to Fossil/fossil.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef __Fossil__
#define __Fossil__

#include "plugin.h"
#include "fossilinfo.h"
#include "commitmessagescache.h"
//#include "fossilcommand.h"
#include "fossilsettingsdata.h"

class FossilView;
class FossilConsole;
class wxMenu;
class wxMenuItem;

class Fossil : public IPlugin
{
private:
	FossilView*     m_fossilView;
	FossilConsole*         m_fossilConsole;
	wxMenuItem*         m_explorerSepItem;
	//FossilCommand          m_simpleCommand;
	//FossilCommand          m_diffCommand;
	//FossilCommand          m_blameCommand;
	double              m_fossilClientVersion;
	CommitMessagesCache m_commitMessagesCache;

protected:
	void OnSettings(wxCommandEvent &event);






|













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef __Fossil__
#define __Fossil__

#include "plugin.h"
#include "fossilinfo.h"
#include "commitmessagescache.h"
#include "fossilcommand.h"
#include "fossilsettingsdata.h"

class FossilView;
class FossilConsole;
class wxMenu;
class wxMenuItem;

class Fossil : public IPlugin
{
private:
	FossilView*     m_fossilView;
	FossilConsole*         m_fossilConsole;
	wxMenuItem*         m_explorerSepItem;
	FossilCommand          m_simpleCommand;
	//FossilCommand          m_diffCommand;
	//FossilCommand          m_blameCommand;
	double              m_fossilClientVersion;
	CommitMessagesCache m_commitMessagesCache;

protected:
	void OnSettings(wxCommandEvent &event);

Changes to Fossil/fossil_console.cpp.

1
2
3
4
5
6
7
8
9
..
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
...
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
213
214
215
216
217
218
219


220
221
222
223
224
225
226
#include <wx/app.h>
//#include "environmentconfig.h"
#include <wx/textdlg.h>
#include "fossil_console.h"
#include "fossil_strings.h"
#include <wx/tokenzr.h>
#include <wx/aui/framemanager.h>
#include <wx/xrc/xmlres.h>
#include "processreaderthread.cpp"
................................................................................
FossilConsole::FossilConsole(wxWindow *parent, Fossil* plugin)
		: FossilShellBase(parent)
		//, m_handler(NULL)
		, m_process(NULL)
		, m_plugin (plugin)
		, m_printProcessOutput(true)
{
	m_sci->SetLexer(wxSCI_LEX_FOSSIL);
	m_sci->StyleClearAll();

	for (int i=0; i<=wxSCI_STYLE_DEFAULT; i++) {
		m_sci->StyleSetBackground(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
		m_sci->StyleSetForeground(i, *wxBLACK);
	}

................................................................................
	m_sci->SetWrapStartIndent(4);
	m_sci->SetWrapVisualFlags(2);
	m_sci->SetScrollWidthTracking(true);

	/////////////////////////////////////////////////////////////////////////////
	// Set FOSSIL styles
	/////////////////////////////////////////////////////////////////////////////
	m_sci->StyleSetForeground ( wxSCI_LEX_FOSSIL_INFO,     wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT) );
	m_sci->StyleSetBackground ( wxSCI_LEX_FOSSIL_INFO,     wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_FOSSIL_ADDED,    wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_FOSSIL_ADDED,    wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_FOSSIL_MERGED,   wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_FOSSIL_MERGED,   wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_FOSSIL_UPDATED,  wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_FOSSIL_UPDATED,  wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_FOSSIL_CONFLICT, wxT("RED") );
	m_sci->StyleSetBackground ( wxSCI_LEX_FOSSIL_CONFLICT, wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_FOSSIL_DELETED,  wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_FOSSIL_DELETED,  wxSystemSettings::GetColour ( wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetFont ( wxSCI_LEX_FOSSIL_INFO,     font );
	m_sci->StyleSetFont ( wxSCI_LEX_FOSSIL_ADDED,    font );
	m_sci->StyleSetFont ( wxSCI_LEX_FOSSIL_MERGED,   font );
	m_sci->StyleSetFont ( wxSCI_LEX_FOSSIL_UPDATED,  font );
	m_sci->StyleSetFont ( wxSCI_LEX_FOSSIL_CONFLICT, font );
	m_sci->StyleSetFont ( wxSCI_LEX_FOSSIL_DELETED,  font );

	m_sci->SetReadOnly(true);
}

FossilConsole::~FossilConsole()
{
}
................................................................................
void FossilConsole::Clear()
{
	m_sci->SetReadOnly(false);
	m_sci->ClearAll();
	m_sci->SetReadOnly(true);
}

void FossilConsole::OnProcessEnd(wxCommandEvent& event) {}

#if 0

void FossilConsole::OnProcessEnd(wxCommandEvent& event)
{
	ProcessEventData *ped = (ProcessEventData *)event.GetClientData();
	delete ped;

	if ( m_process ) {
		delete m_process;
................................................................................
		delete m_handler;
		m_handler = NULL;
	}

	m_workingDirectory.Clear();
	m_url.Clear();
}



bool FossilConsole::ExecuteURL(const wxString& cmd, const wxString& url, FossilCommandHandler* handler, bool printProcessOutput)
{
	if(!DoExecute(cmd, handler, wxT(""), printProcessOutput))
		return false;

	m_url = url;

|







 







|







 







|
|

|
|

|
|

|
|

|
|

|
|

|
|
|
|
|
|







 







<
<
<
<







 







>
>







1
2
3
4
5
6
7
8
9
..
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
...
169
170
171
172
173
174
175




176
177
178
179
180
181
182
...
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#include <wx/app.h>
#include "environmentconfig.h"
#include <wx/textdlg.h>
#include "fossil_console.h"
#include "fossil_strings.h"
#include <wx/tokenzr.h>
#include <wx/aui/framemanager.h>
#include <wx/xrc/xmlres.h>
#include "processreaderthread.cpp"
................................................................................
FossilConsole::FossilConsole(wxWindow *parent, Fossil* plugin)
		: FossilShellBase(parent)
		//, m_handler(NULL)
		, m_process(NULL)
		, m_plugin (plugin)
		, m_printProcessOutput(true)
{
	m_sci->SetLexer(wxSCI_LEX_SVN);
	m_sci->StyleClearAll();

	for (int i=0; i<=wxSCI_STYLE_DEFAULT; i++) {
		m_sci->StyleSetBackground(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
		m_sci->StyleSetForeground(i, *wxBLACK);
	}

................................................................................
	m_sci->SetWrapStartIndent(4);
	m_sci->SetWrapVisualFlags(2);
	m_sci->SetScrollWidthTracking(true);

	/////////////////////////////////////////////////////////////////////////////
	// Set FOSSIL styles
	/////////////////////////////////////////////////////////////////////////////
	m_sci->StyleSetForeground ( wxSCI_LEX_SVN_INFO,     wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT) );
	m_sci->StyleSetBackground ( wxSCI_LEX_SVN_INFO,     wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_SVN_ADDED,    wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_SVN_ADDED,    wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_SVN_MERGED,   wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_SVN_MERGED,   wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_SVN_UPDATED,  wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_SVN_UPDATED,  wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_SVN_CONFLICT, wxT("RED") );
	m_sci->StyleSetBackground ( wxSCI_LEX_SVN_CONFLICT, wxSystemSettings::GetColour (wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetForeground ( wxSCI_LEX_SVN_DELETED,  wxT("FOREST GREEN") );
	m_sci->StyleSetBackground ( wxSCI_LEX_SVN_DELETED,  wxSystemSettings::GetColour ( wxSYS_COLOUR_WINDOW ) );

	m_sci->StyleSetFont ( wxSCI_LEX_SVN_INFO,     font );
	m_sci->StyleSetFont ( wxSCI_LEX_SVN_ADDED,    font );
	m_sci->StyleSetFont ( wxSCI_LEX_SVN_MERGED,   font );
	m_sci->StyleSetFont ( wxSCI_LEX_SVN_UPDATED,  font );
	m_sci->StyleSetFont ( wxSCI_LEX_SVN_CONFLICT, font );
	m_sci->StyleSetFont ( wxSCI_LEX_SVN_DELETED,  font );

	m_sci->SetReadOnly(true);
}

FossilConsole::~FossilConsole()
{
}
................................................................................
void FossilConsole::Clear()
{
	m_sci->SetReadOnly(false);
	m_sci->ClearAll();
	m_sci->SetReadOnly(true);
}





void FossilConsole::OnProcessEnd(wxCommandEvent& event)
{
	ProcessEventData *ped = (ProcessEventData *)event.GetClientData();
	delete ped;

	if ( m_process ) {
		delete m_process;
................................................................................
		delete m_handler;
		m_handler = NULL;
	}

	m_workingDirectory.Clear();
	m_url.Clear();
}

#if 0

bool FossilConsole::ExecuteURL(const wxString& cmd, const wxString& url, FossilCommandHandler* handler, bool printProcessOutput)
{
	if(!DoExecute(cmd, handler, wxT(""), printProcessOutput))
		return false;

	m_url = url;

Changes to Fossil/fossil_console.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef FOSSILSHELL_H
#define FOSSILSHELL_H

#include "fossil_ui.h"
//#include "fossilcommandhandler.h"

class IProcess;
class Fossil;

class FossilConsole : public FossilShellBase
{
	//FossilCommandHandler *m_handler;
	wxString           m_output;
	IProcess*          m_process;
	Fossil*       m_plugin;
	bool               m_printProcessOutput;
	wxString           m_workingDirectory;
	wxString           m_url;

................................................................................
	virtual void OnProcessEnd       (wxCommandEvent& event);
	
	//bool DoExecute(const wxString &cmd, FossilCommandHandler *handler, const wxString &workingDirectory, bool printProcessOutput);
public:
	FossilConsole(wxWindow *parent, Fossil* plugin);
	virtual ~FossilConsole();

	//bool Execute(const wxString &cmd, const wxString &workingDirectory, FossilCommandHandler *handler, bool printProcessOutput = true);
	//bool ExecuteURL(const wxString &cmd, const wxString &url, FossilCommandHandler *handler, bool printProcessOutput = true);
	void Clear  ();
	void Stop   ();
	void AppendText(const wxString &text);
	bool IsRunning();
	bool IsEmpty();
	void EnsureVisible();

};
#endif // FOSSILSHELL_H




|






|







 







|










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef FOSSILSHELL_H
#define FOSSILSHELL_H

#include "fossil_ui.h"
#include "fossilcommandhandler.h"

class IProcess;
class Fossil;

class FossilConsole : public FossilShellBase
{
	FossilCommandHandler *m_handler;
	wxString           m_output;
	IProcess*          m_process;
	Fossil*       m_plugin;
	bool               m_printProcessOutput;
	wxString           m_workingDirectory;
	wxString           m_url;

................................................................................
	virtual void OnProcessEnd       (wxCommandEvent& event);
	
	//bool DoExecute(const wxString &cmd, FossilCommandHandler *handler, const wxString &workingDirectory, bool printProcessOutput);
public:
	FossilConsole(wxWindow *parent, Fossil* plugin);
	virtual ~FossilConsole();

	bool Execute(const wxString &cmd, const wxString &workingDirectory, FossilCommandHandler *handler, bool printProcessOutput = true);
	//bool ExecuteURL(const wxString &cmd, const wxString &url, FossilCommandHandler *handler, bool printProcessOutput = true);
	void Clear  ();
	void Stop   ();
	void AppendText(const wxString &text);
	bool IsRunning();
	bool IsEmpty();
	void EnsureVisible();

};
#endif // FOSSILSHELL_H

Changes to Fossil/fossil_ui.cpp.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
	
	this->SetSizer( mainSizer );
	this->Layout();
	mainSizer->Fit( this );
	
	// Connect Events
	m_buttonChangeRootDir->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FossilPageBase::OnChangeRootDir ), NULL, this );
	m_treeCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( FossilPageBase::OnItemActivated ), NULL, this );
	m_treeCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( FossilPageBase::OnTreeMenu ), NULL, this );
}

FossilPageBase::~FossilPageBase()
{
	// Disconnect Events
	m_buttonChangeRootDir->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FossilPageBase::OnChangeRootDir ), NULL, this );
	m_treeCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( FossilPageBase::OnItemActivated ), NULL, this );
	m_treeCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( FossilPageBase::OnTreeMenu ), NULL, this );
	
}

CommitDialogBase::CommitDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );







|







|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
	
	this->SetSizer( mainSizer );
	this->Layout();
	mainSizer->Fit( this );
	
	// Connect Events
	m_buttonChangeRootDir->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FossilPageBase::OnChangeRootDir ), NULL, this );
	//m_treeCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( FossilPageBase::OnItemActivated ), NULL, this );
	m_treeCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( FossilPageBase::OnTreeMenu ), NULL, this );
}

FossilPageBase::~FossilPageBase()
{
	// Disconnect Events
	m_buttonChangeRootDir->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FossilPageBase::OnChangeRootDir ), NULL, this );
	//m_treeCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( FossilPageBase::OnItemActivated ), NULL, this );
	m_treeCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( FossilPageBase::OnTreeMenu ), NULL, this );
	
}

CommitDialogBase::CommitDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );

Changes to Fossil/fossil_ui.h.

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
	protected:
		wxTextCtrl* m_textCtrlRootDir;
		wxButton* m_buttonChangeRootDir;
		wxTreeCtrl* m_treeCtrl;
		
		// Virtual event handlers, overide them in your derived class
		virtual void OnChangeRootDir( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnItemActivated( wxTreeEvent& event ) { event.Skip(); }
		virtual void OnTreeMenu( wxTreeEvent& event ) { event.Skip(); }
		
	
	public:
		
		FossilPageBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL );
		~FossilPageBase();







|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
	protected:
		wxTextCtrl* m_textCtrlRootDir;
		wxButton* m_buttonChangeRootDir;
		wxTreeCtrl* m_treeCtrl;
		
		// Virtual event handlers, overide them in your derived class
		virtual void OnChangeRootDir( wxCommandEvent& event ) { event.Skip(); }
		//virtual void OnItemActivated( wxTreeEvent& event ) { event.Skip(); }
		virtual void OnTreeMenu( wxTreeEvent& event ) { event.Skip(); }
		
	
	public:
		
		FossilPageBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL );
		~FossilPageBase();

Changes to Fossil/fossil_view.cpp.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
53
54
55
56
57
58
59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
...
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
...
235
236
237
238
239
240
241


242

243
244
245
246
247
248
249








250
251
252
253
254
255
256
...
513
514
515
516
517
518
519


520
521
522
523
524
525
526
...
928
929
930
931
932
933
934


935
936
937
938
939
940
941
...
987
988
989
990
991
992
993
994
995
996
997
998
999
1000

1001
1002
1003
1004
1005
1006
1007
//#include "fossil_copy_dialog.h"
#include "commit_dialog.h"
//#include "fossil_default_command_handler.h"
#include <wx/menu.h>
#include <wx/dirdlg.h>
#include "fileextmanager.h"
#include "fossilsettingsdata.h"
//#include "fossilstatushandler.h"
#include <wx/wupdlock.h>
#include "fossil_strings.h"
#include "fossil_view.h"
#include <wx/xrc/xmlres.h>
#include "fossiltreedata.h"
#include <wx/imaglist.h>
#include "imanager.h"
................................................................................
	EVT_MENU(XRCID("fossil_open_file"),          FossilView::OnOpenFile)
	EVT_MENU(XRCID("fossil_switch"),             FossilView::OnSwitch)
END_EVENT_TABLE()

FossilView::FossilView( wxWindow* parent, Fossil *plugin )
	: FossilPageBase( parent )
	, m_plugin          ( plugin )
	//, m_simpleCommand   ( plugin )
	//, m_diffCommand     ( plugin )
{
/*
	CreatGUIControls();
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_WORKSPACE_LOADED,      wxCommandEventHandler(FossilView::OnWorkspaceLoaded),     NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_WORKSPACE_CLOSED,      wxCommandEventHandler(FossilView::OnWorkspaceClosed),     NULL, this);

	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_FILE_SAVED,            wxCommandEventHandler(FossilView::OnRefreshView),         NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_PROJ_FILE_ADDED,       wxCommandEventHandler(FossilView::OnFileAdded  ),         NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_FILE_RENAMED,          wxCommandEventHandler(FossilView::OnFileRenamed),         NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(FossilView::OnActiveEditorChanged), NULL, this);
*/
}

................................................................................
void FossilView::OnChangeRootDir( wxCommandEvent& event )
{
	wxUnusedVar(event);
	wxString path(m_textCtrlRootDir->GetValue());
	wxString new_path = wxDirSelector(wxT(""), path, wxDD_DEFAULT_STYLE, wxDefaultPosition, this);
	if (new_path.IsEmpty() == false) {
		m_textCtrlRootDir->SetValue(new_path);
		//BuildTree();
	}
}

void FossilView::OnTreeMenu( wxTreeEvent& event )
{
/*
	// Popup the menu
................................................................................
		}

		PopupMenu( &menu );
	}
*/
}

void FossilView::BuildTree()
{
	BuildTree( m_textCtrlRootDir->GetValue() );
}

void FossilView::BuildTree(const wxString& root)
{
	if(root.IsEmpty())
		return;

	m_textCtrlRootDir->SetValue(root);
	wxString command;
	command << m_plugin->GetFossilExeName() << wxT("--xml -q status");
	//m_simpleCommand.Execute(command, root, new FossilStatusHandler(m_plugin, wxNOT_FOUND, NULL), m_plugin);
}

void FossilView::OnItemActivated(wxTreeEvent& event) {}

void FossilView::OnWorkspaceLoaded(wxCommandEvent& event)
{
	event.Skip();
	Workspace *workspace = m_plugin->GetManager()->GetWorkspace();
	if(m_plugin->GetManager()->IsWorkspaceOpen() && workspace) {
		m_textCtrlRootDir->SetValue(workspace->GetWorkspaceFileName().GetPath());
		BuildTree();
	}
}

void FossilView::OnWorkspaceClosed(wxCommandEvent& event)
{
	event.Skip();
	m_textCtrlRootDir->SetValue(wxT(""));
	ClearAll();
	m_plugin->GetConsole()->Clear();
}

void FossilView::ClearAll()
{
	m_treeCtrl->DeleteAllItems();
}

#if 0

void FossilView::CreatGUIControls()
{
	// Assign the image list
	wxImageList *imageList = new wxImageList(16, 16, true);

	imageList->Add(wxXmlResource::Get()->LoadBitmap(wxT("folder")));
	imageList->Add(wxXmlResource::Get()->LoadBitmap(wxT("error")));
	imageList->Add(wxXmlResource::Get()->LoadBitmap(wxT("edit_add")));
................................................................................

	tb->AddSeparator();
	tb->AddTool(XRCID("fossil_checkout"),         wxT("Fossil Checkout"), wxXmlResource::Get()->LoadBitmap ( wxT ( "svn_checkout" ) ), wxT ( "Fossil Checkout" ) );

	tb->AddSeparator();
	tb->AddTool(XRCID("fossil_settings"),     wxT("Fossil Settings..."), wxXmlResource::Get()->LoadBitmap ( wxT ( "svn_settings" ) ), wxT ( "Fossil Settings..." ) );
	tb->AddTool(XRCID("fossil_info"),         wxT("Fossil Info"), wxXmlResource::Get()->LoadBitmap ( wxT ( "svn_info" ) ), wxT ( "Fossil Info" ) );

	tb->Connect(XRCID("clear_fossil_output"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnClearOuptut), NULL, this);
	tb->Connect(XRCID("fossil_stop"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnStop),        NULL, this);
	tb->Connect(XRCID("fossil_cleanup"),      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnCleanup),     NULL, this);
	tb->Connect(XRCID("fossil_info"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnShowFossilInfo), NULL, this);
	tb->Connect(XRCID("fossil_refresh"),      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnRefreshView), NULL, this);
	tb->Connect(XRCID("fossil_settings"),     wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnSettings),    NULL, this);

	wxSizer *sz = GetSizer();
	sz->Insert(0, tb, 0, wxEXPAND);
	tb->Realize();

	if (m_plugin->GetManager()->IsWorkspaceOpen()) {
		m_textCtrlRootDir->SetValue(m_plugin->GetManager()->GetWorkspace()->GetWorkspaceFileName().GetPath());
	}
................................................................................
void FossilView::BuildTree(const wxString& root)
{
	if(root.IsEmpty())
		return;

	m_textCtrlRootDir->SetValue(root);
	wxString command;


	command << m_plugin->GetFossilExeName() << wxT("--xml -q status");

	m_simpleCommand.Execute(command, root, new FossilStatusHandler(m_plugin, wxNOT_FOUND, NULL), m_plugin);
}

void FossilView::OnWorkspaceLoaded(wxCommandEvent& event)
{
	event.Skip();
	Workspace *workspace = m_plugin->GetManager()->GetWorkspace();








	if(m_plugin->GetManager()->IsWorkspaceOpen() && workspace) {
		m_textCtrlRootDir->SetValue(workspace->GetWorkspaceFileName().GetPath());
		BuildTree();
	}
}

void FossilView::OnWorkspaceClosed(wxCommandEvent& event)
................................................................................
		item = m_treeCtrl->GetNextChild(parent, cookie);
	}
}

////////////////////////////////////////////
// Source control command handlers
////////////////////////////////////////////



void FossilView::OnUpdate(wxCommandEvent& event)
{
	wxString command;
	wxString loginString;
	if(m_plugin->LoginIfNeeded(event, m_textCtrlRootDir->GetValue(), loginString) == false) {
		return;
................................................................................
	m_plugin->EditSettings();
}

void FossilView::OnBlame(wxCommandEvent& event)
{
	m_plugin->Blame(event, m_selectionInfo.m_paths);
}



void FossilView::OnLinkEditor(wxCommandEvent& event)
{
	FossilSettingsData ssd = m_plugin->GetSettings();
	if(event.IsChecked())
		ssd.SetFlags(ssd.GetFlags() | FossilLinkEditor);
	else
................................................................................

void FossilView::OnActiveEditorChanged(wxCommandEvent& event)
{
	event.Skip();
	DoLinkEditor();
}

#endif

void FossilView::DisconnectEvents()
{
/*
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(FossilView::OnWorkspaceLoaded),          NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(FossilView::OnWorkspaceClosed),          NULL, this);

	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_FILE_SAVED,       wxCommandEventHandler(FossilView::OnRefreshView),              NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_PROJ_FILE_ADDED,  wxCommandEventHandler(FossilView::OnFileAdded),                NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_FILE_RENAMED,     wxCommandEventHandler(FossilView::OnFileRenamed),              NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(FossilView::OnActiveEditorChanged), NULL, this);
*/
}








|







 







|


<
|


>







 







|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







 







|






|







 







>
>
|
>
|






>
>
>
>
>
>
>
>







 







>
>







 







>
>







 







<
<


<


>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72
73
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
119
120
121
122
123
124
125











































126
127
128
129
130
131
132
133
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
...
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
...
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
...
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
...
959
960
961
962
963
964
965


966
967

968
969
970
971
972
973
974
975
976
977
//#include "fossil_copy_dialog.h"
#include "commit_dialog.h"
//#include "fossil_default_command_handler.h"
#include <wx/menu.h>
#include <wx/dirdlg.h>
#include "fileextmanager.h"
#include "fossilsettingsdata.h"
#include "fossilstatushandler.h"
#include <wx/wupdlock.h>
#include "fossil_strings.h"
#include "fossil_view.h"
#include <wx/xrc/xmlres.h>
#include "fossiltreedata.h"
#include <wx/imaglist.h>
#include "imanager.h"
................................................................................
	EVT_MENU(XRCID("fossil_open_file"),          FossilView::OnOpenFile)
	EVT_MENU(XRCID("fossil_switch"),             FossilView::OnSwitch)
END_EVENT_TABLE()

FossilView::FossilView( wxWindow* parent, Fossil *plugin )
	: FossilPageBase( parent )
	, m_plugin          ( plugin )
	, m_simpleCommand   ( plugin )
	//, m_diffCommand     ( plugin )
{

	CreateGUIControls();
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_WORKSPACE_LOADED,      wxCommandEventHandler(FossilView::OnWorkspaceLoaded),     NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_WORKSPACE_CLOSED,      wxCommandEventHandler(FossilView::OnWorkspaceClosed),     NULL, this);
/*
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_FILE_SAVED,            wxCommandEventHandler(FossilView::OnRefreshView),         NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_PROJ_FILE_ADDED,       wxCommandEventHandler(FossilView::OnFileAdded  ),         NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_FILE_RENAMED,          wxCommandEventHandler(FossilView::OnFileRenamed),         NULL, this);
	m_plugin->GetManager()->GetTheApp()->Connect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(FossilView::OnActiveEditorChanged), NULL, this);
*/
}

................................................................................
void FossilView::OnChangeRootDir( wxCommandEvent& event )
{
	wxUnusedVar(event);
	wxString path(m_textCtrlRootDir->GetValue());
	wxString new_path = wxDirSelector(wxT(""), path, wxDD_DEFAULT_STYLE, wxDefaultPosition, this);
	if (new_path.IsEmpty() == false) {
		m_textCtrlRootDir->SetValue(new_path);
		BuildTree();
	}
}

void FossilView::OnTreeMenu( wxTreeEvent& event )
{
/*
	// Popup the menu
................................................................................
		}

		PopupMenu( &menu );
	}
*/
}












































void FossilView::CreateGUIControls()
{
	// Assign the image list
	wxImageList *imageList = new wxImageList(16, 16, true);

	imageList->Add(wxXmlResource::Get()->LoadBitmap(wxT("folder")));
	imageList->Add(wxXmlResource::Get()->LoadBitmap(wxT("error")));
	imageList->Add(wxXmlResource::Get()->LoadBitmap(wxT("edit_add")));
................................................................................

	tb->AddSeparator();
	tb->AddTool(XRCID("fossil_checkout"),         wxT("Fossil Checkout"), wxXmlResource::Get()->LoadBitmap ( wxT ( "svn_checkout" ) ), wxT ( "Fossil Checkout" ) );

	tb->AddSeparator();
	tb->AddTool(XRCID("fossil_settings"),     wxT("Fossil Settings..."), wxXmlResource::Get()->LoadBitmap ( wxT ( "svn_settings" ) ), wxT ( "Fossil Settings..." ) );
	tb->AddTool(XRCID("fossil_info"),         wxT("Fossil Info"), wxXmlResource::Get()->LoadBitmap ( wxT ( "svn_info" ) ), wxT ( "Fossil Info" ) );
/*
	tb->Connect(XRCID("clear_fossil_output"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnClearOuptut), NULL, this);
	tb->Connect(XRCID("fossil_stop"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnStop),        NULL, this);
	tb->Connect(XRCID("fossil_cleanup"),      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnCleanup),     NULL, this);
	tb->Connect(XRCID("fossil_info"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnShowFossilInfo), NULL, this);
	tb->Connect(XRCID("fossil_refresh"),      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnRefreshView), NULL, this);
	tb->Connect(XRCID("fossil_settings"),     wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FossilView::OnSettings),    NULL, this);
*/
	wxSizer *sz = GetSizer();
	sz->Insert(0, tb, 0, wxEXPAND);
	tb->Realize();

	if (m_plugin->GetManager()->IsWorkspaceOpen()) {
		m_textCtrlRootDir->SetValue(m_plugin->GetManager()->GetWorkspace()->GetWorkspaceFileName().GetPath());
	}
................................................................................
void FossilView::BuildTree(const wxString& root)
{
	if(root.IsEmpty())
		return;

	m_textCtrlRootDir->SetValue(root);
	wxString command;
	command << m_plugin->GetFossilExeName() << wxT("open ");
	m_simpleCommand.Execute(command, root, new FossilStatusHandler(m_plugin, wxNOT_FOUND, NULL), m_plugin);
	//command << m_plugin->GetFossilExeName() << wxT("--xml -q status");
	//command << m_plugin->GetFossilExeName() << wxT("status");
	//m_simpleCommand.Execute(command, root, new FossilStatusHandler(m_plugin, wxNOT_FOUND, NULL), m_plugin);
}

void FossilView::OnWorkspaceLoaded(wxCommandEvent& event)
{
	event.Skip();
	Workspace *workspace = m_plugin->GetManager()->GetWorkspace();

////////////////////////////////////
	//__asm__("int $3"); //trace M.Isa
	wxString prop = wxT("Database");
	wxString errMsg;
	wxString wkout = workspace->GetStringProperty(prop, errMsg);
	m_plugin->GetConsole()->AppendText(wxT("mydebug: ") + errMsg + wkout + wxT("\n"));

	if(m_plugin->GetManager()->IsWorkspaceOpen() && workspace) {
		m_textCtrlRootDir->SetValue(workspace->GetWorkspaceFileName().GetPath());
		BuildTree();
	}
}

void FossilView::OnWorkspaceClosed(wxCommandEvent& event)
................................................................................
		item = m_treeCtrl->GetNextChild(parent, cookie);
	}
}

////////////////////////////////////////////
// Source control command handlers
////////////////////////////////////////////

#if 0

void FossilView::OnUpdate(wxCommandEvent& event)
{
	wxString command;
	wxString loginString;
	if(m_plugin->LoginIfNeeded(event, m_textCtrlRootDir->GetValue(), loginString) == false) {
		return;
................................................................................
	m_plugin->EditSettings();
}

void FossilView::OnBlame(wxCommandEvent& event)
{
	m_plugin->Blame(event, m_selectionInfo.m_paths);
}

#endif

void FossilView::OnLinkEditor(wxCommandEvent& event)
{
	FossilSettingsData ssd = m_plugin->GetSettings();
	if(event.IsChecked())
		ssd.SetFlags(ssd.GetFlags() | FossilLinkEditor);
	else
................................................................................

void FossilView::OnActiveEditorChanged(wxCommandEvent& event)
{
	event.Skip();
	DoLinkEditor();
}



void FossilView::DisconnectEvents()
{

	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(FossilView::OnWorkspaceLoaded),          NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(FossilView::OnWorkspaceClosed),          NULL, this);
/*
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_FILE_SAVED,       wxCommandEventHandler(FossilView::OnRefreshView),              NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_PROJ_FILE_ADDED,  wxCommandEventHandler(FossilView::OnFileAdded),                NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_FILE_RENAMED,     wxCommandEventHandler(FossilView::OnFileRenamed),              NULL, this);
	m_plugin->GetManager()->GetTheApp()->Disconnect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(FossilView::OnActiveEditorChanged), NULL, this);
*/
}

Changes to Fossil/fossil_view.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef __fossil_page__
#define __fossil_page__

/**
@file
Subclass of FossilPageBase, which is generated by wxFormBuilder.
*/

#include "fossil_ui.h"
//#include "fossilinfo.h"
//#include "fossilcommand.h"
//#include "fossiltreedata.h"

class Fossil;
class wxMenu;

class FossilPageSelectionInfo {

public:
	wxArrayString            m_paths;
	//FossilTreeData::FossilNodeType m_selectionType;

public:
	FossilPageSelectionInfo() {} // : m_selectionType(FossilTreeData::FossilNodeTypeInvalid) {}
	virtual ~FossilPageSelectionInfo() {}

	void Clear() {
		m_paths.Clear();
		// m_selectionType = FossilTreeData::FossilNodeTypeInvalid;
	}
};

/** Implementing FossilPageBase */
class FossilView : public FossilPageBase
{
	Fossil*         m_plugin;
	wxTreeItemId         m_modifiedItems;
	//FossilCommand           m_simpleCommand;
	//FossilCommand           m_diffCommand;
	FossilPageSelectionInfo m_selectionInfo;

public:
/*
	enum {
		FossilInfo_Tag,
		FossilInfo_Branch,
		FossilInfo_Info
	};
*/

protected:
	void                     CreatGUIControls();
	void                     ClearAll();
	//void                     DoAddNode(const wxString &title, int imgId, FossilTreeData::FossilNodeType nodeType, const wxArrayString &files);
	int                      DoGetIconIndex(const wxString &filename);
	//FossilTreeData::FossilNodeType DoGetSelectionType(const wxArrayTreeItemIds &items);
	void                     DoGetPaths(const wxTreeItemId &parent, wxArrayString &paths);
	void                     DoLinkEditor();

protected:
	// Menu management
	void CreateFileMenu      (wxMenu *menu);
	void CreateRootMenu      (wxMenu *menu);





|




|
|








|


|




|








|













|

|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef __fossil_page__
#define __fossil_page__

/**
@file
Subclass of FossilPageBase
*/

#include "fossil_ui.h"
//#include "fossilinfo.h"
#include "fossilcommand.h"
#include "fossiltreedata.h"

class Fossil;
class wxMenu;

class FossilPageSelectionInfo {

public:
	wxArrayString            m_paths;
	FossilTreeData::FossilNodeType m_selectionType;

public:
	FossilPageSelectionInfo() : m_selectionType(FossilTreeData::FossilNodeTypeInvalid) {}
	virtual ~FossilPageSelectionInfo() {}

	void Clear() {
		m_paths.Clear();
		m_selectionType = FossilTreeData::FossilNodeTypeInvalid;
	}
};

/** Implementing FossilPageBase */
class FossilView : public FossilPageBase
{
	Fossil*         m_plugin;
	wxTreeItemId         m_modifiedItems;
	FossilCommand           m_simpleCommand;
	//FossilCommand           m_diffCommand;
	FossilPageSelectionInfo m_selectionInfo;

public:
/*
	enum {
		FossilInfo_Tag,
		FossilInfo_Branch,
		FossilInfo_Info
	};
*/

protected:
	void                     CreateGUIControls();
	void                     ClearAll();
	void                     DoAddNode(const wxString &title, int imgId, FossilTreeData::FossilNodeType nodeType, const wxArrayString &files);
	int                      DoGetIconIndex(const wxString &filename);
	FossilTreeData::FossilNodeType DoGetSelectionType(const wxArrayTreeItemIds &items);
	void                     DoGetPaths(const wxTreeItemId &parent, wxArrayString &paths);
	void                     DoLinkEditor();

protected:
	// Menu management
	void CreateFileMenu      (wxMenu *menu);
	void CreateRootMenu      (wxMenu *menu);

Added Fossil/fossilcommand.cpp.

























































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#include "fossilcommand.h"
#include "environmentconfig.h"
#include "fossil_strings.h"
#include "fossil_console.h"
#include "globals.h"
#include "fossil.h"

BEGIN_EVENT_TABLE(FossilCommand, wxEvtHandler)
EVT_COMMAND(wxID_ANY, wxEVT_PROC_DATA_READ,  FossilCommand::OnProcessOutput)
EVT_COMMAND(wxID_ANY, wxEVT_PROC_TERMINATED, FossilCommand::OnProcessTerminated)
END_EVENT_TABLE()

FossilCommand::FossilCommand(Fossil* plugin)
		: m_process(NULL)
		, m_handler(NULL)
		, m_plugin (plugin)
{
}

FossilCommand::~FossilCommand()
{
	ClearAll();
}

bool FossilCommand::Execute(const wxString &command, const wxString &workingDirectory, FossilCommandHandler *handler, Fossil *plugin)
{
	// Dont run 2 commands at the same time
	if(m_process) {
		if(handler) {
			handler->GetPlugin()->GetConsole()->AppendText(wxT("command line 30: ") + fossilANOTHER_PROCESS_RUNNING);
			delete handler;
		}
		return false;
	}

	ClearAll();

	// Wrap the command in the OS Shell
	wxString cmdShell (command);
	WrapInShell(cmdShell);


	// Apply the environment variables before executing the command
	StringMap om;
	om[wxT("LC_ALL")] = wxT("C");

	bool useOverrideMap = m_plugin->GetSettings().GetFlags() & FossilUsePosixLocale;
	EnvSetter env(m_plugin->GetManager()->GetEnv(), useOverrideMap ? &om : NULL);


	m_process = CreateAsyncProcess(this, command, workingDirectory);
	if ( !m_process ) {
		return false;
	}
	m_workingDirectory = workingDirectory.c_str();
	m_command          = command.c_str();
	m_handler          = handler;
	return true;
}

void FossilCommand::OnProcessOutput(wxCommandEvent& event)
{
	ProcessEventData *ped = (ProcessEventData*)event.GetClientData();
	if( ped ) {
		m_output.Append(ped->GetData().c_str());
		delete ped;
	}
}

void FossilCommand::OnProcessTerminated(wxCommandEvent& event)
{
	ProcessEventData *ped = (ProcessEventData*)event.GetClientData();
	if( ped ) {
		delete ped;
	}

	if (m_handler) {

		if(m_handler->TestLoginRequired(m_output)) {
			// re-issue the last command but this time with login dialog
			m_handler->GetPlugin()->GetConsole()->AppendText(wxT("Authentication failed. Retrying...\n"));
			m_handler->ProcessLoginRequired(m_workingDirectory);

		} else if(m_handler->TestVerificationFailed(m_output)) {
			m_handler->GetPlugin()->GetConsole()->AppendText(wxT("Server certificate verification failed. Retrying...\n"));
			m_handler->ProcessVerificationRequired();

		} else {
			// command ended successfully, invoke the "success" callback
			m_handler->Process(m_output);
		}

		delete m_handler;
		m_handler = NULL;
	}

	if (m_process) {
		delete m_process;
		m_process = NULL;
	}
}

void FossilCommand::ClearAll()
{
	m_workingDirectory.Clear();
	m_command.Clear();
	m_output.Clear();
}

Added Fossil/fossilcommand.h.















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef FOSSILCOMMAND_H
#define FOSSILCOMMAND_H

#include <wx/event.h> // Base class
#include "fossilcommandhandler.h"
#include "asyncprocess.h"
#include "processreaderthread.h"

class Fossil;
class FossilCommand : public wxEvtHandler
{
	IProcess *         m_process;
	wxString           m_command;
	wxString           m_workingDirectory;
	FossilCommandHandler *m_handler;
	wxString           m_output;
	Fossil*       m_plugin;

protected:

	DECLARE_EVENT_TABLE();

	// Event handlers
	void OnProcessTerminated(wxCommandEvent &event);
	void OnProcessOutput    (wxCommandEvent &event);

public:
	FossilCommand(Fossil* plugin);
	virtual ~FossilCommand();

	bool Execute(const wxString &command, const wxString &workingDirectory, FossilCommandHandler *handler, Fossil *plugin);

	void SetWorkingDirectory(const wxString& workingDirectory) {
		this->m_workingDirectory = workingDirectory;
	}

	const wxString& GetCommand() const {
		return m_command;
	}

	IProcess* GetProcess() {
		return m_process;
	}

	const wxString& GetWorkingDirectory() const {
		return m_workingDirectory;
	}

	void ClearAll();
	bool IsBusy() {
		return m_process != NULL;
	}
};

#endif // FOSSILCOMMAND_H

Added Fossil/fossilcommandhandler.h.

































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#ifndef FOSSILCOMMANDHANDLER_H
#define FOSSILCOMMANDHANDLER_H

#include <wx/string.h>
#include <wx/event.h>
#include <wx/log.h>

class Fossil;
class IManager;
class IProcess;

#define LOGIN_REQUIRES     1253
#define INTERACTIVE_MODE   1254
#define LOGIN_REQUIRES_URL 1255

class FossilCommandHandler
{
protected:
	Fossil*  m_plugin;
	int           m_commandId;
	wxEvtHandler* m_owner;

public:
	FossilCommandHandler(Fossil *plugin, int commandId, wxEvtHandler *owner)
			: m_plugin   (plugin   )
			, m_commandId(commandId)
			, m_owner    (owner    )
			{
	}

	virtual ~FossilCommandHandler() {
	}

	Fossil* GetPlugin() {
		return m_plugin;
	}

	void SetCommandId(int commandId) {
		this->m_commandId = commandId;
	}

	void SetOwner(wxEvtHandler* owner) {
		this->m_owner = owner;
	}

	int GetCommandId() const {
		return m_commandId;
	}

	wxEvtHandler* GetOwner() {
		return m_owner;
	}

	bool TestLoginRequired(const wxString &output) {

		wxString svnOutput( output );
		svnOutput.MakeLower();
		if (svnOutput.Contains(wxT("could not authenticate to server")) || svnOutput.Contains(wxT(": authorization failed"))) {
			// failed to login...
			return true;
		}
		return false;
	}

	bool TestVerificationFailed(const wxString &output) {
		wxString svnOutput( output );
		svnOutput.MakeLower();
		if (svnOutput.Contains(wxT("certificate verification failed"))) {
			// failed to login...
			return true;
		}
		return false;
	}

	// "(R)eject, accept (t)emporarily or accept (p)ermanently"
	// password for 'login' gnome keyring
	bool TestInteractiveVerification(const wxString &output) {
		wxString svnOutput( output );
		svnOutput.MakeLower();
		if (svnOutput.Contains(wxT("(r)eject, accept (t)emporarily or accept (p)ermanently")) )
		{
			// failed to login...
			return true;
		}
		return false;
	}

	/**
	 * @brief handle here process output (e.g. interactive commands that needs response)
	 * @param process the process
	 * @param output  the process output
	 */
	virtual void OnProcessOutput(IProcess *process, const wxString &output) {}

	/**
	 * @brief the svn operation failed due to login error. Retry the last command but this
	 * time, pop the login dialog
	 */
	virtual void ProcessLoginRequired(const wxString &workingDirectory) {
		if(m_commandId != wxNOT_FOUND && m_owner) {
			int eventId (m_commandId);
			wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, eventId);

			// set the command
			event.SetInt(LOGIN_REQUIRES);

			// set the working directory where the svn was invoked from
			event.SetString(workingDirectory);
			m_owner->AddPendingEvent(event);
		} else {
			if(m_commandId == wxNOT_FOUND) 
				wxLogMessage(wxT("svn: ProcessLoginRequired: passed m_commandId = wxNOT_FOUND"));
			
			else if(m_owner == NULL)
				wxLogMessage(wxT("svn: ProcessLoginRequired: passed NULL m_owner"));
		}
	}
	
	/**
	 * @brief the svn operation failed due to login error. Retry the last command but this
	 * time, pop the login dialog
	 */
	virtual void ProcessLoginRequiredForURL(const wxString &url) {
		if(m_commandId != wxNOT_FOUND && m_owner) {
			int eventId (m_commandId);
			wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, eventId);

			// set the command
			event.SetInt(LOGIN_REQUIRES_URL);

			// set the working directory where the svn was invoked from
			event.SetString(url);
			m_owner->AddPendingEvent(event);
			
		} else {
			if(m_commandId == wxNOT_FOUND) 
				wxLogMessage(wxT("svn: ProcessLoginRequired: passed m_commandId = wxNOT_FOUND"));
			
			else if(m_owner == NULL)
				wxLogMessage(wxT("svn: ProcessLoginRequired: passed NULL m_owner"));
		}
	}
	
	/**
	 * @brief the svn operation failed due to server certificate errorlogin error. Retry the last command but this
	 * time, pop the login dialog
	 */
	virtual void ProcessVerificationRequired() {
		if(m_commandId != wxNOT_FOUND && m_owner) {
			int eventId (m_commandId);
			wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, eventId);
			event.SetInt(INTERACTIVE_MODE);
			m_owner->AddPendingEvent(event);
		}
	}

	virtual void Process(const wxString &output) = 0;
};

#endif // FOSSILCOMMANDHANDLER_H

Added Fossil/fossilstatushandler.cpp.













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "fossilstatushandler.h"
#include "fossil_console.h"
#include "fossil_view.h"
#include "fossil.h"
//#include "fossilxml.h"

FossilStatusHandler::FossilStatusHandler(Fossil *plugin, int commandId, wxEvtHandler *owner)
		: FossilCommandHandler(plugin, commandId, owner)
{
}

FossilStatusHandler::~FossilStatusHandler()
{
}

void FossilStatusHandler::Process(const wxString& output)
{
	GetPlugin()->GetConsole()->AppendText(wxT("statushandler line 18: ") + output);
	wxArrayString modFiles, conflictedFiles, unversionedFiles, newFiles, deletedFiles;
	//FossilXML::GetFiles(output, modFiles, conflictedFiles, unversionedFiles, newFiles, deletedFiles);
	GetPlugin()->GetFossilView()->UpdateTree(modFiles, conflictedFiles, unversionedFiles, newFiles, deletedFiles);
}

Added Fossil/fossilstatushandler.h.





































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef FOSSILSTATUSHANDLER_H
#define FOSSILSTATUSHANDLER_H

#include "fossilcommandhandler.h" // Base class

class FossilView;
class Fossil;

class FossilStatusHandler : public FossilCommandHandler {
public:
	FossilStatusHandler(Fossil *plugin, int commandId, wxEvtHandler *owner);
	virtual ~FossilStatusHandler();

public:
	virtual void Process(const wxString &output);
};

#endif // FOSSILSTATUSHANDLER_H