L3 Disk Explorer is an application in order to access to files in a floppy disk image for retro computer and operating system.
Revision | 0c45a39c48b7baca9d95f2f2a40e53b6d121834d (tree) |
---|---|
Time | 2022-04-21 19:39:17 |
Author | Sasaji <sasaji@s-sa...> |
Commiter | Sasaji |
Version 0.1.1 Release
@@ -3,7 +3,7 @@ | ||
3 | 3 | # |
4 | 4 | CC=g++ |
5 | 5 | |
6 | -APPLICATION_VERSION=0.1.0 | |
6 | +APPLICATION_VERSION=0.1.1 | |
7 | 7 | |
8 | 8 | CDEFS= |
9 | 9 | DBG_CDEFS=-D_DEBUG -D_DEBUG_LOG |
@@ -2,6 +2,11 @@ | ||
2 | 2 | 更新履歴 |
3 | 3 | ============================================================================== |
4 | 4 | |
5 | +2016-01-27 Version 0.1.1 | |
6 | +・単密度のディスクイメージから倍密度へドラッグ&ドロップすると拡張子が不明に | |
7 | + なることがある不具合を修正。 | |
8 | +・ファイル追加する際、ディレクトリエントリを初期化していなかった不具合を修正。 | |
9 | + | |
5 | 10 | 2015-11-21 Version 0.1.0 |
6 | 11 | ・新規作成。 |
7 | 12 |
@@ -1,9 +1,9 @@ | ||
1 | 1 | ============================================================================== |
2 | 2 | L3 Disk Explorer |
3 | - Version 0.1 | |
4 | - 2015/11/21 | |
3 | + Version 0.1.1 | |
4 | + 2016/01/27 | |
5 | 5 | |
6 | - Copyright(C) Sasaji 2015 All Rights Reserved. | |
6 | + Copyright(C) Sasaji 2015-2016 All Rights Reserved. | |
7 | 7 | ============================================================================== |
8 | 8 | |
9 | 9 | ● はじめに |
@@ -588,6 +588,13 @@ void DiskBasicDirItem::SetFileNameAndAttr(const wxString &filename, int file_typ | ||
588 | 588 | } |
589 | 589 | } |
590 | 590 | |
591 | +void DiskBasicDirItem::ClearFileNameAndAttr() | |
592 | +{ | |
593 | + if (data) { | |
594 | + memset(data, 0, sizeof(directory_t)); | |
595 | + } | |
596 | +} | |
597 | + | |
591 | 598 | int DiskBasicDirItem::GetFileType() |
592 | 599 | { |
593 | 600 | return (data->type <= 2 ? data->type : 0); |
@@ -694,7 +701,7 @@ bool DiskBasicDirItem::ConvFromNativeNameWithExtension(int format_type, int file | ||
694 | 701 | gCharCodes.ConvToString(src, 8, dst); |
695 | 702 | dst.Trim(true); |
696 | 703 | if (format_type != 0) { |
697 | - if (ext && ext[0] != 0x00 && ext[0] != 0x20) { | |
704 | + if (ext && ext[0] != 0x00 && ext[0] != 0x20 && ext[0] != 0xff) { | |
698 | 705 | dst += wxT("."); |
699 | 706 | gCharCodes.ConvToString(ext, 3, dst); |
700 | 707 | dst.Trim(true); |
@@ -1370,6 +1377,7 @@ bool DiskBasic::SaveFile(DiskBasicDirItem *item, wxInputStream *istream, const w | ||
1370 | 1377 | } |
1371 | 1378 | |
1372 | 1379 | // ファイル名属性を設定 |
1380 | + item->ClearFileNameAndAttr(); | |
1373 | 1381 | item->SetFileNameAndAttr(filename, file_type, data_type); |
1374 | 1382 | |
1375 | 1383 | int sizeremain = (int)istream->GetLength(); |
@@ -245,6 +245,7 @@ public: | ||
245 | 245 | |
246 | 246 | void SetFileName(const wxString &filename); |
247 | 247 | void SetFileNameAndAttr(const wxString &filename, int file_type, int data_type); |
248 | + void ClearFileNameAndAttr(); | |
248 | 249 | int GetFileType(); |
249 | 250 | int GetDataType(); |
250 | 251 | wxString GetFileNameStr(); |
@@ -31,8 +31,8 @@ void Params::AddRecentFile(const wxString &val) | ||
31 | 31 | // 追加 |
32 | 32 | mRecentFiles.Insert(fpath.GetFullPath(), 0); |
33 | 33 | // 10を超える分は消す |
34 | - if (mRecentFiles.Count() > 10) { | |
35 | - mRecentFiles.RemoveAt(10); | |
34 | + if (mRecentFiles.Count() > MAX_RECENT_FILES) { | |
35 | + mRecentFiles.RemoveAt(MAX_RECENT_FILES); | |
36 | 36 | } |
37 | 37 | } |
38 | 38 |
@@ -70,7 +70,7 @@ void Config::Load() | ||
70 | 70 | ,wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH | wxCONFIG_USE_NO_ESCAPE_CHARACTERS); |
71 | 71 | |
72 | 72 | ini->Read(_T("Path"), &mFilePath, mFilePath); |
73 | - for(size_t i=0; i<10; i++) { | |
73 | + for(int i=0; i<MAX_RECENT_FILES; i++) { | |
74 | 74 | wxString sval; |
75 | 75 | ini->Read(wxString::Format(_T("Recent%d"), i), &sval); |
76 | 76 | if (!sval.IsEmpty()) { |
@@ -95,7 +95,7 @@ void Config::Save() | ||
95 | 95 | ,wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH | wxCONFIG_USE_NO_ESCAPE_CHARACTERS); |
96 | 96 | |
97 | 97 | ini->Write(_T("Path"), mFilePath); |
98 | - for(size_t i=0,row=0; row<10 && i<mRecentFiles.Count(); i++) { | |
98 | + for(int i=0,row=0; row<MAX_RECENT_FILES && i<(int)mRecentFiles.Count(); i++) { | |
99 | 99 | wxString sval = mRecentFiles.Item(i); |
100 | 100 | if (sval.IsEmpty()) continue; |
101 | 101 | ini->Write(wxString::Format(_T("Recent%d"), row), sval); |
@@ -8,6 +8,8 @@ | ||
8 | 8 | #include "common.h" |
9 | 9 | #include <wx/wx.h> |
10 | 10 | |
11 | +#define MAX_RECENT_FILES 10 | |
12 | + | |
11 | 13 | /// 設定ファイルパラメータ |
12 | 14 | class Params |
13 | 15 | { |
@@ -116,6 +116,9 @@ L3DiskList::L3DiskList(L3DiskFrame *parentframe, wxWindow *parentwindow) | ||
116 | 116 | menuPopup->AppendSeparator(); |
117 | 117 | menuPopup->Append(IDM_PROPERTY_DISK, _("Disk &Information")); |
118 | 118 | |
119 | + // key | |
120 | + Bind(wxEVT_CHAR, &L3DiskList::OnChar, this); | |
121 | + | |
119 | 122 | ClearFileName(); |
120 | 123 | } |
121 | 124 |
@@ -231,6 +234,19 @@ void L3DiskList::OnPropertyDisk(wxCommandEvent& event) | ||
231 | 234 | ShowDiskAttr(); |
232 | 235 | } |
233 | 236 | |
237 | +/// キー入力 | |
238 | +void L3DiskList::OnChar(wxKeyEvent& event) | |
239 | +{ | |
240 | + switch(event.GetKeyCode()) { | |
241 | + case WXK_RETURN: | |
242 | + ShowDiskAttr(); | |
243 | + break; | |
244 | + case WXK_DELETE: | |
245 | + DeleteDisk(); | |
246 | + break; | |
247 | + } | |
248 | +} | |
249 | + | |
234 | 250 | /// ポップアップメニュー表示 |
235 | 251 | void L3DiskList::ShowPopupMenu() |
236 | 252 | { |
@@ -91,6 +91,8 @@ public: | ||
91 | 91 | void OnFormatDisk(wxCommandEvent& event); |
92 | 92 | |
93 | 93 | void OnPropertyDisk(wxCommandEvent& event); |
94 | + | |
95 | + void OnChar(wxKeyEvent& event); | |
94 | 96 | //@} |
95 | 97 | /// @name functions |
96 | 98 | //@{ |
@@ -75,6 +75,7 @@ wxEND_EVENT_TABLE() | ||
75 | 75 | L3DiskFileList::L3DiskFileList(L3DiskFrame *parentframe, wxWindow *parentwindow) |
76 | 76 | : wxPanel(parentwindow, wxID_ANY, wxDefaultPosition, wxDefaultSize) |
77 | 77 | { |
78 | + initialized = false; | |
78 | 79 | parent = parentwindow; |
79 | 80 | frame = parentframe; |
80 | 81 |
@@ -122,6 +123,9 @@ L3DiskFileList::L3DiskFileList(L3DiskFrame *parentframe, wxWindow *parentwindow) | ||
122 | 123 | menuPopup->AppendSeparator(); |
123 | 124 | menuPopup->Append(IDM_PROPERTY, _("&Property")); |
124 | 125 | |
126 | + // key | |
127 | + list->Bind(wxEVT_CHAR, &L3DiskFileList::OnChar, this); | |
128 | + | |
125 | 129 | #if 0 |
126 | 130 | UINT fno = 0; |
127 | 131 | char fname[257]; |
@@ -132,6 +136,8 @@ L3DiskFileList::L3DiskFileList(L3DiskFrame *parentframe, wxWindow *parentwindow) | ||
132 | 136 | } while(fno != 0); |
133 | 137 | ::CloseClipboard(); |
134 | 138 | #endif |
139 | + | |
140 | + initialized = true; | |
135 | 141 | } |
136 | 142 | |
137 | 143 | L3DiskFileList::~L3DiskFileList() |
@@ -152,6 +158,8 @@ void L3DiskFileList::OnSize(wxSizeEvent& event) | ||
152 | 158 | /// 選択 |
153 | 159 | void L3DiskFileList::OnSelectionChanged(wxDataViewEvent& event) |
154 | 160 | { |
161 | + if (!initialized) return; | |
162 | + | |
155 | 163 | if (GetSelectedRow() == wxNOT_FOUND) { |
156 | 164 | // 非選択 |
157 | 165 | UnselectItem(); |
@@ -236,6 +244,19 @@ void L3DiskFileList::OnProperty(wxCommandEvent& event) | ||
236 | 244 | ShowFileAttr(); |
237 | 245 | } |
238 | 246 | |
247 | +/// キー押下 | |
248 | +void L3DiskFileList::OnChar(wxKeyEvent& event) | |
249 | +{ | |
250 | + switch(event.GetKeyCode()) { | |
251 | + case WXK_RETURN: | |
252 | + ShowFileAttr(); | |
253 | + break; | |
254 | + case WXK_DELETE: | |
255 | + DeleteDataFile(); | |
256 | + break; | |
257 | + } | |
258 | +} | |
259 | + | |
239 | 260 | /// ポップアップメニュー表示 |
240 | 261 | void L3DiskFileList::ShowPopupMenu() |
241 | 262 | { |
@@ -305,7 +326,7 @@ void L3DiskFileList::RefreshFiles() | ||
305 | 326 | lval = dir->Item(i).GetGroupSize(); |
306 | 327 | data.push_back( lval >= 0 ? wxNumberFormatter::ToString(lval) : wxT("---") ); // 使用グループ数 |
307 | 328 | lval = dir->Item(i).GetStartGroup(); |
308 | - data.push_back( wxString::Format(wxT("%02x"), lval)); // 開始グループ | |
329 | + data.push_back( wxString::Format(wxT("%02x"), (int)lval)); // 開始グループ | |
309 | 330 | |
310 | 331 | int track_num = -1; |
311 | 332 | int side_num = -1; |
@@ -57,6 +57,8 @@ private: | ||
57 | 57 | // BASICフォーマットの情報 |
58 | 58 | DiskBasic basic; |
59 | 59 | |
60 | + bool initialized; | |
61 | + | |
60 | 62 | int ShowIntNameBoxAndCheckSameFile(IntNameBox &dlg); |
61 | 63 | |
62 | 64 | public: |
@@ -77,6 +79,7 @@ public: | ||
77 | 79 | void OnDeleteFile(wxCommandEvent& event); |
78 | 80 | void OnRenameFile(wxCommandEvent& event); |
79 | 81 | void OnProperty(wxCommandEvent& event); |
82 | + void OnChar(wxKeyEvent& event); | |
80 | 83 | //@} |
81 | 84 | |
82 | 85 | void ShowPopupMenu(); |
@@ -659,6 +659,7 @@ wxEND_EVENT_TABLE() | ||
659 | 659 | L3DiskRawSector::L3DiskRawSector(L3DiskFrame *parentframe, L3DiskRawPanel *parentwindow) |
660 | 660 | : wxDataViewListCtrl(parentwindow, wxID_ANY, wxDefaultPosition, wxDefaultSize) |
661 | 661 | { |
662 | + initialized = false; | |
662 | 663 | parent = parentwindow; |
663 | 664 | frame = parentframe; |
664 | 665 |
@@ -690,6 +691,8 @@ L3DiskRawSector::L3DiskRawSector(L3DiskFrame *parentframe, L3DiskRawPanel *paren | ||
690 | 691 | menuPopup->Append(IDM_MODIFY_DENSITY_TRACK, _("Modify All Density On This Track")); |
691 | 692 | menuPopup->AppendSeparator(); |
692 | 693 | menuPopup->Append(IDM_PROPERTY_SECTOR, _("&Property")); |
694 | + | |
695 | + initialized = true; | |
693 | 696 | } |
694 | 697 | |
695 | 698 | L3DiskRawSector::~L3DiskRawSector() |
@@ -701,6 +704,8 @@ L3DiskRawSector::~L3DiskRawSector() | ||
701 | 704 | /// 選択 |
702 | 705 | void L3DiskRawSector::OnSelectionChanged(wxDataViewEvent& event) |
703 | 706 | { |
707 | + if (!initialized) return; | |
708 | + | |
704 | 709 | if (GetSelectedRow() == wxNOT_FOUND || !track) { |
705 | 710 | // 非選択 |
706 | 711 | UnselectItem(); |
@@ -148,6 +148,8 @@ private: | ||
148 | 148 | |
149 | 149 | wxDataViewItem selected_item; |
150 | 150 | |
151 | + bool initialized; | |
152 | + | |
151 | 153 | public: |
152 | 154 | L3DiskRawSector(L3DiskFrame *parentframe, L3DiskRawPanel *parent); |
153 | 155 | ~L3DiskRawSector(); |
@@ -4,12 +4,12 @@ | ||
4 | 4 | #ifndef _VERSION_H_ |
5 | 5 | #define _VERSION_H_ |
6 | 6 | |
7 | -#define APPLICATION_VERSION "0.1.0" | |
7 | +#define APPLICATION_VERSION "0.1.1" | |
8 | 8 | #define APP_VER_MAJOR 0 |
9 | 9 | #define APP_VER_MINOR 1 |
10 | -#define APP_VER_REV 0 | |
10 | +#define APP_VER_REV 1 | |
11 | 11 | #define APP_VER_BUILD 0 |
12 | -#define APP_COPYRIGHT "Copyright (C) 2015 Sasaji" | |
12 | +#define APP_COPYRIGHT "Copyright (C) 2015-2016 Sasaji" | |
13 | 13 | |
14 | 14 | #if defined(__MINGW32__) |
15 | 15 | #ifdef x86_64 |