diff --git a/core/changelog.txt b/core/changelog.txt index 34995391d..6523f905d 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -89,6 +89,7 @@ Please visit http://aegisub.net to download latest version - Aegisub now supports file attachments, which are stored decoded (to save memory) and are not part of the undo stack (for the same reason). Previously, they were simply left ignored in the file as unknown lines. (AMZ) - Implemented an Attached files list, where you can attach new fonts and graphics, extract them, or remove them from the script file. (AMZ) - The Font Collector can now collect fonts as script attachments. (AMZ) +- Added recent menu to Video Timecodes. (AMZ) = 1.09 beta - 2006.01.16 =========================== diff --git a/core/frame_main.cpp b/core/frame_main.cpp index 8a4d655b1..7db81e74f 100644 --- a/core/frame_main.cpp +++ b/core/frame_main.cpp @@ -214,6 +214,7 @@ void FrameMain::InitMenu() { RecentSubs = new wxMenu(); RecentVids = new wxMenu(); RecentAuds = new wxMenu(); + RecentTimecodes = new wxMenu(); // Create file menu fileMenu = new wxMenu(); @@ -266,6 +267,8 @@ void FrameMain::InitMenu() { videoMenu->AppendSeparator(); videoMenu->Append(Menu_File_Open_VFR, _("Open timecodes file..."), _("Opens a VFR timecodes v1 or v2 file")); videoMenu->Append(Menu_File_Close_VFR, _("Close timecodes file"), _("Closes the currently open timecodes file"))->Enable(false); + wxMenuItem *RecentTimesParent = new wxMenuItem(videoMenu, Menu_File_Recent_Timecodes_Parent, _("Recent"), _T(""), wxITEM_NORMAL, RecentTimecodes); + videoMenu->Append(RecentTimesParent); videoMenu->AppendSeparator(); AppendBitmapMenuItem (videoMenu,Menu_Video_JumpTo, _("&Jump To...\t") + Hotkeys.GetText(_T("Video Jump")), _("Jump to frame or time"), wxBITMAP(jumpto_button)); videoMenu->AppendSeparator(); diff --git a/core/frame_main.h b/core/frame_main.h index 98158fec5..8c578c46d 100644 --- a/core/frame_main.h +++ b/core/frame_main.h @@ -85,6 +85,7 @@ private: wxMenu *RecentSubs; wxMenu *RecentVids; wxMenu *RecentAuds; + wxMenu *RecentTimecodes; wxToolBar *Toolbar; wxComboBox *ZoomBox; @@ -122,6 +123,7 @@ private: void OnOpenRecentSubs (wxCommandEvent &event); void OnOpenRecentVideo (wxCommandEvent &event); void OnOpenRecentAudio (wxCommandEvent &event); + void OnOpenRecentTimecodes (wxCommandEvent &event); void OnCloseWindow (wxCloseEvent &event); void OnMenuOpen (wxMenuEvent &event); @@ -275,6 +277,7 @@ enum { Menu_File_Recent_Subs_Parent, Menu_File_Recent_Vids_Parent, Menu_File_Recent_Auds_Parent, + Menu_File_Recent_Timecodes_Parent, Menu_Video_JumpTo, Menu_View_Zoom_50, @@ -372,7 +375,8 @@ enum { Menu_File_Recent = 2000, Menu_Video_Recent = 2200, - Menu_Audio_Recent = 2400 + Menu_Audio_Recent = 2400, + Menu_Timecodes_Recent = 2500 }; diff --git a/core/frame_main_events.cpp b/core/frame_main_events.cpp index f3ea6f00f..c26a4598f 100644 --- a/core/frame_main_events.cpp +++ b/core/frame_main_events.cpp @@ -116,9 +116,10 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame) EVT_KEY_DOWN(FrameMain::OnKeyDown) EVT_MENU_OPEN(FrameMain::OnMenuOpen) - EVT_MENU_RANGE(Menu_File_Recent,Menu_File_Recent+100, FrameMain::OnOpenRecentSubs) - EVT_MENU_RANGE(Menu_Video_Recent,Menu_Video_Recent+100, FrameMain::OnOpenRecentVideo) - EVT_MENU_RANGE(Menu_Audio_Recent,Menu_Audio_Recent+100, FrameMain::OnOpenRecentAudio) + EVT_MENU_RANGE(Menu_File_Recent,Menu_File_Recent+99, FrameMain::OnOpenRecentSubs) + EVT_MENU_RANGE(Menu_Video_Recent,Menu_Video_Recent+99, FrameMain::OnOpenRecentVideo) + EVT_MENU_RANGE(Menu_Audio_Recent,Menu_Audio_Recent+99, FrameMain::OnOpenRecentAudio) + EVT_MENU_RANGE(Menu_Timecodes_Recent,Menu_Timecodes_Recent+99, FrameMain::OnOpenRecentTimecodes) EVT_MENU(Menu_File_Open, FrameMain::OnOpenProject) EVT_MENU(Menu_File_Save, FrameMain::OnSaveProject) @@ -307,8 +308,12 @@ void FrameMain::OnMenuOpen (wxMenuEvent &event) { for (int i=count;--i>=0;) { RecentVids->Destroy(RecentVids->FindItemByPosition(i)); } + count = RecentTimecodes->GetMenuItemCount(); + for (int i=count;--i>=0;) { + RecentTimecodes->Destroy(RecentTimecodes->FindItemByPosition(i)); + } - // Rebuild recent + // Rebuild recent videos int added = 0; wxString n; wxArrayString entries = Options.GetRecentList(_T("Recent vid")); @@ -321,6 +326,19 @@ void FrameMain::OnMenuOpen (wxMenuEvent &event) { added++; } if (added == 0) RecentVids->Append(Menu_Video_Recent,_T("Empty"))->Enable(false); + + // Rebuild recent timecodes + added = 0; + entries = Options.GetRecentList(_T("Recent timecodes")); + for (size_t i=0;iAppend(Menu_Timecodes_Recent+i,n + _T(" ") + filename); + added++; + } + if (added == 0) RecentTimecodes->Append(Menu_Timecodes_Recent,_T("Empty"))->Enable(false); } // Audio menu @@ -388,6 +406,15 @@ void FrameMain::OnOpenRecentVideo(wxCommandEvent &event) { } +//////////////////////////////// +// Open recent timecodes entry +void FrameMain::OnOpenRecentTimecodes(wxCommandEvent &event) { + int number = event.GetId()-Menu_Timecodes_Recent; + wxString key = _T("Recent timecodes #") + wxString::Format(_T("%i"),number+1); + LoadVFR(Options.AsText(key)); +} + + //////////////////////////////// // Open recent audio menu entry void FrameMain::OnOpenRecentAudio(wxCommandEvent &event) { diff --git a/core/options.cpp b/core/options.cpp index 039cbc8c2..62326a17a 100644 --- a/core/options.cpp +++ b/core/options.cpp @@ -72,6 +72,7 @@ void OptionsManager::LoadDefaults() { SetBool(_T("Keep raw dialogue data"),false); SetInt(_T("Undo Levels"),8); + SetInt(_T("Recent timecodes max"),16); SetInt(_T("Recent sub max"),16); SetInt(_T("Recent vid max"),16); SetInt(_T("Recent aud max"),16); diff --git a/core/vfr.cpp b/core/vfr.cpp index 2061b56ff..94d014f17 100644 --- a/core/vfr.cpp +++ b/core/vfr.cpp @@ -37,6 +37,7 @@ /////////// // Headers #include +#include "options.h" #include "vfr.h" #include "utils.h" #include "text_file_reader.h" @@ -216,6 +217,9 @@ void FrameRate::Load(wxString filename) { loaded = true; vfrFile = filename; FrameRateType = VFR; + + // Add to recent + Options.AddToRecentList(filename,_T("Recent timecodes")); }