~ubuntu-branches/debian/stretch/codelite/stretch

« back to all changes in this revision

Viewing changes to .pc/10_move-helper-binaries.patch/Subversion2/subversion_view.cpp

  • Committer: Package Import Robot
  • Author(s): James Cowgill
  • Date: 2014-09-01 00:23:18 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20140901002318-wx98wxrjb2e0ifi8
Tags: 6.1.1+dfsg-1
* New upstream release.

* debian/control
  - Build depend on libhunspell-dev.
  - Re-enable SFTP support using libssh-gcrypt.
  - Recommend valgrind (for new MemChecker plugin).
* debian/copyright
  - Remove bundled version of hunspell.
* debian/patches
  - Refresh patches.
  - Patch 10_move-helper-binaries.patch rewritten due to upstream changes.
  - Add 19_remove-bundled-clang-format.patch to fix clang-format paths.
  - Add 20_Compilation-fix-for-non-precompiled-header-builds.patch from
    upstream to fix build.
* debian/*.1
  - Remove manpages in debian/ - moved to upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <wx/app.h>
2
 
#include "event_notifier.h"
3
 
#include "svn_overlay_tool.h"
4
 
#include "diff_dialog.h"
5
 
#include "file_logger.h"
6
 
#include "svn_checkout_dialog.h"
7
 
#include "subversion2_ui.h"
8
 
#include "wx_tree_traverser.h"
9
 
#include <wx/settings.h>
10
 
#include "svn_select_local_repo_dlg.h"
11
 
#include <wx/filedlg.h>
12
 
#include <wx/textdlg.h>
13
 
#include "plugin.h"
14
 
#include "svn_local_properties.h"
15
 
#include "svn_props_dialog.h"
16
 
#include "procutils.h"
17
 
#include "bitmap_loader.h"
18
 
#include "svn_login_dialog.h"
19
 
#include "svn_command_handlers.h"
20
 
#include "svn_copy_dialog.h"
21
 
#include "svn_default_command_handler.h"
22
 
#include <wx/menu.h>
23
 
#include <wx/dirdlg.h>
24
 
#include "fileextmanager.h"
25
 
#include "svnsettingsdata.h"
26
 
#include "svnstatushandler.h"
27
 
#include <wx/wupdlock.h>
28
 
#include "subversion_strings.h"
29
 
#include "subversion_view.h"
30
 
#include <wx/xrc/xmlres.h>
31
 
#include "svntreedata.h"
32
 
#include <wx/imaglist.h>
33
 
#include "imanager.h"
34
 
#include "workspace.h"
35
 
#include "subversion2.h"
36
 
#include "svn_console.h"
37
 
#include "globals.h"
38
 
#include "SvnInfoDialog.h"
39
 
#include <map>
40
 
#include "cl_command_event.h"
41
 
#include "workspacesvnsettings.h"
42
 
#include <wx/cmdline.h>
43
 
#include "dirsaver.h"
44
 
#include "clcommandlineparser.h"
45
 
#include "DiffSideBySidePanel.h"
46
 
 
47
 
BEGIN_EVENT_TABLE(SubversionView, SubversionPageBase)
48
 
    EVT_UPDATE_UI(XRCID("svn_stop"),         SubversionView::OnStopUI)
49
 
    EVT_UPDATE_UI(XRCID("clear_svn_output"), SubversionView::OnClearOuptutUI)
50
 
 
51
 
    EVT_MENU(XRCID("svn_link_editor"),             SubversionView::OnLinkEditor)
52
 
    EVT_MENU(XRCID("svn_commit"),                  SubversionView::OnCommit)
53
 
    EVT_MENU(XRCID("svn_update"),                  SubversionView::OnUpdate)
54
 
    EVT_MENU(XRCID("svn_revert"),                  SubversionView::OnRevert)
55
 
    EVT_MENU(XRCID("svn_tag"),                     SubversionView::OnTag)
56
 
    EVT_MENU(XRCID("svn_branch"),                  SubversionView::OnBranch)
57
 
    EVT_MENU(XRCID("svn_diff"),                    SubversionView::OnDiff)
58
 
    EVT_MENU(XRCID("svn_patch"),                   SubversionView::OnPatch)
59
 
    EVT_MENU(XRCID("svn_patch_dry_run"),           SubversionView::OnPatchDryRun)
60
 
    EVT_MENU(XRCID("svn_resolve"),                 SubversionView::OnResolve)
61
 
    EVT_MENU(XRCID("svn_add"),                     SubversionView::OnAdd)
62
 
    EVT_MENU(XRCID("svn_delete"),                  SubversionView::OnDelete)
63
 
    EVT_MENU(XRCID("svn_ignore_file"),             SubversionView::OnIgnoreFile)
64
 
    EVT_MENU(XRCID("svn_ignore_file_pattern"),     SubversionView::OnIgnoreFilePattern)
65
 
    EVT_MENU(XRCID("svn_blame"),                   SubversionView::OnBlame)
66
 
    EVT_MENU(XRCID("svn_checkout"),                SubversionView::OnCheckout)
67
 
    EVT_MENU(XRCID("svn_open_file"),               SubversionView::OnOpenFile)
68
 
    EVT_MENU(XRCID("svn_switch"),                  SubversionView::OnSwitch)
69
 
    EVT_MENU(XRCID("svn_properties"),              SubversionView::OnProperties)
70
 
    EVT_MENU(XRCID("svn_log"),                     SubversionView::OnLog)
71
 
    EVT_MENU(XRCID("svn_lock"),                    SubversionView::OnLock)
72
 
    EVT_MENU(XRCID("svn_unlock"),                  SubversionView::OnUnLock)
73
 
    EVT_MENU(XRCID("svn_rename"),                  SubversionView::OnRename)
74
 
    EVT_MENU(XRCID("svn_open_local_repo_browser"), SubversionView::OnChangeRootDir)
75
 
END_EVENT_TABLE()
76
 
 
77
 
static int FOLDER_IMG_ID      = wxNOT_FOUND;
78
 
static int MODIFIED_IMG_ID    = wxNOT_FOUND;
79
 
static int NEW_IMG_ID         = wxNOT_FOUND;
80
 
static int DELETED_IMG_ID     = wxNOT_FOUND;
81
 
static int CONFLICT_IMG_ID    = wxNOT_FOUND;
82
 
static int UNVERSIONED_IMG_ID = wxNOT_FOUND;
83
 
static int PROJECT_IMG_ID     = wxNOT_FOUND;
84
 
static int WORKSPACE_IMG_ID   = wxNOT_FOUND;
85
 
static int LOCKED_IMG_ID      = wxNOT_FOUND;
86
 
 
87
 
SubversionView::SubversionView( wxWindow* parent, Subversion2 *plugin )
88
 
    : SubversionPageBase( parent )
89
 
    , m_plugin          ( plugin )
90
 
    , m_simpleCommand   ( plugin )
91
 
    , m_diffCommand     ( plugin )
92
 
    , m_fileExplorerLastBaseImgIdx (-1)
93
 
{
94
 
    CreatGUIControls();
95
 
    m_themeHelper = new ThemeHandlerHelper(this);
96
 
    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_LOADED,            wxCommandEventHandler(SubversionView::OnWorkspaceLoaded),           NULL, this);
97
 
    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_CLOSED,            wxCommandEventHandler(SubversionView::OnWorkspaceClosed),           NULL, this);
98
 
    EventNotifier::Get()->Connect(wxEVT_FILE_SAVED,                  clCommandEventHandler(SubversionView::OnFileSaved),                 NULL, this);
99
 
    EventNotifier::Get()->Connect(wxEVT_PROJ_FILE_ADDED,             clCommandEventHandler(SubversionView::OnFileAdded  ),               NULL, this);
100
 
    EventNotifier::Get()->Connect(wxEVT_FILE_RENAMED,                wxCommandEventHandler(SubversionView::OnFileRenamed),               NULL, this);
101
 
    EventNotifier::Get()->Connect(wxEVT_ACTIVE_EDITOR_CHANGED,       wxCommandEventHandler(SubversionView::OnActiveEditorChanged),       NULL, this);
102
 
}
103
 
 
104
 
SubversionView::~SubversionView()
105
 
{
106
 
    wxDELETE(m_themeHelper);
107
 
    DisconnectEvents();
108
 
}
109
 
 
110
 
void SubversionView::OnChangeRootDir( wxCommandEvent& event )
111
 
{
112
 
    wxUnusedVar(event);
113
 
    wxString newPath = ::wxDirSelector(_("Choose directory"));
114
 
    if ( !newPath.IsEmpty() ) {
115
 
        DoRootDirChanged( newPath );
116
 
    }
117
 
}
118
 
 
119
 
void SubversionView::OnTreeMenu( wxTreeEvent& event )
120
 
{
121
 
    // Popup the menu
122
 
    wxArrayTreeItemIds items;
123
 
    size_t count = m_treeCtrl->GetSelections(items);
124
 
    if (count) {
125
 
        SvnTreeData::SvnNodeType type = DoGetSelectionType(items);
126
 
        if (type == SvnTreeData::SvnNodeTypeInvalid)
127
 
            // Mix or an invalid selection
128
 
            return;
129
 
 
130
 
        wxMenu menu;
131
 
        switch (type) {
132
 
        case SvnTreeData::SvnNodeTypeFile:
133
 
            CreateFileMenu( &menu );
134
 
            break;
135
 
 
136
 
        case SvnTreeData::SvnNodeTypeRoot:
137
 
            CreateRootMenu( &menu );
138
 
            break;
139
 
 
140
 
        case SvnTreeData::SvnNodeTypeAddedRoot:
141
 
        case SvnTreeData::SvnNodeTypeDeletedRoot:
142
 
        case SvnTreeData::SvnNodeTypeModifiedRoot:
143
 
        case SvnTreeData::SvnNodeTypeFolder:
144
 
            CreateSecondRootMenu( &menu );
145
 
            break;
146
 
 
147
 
        default:
148
 
            return;
149
 
        }
150
 
 
151
 
        PopupMenu( &menu );
152
 
    }
153
 
}
154
 
 
155
 
void SubversionView::CreatGUIControls()
156
 
{
157
 
    MSWSetNativeTheme(m_treeCtrl);
158
 
 
159
 
    // Assign the image list
160
 
    BitmapLoader *bmpLoader = m_plugin->GetManager()->GetStdIcons();
161
 
 
162
 
    // Prepare a default image list which contains all the mimetypes knows to FileExtManager
163
 
    wxImageList *imageList =  bmpLoader->MakeStandardMimeImageList();
164
 
 
165
 
    // Append the subversion unique icons
166
 
    FOLDER_IMG_ID      = imageList->Add(bmpLoader->LoadBitmap(wxT("mime/16/folder" ) ));
167
 
    MODIFIED_IMG_ID    = imageList->Add(bmpLoader->LoadBitmap(wxT("subversion/16/modified" ) ));
168
 
    NEW_IMG_ID         = imageList->Add(bmpLoader->LoadBitmap(wxT("subversion/16/new" ) ));
169
 
    DELETED_IMG_ID     = imageList->Add(bmpLoader->LoadBitmap(wxT("subversion/16/deleted" ) ));
170
 
    CONFLICT_IMG_ID    = imageList->Add(bmpLoader->LoadBitmap(wxT("subversion/16/conflict" ) ));
171
 
    UNVERSIONED_IMG_ID = imageList->Add(bmpLoader->LoadBitmap(wxT("subversion/16/unversioned" ) ));
172
 
    PROJECT_IMG_ID     = imageList->Add(bmpLoader->LoadBitmap(wxT("workspace/16/project") ) );
173
 
    WORKSPACE_IMG_ID   = imageList->Add(bmpLoader->LoadBitmap(wxT("workspace/16/workspace") ) );
174
 
    LOCKED_IMG_ID      = imageList->Add(bmpLoader->LoadBitmap(wxT("subversion/16/locked" ) ) );
175
 
 
176
 
    m_treeCtrl->AssignImageList( imageList );
177
 
 
178
 
    // Add toolbar
179
 
    // Create the toolbar
180
 
    BitmapLoader *bmpLdr = m_plugin->GetManager()->GetStdIcons();
181
 
    wxToolBar *tb = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_NODIVIDER);
182
 
    tb->AddTool(XRCID("svn_link_editor"), _("Link Editor"), wxXmlResource::Get()->LoadBitmap(wxT("link_editor")), _("Link Editor"), wxITEM_CHECK);
183
 
    tb->ToggleTool(XRCID("svn_link_editor"), m_plugin->GetSettings().GetFlags() & SvnLinkEditor);
184
 
    tb->AddTool(XRCID("svn_open_local_repo_browser"), _("Select a Directory to View..."), bmpLdr->LoadBitmap(wxT("toolbars/16/standard/file_open")), _("Select a Directory to View..."), wxITEM_NORMAL);
185
 
    tb->AddSeparator();
186
 
 
187
 
    tb->AddTool(XRCID("svn_stop"),         _("Stop current svn process"), bmpLdr->LoadBitmap(wxT("subversion/16/stop")),       _( "Stop current svn process" ) );
188
 
    tb->AddTool(XRCID("svn_cleanup"),      _("Svn Cleanup"),              bmpLdr->LoadBitmap(wxT("subversion/16/cleanup")),    _( "Svn Cleanup" ) );
189
 
    tb->AddSeparator();
190
 
    tb->AddTool(XRCID("svn_checkout"),     _("Svn Checkout"),             bmpLdr->LoadBitmap(wxT("subversion/16/checkout")),   _( "Svn Checkout" ) );
191
 
    tb->AddSeparator();
192
 
    tb->AddTool(XRCID("svn_refresh"),      _("Refresh View"),             bmpLdr->LoadBitmap(wxT("subversion/16/refresh")),  _( "Refresh View" ) );
193
 
    tb->AddSeparator();
194
 
    tb->AddTool(XRCID("clear_svn_output"), _("Clear Svn Output Tab"),     bmpLdr->LoadBitmap(wxT("output-pane/16/clear")),     _("Clear Svn Output Tab"), wxITEM_NORMAL);
195
 
    tb->AddTool(XRCID("svn_settings"),     _("Svn Settings..."),          bmpLdr->LoadBitmap(wxT("subversion/16/settings")),  _( "Svn Settings..." ) );
196
 
    tb->AddTool(XRCID("svn_info"),         _("Svn Info"),                 bmpLdr->LoadBitmap(wxT("subversion/16/info")),      _( "Svn Info" ) );
197
 
 
198
 
    tb->Connect(XRCID("clear_svn_output"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SubversionView::OnClearOuptut), NULL, this);
199
 
    tb->Connect(XRCID("svn_stop"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SubversionView::OnStop),        NULL, this);
200
 
    tb->Connect(XRCID("svn_cleanup"),      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SubversionView::OnCleanup),     NULL, this);
201
 
    tb->Connect(XRCID("svn_info"),         wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SubversionView::OnShowSvnInfo), NULL, this);
202
 
    tb->Connect(XRCID("svn_refresh"),      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SubversionView::OnRefreshView), NULL, this);
203
 
    tb->Connect(XRCID("svn_settings"),     wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SubversionView::OnSettings),    NULL, this);
204
 
 
205
 
    wxSizer *sz = GetSizer();
206
 
    sz->Insert(0, tb, 0, wxEXPAND);
207
 
    tb->Realize();
208
 
 
209
 
    m_subversionConsole = new SvnConsole(m_plugin->GetManager()->GetOutputPaneNotebook(), m_plugin);
210
 
    m_plugin->GetManager()->GetOutputPaneNotebook()->AddPage(m_subversionConsole, wxT("Subversion"), false, m_plugin->GetManager()->GetStdIcons()->LoadBitmap(wxT("subversion/16/svn")));
211
 
 
212
 
    DoRootDirChanged(wxGetCwd());
213
 
    BuildTree();
214
 
}
215
 
 
216
 
void SubversionView::BuildTree()
217
 
{
218
 
    BuildTree( DoGetCurRepoPath() );
219
 
}
220
 
 
221
 
void SubversionView::BuildTree(const wxString& root)
222
 
{
223
 
    if(root.IsEmpty())
224
 
        return;
225
 
 
226
 
    DoChangeRootPathUI(root);
227
 
 
228
 
    wxString command;
229
 
    command << m_plugin->GetSvnExeName() << wxT(" --no-ignore status");
230
 
    m_simpleCommand.Execute(command, root, new SvnStatusHandler(m_plugin, wxNOT_FOUND, NULL), m_plugin);
231
 
}
232
 
 
233
 
void SubversionView::BuildExplorerTree(const wxString& root)
234
 
{
235
 
    if(root.IsEmpty())
236
 
        return;
237
 
 
238
 
    wxString command;
239
 
    command << m_plugin->GetSvnExeName() << wxT(" --no-ignore status");
240
 
    m_simpleCommand.Execute(command, root, new SvnStatusHandler(m_plugin, wxNOT_FOUND, NULL, true, root), m_plugin);
241
 
}
242
 
 
243
 
 
244
 
void SubversionView::OnWorkspaceLoaded(wxCommandEvent& event)
245
 
{
246
 
    event.Skip();
247
 
 
248
 
    // Workspace changes its directory to the workspace path, update the SVN path
249
 
    wxString path = ::wxGetCwd();
250
 
    m_workspaceFile = event.GetString();
251
 
    
252
 
    WorkspaceSvnSettings conf(m_workspaceFile);
253
 
    wxString customizedRepo = conf.Load().GetRepoPath();
254
 
    if ( !customizedRepo.IsEmpty() ) {
255
 
        path.swap( customizedRepo );
256
 
    }
257
 
    
258
 
    DoRootDirChanged(path);
259
 
    BuildTree();
260
 
}
261
 
 
262
 
void SubversionView::OnWorkspaceClosed(wxCommandEvent& event)
263
 
{
264
 
    event.Skip();
265
 
    
266
 
    // Save the local svn settings
267
 
    if ( m_workspaceFile.IsOk() && m_workspaceFile.Exists() ) {
268
 
        WorkspaceSvnSettings conf(m_workspaceFile);
269
 
        conf.SetRepoPath( m_curpath );
270
 
        conf.Save();
271
 
    }
272
 
    
273
 
    m_workspaceFile.Clear();
274
 
    DoChangeRootPathUI(_("<No repository path is selected>"));
275
 
    m_plugin->GetConsole()->Clear();
276
 
}
277
 
 
278
 
void SubversionView::ClearAll()
279
 
{
280
 
    m_treeCtrl->DeleteAllItems();
281
 
}
282
 
 
283
 
void SubversionView::UpdateTree(const wxArrayString& modifiedFiles, const wxArrayString& conflictedFiles, const wxArrayString& unversionedFiles, const wxArrayString& newFiles, const wxArrayString& deletedFiles, const wxArrayString& lockedFiles, const wxArrayString& ignoreFiles, bool fileExplorerOnly, const wxString& sRootDir)
284
 
{
285
 
    wxString rootDir = sRootDir;
286
 
    if(rootDir.IsEmpty())
287
 
        rootDir = DoGetCurRepoPath();
288
 
 
289
 
    if( !fileExplorerOnly ) {
290
 
 
291
 
#ifdef __WXMSW__
292
 
        wxWindowUpdateLocker locker(m_treeCtrl);
293
 
#else
294
 
        clWindowUpdateLocker locker( m_treeCtrl );
295
 
#endif
296
 
        ClearAll();
297
 
 
298
 
        // Add root node
299
 
        wxTreeItemId root = m_treeCtrl->AddRoot(rootDir, FOLDER_IMG_ID, FOLDER_IMG_ID, new SvnTreeData(SvnTreeData::SvnNodeTypeRoot, rootDir));
300
 
 
301
 
        if(root.IsOk() == false)
302
 
            return;
303
 
 
304
 
        DoAddNode(svnMODIFIED_FILES,    MODIFIED_IMG_ID,    SvnTreeData::SvnNodeTypeModifiedRoot,    modifiedFiles);
305
 
        DoAddNode(svnADDED_FILES,       NEW_IMG_ID,         SvnTreeData::SvnNodeTypeAddedRoot,       newFiles);
306
 
        DoAddNode(svnDELETED_FILES,     DELETED_IMG_ID,     SvnTreeData::SvnNodeTypeDeletedRoot,     deletedFiles);
307
 
        DoAddNode(svnCONFLICTED_FILES,  CONFLICT_IMG_ID,    SvnTreeData::SvnNodeTypeConflictRoot,    conflictedFiles);
308
 
        DoAddNode(svnLOCKED_FILES,      LOCKED_IMG_ID,      SvnTreeData::SvnNodeTypeLockedRoot,      lockedFiles);
309
 
        DoAddNode(svnUNVERSIONED_FILES, UNVERSIONED_IMG_ID, SvnTreeData::SvnNodeTypeUnversionedRoot, unversionedFiles);
310
 
 
311
 
        if (m_treeCtrl->ItemHasChildren(root)) {
312
 
            m_treeCtrl->Expand(root);
313
 
        }
314
 
 
315
 
        DoLinkEditor();
316
 
    }
317
 
 
318
 
#ifdef __WXMSW__
319
 
    return;
320
 
#endif
321
 
 
322
 
    DoCreateFileExplorerImages();
323
 
 
324
 
#if 0
325
 
    if(m_fileExplorerLastBaseImgIdx != -1) {
326
 
        // Unified all the arrays into a single map
327
 
        SvnFileExplorerTraverser::Map_t mymap;
328
 
 
329
 
        wxTreeCtrl*   fileExplorer = m_plugin->GetManager()->GetTree(TreeFileExplorer);
330
 
        wxTreeItemId  feRootItem   = fileExplorer->GetItemByFullPath(rootDir);
331
 
 
332
 
#ifdef __WXMSW__
333
 
        wxWindowUpdateLocker locker(fileExplorer);
334
 
#else
335
 
        clWindowUpdateLocker locker(fileExplorer);
336
 
#endif
337
 
        DoAddArrayToMap(modifiedFiles,    mymap, SvnFileExplorerTraverser::Modified,    rootDir);
338
 
        DoAddArrayToMap(newFiles,         mymap, SvnFileExplorerTraverser::New,         rootDir);
339
 
        DoAddArrayToMap(deletedFiles,     mymap, SvnFileExplorerTraverser::Deleted,     rootDir);
340
 
        DoAddArrayToMap(conflictedFiles,  mymap, SvnFileExplorerTraverser::Conflicted,  rootDir);
341
 
        DoAddArrayToMap(lockedFiles,      mymap, SvnFileExplorerTraverser::Locked,      rootDir);
342
 
        DoAddArrayToMap(unversionedFiles, mymap, SvnFileExplorerTraverser::Unversioned, rootDir);
343
 
        DoAddArrayToMap(ignoreFiles,      mymap, SvnFileExplorerTraverser::Ignored,     rootDir);
344
 
 
345
 
        if (feRootItem.IsOk()) {
346
 
            CL_DEBUG(wxT("wxTreeTraverser started..."));
347
 
            SvnFileExplorerTraverser traverser(fileExplorer, mymap, m_fileExplorerLastBaseImgIdx, DoGetCurRepoPath());
348
 
            traverser.Traverse(feRootItem);
349
 
            CL_DEBUG(wxT("wxTreeTraverser started...end"));
350
 
        }
351
 
    }
352
 
#endif
353
 
 
354
 
}
355
 
 
356
 
void SubversionView::DoAddNode(const wxString& title, int imgId, SvnTreeData::SvnNodeType nodeType, const wxArrayString& files)
357
 
{
358
 
    wxTreeItemId root = m_treeCtrl->GetRootItem();
359
 
    wxString basePath = DoGetCurRepoPath();
360
 
 
361
 
    // Add the basic four root items
362
 
    if (files.IsEmpty() == false) {
363
 
 
364
 
        wxTreeItemId parent = m_treeCtrl->AppendItem(root, title, imgId, imgId, new SvnTreeData(nodeType, wxT("")));
365
 
 
366
 
        // Set the parent node with bold font
367
 
        wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
368
 
        font.SetWeight(wxFONTWEIGHT_BOLD);
369
 
        m_treeCtrl->SetItemFont(parent, font);
370
 
 
371
 
        // Add all children items
372
 
        for (size_t i=0; i<files.GetCount(); i++) {
373
 
            wxFileName filename(files.Item(i));
374
 
            wxTreeItemId folderParent = DoGetParentNode(files.Item(i), parent);
375
 
            m_treeCtrl->AppendItem(folderParent,
376
 
                                   filename.GetFullName(),
377
 
                                   DoGetIconIndex(filename.GetFullName()),
378
 
                                   DoGetIconIndex(filename.GetFullName()),
379
 
                                   new SvnTreeData(SvnTreeData::SvnNodeTypeFile, files.Item(i)));
380
 
        }
381
 
 
382
 
        if ( nodeType != SvnTreeData::SvnNodeTypeUnversionedRoot) {
383
 
            m_treeCtrl->Expand(parent);
384
 
 
385
 
            // Expand the top level children as well
386
 
            wxTreeItemIdValue cookie;
387
 
            wxTreeItemId child = m_treeCtrl->GetFirstChild(parent, cookie);
388
 
            while( child.IsOk() ) {
389
 
                if(m_treeCtrl->ItemHasChildren(child)) {
390
 
                    m_treeCtrl->Expand(child);
391
 
                }
392
 
                child = m_treeCtrl->GetNextChild(parent, cookie);
393
 
            }
394
 
 
395
 
        }
396
 
    }
397
 
}
398
 
 
399
 
int SubversionView::DoGetIconIndex(const wxString& filename)
400
 
{
401
 
    FileExtManager::Init();
402
 
    int iconIndex = m_plugin->GetManager()->GetStdIcons()->GetMimeImageId(filename);
403
 
    if(iconIndex == wxNOT_FOUND)
404
 
        iconIndex = m_plugin->GetManager()->GetStdIcons()->GetMimeImageId(wxT("file.txt")); // text file icon is the default
405
 
 
406
 
    return iconIndex;
407
 
}
408
 
 
409
 
SvnTreeData::SvnNodeType SubversionView::DoGetSelectionType(const wxArrayTreeItemIds& items)
410
 
{
411
 
    m_selectionInfo.Clear();
412
 
    SvnTreeData::SvnNodeType type(SvnTreeData::SvnNodeTypeInvalid);
413
 
    for (size_t i=0; i<items.GetCount(); i++) {
414
 
        if (items.Item(i).IsOk() == false) {
415
 
            m_selectionInfo.Clear();
416
 
            return m_selectionInfo.m_selectionType; // Invalid
417
 
        }
418
 
 
419
 
        SvnTreeData *data = (SvnTreeData *)m_treeCtrl->GetItemData(items.Item(i));
420
 
        if ( !data ) {
421
 
            m_selectionInfo.Clear();
422
 
            return m_selectionInfo.m_selectionType; // Invalid
423
 
        }
424
 
 
425
 
        if (data->GetType() == SvnTreeData::SvnNodeTypeRoot && items.GetCount() == 1) {
426
 
            // populate the list of paths with all the added paths
427
 
            DoGetPaths( items.Item(i), m_selectionInfo.m_paths );
428
 
            m_selectionInfo.m_selectionType = SvnTreeData::SvnNodeTypeRoot;
429
 
            return m_selectionInfo.m_selectionType;
430
 
        }
431
 
 
432
 
        if (data->GetType() == SvnTreeData::SvnNodeTypeAddedRoot && items.GetCount() == 1) {
433
 
            // populate the list of paths with all the added paths
434
 
            DoGetPaths( items.Item(i), m_selectionInfo.m_paths );
435
 
            m_selectionInfo.m_selectionType = SvnTreeData::SvnNodeTypeAddedRoot;
436
 
            return m_selectionInfo.m_selectionType;
437
 
        }
438
 
 
439
 
        if (data->GetType() == SvnTreeData::SvnNodeTypeDeletedRoot && items.GetCount() == 1) {
440
 
            // populate the list of paths with all the deleted paths
441
 
            DoGetPaths( items.Item(i), m_selectionInfo.m_paths );
442
 
            m_selectionInfo.m_selectionType = SvnTreeData::SvnNodeTypeDeletedRoot;
443
 
            return m_selectionInfo.m_selectionType;
444
 
        }
445
 
 
446
 
        if (data->GetType() == SvnTreeData::SvnNodeTypeConflictRoot && items.GetCount() == 1) {
447
 
            // populate the list of paths with all the conflicted paths
448
 
            DoGetPaths( items.Item(i), m_selectionInfo.m_paths );
449
 
            m_selectionInfo.m_selectionType = SvnTreeData::SvnNodeTypeConflictRoot;
450
 
            return m_selectionInfo.m_selectionType;
451
 
        }
452
 
 
453
 
        if (data->GetType() == SvnTreeData::SvnNodeTypeModifiedRoot && items.GetCount() == 1) {
454
 
            // populate the list of paths with all the conflicted paths
455
 
            DoGetPaths( items.Item(i), m_selectionInfo.m_paths );
456
 
            m_selectionInfo.m_selectionType = SvnTreeData::SvnNodeTypeModifiedRoot;
457
 
            return m_selectionInfo.m_selectionType;
458
 
        }
459
 
 
460
 
        if (data->GetType() == SvnTreeData::SvnNodeTypeFolder && items.GetCount() == 1) {
461
 
            // populate the list of paths with all the conflicted paths
462
 
            DoGetPaths( items.Item(i), m_selectionInfo.m_paths );
463
 
            m_selectionInfo.m_selectionType = SvnTreeData::SvnNodeTypeFolder;
464
 
            return m_selectionInfo.m_selectionType;
465
 
        }
466
 
 
467
 
        if (type == SvnTreeData::SvnNodeTypeInvalid &&
468
 
            (data->GetType() == SvnTreeData::SvnNodeTypeFile || data->GetType() == SvnTreeData::SvnNodeTypeRoot)) {
469
 
            type = data->GetType();
470
 
            m_selectionInfo.m_selectionType = type;
471
 
            m_selectionInfo.m_paths.Add(data->GetFilepath());
472
 
 
473
 
        } else if ( type == SvnTreeData::SvnNodeTypeInvalid ) {
474
 
            type = data->GetType();
475
 
 
476
 
        } else if (data->GetType() != type) {
477
 
            m_selectionInfo.m_paths.Clear();
478
 
            return SvnTreeData::SvnNodeTypeInvalid;
479
 
 
480
 
        } else {
481
 
            // Same type, just add the path
482
 
            m_selectionInfo.m_paths.Add(data->GetFilepath());
483
 
        }
484
 
    }
485
 
    return type;
486
 
}
487
 
 
488
 
void SubversionView::CreateSecondRootMenu(wxMenu* menu)
489
 
{
490
 
    menu->Append(XRCID("svn_commit"),  wxT("Commit"));
491
 
    menu->Append(XRCID("svn_update"),  wxT("Update"));
492
 
    menu->AppendSeparator();
493
 
    menu->Append(XRCID("svn_revert"),  wxT("Revert"));
494
 
    menu->Append(XRCID("svn_add"),     wxT("Add"));
495
 
    menu->AppendSeparator();
496
 
    menu->Append(XRCID("svn_diff"),    _("Create Diff..."));
497
 
}
498
 
 
499
 
void SubversionView::CreateFileMenu(wxMenu* menu)
500
 
{
501
 
    menu->Append(XRCID("svn_open_file"),  _("Open File..."));
502
 
    menu->AppendSeparator();
503
 
    menu->Append(XRCID("svn_commit"),  wxT("Commit"));
504
 
    menu->Append(XRCID("svn_update"),  wxT("Update"));
505
 
    menu->AppendSeparator();
506
 
    menu->Append(XRCID("svn_revert"),  wxT("Revert"));
507
 
 
508
 
    menu->AppendSeparator();
509
 
    menu->Append(XRCID("svn_lock"),    wxT("Lock"));
510
 
    menu->Append(XRCID("svn_unlock"),  wxT("Unlock"));
511
 
 
512
 
    menu->AppendSeparator();
513
 
    menu->Append(XRCID("svn_add"),     wxT("Add"));
514
 
    menu->Append(XRCID("svn_delete"),  wxT("Delete"));
515
 
    menu->Append(XRCID("svn_rename"),  wxT("Rename"));
516
 
    menu->AppendSeparator();
517
 
    menu->Append(XRCID("svn_resolve"), wxT("Resolve"));
518
 
    menu->AppendSeparator();
519
 
    menu->Append(XRCID("svn_diff"),    _("Create Diff..."));
520
 
    menu->AppendSeparator();
521
 
 
522
 
    menu->Append(XRCID("svn_blame"),    _("Blame..."));
523
 
    menu->AppendSeparator();
524
 
 
525
 
    wxMenu *subMenu;
526
 
    subMenu = new wxMenu;
527
 
    subMenu->Append(XRCID("svn_ignore_file"),         _("Ignore this file"));
528
 
    subMenu->Append(XRCID("svn_ignore_file_pattern"), _("Ignore this file pattern"));
529
 
    menu->Append(wxID_ANY, wxT("Ignore"), subMenu);
530
 
}
531
 
 
532
 
void SubversionView::CreateRootMenu(wxMenu* menu)
533
 
{
534
 
    menu->Append(XRCID("svn_commit"),        wxT("Commit"));
535
 
    menu->Append(XRCID("svn_update"),        wxT("Update"));
536
 
    menu->AppendSeparator();
537
 
 
538
 
    menu->Append(XRCID("svn_revert"),        wxT("Revert"));
539
 
    menu->AppendSeparator();
540
 
 
541
 
    menu->Append(XRCID("svn_tag"),           _("Create Tag"));
542
 
    menu->Append(XRCID("svn_branch"),        _("Create Branch"));
543
 
    menu->AppendSeparator();
544
 
 
545
 
    menu->Append(XRCID("svn_switch"),        _("Switch URL..."));
546
 
    menu->AppendSeparator();
547
 
 
548
 
    menu->Append(XRCID("svn_diff"),          _("Create Diff..."));
549
 
    menu->Append(XRCID("svn_patch"),         _("Apply Patch..."));
550
 
    menu->Append(XRCID("svn_patch_dry_run"), _("Apply Patch - Dry Run..."));
551
 
 
552
 
    menu->AppendSeparator();
553
 
    menu->Append(XRCID("svn_log"),           _("Change Log..."));
554
 
 
555
 
    menu->AppendSeparator();
556
 
    menu->Append(XRCID("svn_properties"),    _("Properties..."));
557
 
}
558
 
 
559
 
void SubversionView::DoGetPaths(const wxTreeItemId& parent, wxArrayString& paths)
560
 
{
561
 
    if ( m_treeCtrl->ItemHasChildren(parent) == false ) {
562
 
        return;
563
 
    }
564
 
 
565
 
    wxTreeItemIdValue cookie;
566
 
    wxTreeItemId item = m_treeCtrl->GetFirstChild(parent, cookie);
567
 
    while ( item.IsOk() ) {
568
 
        SvnTreeData *data = (SvnTreeData *)m_treeCtrl->GetItemData(item);
569
 
        if (data) {
570
 
 
571
 
            if (data->GetFilepath().IsEmpty() == false && data->GetType() == SvnTreeData::SvnNodeTypeFile) {
572
 
                paths.Add( data->GetFilepath() );
573
 
            }
574
 
 
575
 
            if (( data->GetType() == SvnTreeData::SvnNodeTypeAddedRoot    ||
576
 
                  data->GetType() == SvnTreeData::SvnNodeTypeModifiedRoot ||
577
 
                  data->GetType() == SvnTreeData::SvnNodeTypeDeletedRoot  ||
578
 
                  data->GetType() == SvnTreeData::SvnNodeTypeFolder)      &&
579
 
                m_treeCtrl->ItemHasChildren(item)) {
580
 
                DoGetPaths(item, paths);
581
 
            }
582
 
        }
583
 
        item = m_treeCtrl->GetNextChild(parent, cookie);
584
 
    }
585
 
}
586
 
 
587
 
////////////////////////////////////////////
588
 
// Source control command handlers
589
 
////////////////////////////////////////////
590
 
 
591
 
void SubversionView::OnUpdate(wxCommandEvent& event)
592
 
{
593
 
    wxString command;
594
 
    wxString loginString;
595
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
596
 
        return;
597
 
    }
598
 
    bool nonInteractive = m_plugin->GetNonInteractiveMode(event);
599
 
    command << m_plugin->GetSvnExeName(nonInteractive) << loginString << wxT(" update ");
600
 
 
601
 
    if (m_selectionInfo.m_selectionType != SvnTreeData::SvnNodeTypeRoot) {
602
 
        // Concatenate list of files to be updated
603
 
        for (size_t i=0; i<m_selectionInfo.m_paths.GetCount(); i++) {
604
 
            command << wxT("\"") << m_selectionInfo.m_paths.Item(i) << wxT("\" ");
605
 
        }
606
 
    }
607
 
 
608
 
    m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnUpdateHandler(m_plugin, event.GetId(), this));
609
 
}
610
 
 
611
 
void SubversionView::OnCommit(wxCommandEvent& event)
612
 
{
613
 
    m_plugin->DoCommit(m_selectionInfo.m_paths, DoGetCurRepoPath(), event);
614
 
}
615
 
 
616
 
void SubversionView::OnAdd(wxCommandEvent& event)
617
 
{
618
 
    wxString command;
619
 
    wxString loginString;
620
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
621
 
        return;
622
 
    }
623
 
 
624
 
    command << m_plugin->GetSvnExeName(false) << loginString << wxT(" add ");
625
 
 
626
 
    // Concatenate list of files to be updated
627
 
    for (size_t i=0; i<m_selectionInfo.m_paths.GetCount(); i++) {
628
 
        command << wxT("\"") << m_selectionInfo.m_paths.Item(i) << wxT("\" ");
629
 
    }
630
 
 
631
 
    m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
632
 
}
633
 
 
634
 
void SubversionView::OnRevert(wxCommandEvent& event)
635
 
{
636
 
    wxString command;
637
 
 
638
 
    // Svn revert does not require login string
639
 
    command << m_plugin->GetSvnExeName(false) << wxT(" revert --recursive ");
640
 
 
641
 
    if (m_selectionInfo.m_selectionType != SvnTreeData::SvnNodeTypeRoot) {
642
 
        // Concatenate list of files to be updated
643
 
        for (size_t i=0; i<m_selectionInfo.m_paths.GetCount(); i++) {
644
 
            command << wxT("\"") << m_selectionInfo.m_paths.Item(i) << wxT("\" ");
645
 
        }
646
 
    } else {
647
 
        command << wxT(".");
648
 
    }
649
 
    m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
650
 
}
651
 
 
652
 
void SubversionView::OnBranch(wxCommandEvent& event)
653
 
{
654
 
    wxString command;
655
 
    command << m_plugin->GetSvnExeName() << wxT("info --xml ");
656
 
 
657
 
    SvnInfo svnInfo;
658
 
    m_plugin->DoGetSvnInfoSync(svnInfo, DoGetCurRepoPath());
659
 
 
660
 
    command.Clear();
661
 
    wxString loginString;
662
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
663
 
        return;
664
 
    }
665
 
 
666
 
    // Prompt user for URLs + comment
667
 
    SvnCopyDialog dlg(m_plugin->GetManager()->GetTheApp()->GetTopWindow());
668
 
 
669
 
    dlg.SetTitle(_("Create Branch"));
670
 
    dlg.SetSourceURL(svnInfo.m_sourceUrl);
671
 
    dlg.SetTargetURL(svnInfo.m_sourceUrl);
672
 
 
673
 
    if (dlg.ShowModal() == wxID_OK) {
674
 
        command.Clear();
675
 
        // Prepare the 'copy' command
676
 
        bool nonInteractive = m_plugin->GetNonInteractiveMode(event);
677
 
        command
678
 
                << m_plugin->GetSvnExeName(nonInteractive)
679
 
                << loginString
680
 
                << wxT(" copy ")
681
 
                << dlg.GetSourceURL()
682
 
                << wxT(" ")
683
 
                << dlg.GetTargetURL()
684
 
                << wxT(" -m \"")
685
 
                << dlg.GetMessage()
686
 
                << wxT("\"");
687
 
 
688
 
        m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
689
 
    }
690
 
}
691
 
 
692
 
void SubversionView::OnTag(wxCommandEvent& event)
693
 
{
694
 
    wxString command;
695
 
    command << m_plugin->GetSvnExeName() << wxT("info --xml ");
696
 
 
697
 
    SvnInfo svnInfo;
698
 
    m_plugin->DoGetSvnInfoSync(svnInfo, DoGetCurRepoPath());
699
 
 
700
 
    // Prompt the login dialog now
701
 
    command.Clear();
702
 
    wxString loginString;
703
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
704
 
        return;
705
 
    }
706
 
 
707
 
    // Prompt user for URLs + comment
708
 
    SvnCopyDialog dlg(m_plugin->GetManager()->GetTheApp()->GetTopWindow());
709
 
 
710
 
    dlg.SetTitle(_("Create Tag"));
711
 
    dlg.SetSourceURL(svnInfo.m_sourceUrl);
712
 
    dlg.SetTargetURL(svnInfo.m_sourceUrl);
713
 
 
714
 
    if (dlg.ShowModal() == wxID_OK) {
715
 
        // Prepare the 'copy' command
716
 
        bool nonInteractive = m_plugin->GetNonInteractiveMode(event);
717
 
        command.Clear();
718
 
        command
719
 
                << m_plugin->GetSvnExeName(nonInteractive)
720
 
                << loginString
721
 
                << wxT(" copy ")
722
 
                << dlg.GetSourceURL()
723
 
                << wxT(" ")
724
 
                << dlg.GetTargetURL()
725
 
                << wxT(" -m \"")
726
 
                << dlg.GetMessage()
727
 
                << wxT("\"");
728
 
 
729
 
        m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
730
 
    }
731
 
}
732
 
 
733
 
void SubversionView::OnDelete(wxCommandEvent& event)
734
 
{
735
 
    wxString command;
736
 
    wxString loginString;
737
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
738
 
        return;
739
 
    }
740
 
    bool nonInteractive = m_plugin->GetNonInteractiveMode(event);
741
 
    command << m_plugin->GetSvnExeName(nonInteractive) << loginString << wxT(" --force delete ");
742
 
 
743
 
    // Concatenate list of files to be updated
744
 
    for (size_t i=0; i<m_selectionInfo.m_paths.GetCount(); i++) {
745
 
        command << wxT("\"") << m_selectionInfo.m_paths.Item(i) << wxT("\" ");
746
 
    }
747
 
 
748
 
    m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
749
 
}
750
 
 
751
 
void SubversionView::OnResolve(wxCommandEvent& event)
752
 
{
753
 
    wxString command;
754
 
    wxString loginString;
755
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
756
 
        return;
757
 
    }
758
 
 
759
 
    command << m_plugin->GetSvnExeName(false) << loginString << wxT(" resolved ");
760
 
 
761
 
    // Concatenate list of files to be updated
762
 
    for (size_t i=0; i<m_selectionInfo.m_paths.GetCount(); i++) {
763
 
        command << wxT("\"") << m_selectionInfo.m_paths.Item(i) << wxT("\" ");
764
 
    }
765
 
 
766
 
    m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
767
 
}
768
 
 
769
 
void SubversionView::OnDiff(wxCommandEvent& event)
770
 
{
771
 
    wxString loginString;
772
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
773
 
        return;
774
 
    }
775
 
 
776
 
    bool nonInteractive = m_plugin->GetNonInteractiveMode(event);
777
 
 
778
 
    DiffDialog dlg(this, m_plugin->GetManager());
779
 
    if(dlg.ShowModal() == wxID_OK) {
780
 
        wxString from = dlg.GetFromRevision();
781
 
        wxString to   = dlg.GetToRevision();
782
 
 
783
 
        if(to.IsEmpty() == false) {
784
 
            to.Prepend(wxT(":"));
785
 
        }
786
 
 
787
 
        // Simple diff
788
 
        wxString diff_cmd;
789
 
        diff_cmd << m_plugin->GetSvnExeNameNoConfigDir(nonInteractive) << loginString;
790
 
        
791
 
        SvnSettingsData ssd = m_plugin->GetSettings();
792
 
        if ( ssd.GetFlags() & SvnUseExternalDiff ) {
793
 
            diff_cmd << " --diff-cmd=\"" << ssd.GetExternalDiffViewer() << "\" ";
794
 
        }
795
 
        diff_cmd << " diff ";
796
 
        
797
 
        if ( dlg.IgnoreWhitespaces() && !(ssd.GetFlags() & SvnUseExternalDiff) ) {
798
 
            diff_cmd << " -x -w ";
799
 
        }
800
 
        
801
 
        diff_cmd << " -r " << from << to << " ";
802
 
        
803
 
        for (size_t i=0; i<m_selectionInfo.m_paths.GetCount(); i++) {
804
 
            diff_cmd << wxT("\"") << m_selectionInfo.m_paths.Item(i) << wxT("\" ");
805
 
        }
806
 
        m_plugin->GetConsole()->Execute(diff_cmd, DoGetCurRepoPath(), new SvnDiffHandler(m_plugin, event.GetId(), this), false);
807
 
    }
808
 
}
809
 
 
810
 
void SubversionView::OnPatch(wxCommandEvent& event)
811
 
{
812
 
    m_plugin->Patch(false, DoGetCurRepoPath(), this, event.GetId());
813
 
}
814
 
 
815
 
void SubversionView::OnPatchDryRun(wxCommandEvent& event)
816
 
{
817
 
    m_plugin->Patch(true, DoGetCurRepoPath(), this, event.GetId());
818
 
}
819
 
 
820
 
void SubversionView::OnCleanup(wxCommandEvent& event)
821
 
{
822
 
    wxUnusedVar(event);
823
 
    wxString command;
824
 
    command << m_plugin->GetSvnExeName(false) << wxT(" cleanup ");
825
 
    m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, wxNOT_FOUND, NULL));
826
 
}
827
 
 
828
 
void SubversionView::OnStop(wxCommandEvent& event)
829
 
{
830
 
    wxUnusedVar(event);
831
 
    m_plugin->GetConsole()->Stop();
832
 
}
833
 
 
834
 
void SubversionView::OnClearOuptut(wxCommandEvent& event)
835
 
{
836
 
    wxUnusedVar(event);
837
 
    m_plugin->GetConsole()->Clear();
838
 
}
839
 
 
840
 
void SubversionView::OnRefreshView(wxCommandEvent& event)
841
 
{
842
 
    event.Skip();
843
 
    BuildTree();
844
 
}
845
 
 
846
 
void SubversionView::OnFileAdded(clCommandEvent& event)
847
 
{
848
 
    event.Skip();
849
 
    
850
 
    typedef std::map<wxString, bool> StringBoolMap_t;
851
 
    StringBoolMap_t path_in_svn;
852
 
    
853
 
    // svn is setup ?
854
 
    int flags = event.GetInt();
855
 
    if ( flags & kEventImportingFolder )
856
 
        return;
857
 
    
858
 
    SvnSettingsData ssd = m_plugin->GetSettings();
859
 
    if(ssd.GetFlags() & SvnAddFileToSvn) {
860
 
        const wxArrayString &files = event.GetStrings();
861
 
        bool     addToSvn(false);
862
 
        wxString command;
863
 
        command << m_plugin->GetSvnExeName() << wxT(" add ");
864
 
        for(size_t i=0; i<files.GetCount(); i++) {
865
 
            
866
 
            wxString currentFilePath = files.Item(i).BeforeLast(wxFILE_SEP_PATH);
867
 
            bool curPathUnderSvn = false;
868
 
            if ( path_in_svn.count( currentFilePath ) ) {
869
 
                // use the cached result
870
 
                curPathUnderSvn = path_in_svn.find(currentFilePath)->second;
871
 
                
872
 
            } else {
873
 
                // query svn and cache the result for future use
874
 
                curPathUnderSvn = m_plugin->IsPathUnderSvn( currentFilePath );
875
 
                path_in_svn.insert( std::make_pair(currentFilePath, curPathUnderSvn ) );
876
 
            }
877
 
            
878
 
            if (curPathUnderSvn) {
879
 
                command << wxT("\"") << files.Item(i) << wxT("\" ");
880
 
                addToSvn = true;
881
 
            }
882
 
        }
883
 
 
884
 
        if(addToSvn) {
885
 
            command.RemoveLast();
886
 
            m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
887
 
        }
888
 
 
889
 
    }
890
 
}
891
 
 
892
 
void SubversionView::OnFileRenamed(wxCommandEvent& event)
893
 
{
894
 
    wxArrayString *files = (wxArrayString*)event.GetClientData();
895
 
 
896
 
    // If the Svn Client Version is set to 0.0 it means that we dont have SVN client installed
897
 
    if( m_plugin->GetSvnClientVersion() && files && (m_plugin->GetSettings().GetFlags() & SvnRenameFileInRepo) ) {
898
 
        wxString oldName = files->Item(0);
899
 
        wxString newName = files->Item(1);
900
 
 
901
 
        if(m_plugin->IsPathUnderSvn( wxFileName(oldName).GetPath() ) == false) {
902
 
            event.Skip();
903
 
            return;
904
 
        }
905
 
 
906
 
        wxString command;
907
 
        command << m_plugin->GetSvnExeName() << wxT(" rename \"") << oldName << wxT("\" \"") << newName << wxT("\"");
908
 
        m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
909
 
 
910
 
    } else
911
 
        event.Skip();
912
 
}
913
 
 
914
 
void SubversionView::OnShowSvnInfo(wxCommandEvent& event)
915
 
{
916
 
    wxUnusedVar(event);
917
 
 
918
 
    SvnInfo svnInfo;
919
 
    m_plugin->DoGetSvnInfoSync(svnInfo, DoGetCurRepoPath());
920
 
 
921
 
    SvnInfoDialog dlg(m_plugin->GetManager()->GetTheApp()->GetTopWindow());
922
 
    dlg.GetTextCtrlAuthor()->SetValue( svnInfo.m_author );
923
 
    dlg.GetTextCtrlDate()->SetValue( svnInfo.m_date );
924
 
    dlg.GetTextCtrlRevision()->SetValue( svnInfo.m_revision );
925
 
    dlg.GetTextCtrlRootURL()->SetValue( svnInfo.m_url );
926
 
    dlg.GetTextCtrlURL()->SetValue( svnInfo.m_sourceUrl );
927
 
    dlg.ShowModal();
928
 
}
929
 
 
930
 
void SubversionView::OnItemActivated(wxTreeEvent& event)
931
 
{
932
 
    wxTreeItemId item = m_treeCtrl->GetFocusedItem();
933
 
    CHECK_ITEM_RET(item);
934
 
    
935
 
    SvnTreeData *data = (SvnTreeData *)m_treeCtrl->GetItemData(item);
936
 
    if (!data || data->GetType() != SvnTreeData::SvnNodeTypeFile) {
937
 
        event.Skip();
938
 
        return;
939
 
    }
940
 
    
941
 
    wxString loginString;
942
 
    if(m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString) == false) {
943
 
        return;
944
 
    }
945
 
    
946
 
    bool nonInteractive = m_plugin->GetNonInteractiveMode(event);
947
 
 
948
 
    // Simple diff
949
 
    wxString command;
950
 
    
951
 
    // By default use ignore-whitespaces
952
 
    command << m_plugin->GetSvnExeNameNoConfigDir(nonInteractive) << loginString;
953
 
    
954
 
    SvnSettingsData ssd = m_plugin->GetSettings();
955
 
    if ( ssd.GetFlags() & SvnUseExternalDiff ) {
956
 
        
957
 
        // Using external diff viewer
958
 
        command << " diff \"" << data->GetFilepath() << "\" --diff-cmd=\"" << ssd.GetExternalDiffViewer() << "\"";
959
 
        m_plugin->GetConsole()->Execute(command, DoGetCurRepoPath(), new SvnDiffHandler(m_plugin, event.GetId(), this), false);
960
 
        
961
 
    } else {
962
 
        
963
 
        // Use the internal diff viewer
964
 
        // --diff-cmd will execute external tool like this:
965
 
        // -u -L "php-plugin/XDebugManager.cpp  (revision 447)" -L "php-plugin/XDebugManager.cpp        (working copy)" C:\src\codelite\codelitephp\.svn\pristine\ae\ae25b80b53f432c6124c455ef815679df6ed4ea4.svn-base C:\src\codelite\codelitephp\php-plugin\XDebugManager.cpp 
966
 
        command << " diff \"" << data->GetFilepath() << "\" --diff-cmd=";
967
 
        // We dont have proper echo on windows that can be used here, so 
968
 
        // we provide our own batch script wrapper
969
 
        wxFileName echoTool(wxStandardPaths::Get().GetExecutablePath());
970
 
        echoTool.SetFullName("codelite-echo");
971
 
#ifdef __WXMSW__
972
 
        echoTool.SetExt("exe");
973
 
#endif
974
 
        command << "\"" << echoTool.GetFullPath() << "\"";
975
 
        
976
 
        wxArrayString lines;
977
 
        {
978
 
            DirSaver ds;
979
 
            ::wxSetWorkingDirectory( DoGetCurRepoPath() );
980
 
            ProcUtils::SafeExecuteCommand(command, lines);
981
 
        }
982
 
        if ( lines.GetCount() < 3 ) {
983
 
            return;
984
 
        }
985
 
        
986
 
        clCommandLineParser parser(lines.Item(2));
987
 
        wxArrayString tokens = parser.ToArray();
988
 
        if ( tokens.GetCount() < 2 )
989
 
            return;
990
 
 
991
 
        wxString rightFile = tokens.Last();
992
 
        tokens.RemoveAt(tokens.GetCount()-1);
993
 
        wxString leftFile = tokens.Last();
994
 
        
995
 
        // get the left file title
996
 
        wxString title_left, title_right;
997
 
        title_right = _("Working copy");
998
 
        title_left  = _("HEAD version");
999
 
        
1000
 
        DiffSideBySidePanel *diffPanel = new DiffSideBySidePanel( EventNotifier::Get()->TopFrame());
1001
 
        DiffSideBySidePanel::FileInfo l(leftFile, title_left, true);
1002
 
        DiffSideBySidePanel::FileInfo r(rightFile, title_right, false);
1003
 
        diffPanel->SetFilesDetails(l, r);
1004
 
        diffPanel->Diff();
1005
 
        diffPanel->SetOriginSourceControl();
1006
 
        m_plugin->GetManager()->AddPage( diffPanel, _("Svn Diff: ") + wxFileName(data->GetFilepath()).GetFullName(), wxNullBitmap, true);
1007
 
    }
1008
 
}
1009
 
 
1010
 
void SubversionView::OnStopUI(wxUpdateUIEvent& event)
1011
 
{
1012
 
    event.Enable(m_plugin->GetConsole()->IsRunning());
1013
 
}
1014
 
 
1015
 
void SubversionView::OnClearOuptutUI(wxUpdateUIEvent& event)
1016
 
{
1017
 
    event.Enable(m_plugin->GetConsole()->IsEmpty() == false);
1018
 
}
1019
 
 
1020
 
void SubversionView::OnCheckout(wxCommandEvent& event)
1021
 
{
1022
 
    wxString loginString;
1023
 
    if(!m_plugin->LoginIfNeeded(event, DoGetCurRepoPath(), loginString))
1024
 
        return;
1025
 
 
1026
 
    wxString command;
1027
 
    bool nonInteractive = m_plugin->GetNonInteractiveMode(event);
1028
 
 
1029
 
    SvnCheckoutDialog dlg(m_plugin->GetManager()->GetTheApp()->GetTopWindow(), m_plugin);
1030
 
    if(dlg.ShowModal() == wxID_OK) {
1031
 
        command << m_plugin->GetSvnExeName(nonInteractive) << loginString << wxT(" co ") << dlg.GetURL() << wxT(" \"") << dlg.GetTargetDir() << wxT("\"");
1032
 
        m_plugin->GetConsole()->ExecuteURL(command, dlg.GetURL(), new SvnCheckoutHandler(m_plugin, event.GetId(), this), true);
1033
 
    }
1034
 
}
1035
 
 
1036
 
void SubversionView::OnIgnoreFile(wxCommandEvent& event)
1037
 
{
1038
 
    wxUnusedVar(event);
1039
 
    m_plugin->IgnoreFiles(m_selectionInfo.m_paths, false);
1040
 
}
1041
 
 
1042
 
void SubversionView::OnIgnoreFilePattern(wxCommandEvent& event)
1043
 
{
1044
 
    wxUnusedVar(event);
1045
 
    m_plugin->IgnoreFiles(m_selectionInfo.m_paths, true);
1046
 
}
1047
 
 
1048
 
void SubversionView::OnSettings(wxCommandEvent& event)
1049
 
{
1050
 
    wxUnusedVar(event);
1051
 
    m_plugin->EditSettings();
1052
 
}
1053
 
 
1054
 
void SubversionView::OnBlame(wxCommandEvent& event)
1055
 
{
1056
 
    m_plugin->Blame(event, m_selectionInfo.m_paths);
1057
 
}
1058
 
 
1059
 
void SubversionView::OnLinkEditor(wxCommandEvent& event)
1060
 
{
1061
 
    SvnSettingsData ssd = m_plugin->GetSettings();
1062
 
    if(event.IsChecked())
1063
 
        ssd.SetFlags(ssd.GetFlags() | SvnLinkEditor);
1064
 
    else
1065
 
        ssd.SetFlags(ssd.GetFlags() & ~SvnLinkEditor);
1066
 
 
1067
 
    m_plugin->SetSettings(ssd);
1068
 
 
1069
 
    DoLinkEditor();
1070
 
}
1071
 
 
1072
 
void SubversionView::DoLinkEditor()
1073
 
{
1074
 
    if(!(m_plugin->GetSettings().GetFlags() & SvnLinkEditor))
1075
 
        return;
1076
 
 
1077
 
    IEditor *editor = m_plugin->GetManager()->GetActiveEditor();
1078
 
    if(!editor)
1079
 
        return;
1080
 
 
1081
 
    wxString fullPath = editor->GetFileName().GetFullPath();
1082
 
    wxTreeItemId root = m_treeCtrl->GetRootItem();
1083
 
    if(root.IsOk() == false)
1084
 
        return;
1085
 
 
1086
 
    wxString basePath = DoGetCurRepoPath();
1087
 
    wxTreeItemIdValue cookie;
1088
 
    wxTreeItemIdValue childCookie;
1089
 
    wxTreeItemId parent = m_treeCtrl->GetFirstChild(root, cookie);
1090
 
    while(parent.IsOk()) {
1091
 
        // Loop over the main nodes 'modified', 'unversioned' etc
1092
 
        if(m_treeCtrl->ItemHasChildren(parent)) {
1093
 
            // Loop over the files under the main nodes
1094
 
            wxTreeItemId child = m_treeCtrl->GetFirstChild(parent, childCookie);
1095
 
            while(child.IsOk()) {
1096
 
                wxTreeItemId match = DoFindFile(child, basePath, fullPath);
1097
 
                if(match.IsOk()) {
1098
 
                    m_treeCtrl->UnselectAll();
1099
 
                    m_treeCtrl->SelectItem(match);
1100
 
                    m_treeCtrl->EnsureVisible(match);
1101
 
                    return;
1102
 
                }
1103
 
                child = m_treeCtrl->GetNextChild(parent, childCookie);
1104
 
            }
1105
 
        }
1106
 
        parent = m_treeCtrl->GetNextChild(root, cookie);
1107
 
    }
1108
 
}
1109
 
 
1110
 
void SubversionView::OnActiveEditorChanged(wxCommandEvent& event)
1111
 
{
1112
 
    event.Skip();
1113
 
    DoLinkEditor();
1114
 
}
1115
 
 
1116
 
void SubversionView::DisconnectEvents()
1117
 
{
1118
 
    EventNotifier::Get()->Disconnect(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(SubversionView::OnWorkspaceLoaded),          NULL, this);
1119
 
    EventNotifier::Get()->Disconnect(wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(SubversionView::OnWorkspaceClosed),          NULL, this);
1120
 
    EventNotifier::Get()->Disconnect(wxEVT_FILE_SAVED,       clCommandEventHandler(SubversionView::OnFileSaved),                NULL, this);
1121
 
    EventNotifier::Get()->Disconnect(wxEVT_PROJ_FILE_ADDED,  clCommandEventHandler(SubversionView::OnFileAdded),                NULL, this);
1122
 
    EventNotifier::Get()->Disconnect(wxEVT_FILE_RENAMED,     wxCommandEventHandler(SubversionView::OnFileRenamed),              NULL, this);
1123
 
    EventNotifier::Get()->Disconnect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(SubversionView::OnActiveEditorChanged), NULL, this);
1124
 
}
1125
 
 
1126
 
void SubversionView::OnOpenFile(wxCommandEvent& event)
1127
 
{
1128
 
    wxUnusedVar(event);
1129
 
 
1130
 
    wxArrayTreeItemIds items;
1131
 
    wxArrayString      paths;
1132
 
    size_t count = m_treeCtrl->GetSelections(items);
1133
 
    for(size_t i=0; i<count; i++) {
1134
 
        wxTreeItemId item = items.Item(i);
1135
 
 
1136
 
        if(item.IsOk() == false)
1137
 
            continue;
1138
 
 
1139
 
        SvnTreeData *data = (SvnTreeData *)m_treeCtrl->GetItemData(item);
1140
 
        if (data && data->GetType() == SvnTreeData::SvnNodeTypeFile) {
1141
 
            paths.Add(DoGetCurRepoPath() + wxFileName::GetPathSeparator() + data->GetFilepath());
1142
 
        }
1143
 
    }
1144
 
 
1145
 
    for(size_t i=0; i<paths.GetCount(); i++) {
1146
 
 
1147
 
        if(wxFileName(paths.Item(i)).IsDir() == false)
1148
 
            m_plugin->GetManager()->OpenFile(paths.Item(i));
1149
 
 
1150
 
    }
1151
 
}
1152
 
 
1153
 
void SubversionView::OnSwitch(wxCommandEvent& event)
1154
 
{
1155
 
    SvnInfo svnInfo;
1156
 
    m_plugin->DoGetSvnInfoSync(svnInfo, DoGetCurRepoPath());
1157
 
    m_plugin->DoSwitchURL(DoGetCurRepoPath(), svnInfo.m_sourceUrl, event);
1158
 
}
1159
 
 
1160
 
void SubversionView::OnProperties(wxCommandEvent& event)
1161
 
{
1162
 
    SvnInfo svnInfo;
1163
 
    m_plugin->DoGetSvnInfoSync(svnInfo, DoGetCurRepoPath());
1164
 
 
1165
 
    SvnPropsDlg dlg(m_plugin->GetManager()->GetTheApp()->GetTopWindow(), svnInfo.m_sourceUrl, m_plugin);
1166
 
    if(dlg.ShowModal() == wxID_OK) {
1167
 
        SubversionLocalProperties props(svnInfo.m_sourceUrl);
1168
 
        props.WriteProperty(SubversionLocalProperties::BUG_TRACKER_MESSAGE, dlg.GetBugMsg());
1169
 
        props.WriteProperty(SubversionLocalProperties::BUG_TRACKER_URL,     dlg.GetBugTrackerURL());
1170
 
        props.WriteProperty(SubversionLocalProperties::FR_TRACKER_MESSAGE,  dlg.GetFRMsg());
1171
 
        props.WriteProperty(SubversionLocalProperties::FR_TRACKER_URL,      dlg.GetFRTrackerURL());
1172
 
    }
1173
 
}
1174
 
 
1175
 
void SubversionView::OnLog(wxCommandEvent& event)
1176
 
{
1177
 
    m_plugin->ChangeLog(DoGetCurRepoPath(), DoGetCurRepoPath(), event);
1178
 
}
1179
 
 
1180
 
void SubversionView::OnLock(wxCommandEvent& event)
1181
 
{
1182
 
    wxArrayString files;
1183
 
    for(size_t i=0; i<m_selectionInfo.m_paths.size(); i++) {
1184
 
        wxFileName fn(DoGetCurRepoPath() + wxFileName::GetPathSeparator() + m_selectionInfo.m_paths.Item(i));
1185
 
        files.Add( fn.GetFullPath() );
1186
 
    }
1187
 
    m_plugin->DoLockFile(DoGetCurRepoPath(), files, event, true);
1188
 
}
1189
 
 
1190
 
void SubversionView::OnUnLock(wxCommandEvent& event)
1191
 
{
1192
 
    wxArrayString files;
1193
 
    for(size_t i=0; i<m_selectionInfo.m_paths.size(); i++) {
1194
 
        wxFileName fn(DoGetCurRepoPath() + wxFileName::GetPathSeparator() + m_selectionInfo.m_paths.Item(i));
1195
 
        files.Add( fn.GetFullPath() );
1196
 
    }
1197
 
    m_plugin->DoLockFile(DoGetCurRepoPath(), files, event, false);
1198
 
}
1199
 
 
1200
 
void SubversionView::DoChangeRootPathUI(const wxString& path)
1201
 
{
1202
 
    if(path == _("<No repository path is selected>")) {
1203
 
        ClearAll();
1204
 
    }
1205
 
    m_curpath = path;
1206
 
}
1207
 
 
1208
 
void SubversionView::DoRootDirChanged(const wxString& path)
1209
 
{
1210
 
    if(path == _("<No repository path is selected>")) {
1211
 
        DoChangeRootPathUI(path);
1212
 
 
1213
 
    } else {
1214
 
 
1215
 
        // If a workspace is opened, set this new path to the workspace
1216
 
        SvnSettingsData ssd = m_plugin->GetSettings();
1217
 
 
1218
 
        const wxArrayString &repos = ssd.GetRepos();
1219
 
        wxArrayString modDirs = repos;
1220
 
        if(modDirs.Index(path) == wxNOT_FOUND) {
1221
 
            modDirs.Add(path);
1222
 
        }
1223
 
 
1224
 
        ssd.SetRepos(modDirs);
1225
 
        m_plugin->SetSettings(ssd);
1226
 
 
1227
 
        if(m_plugin->GetManager()->IsWorkspaceOpen()) {
1228
 
            LocalWorkspaceST::Get()->SetCustomData(wxT("SubversionPath"), path);
1229
 
            LocalWorkspaceST::Get()->Flush();
1230
 
        }
1231
 
        DoChangeRootPathUI(path);
1232
 
        BuildTree();
1233
 
    }
1234
 
}
1235
 
 
1236
 
wxTreeItemId SubversionView::DoGetParentNode(const wxString& filename, const wxTreeItemId& parent)
1237
 
{
1238
 
    wxFileName fn(filename);
1239
 
    wxTreeItemId actualParentNode = parent;
1240
 
    wxArrayString dirs = fn.GetDirs();
1241
 
    wxString curpath;
1242
 
    for(size_t i=0; i<dirs.GetCount(); i++) {
1243
 
        // add or get the parent for this node
1244
 
        curpath << dirs.Item(i) << wxT("/");
1245
 
        actualParentNode = DoFindChild(actualParentNode, dirs.Item(i), curpath);
1246
 
    }
1247
 
    return actualParentNode;
1248
 
}
1249
 
 
1250
 
wxTreeItemId SubversionView::DoFindChild(const wxTreeItemId& parent, const wxString& name, const wxString &curpath)
1251
 
{
1252
 
    wxTreeItemIdValue cookie;
1253
 
    wxTreeItemId child = m_treeCtrl->GetFirstChild(parent, cookie);
1254
 
    while( child.IsOk() ) {
1255
 
        if(m_treeCtrl->GetItemText(child) == name) {
1256
 
            return child;
1257
 
        }
1258
 
        child = m_treeCtrl->GetNextChild(parent, cookie);
1259
 
    }
1260
 
    // if we reached here, we did not find a tree node for this name
1261
 
    return m_treeCtrl->AppendItem(parent, // parent node
1262
 
                                  name,   // text
1263
 
                                  FOLDER_IMG_ID,      // folder icon
1264
 
                                  FOLDER_IMG_ID,
1265
 
                                  new SvnTreeData(SvnTreeData::SvnNodeTypeFolder, curpath));
1266
 
}
1267
 
 
1268
 
void SubversionView::OnRename(wxCommandEvent& event)
1269
 
{
1270
 
    wxArrayString files;
1271
 
    for(size_t i=0; i<m_selectionInfo.m_paths.size(); i++) {
1272
 
        wxFileName oldname(DoGetCurRepoPath() + wxFileName::GetPathSeparator() + m_selectionInfo.m_paths.Item(i));
1273
 
        wxString newname = wxGetTextFromUser(_("New name:"), _("Svn rename..."), oldname.GetFullName());
1274
 
 
1275
 
        if(newname.IsEmpty() || newname == oldname.GetFullName())
1276
 
            continue;
1277
 
 
1278
 
        m_plugin->DoRename(DoGetCurRepoPath(), oldname.GetFullName(), newname, event);
1279
 
    }
1280
 
}
1281
 
 
1282
 
wxString SubversionView::DoGetCurRepoPath() const
1283
 
{
1284
 
    return m_curpath;
1285
 
}
1286
 
 
1287
 
wxTreeItemId SubversionView::DoFindFile(const wxTreeItemId& parent, const wxString &basepath, const wxString& fullpath)
1288
 
{
1289
 
    if(parent.IsOk() == false) {
1290
 
        return wxTreeItemId();
1291
 
    }
1292
 
 
1293
 
    SvnTreeData* data = static_cast<SvnTreeData*>(m_treeCtrl->GetItemData(parent));
1294
 
    if(data && data->GetType() == SvnTreeData::SvnNodeTypeFile) {
1295
 
        wxFileName fn(data->GetFilepath());
1296
 
        fn.MakeAbsolute(basepath);
1297
 
        if(fn.GetFullPath() == fullpath) {
1298
 
            return parent;
1299
 
        }
1300
 
    }
1301
 
 
1302
 
    if(m_treeCtrl->ItemHasChildren(parent)) {
1303
 
        wxTreeItemIdValue cookie;
1304
 
        wxTreeItemId child = m_treeCtrl->GetFirstChild(parent, cookie);
1305
 
        while(child.IsOk()) {
1306
 
            wxTreeItemId fileId = DoFindFile(child, basepath, fullpath);
1307
 
            if(fileId.IsOk()) {
1308
 
                return fileId;
1309
 
            }
1310
 
            child = m_treeCtrl->GetNextChild(parent, cookie);
1311
 
        }
1312
 
    }
1313
 
    return wxTreeItemId();
1314
 
}
1315
 
 
1316
 
void SubversionView::DoCreateFileExplorerImages()
1317
 
{
1318
 
    // Create new bitmaps for the FileExplorer tree
1319
 
    // The idea here is to add them in the order of the enum of the appearanced in the enum:
1320
 
    //
1321
 
    // enum {
1322
 
    //     Modified,
1323
 
    //     Locked,
1324
 
    //     Unversioned,
1325
 
    //     Conflicted,
1326
 
    //     Deleted,
1327
 
    //     New,
1328
 
    //     Ok
1329
 
    // };
1330
 
#if 0
1331
 
    if(m_fileExplorerLastBaseImgIdx == -1) {
1332
 
        wxTreeCtrl* fe = m_plugin->GetManager()->GetTree(TreeFileExplorer);
1333
 
        const std::vector<wxBitmap>& images  = fe->GetImages();
1334
 
        wxImageList *il = fe->GetImageList();
1335
 
 
1336
 
        if(!images.empty() && il) {
1337
 
            int baseImagesCount = images.size();
1338
 
            m_fileExplorerLastBaseImgIdx = baseImagesCount;
1339
 
            int idx;
1340
 
            for(int i=0; i<baseImagesCount; i++) {
1341
 
                idx = il->Add(SvnOverlayTool::Get().OKIcon(images.at(i)));
1342
 
            }
1343
 
 
1344
 
            for(int i=0; i<baseImagesCount; i++) {
1345
 
                idx = il->Add(SvnOverlayTool::Get().ModifiedIcon(images.at(i)));
1346
 
            }
1347
 
 
1348
 
            for(int i=0; i<baseImagesCount; i++) {
1349
 
                idx = il->Add(SvnOverlayTool::Get().LockedIcon(images.at(i)));
1350
 
            }
1351
 
 
1352
 
            for(int i=0; i<baseImagesCount; i++) {
1353
 
                idx = il->Add(SvnOverlayTool::Get().UnversionedIcon(images.at(i)));
1354
 
            }
1355
 
 
1356
 
            for(int i=0; i<baseImagesCount; i++) {
1357
 
                idx = il->Add(SvnOverlayTool::Get().ConflictIcon(images.at(i)));
1358
 
            }
1359
 
 
1360
 
            for(int i=0; i<baseImagesCount; i++) {
1361
 
                idx = il->Add(SvnOverlayTool::Get().DeletedIcon(images.at(i)));
1362
 
            }
1363
 
 
1364
 
            for(int i=0; i<baseImagesCount; i++) {
1365
 
                idx = il->Add(SvnOverlayTool::Get().NewIcon(images.at(i)));
1366
 
            }
1367
 
            wxUnusedVar(idx);
1368
 
        }
1369
 
 
1370
 
        //int newCount = il->GetImageCount();
1371
 
        //wxPrintf(wxT("%d\n"), newCount);
1372
 
    }
1373
 
#endif
1374
 
}
1375
 
 
1376
 
void SubversionView::OnFileSaved(clCommandEvent& event)
1377
 
{
1378
 
    event.Skip();
1379
 
    OnRefreshView( event );
1380
 
}