To prevent forgetting the last read issue and assisting
in opening the next file in series, make the file open
dialog default to the last opened file.
Tested on Ubuntu 5.10 Breezy.
--- src/ComicalFrame.cpp 23 Jan 2006 00:17:14
-0000 1.9
+++ src/ComicalFrame.cpp 26 Jan 2006 12:22:08 -0000
@@ -262,8 +262,10 @@ void
ComicalFrame::OnAbout(wxCommandEven
void ComicalFrame::OnOpen(wxCommandEvent& event)
{
wxString cwd;
+ wxString currFile;
config->Read(wxT("CWD"), &cwd);
- wxString filename = wxFileSelector(wxT("Open a
Comic Book"), cwd, wxT(""), wxT(""), wxT("Comic Books
(.cbr,.cbz,.rar,.zip)|.cbr;.CBR;.cbz;.CBZ;.rar;.RAR;.zip;.ZIP"),wxOPEN
| wxCHANGE_DIR | wxFILE_MUST_EXIST, this);
+ config->Read(wxT("CurrFile"), &currFile);
+ wxString filename = wxFileSelector(wxT("Open a
Comic Book"), cwd, currFile, wxT(""), wxT("Comic Books
(.cbr,.cbz,.rar,.zip)|.cbr;.CBR;.cbz;.CBZ;.rar;.RAR;.zip;.ZIP"),
wxOPEN | wxCHANGE_DIR | wxFILE_MUST_EXIST, this);
if (!filename.empty()) OpenFile(filename);
@@ -300,6 +302,7 @@ void
ComicalFrame::OpenFile(wxString fil
startBook();
SetTitle(wxT("Comical - " +
filename));
config->Write(wxT("CWD"),
wxPathOnly(filename));
+ config->Write(wxT("CurrFile"),
wxFileNameFromPath(filename));
} catch (ArchiveException &ae) {
clearComicBook();
wxLogError(ae.Message);
Patch to default to last opened file in file dialog
Logged In: YES
user_id=923253
I'll take a look at this.
Logged In: NO
Don't think this is really necessary since once bookmarks
are implemented this should be a non-issue. However, if this
is still wanted, it may be better to just modify the CWD
setting to append the file name on to the end of the working
directory. Then you can just strip the name of the end.