From 7a7b7fb5e9b41968deba37e69b0c24e36f267f64 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 30 Apr 2010 20:42:07 +0000 Subject: [PATCH] Add menu options for the tag hiding modes to the view menu. Closes #433 Originally committed to SVN as r4254. --- aegisub/src/frame_main.cpp | 4 ++++ aegisub/src/frame_main.h | 4 ++++ aegisub/src/frame_main_events.cpp | 21 ++++++++++++--------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/aegisub/src/frame_main.cpp b/aegisub/src/frame_main.cpp index 198b22b46..0893dc347 100644 --- a/aegisub/src/frame_main.cpp +++ b/aegisub/src/frame_main.cpp @@ -539,6 +539,10 @@ void FrameMain::InitMenu() { viewMenu->AppendRadioItem(Menu_View_Video, _("Video+Subs View"), _("Display video and subtitles only")); viewMenu->AppendRadioItem(Menu_View_Audio, _("Audio+Subs View"), _("Display audio and subtitles only")); viewMenu->AppendRadioItem(Menu_View_Standard, _("Full view"), _("Display audio, video and subtitles")); + viewMenu->AppendSeparator(); + viewMenu->AppendRadioItem(Menu_View_FullTags, _("Show Tags"), _("Show full override tags in the subtitle grid")); + viewMenu->AppendRadioItem(Menu_View_ShortTags, _("Simplify Tags"), _("Replace override tags in the subtitle grid with a simplified placeholder")); + viewMenu->AppendRadioItem(Menu_View_NoTags, _("Hide Tags"), _("Hide override tags in the subtitle grid")); MenuBar->Append(viewMenu, _("Vie&w")); // Create help menu diff --git a/aegisub/src/frame_main.h b/aegisub/src/frame_main.h index 8dc923bd5..9d85422c4 100644 --- a/aegisub/src/frame_main.h +++ b/aegisub/src/frame_main.h @@ -255,6 +255,7 @@ private: void OnViewVideo (wxCommandEvent &event); void OnViewAudio (wxCommandEvent &event); void OnViewSubs (wxCommandEvent &event); + void OnSetTags (wxCommandEvent &event); void OnUndo (wxCommandEvent &event); void OnRedo (wxCommandEvent &event); @@ -601,6 +602,9 @@ enum { /// DOCME Menu_View_Subs, + Menu_View_FullTags, + Menu_View_ShortTags, + Menu_View_NoTags, /// DOCME diff --git a/aegisub/src/frame_main_events.cpp b/aegisub/src/frame_main_events.cpp index d7ec12746..ac8fea470 100644 --- a/aegisub/src/frame_main_events.cpp +++ b/aegisub/src/frame_main_events.cpp @@ -211,6 +211,9 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame) EVT_MENU(Menu_View_Audio, FrameMain::OnViewAudio) EVT_MENU(Menu_View_Video, FrameMain::OnViewVideo) EVT_MENU(Menu_View_Subs, FrameMain::OnViewSubs) + EVT_MENU(Menu_View_FullTags, FrameMain::OnSetTags) + EVT_MENU(Menu_View_ShortTags, FrameMain::OnSetTags) + EVT_MENU(Menu_View_NoTags, FrameMain::OnSetTags) EVT_MENU(Video_Prev_Frame,FrameMain::OnPrevFrame) EVT_MENU(Video_Next_Frame,FrameMain::OnNextFrame) @@ -310,6 +313,8 @@ void FrameMain::OnMenuOpen (wxMenuEvent &event) { else if (showVideo && !showAudio) MenuBar->Check(Menu_View_Video,true); else if (showAudio && showVideo) MenuBar->Check(Menu_View_Standard,true); else MenuBar->Check(Menu_View_Audio,true); + + MenuBar->Check(Options.AsInt(L"Grid hide overrides") + Menu_View_FullTags, true); } // Video menu @@ -1841,17 +1846,11 @@ void FrameMain::OnNextLine(wxCommandEvent &event) { /// @brief Cycle through tag hiding modes -/// @param event -/// -void FrameMain::OnToggleTags(wxCommandEvent &event) { - // Read value +void FrameMain::OnToggleTags(wxCommandEvent &) { int tagMode = Options.AsInt(_T("Grid hide overrides")); // Cycle to next - if (tagMode < 0 || tagMode > 2) tagMode = 1; - else { - tagMode = (tagMode+1)%3; - } + tagMode = (tagMode+1)%3; // Show on status bar wxString message = _("ASS Override Tag mode set to "); @@ -1867,7 +1866,11 @@ void FrameMain::OnToggleTags(wxCommandEvent &event) { // Refresh grid SubsBox->Refresh(false); } - +void FrameMain::OnSetTags(wxCommandEvent &event) { + Options.SetInt(_T("Grid hide overrides"), event.GetId() - Menu_View_FullTags); + Options.Save(); + SubsBox->Refresh(false); +} /// @brief Commit Edit Box's changes