Check-in [b88342d24d]

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

Overview
Comment:Now showing file tree by using 'fossil ls' callback
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b88342d24d940f08f629ec96d52b57a4dbb48f07
User & Date: isafam 2014-01-19 22:19:55
Context
2014-01-21
23:27
Added dir folders in file tree .. implemented file add & rename check-in: 766bccfdb4 user: isafam tags: trunk
2014-01-19
22:19
Now showing file tree by using 'fossil ls' callback check-in: b88342d24d user: isafam tags: trunk
2014-01-18
23:29
Simplified settings dialog & saving of working dir in workspace check-in: 82c55878e7 user: isafam tags: trunk
Changes

Changes to Fossil/fossil_view.cpp.

198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
...
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
void FossilView::BuildTree(const wxString& root)
{
	if(root.IsEmpty())
		return;

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

wxXmlNode* FossilView::GetFosNode(Workspace *workspace)
{
	LocalOptionsConfig conf;
	wxXmlNode *fosnode;
................................................................................
}

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

void FossilView::UpdateTree(const wxArrayString& modifiedFiles, const wxArrayString& conflictedFiles, const wxArrayString& unversionedFiles, const wxArrayString& newFiles, const wxArrayString& deletedFiles)
{

	wxWindowUpdateLocker locker( m_treeCtrl );
	ClearAll();

	// Add root node
	wxString rootDir = m_textCtrlRootDir->GetValue();
	wxTreeItemId root = m_treeCtrl->AddRoot(rootDir, 0, 0, new FossilTreeData(FossilTreeData::FossilNodeTypeRoot, rootDir));

	if(root.IsOk() == false)
		return;

	DoAddNode(fossilMODIFIED_FILES,    1, FossilTreeData::FossilNodeTypeModifiedRoot,    modifiedFiles);
	DoAddNode(fossilADDED_FILES,       2, FossilTreeData::FossilNodeTypeAddedRoot,       newFiles);
	DoAddNode(fossilDELETED_FILES,     3, FossilTreeData::FossilNodeTypeDeletedRoot,     deletedFiles);
	DoAddNode(fossilCONFLICTED_FILES,  4, FossilTreeData::FossilNodeTypeConflictRoot,    conflictedFiles);
	DoAddNode(fossilUNVERSIONED_FILES, 5, FossilTreeData::FossilNodeTypeUnversionedRoot, unversionedFiles);

	if (m_treeCtrl->ItemHasChildren(root)) {
		m_treeCtrl->Expand(root);
	}
	DoLinkEditor();
}








|







 







|












|
<
<
<
<







198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
...
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272




273
274
275
276
277
278
279
void FossilView::BuildTree(const wxString& root)
{
	if(root.IsEmpty())
		return;

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

wxXmlNode* FossilView::GetFosNode(Workspace *workspace)
{
	LocalOptionsConfig conf;
	wxXmlNode *fosnode;
................................................................................
}

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

void FossilView::UpdateTree(const wxArrayString& theFiles)
{

	wxWindowUpdateLocker locker( m_treeCtrl );
	ClearAll();

	// Add root node
	wxString rootDir = m_textCtrlRootDir->GetValue();
	wxTreeItemId root = m_treeCtrl->AddRoot(rootDir, 0, 0, new FossilTreeData(FossilTreeData::FossilNodeTypeRoot, rootDir));

	if(root.IsOk() == false)
		return;

	DoAddNode(fossilMODIFIED_FILES, 6, FossilTreeData::FossilNodeTypeModifiedRoot, theFiles);





	if (m_treeCtrl->ItemHasChildren(root)) {
		m_treeCtrl->Expand(root);
	}
	DoLinkEditor();
}

Changes to Fossil/fossil_view.h.

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

public:
	/** Constructor */
	FossilView( wxWindow* parent, Fossil *plugin);
	virtual ~FossilView();

	void     DisconnectEvents();
	void     UpdateTree(const wxArrayString& modifiedFiles, const wxArrayString &conflictedFiles, const wxArrayString &unversionedFiles, const wxArrayString& newFiles, const wxArrayString& deletedFiles);
	void     BuildTree();
	void     BuildTree(const wxString &root);
	wxXmlNode* GetFosNode(Workspace *workspace);
	wxString GetRootDir() const {return m_textCtrlRootDir->GetValue();}
};

#endif // __fossil_page__







|







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

public:
	/** Constructor */
	FossilView( wxWindow* parent, Fossil *plugin);
	virtual ~FossilView();

	void     DisconnectEvents();
	void     UpdateTree(const wxArrayString& theFiles);
	void     BuildTree();
	void     BuildTree(const wxString &root);
	wxXmlNode* GetFosNode(Workspace *workspace);
	wxString GetRootDir() const {return m_textCtrlRootDir->GetValue();}
};

#endif // __fossil_page__

Changes to 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);
}




|













<
>
|
>
>
>
>
>
>
|

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
#include "fossilstatushandler.h"
#include "fossil_console.h"
#include "fossil_view.h"
#include "fossil.h"
#include <wx/tokenzr.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 theFiles;
	wxStringTokenizer tkz(output);
	while ( tkz.HasMoreTokens() )
	{
		wxString str = tkz.GetNextToken();
		theFiles.Add(str);
	}
	GetPlugin()->GetFossilView()->UpdateTree(theFiles);
}