Added recent menu to Video Timecodes.

Originally committed to SVN as r451.
This commit is contained in:
Rodrigo Braz Monteiro 2006-07-01 05:34:39 +00:00
parent f6127e717a
commit a1a840155b
6 changed files with 45 additions and 5 deletions

View File

@ -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) - 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) - 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) - The Font Collector can now collect fonts as script attachments. (AMZ)
- Added recent menu to Video Timecodes. (AMZ)
= 1.09 beta - 2006.01.16 =========================== = 1.09 beta - 2006.01.16 ===========================

View File

@ -214,6 +214,7 @@ void FrameMain::InitMenu() {
RecentSubs = new wxMenu(); RecentSubs = new wxMenu();
RecentVids = new wxMenu(); RecentVids = new wxMenu();
RecentAuds = new wxMenu(); RecentAuds = new wxMenu();
RecentTimecodes = new wxMenu();
// Create file menu // Create file menu
fileMenu = new wxMenu(); fileMenu = new wxMenu();
@ -266,6 +267,8 @@ void FrameMain::InitMenu() {
videoMenu->AppendSeparator(); videoMenu->AppendSeparator();
videoMenu->Append(Menu_File_Open_VFR, _("Open timecodes file..."), _("Opens a VFR timecodes v1 or v2 file")); 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); 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(); videoMenu->AppendSeparator();
AppendBitmapMenuItem (videoMenu,Menu_Video_JumpTo, _("&Jump To...\t") + Hotkeys.GetText(_T("Video Jump")), _("Jump to frame or time"), wxBITMAP(jumpto_button)); AppendBitmapMenuItem (videoMenu,Menu_Video_JumpTo, _("&Jump To...\t") + Hotkeys.GetText(_T("Video Jump")), _("Jump to frame or time"), wxBITMAP(jumpto_button));
videoMenu->AppendSeparator(); videoMenu->AppendSeparator();

View File

@ -85,6 +85,7 @@ private:
wxMenu *RecentSubs; wxMenu *RecentSubs;
wxMenu *RecentVids; wxMenu *RecentVids;
wxMenu *RecentAuds; wxMenu *RecentAuds;
wxMenu *RecentTimecodes;
wxToolBar *Toolbar; wxToolBar *Toolbar;
wxComboBox *ZoomBox; wxComboBox *ZoomBox;
@ -122,6 +123,7 @@ private:
void OnOpenRecentSubs (wxCommandEvent &event); void OnOpenRecentSubs (wxCommandEvent &event);
void OnOpenRecentVideo (wxCommandEvent &event); void OnOpenRecentVideo (wxCommandEvent &event);
void OnOpenRecentAudio (wxCommandEvent &event); void OnOpenRecentAudio (wxCommandEvent &event);
void OnOpenRecentTimecodes (wxCommandEvent &event);
void OnCloseWindow (wxCloseEvent &event); void OnCloseWindow (wxCloseEvent &event);
void OnMenuOpen (wxMenuEvent &event); void OnMenuOpen (wxMenuEvent &event);
@ -275,6 +277,7 @@ enum {
Menu_File_Recent_Subs_Parent, Menu_File_Recent_Subs_Parent,
Menu_File_Recent_Vids_Parent, Menu_File_Recent_Vids_Parent,
Menu_File_Recent_Auds_Parent, Menu_File_Recent_Auds_Parent,
Menu_File_Recent_Timecodes_Parent,
Menu_Video_JumpTo, Menu_Video_JumpTo,
Menu_View_Zoom_50, Menu_View_Zoom_50,
@ -372,7 +375,8 @@ enum {
Menu_File_Recent = 2000, Menu_File_Recent = 2000,
Menu_Video_Recent = 2200, Menu_Video_Recent = 2200,
Menu_Audio_Recent = 2400 Menu_Audio_Recent = 2400,
Menu_Timecodes_Recent = 2500
}; };

View File

@ -116,9 +116,10 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame)
EVT_KEY_DOWN(FrameMain::OnKeyDown) EVT_KEY_DOWN(FrameMain::OnKeyDown)
EVT_MENU_OPEN(FrameMain::OnMenuOpen) EVT_MENU_OPEN(FrameMain::OnMenuOpen)
EVT_MENU_RANGE(Menu_File_Recent,Menu_File_Recent+100, FrameMain::OnOpenRecentSubs) EVT_MENU_RANGE(Menu_File_Recent,Menu_File_Recent+99, FrameMain::OnOpenRecentSubs)
EVT_MENU_RANGE(Menu_Video_Recent,Menu_Video_Recent+100, FrameMain::OnOpenRecentVideo) EVT_MENU_RANGE(Menu_Video_Recent,Menu_Video_Recent+99, FrameMain::OnOpenRecentVideo)
EVT_MENU_RANGE(Menu_Audio_Recent,Menu_Audio_Recent+100, FrameMain::OnOpenRecentAudio) 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_Open, FrameMain::OnOpenProject)
EVT_MENU(Menu_File_Save, FrameMain::OnSaveProject) EVT_MENU(Menu_File_Save, FrameMain::OnSaveProject)
@ -307,8 +308,12 @@ void FrameMain::OnMenuOpen (wxMenuEvent &event) {
for (int i=count;--i>=0;) { for (int i=count;--i>=0;) {
RecentVids->Destroy(RecentVids->FindItemByPosition(i)); 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; int added = 0;
wxString n; wxString n;
wxArrayString entries = Options.GetRecentList(_T("Recent vid")); wxArrayString entries = Options.GetRecentList(_T("Recent vid"));
@ -321,6 +326,19 @@ void FrameMain::OnMenuOpen (wxMenuEvent &event) {
added++; added++;
} }
if (added == 0) RecentVids->Append(Menu_Video_Recent,_T("Empty"))->Enable(false); 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;i<entries.Count();i++) {
n = wxString::Format(_T("%i"),i+1);
if (i < 9) n = _T("&") + n;
wxFileName shortname(entries[i]);
wxString filename = shortname.GetFullName();
RecentTimecodes->Append(Menu_Timecodes_Recent+i,n + _T(" ") + filename);
added++;
}
if (added == 0) RecentTimecodes->Append(Menu_Timecodes_Recent,_T("Empty"))->Enable(false);
} }
// Audio menu // 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 // Open recent audio menu entry
void FrameMain::OnOpenRecentAudio(wxCommandEvent &event) { void FrameMain::OnOpenRecentAudio(wxCommandEvent &event) {

View File

@ -72,6 +72,7 @@ void OptionsManager::LoadDefaults() {
SetBool(_T("Keep raw dialogue data"),false); SetBool(_T("Keep raw dialogue data"),false);
SetInt(_T("Undo Levels"),8); SetInt(_T("Undo Levels"),8);
SetInt(_T("Recent timecodes max"),16);
SetInt(_T("Recent sub max"),16); SetInt(_T("Recent sub max"),16);
SetInt(_T("Recent vid max"),16); SetInt(_T("Recent vid max"),16);
SetInt(_T("Recent aud max"),16); SetInt(_T("Recent aud max"),16);

View File

@ -37,6 +37,7 @@
/////////// ///////////
// Headers // Headers
#include <wx/filename.h> #include <wx/filename.h>
#include "options.h"
#include "vfr.h" #include "vfr.h"
#include "utils.h" #include "utils.h"
#include "text_file_reader.h" #include "text_file_reader.h"
@ -216,6 +217,9 @@ void FrameRate::Load(wxString filename) {
loaded = true; loaded = true;
vfrFile = filename; vfrFile = filename;
FrameRateType = VFR; FrameRateType = VFR;
// Add to recent
Options.AddToRecentList(filename,_T("Recent timecodes"));
} }