From e1f86eb036a5b8721008bbc7cdac3e0b11cd1521 Mon Sep 17 00:00:00 2001 From: sirakaba Date: Fri, 23 Oct 2009 12:32:25 +0000 Subject: [PATCH] =?utf8?q?=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0?= =?utf8?q?=E3=81=A7=E6=9C=80=E5=BE=8C=E3=81=AB=E9=96=8B=E3=81=84=E3=81=A6?= =?utf8?q?=E3=81=84=E3=81=9F=E3=83=91=E3=82=B9=E3=82=92=E3=80=81=E3=83=80?= =?utf8?q?=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=82=92=E9=96=89=E3=81=98?= =?utf8?q?=E3=82=8B=E3=81=9F=E3=81=B3=E3=81=AB=E8=A8=AD=E5=AE=9A=E3=83=95?= =?utf8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E6=9B=B8=E3=81=8D=E8=BE=BC?= =?utf8?q?=E3=82=80=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4=E3=80=82=20?= =?utf8?q?=E6=A0=BC=E7=B4=8D=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?utf8?q?=E9=96=8B=E3=81=8F=E9=9A=9B=E3=81=AB=E3=83=95=E3=82=A1=E3=82=A4?= =?utf8?q?=E3=83=AB=E3=81=AE=E7=A8=AE=E9=A1=9E=E3=82=92=E5=8F=96=E5=BE=97?= =?utf8?q?=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AB?= =?utf8?q?=E3=80=81=E7=89=B9=E5=AE=9A=E3=81=AE=E6=8B=A1=E5=BC=B5=E5=AD=90?= =?utf8?q?=E3=81=A8=E3=81=BF=E3=81=AA=E3=81=99DefaultExt=E3=82=92=E8=A8=AD?= =?utf8?q?=E5=AE=9A=E3=81=AB=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@75 9df91469-1e22-0410-86e7-ea8537beb833 --- src/frontend/frm_main.cpp | 21 +++--- src/frontend/frm_main.h | 167 +++++++++++++++++++++++----------------------- 2 files changed, 93 insertions(+), 95 deletions(-) diff --git a/src/frontend/frm_main.cpp b/src/frontend/frm_main.cpp index f15745e..c312427 100644 --- a/src/frontend/frm_main.cpp +++ b/src/frontend/frm_main.cpp @@ -66,7 +66,6 @@ MainFrame::~MainFrame() this->conf.Write(wxT("Window-Y"), b); } this->conf.Write(wxT("Splitter-Pos"), this->window_splitter->GetSashPosition()); - this->conf.Write(wxT("LastOpenPath"), this->fnLastOpenPath.GetFullPath()); // ƒc[ƒ‹ƒo[/ƒXƒe[ƒ^ƒXƒo[ŠÖ˜AB this->conf.Write(wxT("StatusBar-Show"), this->statusbar->IsShown()); @@ -144,7 +143,6 @@ void MainFrame::OnInit(wxInitDialogEvent&) // Ý’è‚ð“ǂݍž‚݁B this->SetSize(this->conf.Read(wxT("Window-X"), 0l), this->conf.Read(wxT("Window-Y"), 0l), this->conf.Read(wxT("Window-Width"), 800), this->conf.Read(wxT("Window-Height"), 400)); - this->fnLastOpenPath = wxFileName::DirName(this->conf.Read(wxT("LastOpenPath"), ::wxGetCwd())); wxTheMimeTypesManager->Initialize(wxMAILCAP_ALL); // ‰Šú’lÝ’èB @@ -237,7 +235,7 @@ void MainFrame::OnArcCreate(wxCommandEvent& e) if (e.GetClientData() == NULL) { // ˆ—‘Ώۂ̃tƒ@ƒCƒ‹‚ð‘I‘ðB - wxFileDialog fd(this, wxT("Choose files to compress"), this->fnLastOpenPath.GetFullPath()); + wxFileDialog fd(this, wxT("Choose files to compress"), this->conf.Read(wxT("LastOpenPath"), ::wxGetCwd())); fd.SetWindowStyleFlag(wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE); if (fd.ShowModal() == wxID_CANCEL) { @@ -245,8 +243,8 @@ void MainFrame::OnArcCreate(wxCommandEvent& e) } // ‚±‚±‚ÅwxFileName::FileName‚ð—p‚¢‚Ä‚¢‚é‚̂́AŒã‚ŃfƒBƒŒƒNƒgƒŠ–¼‚ð•K—v‚Æ‚·‚éê‡‚ª‚ ‚邽‚߁B // ‚ ‚Ü‚è‚æ‚¢Žd—l‚Å‚Í‚È‚¢‚ª“®‚­‚Ì‚Å‚Æ‚è‚ ‚¦‚¸•ú’uB - this->fnLastOpenPath = wxFileName::FileName(fd.GetDirectory()); - swInfo.fnDestinationDirectory = wxFileName::DirName(this->fnLastOpenPath.GetFullPath()); + swInfo.fnDestinationDirectory = wxFileName::DirName(fd.GetDirectory()); + this->conf.Write(wxT("LastOpenPath"), fd.GetDirectory()); this->statusbar->SetStatusText(swInfo.fnDestinationDirectory.GetFullPath(), 4); fd.GetFilenames(mkDlg.files); @@ -355,13 +353,13 @@ void MainFrame::OnArcOpen(wxCommandEvent& e) if (szFileName.IsEmpty()) { wxFileDialog fd(this); - fd.SetDirectory(this->fnLastOpenPath.GetFullPath()); + fd.SetDirectory(this->conf.Read(wxT("LastOpenPath"), ::wxGetCwd())); fd.SetWindowStyleFlag(wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (fd.ShowModal() == wxID_CANCEL) { return; } - this->fnLastOpenPath = wxFileName::DirName(fd.GetDirectory()); + this->conf.Write(wxT("LastOpenPath"), fd.GetDirectory()); szFileName = fd.GetPath(); } this->OnArcClose(e); @@ -553,13 +551,14 @@ void MainFrame::OnArcAdd(wxCommandEvent& e) { // ˆ—‘Ώۂ̃tƒ@ƒCƒ‹‚ð‘I‘ðB wxArrayString files; - wxFileDialog fd(this, wxT("Choose files to add"), this->fnLastOpenPath.GetFullPath()); + wxFileDialog fd(this, wxT("Choose files to add"), this->conf.Read(wxT("LastOpenPath"), ::wxGetCwd())); fd.SetWindowStyleFlag(wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE); if (fd.ShowModal() == wxID_CANCEL) { return; } fd.GetFilenames(files); + this->conf.Write(wxT("LastOpenPath"), fd.GetDirectory()); // ŠeŽíÝ’èB TPI_SWITCHES swInfo; @@ -593,7 +592,7 @@ void MainFrame::OnArcConvert(wxCommandEvent& e) return; } swInfo.fnDestinationDirectory = wxFileName::DirName(fd.GetDirectory()); - this->fnLastOpenPath = swInfo.fnDestinationDirectory; + this->conf.Write(wxT("LastOpenPath"), fd.GetDirectory()); wxArrayString files; files.Add(fd.GetPath()); @@ -630,8 +629,8 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) ftFile = wxTheMimeTypesManager->GetFileTypeFromExtension(wxFileName::FileName(mkDlg.files[0]).GetExt()); if (! ftFile) { - // Ží—Þ‚ªŽæ“¾‚Å‚«‚È‚¢‚Æ‚«‚̓eƒLƒXƒg‚Æ‚Ý‚È‚·B - ftFile = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("txt")); + // Ží—Þ‚ªŽæ“¾‚Å‚«‚È‚¢‚Æ‚«‚͐ݒè‚ð“ǂݍž‚ށB‰ŠúÝ’è‚ł̓eƒLƒXƒg‚Æ‚Ý‚È‚·B + ftFile = wxTheMimeTypesManager->GetFileTypeFromExtension(this->conf.Read(wxT("DefaultExt"), wxT("txt"))); if (! ftFile) { ::ErrDlg(wxT("Unable to get the file type!"), this); diff --git a/src/frontend/frm_main.h b/src/frontend/frm_main.h index 72cbd31..d107019 100644 --- a/src/frontend/frm_main.h +++ b/src/frontend/frm_main.h @@ -1,85 +1,84 @@ -/******************************************************************************* - TPI - flexible but useless plug-in framework. - Copyright (C) 2002-2009 Silky - - This library is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation; either version 2.1 of the License, or (at your option) - any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License along - with this library; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - $Id: frm_main.h,v 1.10 2009/08/30 09:28:27 sirakaba Exp $ -*******************************************************************************/ - -#include -#include +/******************************************************************************* + TPI - flexible but useless plug-in framework. + Copyright (C) 2002-2009 Silky + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + for more details. + + You should have received a copy of the GNU Lesser General Public License along + with this library; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + $Id: frm_main.h,v 1.10 2009/08/30 09:28:27 sirakaba Exp $ +*******************************************************************************/ + +#include +#include #include - -#ifndef H_LOADED_FRM_MAIN -#define H_LOADED_FRM_MAIN - -class MainFrame: public wxFrame { -public: - wxStatusBar* statusbar; - wxTreeCtrl* tree_ctrl; - myListCtrl* list_ctrl; - ArrayTPI_FILEINFO fileinfo; - TPIHandle tpi; - wxString szCurrentPath; - wxFileName fnLastOpenPath; - wxCmdLineParser cmdLine; - - // Event handler. - void OnInit( wxInitDialogEvent&); - - void OnExit( wxCommandEvent&); - void OnArcCreate( wxCommandEvent&); - void OnArcOpen( wxCommandEvent&); - void OnArcClose( wxCommandEvent&); - void OnArcAdd( wxCommandEvent&); - void OnArcConvert( wxCommandEvent&); - - void OnArcExtract( wxCommandEvent&); - void OnArcDelete( wxCommandEvent&); - void OnArcTest( wxCommandEvent&); - void OnArcRepair( wxCommandEvent&); - - void OnViewMode(wxCommandEvent&); - - void OnShowToolBar( wxCommandEvent&); - void OnShowStatusBar(wxCommandEvent&); - - void OnSelectAll(wxCommandEvent&); - - void OnTreeChanged(wxTreeEvent&); - void OnTreeBeginDrag(wxTreeEvent&); - - void OnListItemDClick(wxListEvent&); - void OnListBeginDrag( wxListEvent&); - - void OnFilter(wxCommandEvent&); - - int LoadTPI(wxString &); - int ErrorCheck(int); - - MainFrame(); - ~MainFrame(); - -protected: - wxMenuBar* menubar; - wxToolBar* toolbar; - wxSplitterWindow* window_splitter; - wxTextCtrl * tcFilter; - wxFileConfig conf; - DECLARE_EVENT_TABLE() -}; - -#endif + +#ifndef H_LOADED_FRM_MAIN +#define H_LOADED_FRM_MAIN + +class MainFrame: public wxFrame { +public: + wxStatusBar* statusbar; + wxTreeCtrl* tree_ctrl; + myListCtrl* list_ctrl; + ArrayTPI_FILEINFO fileinfo; + TPIHandle tpi; + wxString szCurrentPath; + wxCmdLineParser cmdLine; + + // Event handler. + void OnInit( wxInitDialogEvent&); + + void OnExit( wxCommandEvent&); + void OnArcCreate( wxCommandEvent&); + void OnArcOpen( wxCommandEvent&); + void OnArcClose( wxCommandEvent&); + void OnArcAdd( wxCommandEvent&); + void OnArcConvert( wxCommandEvent&); + + void OnArcExtract( wxCommandEvent&); + void OnArcDelete( wxCommandEvent&); + void OnArcTest( wxCommandEvent&); + void OnArcRepair( wxCommandEvent&); + + void OnViewMode(wxCommandEvent&); + + void OnShowToolBar( wxCommandEvent&); + void OnShowStatusBar(wxCommandEvent&); + + void OnSelectAll(wxCommandEvent&); + + void OnTreeChanged(wxTreeEvent&); + void OnTreeBeginDrag(wxTreeEvent&); + + void OnListItemDClick(wxListEvent&); + void OnListBeginDrag( wxListEvent&); + + void OnFilter(wxCommandEvent&); + + int LoadTPI(wxString &); + int ErrorCheck(int); + + MainFrame(); + ~MainFrame(); + +protected: + wxMenuBar* menubar; + wxToolBar* toolbar; + wxSplitterWindow* window_splitter; + wxTextCtrl * tcFilter; + wxFileConfig conf; + DECLARE_EVENT_TABLE() +}; + +#endif -- 2.11.0