# HG changeset patch # User pyon@macmini # Date 1321616772 -32400 # Node ID 3b54f3deeed9e29ab58306edbd543823a86da337 # Parent 73116df23be8d11cf92fe2c31a4bcbca2017b5aa fix undo-command. diff -r 73116df23be8 -r 3b54f3deeed9 include/myframe.h --- a/include/myframe.h Fri Nov 18 20:45:39 2011 +0900 +++ b/include/myframe.h Fri Nov 18 20:46:12 2011 +0900 @@ -1,5 +1,5 @@ // Filename : myframe.h -// Last Change: 17-Nov-2011. +// Last Change: 18-Nov-2011. // #ifndef __myframe__ diff -r 73116df23be8 -r 3b54f3deeed9 src/myframe.cpp --- a/src/myframe.cpp Fri Nov 18 20:45:39 2011 +0900 +++ b/src/myframe.cpp Fri Nov 18 20:46:12 2011 +0900 @@ -1,5 +1,5 @@ // Filename : myframe.cpp -// Last Change: 17-Nov-2011. +// Last Change: 18-Nov-2011. // #include "main.h" @@ -15,12 +15,6 @@ #define THUMB_W 160 #define THUMB_H 226 -#if defined(__WXMSW__) - #define MOVECMD wxT("move") -#else - #define MOVECMD wxT("mv") -#endif - // resources // the application icon (under Windows and OS/2 it is in resources and even @@ -260,6 +254,7 @@ END_EVENT_TABLE() // Event Handlers & Functions +/* 自動検知 ON/OFF */ void MyFrame::ToggleAutoDetect(wxCommandEvent& event) { if ( event.IsChecked() ) autodetect_mode = true; @@ -317,7 +312,6 @@ to.Append( m_comboBoxCcn->GetValue() ); // C:/20xx/20yymmdd/XXN m_textCtrlDist->SetValue( to ); - wxString ccn = m_comboBoxCcn->GetValue(); if ( to.Len() < 15 || ccn.IsEmpty() ) { wxMessageBox(wxT("フォルダを指定してください.")); @@ -348,6 +342,7 @@ wxString cmd = wxT("explorer ") + to; wxExecute( cmd ); } + /* 検知 */ void MyFrame::OnDetect(wxCommandEvent& WXUNUSED(event)) { @@ -411,10 +406,7 @@ wxRenameFile( from, to, true ); wxGetApp().WriteLog( wxT("moved : ") + file ); - wxString movecmd = MOVECMD; - from.Replace( wxT("\\"), wxT("\\\\"), true ); - to.Replace( wxT("\\"), wxT("\\\\"), true ); - m_undo.Insert( movecmd + wxT(" ") + to + wxT(" ") + from, 0 ); + m_undo.Insert( to, 0 ); } } /* 選択したファイルを削除 */ @@ -433,11 +425,9 @@ wxRenameFile( from, to, true ); wxGetApp().WriteLog( wxT("deleted : ") + file ); - wxString movecmd = MOVECMD; - from.Replace( wxT("\\"), wxT("\\\\"), true ); - to.Replace( wxT("\\"), wxT("\\\\"), true ); - m_undo.Insert( movecmd + wxT(" ") + to + wxT(" ") + from, 0 ); + m_undo.Insert( to, 0 ); } + UpdateCache(); ClearGuess(); UpdateListImage(); @@ -446,8 +436,11 @@ /* アンドゥ */ void MyFrame::OnUndo(wxCommandEvent& WXUNUSED(event)) { + wxString workdir = m_dirPickerWork->GetPath(); for ( int i=0; iEnable(false);