From 23e73cb50509d82047a4bdf9bea40c10df524ff6 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sat, 30 Dec 2006 20:58:24 +0000 Subject: [PATCH] Fixed a few dialogs and added the early medusa shortcuts stuff Originally committed to SVN as r661. --- aegisub/audio_box.cpp | 4 ++ aegisub/audio_box.h | 2 + aegisub/bitmaps/toggle_audio_medusa.bmp | Bin 0 -> 1378 bytes aegisub/changelog.txt | 4 +- aegisub/dialog_fonts_collector.cpp | 48 +++++++++++++++++++----- aegisub/dialog_fonts_collector.h | 1 + aegisub/dialog_search_replace.cpp | 6 ++- aegisub/hotkeys.cpp | 16 ++++++++ aegisub/options.cpp | 3 ++ aegisub/res.rc | 1 + aegisub/toggle_bitmap.cpp | 3 ++ 11 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 aegisub/bitmaps/toggle_audio_medusa.bmp diff --git a/aegisub/audio_box.cpp b/aegisub/audio_box.cpp index 9593fc37f..1816d3e8e 100644 --- a/aegisub/audio_box.cpp +++ b/aegisub/audio_box.cpp @@ -170,6 +170,10 @@ wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL|wxBORDER_RAISE SSAMode->SetToolTip(_("Substation Alpha Mode - Left click sets start and right click sets end")); SSAMode->SetValue(Options.AsBool(_T("Audio SSA Mode"))); ButtonSizer->Add(SSAMode,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0); + MedusaMode = new ToggleBitmap(this,Audio_Check_Medusa,wxBITMAP(toggle_audio_medusa),wxSize(30,-1)); + MedusaMode->SetToolTip(_("Enable Medusa-Style Timing Shortcuts")); + MedusaMode->SetValue(Options.AsBool(_T("Audio Medusa Timing Hotkeys"))); + ButtonSizer->Add(MedusaMode,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0); SpectrumMode = new ToggleBitmap(this,Audio_Check_Spectrum,wxBITMAP(toggle_audio_spectrum),wxSize(30,-1)); SpectrumMode->SetToolTip(_("Spectrum analyzer mode")); SpectrumMode->SetValue(Options.AsBool(_T("Audio Spectrum"))); diff --git a/aegisub/audio_box.h b/aegisub/audio_box.h index ced354cb8..56ef6f48f 100644 --- a/aegisub/audio_box.h +++ b/aegisub/audio_box.h @@ -75,6 +75,7 @@ private: wxButton *JoinButton; ToggleBitmap *AutoScroll; ToggleBitmap *SSAMode; + ToggleBitmap *MedusaMode; ToggleBitmap *AutoCommit; ToggleBitmap *SpectrumMode; @@ -166,6 +167,7 @@ enum { Audio_Check_AutoCommit, Audio_Check_AutoGoto, Audio_Check_SSA, + Audio_Check_Medusa, Audio_Check_Spectrum }; diff --git a/aegisub/bitmaps/toggle_audio_medusa.bmp b/aegisub/bitmaps/toggle_audio_medusa.bmp new file mode 100644 index 0000000000000000000000000000000000000000..3ee6053a0e0be2bc6d6757284e323d625a3bd8a6 GIT binary patch literal 1378 zcma*lF^&{55QX8l5(qL94p1QhF>#5UJCry{9i@WRo}*&UKu|~6Y_uX6ez#{EjUd3? zpP$F=9=E&w_1pKiI?9(f(kEIU@c|EdfAoKTIN~2wN}S5vK}}QLt^V11{_!N4BfteK zG)8j4K*IxxLSv*53=V!oqR^Pzyhb_#i9%x}nks`MkSH{UhZGEsK%&qXiBn^61QLbD z$i-vIu#P~Y(3rh6Gtv=A6dJRa?M6BRi9%!cD+wbVfkdG(`*o#}jzFT&nEfitNJk)1 zXv}`iZKNZRC^Y8y1U^PO0*OLnl&n8xSSt^#qtFTzo3xRRK%&r?V+-XN=?EkWjZw4ymcbE76xK0& zYnhRbK%&r?z3tpcM<7vX%-)h=q$7|hG-hwtG|~}B6dJR)avA9eBnpk$+q{i*1QMm^ zUspXcF8M#{dYrmmR|_1gi|QTas8-`_GU%?{E?&-Z-lEIP(Mf&lJ>8o3oa1iZyK#G7hOYAZba$&g@7;gA>SNq*IZU)4 literal 0 HcmV?d00001 diff --git a/aegisub/changelog.txt b/aegisub/changelog.txt index 049404203..c79f25b48 100644 --- a/aegisub/changelog.txt +++ b/aegisub/changelog.txt @@ -40,7 +40,7 @@ Please visit http://aegisub.net to download latest version - Added support to save and load keyframe list files. (AMZ) - Switching to a new line in audio mode now centers the line on the grid. (AMZ) - Commiting changes in audio to the last line will insert a new line after it. (AMZ) -- Fonts collector can now collect fonts directly to a zip archive. (AMZ) +- Fonts collector can now collect fonts directly to a zipped archive; also, fixed behavior of the Escape key in it. (AMZ) - Added support for DirectShowSource2 if avss.dll is on Aegisub's folder. (AMZ) - Added DirectSound audio output, to avoid using PortAudio under Win32. (AMZ) - Replaced wxTextCtrl with wxScintilla, to solve many issues related to the Rich Text edit control. (AMZ) @@ -56,7 +56,7 @@ Please visit http://aegisub.net to download latest version - Tweaked the layout of Subtitles Edit area. (AMZ) - Actor and Effect fields now show a "ghosted" caption saying their name when they are not focused on and blank. (AMZ) - Aegisub now remembers if it was maximized when it was last quit, and restores its state when opening again. (AMZ) -- A few minor tweaks to the Find dialogue. (AMZ) +- A few minor fixes to the Find dialogue regarding initial focus and the behavior of the Escape key. (AMZ) - Tweaked the behavior of the margin boxes, now they no longer show padding zeros. (AMZ) - Minor fix to the calculation of the grid's "Style" column width. (AMZ) - Added a "Selection Onward" option to the Shift Times dialogue. (AMZ) diff --git a/aegisub/dialog_fonts_collector.cpp b/aegisub/dialog_fonts_collector.cpp index 2cac15490..74a4c569f 100644 --- a/aegisub/dialog_fonts_collector.cpp +++ b/aegisub/dialog_fonts_collector.cpp @@ -52,6 +52,7 @@ #include "options.h" #include "frame_main.h" #include "subs_grid.h" +#include "main.h" /////////////// @@ -68,10 +69,13 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent) wxFileName filename(AssFile::top->filename); dest = filename.GetPath(); } - AttachmentCheck = new wxCheckBox(this,ATTACHMENT_CHECK,_T("As attachments"),wxDefaultPosition); - ArchiveCheck = new wxCheckBox(this,ARCHIVE_CHECK,_T("As a zipped archive"),wxDefaultPosition); DestBox = new wxTextCtrl(this,-1,dest,wxDefaultPosition,wxSize(250,20),0); BrowseButton = new wxButton(this,BROWSE_BUTTON,_("&Browse...")); + AttachmentCheck = new wxCheckBox(this,ATTACHMENT_CHECK,_T("As attachments"),wxDefaultPosition); + AttachmentCheck->SetValue(Options.AsBool(_T("Fonts Collector Attachment"))); + ArchiveCheck = new wxCheckBox(this,ARCHIVE_CHECK,_T("As a zipped archive"),wxDefaultPosition); + ArchiveCheck->SetValue(Options.AsBool(_T("Fonts Collector Archive"))); + if (ArchiveCheck->GetValue()) AttachmentCheck->SetValue(false); wxSizer *DestBottomSizer = new wxBoxSizer(wxHORIZONTAL); DestLabel = new wxStaticText(this,-1,_("Choose the folder where the fonts will be collected to.\nIt will be created if it doesn't exist.")); DestBottomSizer->Add(DestBox,1,wxEXPAND | wxRIGHT,5); @@ -90,15 +94,15 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent) // Buttons sizer StartButton = new wxButton(this,START_BUTTON,_("&Start!")); StartButton->SetDefault(); - CloseButton = new wxButton(this,wxID_CLOSE); + CloseButton = new wxButton(this,wxID_CANCEL,_T("Close")); wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); ButtonSizer->AddStretchSpacer(1); -#ifndef __WXMAC__ - ButtonSizer->Add(StartButton,0,wxRIGHT,5); - ButtonSizer->Add(CloseButton); -#else +#ifdef __WXMAC__ ButtonSizer->Add(CloseButton,0,wxRIGHT,5); ButtonSizer->Add(StartButton); +#else + ButtonSizer->Add(StartButton,0,wxRIGHT,5); + ButtonSizer->Add(CloseButton); #endif // Main sizer @@ -110,6 +114,9 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent) // Set sizer SetSizer(MainSizer); MainSizer->SetSizeHints(this); + + // Run dummy event to update label + Update(); } @@ -236,19 +243,42 @@ void DialogFontsCollector::OnCheckAttach(wxCommandEvent &event) { bool check = AttachmentCheck->IsChecked(); BrowseButton->Enable(!check); DestBox->Enable(!check); - if (check) ArchiveCheck->SetValue(false); + if (check) { + ArchiveCheck->SetValue(false); + Update(); + } } ///////////////// // Check Archive void DialogFontsCollector::OnCheckArchive(wxCommandEvent &event) { + bool check = ArchiveCheck->IsChecked(); + BrowseButton->Enable(check); + DestBox->Enable(check); + Update(); +} + + +/////////////////// +// Update controls +void DialogFontsCollector::Update() { bool check = ArchiveCheck->IsChecked(); if (check) { AttachmentCheck->SetValue(false); DestLabel->SetLabel(_("Enter the name of the destination zip file to collect the fonts to.\nIf a folder is entered, a default name will be used.")); } - else DestLabel->SetLabel(_("Choose the folder where the fonts will be collected to.\nIt will be created if it doesn't exist.")); + else { + // Set label + DestLabel->SetLabel(_("Choose the folder where the fonts will be collected to.\nIt will be created if it doesn't exist.")); + + // Remove filename from browser box + wxFileName fname(DestBox->GetValue()); + if (fname.DirExists()) { + DestBox->SetValue(fname.GetPath()); + } + else DestBox->SetValue(((AegisubApp*)wxTheApp)->folderName); + } } diff --git a/aegisub/dialog_fonts_collector.h b/aegisub/dialog_fonts_collector.h index 009fb40f4..0f0d5417b 100644 --- a/aegisub/dialog_fonts_collector.h +++ b/aegisub/dialog_fonts_collector.h @@ -104,6 +104,7 @@ private: void OnBrowse(wxCommandEvent &event); void OnCheckAttach(wxCommandEvent &event); void OnCheckArchive(wxCommandEvent &event); + void Update(); public: DialogFontsCollector(wxWindow *parent); diff --git a/aegisub/dialog_search_replace.cpp b/aegisub/dialog_search_replace.cpp index 0077fb34e..85364de42 100644 --- a/aegisub/dialog_search_replace.cpp +++ b/aegisub/dialog_search_replace.cpp @@ -118,7 +118,7 @@ DialogSearchReplace::DialogSearchReplace (wxWindow *parent,bool _hasReplace,wxSt ButtonSizer->Add(new wxButton(this,BUTTON_REPLACE_NEXT,_("Replace next")),0,wxEXPAND | wxBOTTOM,3); ButtonSizer->Add(new wxButton(this,BUTTON_REPLACE_ALL,_("Replace all")),0,wxEXPAND | wxBOTTOM,3); } - ButtonSizer->Add(new wxButton(this,wxID_CLOSE),0,wxEXPAND | wxBOTTOM,20); + ButtonSizer->Add(new wxButton(this,wxID_CANCEL),0,wxEXPAND | wxBOTTOM,20); //ButtonSizer->Add(new wxButton(this,wxID_HELP),0,wxEXPAND | wxBOTTOM,0); // Main sizer @@ -128,6 +128,8 @@ DialogSearchReplace::DialogSearchReplace (wxWindow *parent,bool _hasReplace,wxSt MainSizer->SetSizeHints(this); SetSizer(MainSizer); CenterOnParent(); + + // Open Search.OnDialogOpen(); } @@ -158,7 +160,7 @@ void DialogSearchReplace::UpdateSettings() { /////////////// // Event table BEGIN_EVENT_TABLE(DialogSearchReplace,wxDialog) - EVT_BUTTON(wxID_CLOSE,DialogSearchReplace::OnClose) + EVT_BUTTON(wxID_CANCEL,DialogSearchReplace::OnClose) EVT_BUTTON(BUTTON_FIND_NEXT,DialogSearchReplace::OnFindNext) EVT_BUTTON(BUTTON_REPLACE_NEXT,DialogSearchReplace::OnReplaceNext) EVT_BUTTON(BUTTON_REPLACE_ALL,DialogSearchReplace::OnReplaceAll) diff --git a/aegisub/hotkeys.cpp b/aegisub/hotkeys.cpp index bcb27a384..55973eed4 100644 --- a/aegisub/hotkeys.cpp +++ b/aegisub/hotkeys.cpp @@ -186,6 +186,10 @@ void HotkeyType::FillMap() { keyName[WXK_NUMPAD9] = _T("KP_9"); keyName[WXK_NUMPAD_ADD] = _T("KP_Add"); keyName[WXK_NUMPAD_SUBTRACT] = _T("KP_Subtract"); + keyName[WXK_NUMPAD_SUBTRACT] = _T("KP_Subtract"); + keyName[WXK_NUMPAD_MULTIPLY] = _T("KP_Multiply"); + keyName[WXK_NUMPAD_DIVIDE] = _T("KP_Divide"); + keyName[WXK_NUMPAD_DECIMAL] = _T("KP_Decimal"); keyName[WXK_F1] = _T("F1"); keyName[WXK_F2] = _T("F2"); @@ -378,6 +382,18 @@ void HotkeyManager::LoadDefaults() { SetHotkey(_("Audio Add Lead In"),_T("C")); SetHotkey(_("Audio Add Lead Out"),_T("V")); + SetHotkey(_("Audio Medusa Toggle"),_T("Ctrl-KP_Multiply")); + SetHotkey(_("Audio Medusa Play"),_T("KP_5")); + SetHotkey(_("Audio Medusa Stop"),_T("KP_8")); + SetHotkey(_("Audio Medusa Shift Start Back"),_T("KP_4")); + SetHotkey(_("Audio Medusa Shift Start Forward"),_T("KP_6")); + SetHotkey(_("Audio Medusa Shift End Back"),_T("KP_7")); + SetHotkey(_("Audio Medusa Shift End Forward"),_T("KP_9")); + SetHotkey(_("Audio Medusa Play Before"),_T("KP_1")); + SetHotkey(_("Audio Medusa Play After"),_T("KP_3")); + SetHotkey(_("Audio Medusa Next"),_T("KP_2")); + SetHotkey(_("Audio Medusa Previous"),_T("KP_0")); + SetHotkey(_("Translation Assistant Play"),_T("End")); SetHotkey(_("Translation Assistant Next"),_T("PgDn")); SetHotkey(_("Translation Assistant Prev"),_T("PgUp")); diff --git a/aegisub/options.cpp b/aegisub/options.cpp index a2c4a8e4b..b95b5d2a3 100644 --- a/aegisub/options.cpp +++ b/aegisub/options.cpp @@ -111,6 +111,7 @@ void OptionsManager::LoadDefaults() { SetBool(_T("Audio Autocommit"),false); SetBool(_T("Audio Autoscroll"),true); SetBool(_T("Audio SSA Mode"),false); + SetBool(_T("Audio Medusa Timing Hotkeys"),false); SetBool(_T("Audio SSA Next Line on Commit"),true); SetBool(_T("Audio SSA Allow Autocommit"),false); SetBool(_T("Audio Autofocus"),false); @@ -244,6 +245,8 @@ void OptionsManager::LoadDefaults() { SetBool(_T("Paste Over #9"),true); SetText(_T("Fonts Collector Destination"),_T("?script")); + SetBool(_T("Fonts Collector Attachment"),0); + SetBool(_T("Fonts Collector Archive"),1); SetInt(_T("Audio Display Height"),100); SetBool(_T("Audio Spectrum"),false); diff --git a/aegisub/res.rc b/aegisub/res.rc index 9fc4ec8e4..995bace7e 100644 --- a/aegisub/res.rc +++ b/aegisub/res.rc @@ -135,6 +135,7 @@ button_leadout BITMAP "bitmaps/button_leadout.bmp" toggle_audio_autoscroll BITMAP "bitmaps/toggle_audio_autoscroll.bmp" toggle_audio_autocommit BITMAP "bitmaps/toggle_audio_autocommit.bmp" toggle_audio_ssa BITMAP "bitmaps/toggle_audio_ssa.bmp" +toggle_audio_medusa BITMAP "bitmaps/toggle_audio_medusa.bmp" toggle_audio_spectrum BITMAP "bitmaps/toggle_audio_spectrum.bmp" toggle_audio_link BITMAP "bitmaps/toggle_audio_link.bmp" toggle_video_autoscroll BITMAP "bitmaps/toggle_video_autoscroll.bmp" diff --git a/aegisub/toggle_bitmap.cpp b/aegisub/toggle_bitmap.cpp index 2c45baec5..48fd8f576 100644 --- a/aegisub/toggle_bitmap.cpp +++ b/aegisub/toggle_bitmap.cpp @@ -70,7 +70,10 @@ bool ToggleBitmap::GetValue() { ///////////// // Set state void ToggleBitmap::SetValue(bool _state) { + // Set flag state = _state; + + // Refresh Refresh(false); }