|
|
* Tags for wxConfig file settings, defined here to avoid duplicate | * Tags for wxConfig file settings, defined here to avoid duplicate |
* hard coded strings. | * hard coded strings. |
*/ | */ |
static const char ConfigSortColumn[] = "/FileListCtrl/SortColumn"; |
static const wxChar * ConfigSortColumn = _("/FileListCtrl/SortColumn"); |
static const char ConfigSortOrder[] = "/FileListCtrl/SortOrder"; |
static const wxChar * ConfigSortOrder = _("/FileListCtrl/SortOrder"); |
static const char ConfigColumnWidthFmt[] = "/FileListCtrl/Column%sWidth"; |
static const wxChar * ConfigColumnWidthFmt = _("/FileListCtrl/Column%sWidth"); |
static const char ConfigColumnVisibleFmt[] = "/FileListCtrl/Column%sVisible"; |
static const wxChar * ConfigColumnVisibleFmt = _("/FileListCtrl/Column%sVisible"); |
static const char ConfigWithUpdate[] = "/FileListCtrl/WithUpdate"; |
static const wxChar * ConfigWithUpdate = _("/FileListCtrl/WithUpdate"); |
static const char ConfigFlatView[] = "/FileListCtrl/FlatView"; |
static const wxChar * ConfigFlatView = _("/FileListCtrl/FlatView"); |
| |
/** | /** |
* test if the given status entry is a file or | * test if the given status entry is a file or |
|
|
} | } |
| |
// unversioned. | // unversioned. |
return wxDirExists (status->path ()); |
return wxDirExists (wxString(status->path (), wxConvLocal)); |
} | } |
| |
static const int | static const int |
|
|
static int | static int |
ComparePaths (const char * p1, const char * p2) | ComparePaths (const char * p1, const char * p2) |
{ | { |
wxFileName fn1 (p1); |
wxFileName fn1 (wxString(p1, wxConvLocal)); |
wxFileName fn2 (p2); |
wxFileName fn2 (wxString(p2, wxConvLocal)); |
| |
wxString path1 = fn1.GetPath (); | wxString path1 = fn1.GetPath (); |
wxString path2 = fn2.GetPath (); | wxString path2 = fn2.GetPath (); |
|
|
int res = 0; | int res = 0; |
| |
// Is p2 a subdir or entry of p1? | // Is p2 a subdir or entry of p1? |
if (path1.CmpNoCase (p2) == 0) |
if (path1.CmpNoCase (fn2.GetFullPath()) == 0) |
{ | { |
return -1; | return -1; |
} | } |
| |
// Is p1 a subdir or entry of p2? | // Is p1 a subdir or entry of p2? |
if (path2.CmpNoCase (p1) == 0) |
if (path2.CmpNoCase (fn1.GetFullPath()) == 0) |
{ | { |
return 1; | return 1; |
} | } |
|
|
const char * sv1 = s1 == 0 ? "" : s1; | const char * sv1 = s1 == 0 ? "" : s1; |
const char * sv2 = s2 == 0 ? "" : s2; | const char * sv2 = s2 == 0 ? "" : s2; |
| |
return wxString (sv1).CmpNoCase (sv2); |
return wxString (sv1, wxConvLocal).CmpNoCase (wxString(sv2, wxConvLocal)); |
} | } |
| |
/** | /** |
|
|
/** | /** |
* array with column captions | * array with column captions |
*/ | */ |
static const char * |
static const wxChar * |
COLUMN_CAPTIONS[FileListCtrl::COL_COUNT] = | COLUMN_CAPTIONS[FileListCtrl::COL_COUNT] = |
{ | { |
_("Name"), | _("Name"), |
|
|
Data () | Data () |
: SortIncreasing (true), SortColumn (COL_NAME), | : SortIncreasing (true), SortColumn (COL_NAME), |
DirtyColumns (true), FlatMode (false), Context (0), | DirtyColumns (true), FlatMode (false), Context (0), |
Path (""), WithUpdate (false) |
Path (_("")), WithUpdate (false) |
{ | { |
ImageListSmall = new wxImageList (16, 16, TRUE); | ImageListSmall = new wxImageList (16, 16, TRUE); |
| |
|
|
// Hide the list to speed up inserting | // Hide the list to speed up inserting |
Hide (); | Hide (); |
| |
std::string stdpath (path.c_str ()); |
std::string stdpath (path.ToAscii()); |
| |
svn::Client client (m->Context); | svn::Client client (m->Context); |
const svn::StatusEntries statusVector = | const svn::StatusEntries statusVector = |
client.status (path.c_str (), m->FlatMode, true, m->WithUpdate); |
client.status (path.ToAscii (), m->FlatMode, true, m->WithUpdate); |
svn::StatusEntries::const_iterator it; | svn::StatusEntries::const_iterator it; |
const size_t pathLength = path.Length () + 1; | const size_t pathLength = path.Length () + 1; |
| |
|
|
int i = GetItemCount (); | int i = GetItemCount (); |
| |
// truncate the first part of the path | // truncate the first part of the path |
wxString fullPath (status.path ()); |
wxString fullPath (status.path (), wxConvLocal); |
wxString filename (fullPath.Mid (pathLength)); | wxString filename (fullPath.Mid (pathLength)); |
if (filename.Length () == 0) | if (filename.Length () == 0) |
{ | { |
values[COL_NAME] = "."; |
values[COL_NAME] = _("."); |
} | } |
else | else |
{ | { |
|
|
{ | { |
// unversioned entries dont carry dir info | // unversioned entries dont carry dir info |
// with them. must find this out by ourself | // with them. must find this out by ourself |
if (wxDirExists (status.path ())) |
if (wxDirExists(wxString(status.path (), wxConvLocal) ) ) |
{ | { |
imageIndex = GetImageIndex (IMG_INDX_FOLDER, -1); | imageIndex = GetImageIndex (IMG_INDX_FOLDER, -1); |
} | } |
else if (wxFileExists (status.path ())) |
else if (wxFileExists(wxString(status.path (), wxConvLocal) )) |
{ | { |
imageIndex = GetImageIndex (svn_wc_status_unversioned, -1); | imageIndex = GetImageIndex (svn_wc_status_unversioned, -1); |
} | } |
|
|
SetItemData (i, (long)new svn::Status (status)); // The control now owns this data | SetItemData (i, (long)new svn::Status (status)); // The control now owns this data |
// and must delete it in due course. | // and must delete it in due course. |
| |
text = ""; |
text = _(""); |
| |
if (status.isVersioned ()) | if (status.isVersioned ()) |
{ | { |
const svn::Entry & entry = status.entry (); | const svn::Entry & entry = status.entry (); |
values[COL_REV].Printf ("%ld", entry.revision ()); |
values[COL_REV].Printf (_("%ld"), entry.revision ()); |
values[COL_CMT_REV].Printf ("%ld", entry.cmtRev ()); |
values[COL_CMT_REV].Printf (_("%ld"), entry.cmtRev ()); |
| |
values[COL_AUTHOR] = entry.cmtAuthor (); |
values[COL_AUTHOR] = wxString(entry.cmtAuthor (), wxConvLocal); |
| |
// date formatting | // date formatting |
values[COL_CMT_DATE] = FormatDateTime (entry.cmtDate ()); |
values[COL_CMT_DATE] = wxString(FormatDateTime (entry.cmtDate ()), wxConvLocal); |
values[COL_TEXT_TIME] = FormatDateTime (entry.textTime ()); |
values[COL_TEXT_TIME] = wxString(FormatDateTime (entry.textTime ()), wxConvLocal); |
values[COL_PROP_TIME] = FormatDateTime (entry.propTime ()); |
values[COL_PROP_TIME] = wxString(FormatDateTime (entry.propTime ()), wxConvLocal); |
|
|
values[COL_URL] = entry.url (); |
values[COL_URL] = wxString(entry.url (), wxConvLocal); |
values[COL_REPOS] = entry.repos (); |
values[COL_REPOS] = wxString(entry.repos (), wxConvLocal); |
values[COL_UUID] = entry.uuid (); |
values[COL_UUID] = wxString(entry.uuid (), wxConvLocal); |
| |
wxString schedule; | wxString schedule; |
switch (entry.schedule ()) | switch (entry.schedule ()) |
|
|
schedule = _("replace"); | schedule = _("replace"); |
break; | break; |
case svn_wc_schedule_normal: | case svn_wc_schedule_normal: |
schedule = ""; |
schedule = _(""); |
break; | break; |
} | } |
values[COL_SCHEDULE] = schedule; | values[COL_SCHEDULE] = schedule; |
| |
if (entry.isCopied ()) | if (entry.isCopied ()) |
{ | { |
values[COL_COPIED].Printf ("%s, %ld", |
values[COL_COPIED].Printf (_("%s, %ld"), |
entry.copyfromUrl (), | entry.copyfromUrl (), |
entry.copyfromRev ()); | entry.copyfromRev ()); |
} | } |
| |
values[COL_CONFLICT_OLD] = entry.conflictOld (); |
values[COL_CONFLICT_OLD] = wxString(entry.conflictOld (), wxConvLocal); |
values[COL_CONFLICT_NEW] = entry.conflictNew (); |
values[COL_CONFLICT_NEW] = wxString(entry.conflictNew (), wxConvLocal); |
values[COL_CONFLICT_WRK] = entry.conflictWrk (); |
values[COL_CONFLICT_WRK] = wxString(entry.conflictWrk (), wxConvLocal); |
values[COL_CHECKSUM] = entry.checksum (); |
values[COL_CHECKSUM] = wxString(entry.checksum (), wxConvLocal); |
} | } |
switch (status.textStatus ()) | switch (status.textStatus ()) |
{ | { |
|
|
try | try |
{ | { |
if(status != 0) | if(status != 0) |
verbList.InitFromDocument (status->path ()); |
verbList.InitFromDocument (wxString(status->path (), wxConvLocal)); |
} | } |
catch (std::exception) | catch (std::exception) |
{ | { |
|
|
wxMenuItem *pItem; | wxMenuItem *pItem; |
// TODO: Convert verb names to unicode on the fly if needed (or make | // TODO: Convert verb names to unicode on the fly if needed (or make |
// verblist follow wxWindows' unicode setting) | // verblist follow wxWindows' unicode setting) |
pItem = new wxMenuItem (&menu, ID_Verb_Min + i, verbList.GetName (i)); |
pItem = new wxMenuItem (&menu, ID_Verb_Min + i, wxString(verbList.GetName (i), wxConvLocal)); |
//pItem->SetBitmap (wxBITMAP (?)) | //pItem->SetBitmap (wxBITMAP (?)) |
menu.Append (pItem); | menu.Append (pItem); |
} | } |
|
|
Preferences prefs; | Preferences prefs; |
if (!prefs.editor.IsEmpty () || IsDir (status)) | if (!prefs.editor.IsEmpty () || IsDir (status)) |
{ | { |
const char * defaultActionVerb = _("Open"); |
const wxChar * defaultActionVerb = _("Open"); |
if (!IsDir (status)) | if (!IsDir (status)) |
{ | { |
if (svn::Url::isValid (status->path ())) | if (svn::Url::isValid (status->path ())) |
|
|
| |
while (GetColumnCount () < count) | while (GetColumnCount () < count) |
{ | { |
InsertColumn (0, ""); |
InsertColumn (0, _("")); |
} | } |
| |
// Now set the captions and widths | // Now set the captions and widths |