Add menu options for the tag hiding modes to the view menu. Closes #433

Originally committed to SVN as r4254.
This commit is contained in:
Thomas Goyne 2010-04-30 20:42:07 +00:00
parent 2fea4bb1ba
commit 7a7b7fb5e9
3 changed files with 20 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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