Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
// Copyright (c) 2005-2010, Niels Martin Hansen
// Copyright (c) 2005-2010, Rodrigo Braz Monteiro
// Copyright (c) 2010, Amar Takhar
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Aegisub Group nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Aegisub Project http://www.aegisub.org/
2011-01-08 13:10:40 +01:00
# include <wx/msgdlg.h>
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
# include "command.h"
2012-01-08 02:36:16 +01:00
# include <libaegisub/log.h>
2014-04-23 22:53:24 +02:00
# include <libaegisub/make_unique.h>
2012-01-08 02:36:16 +01:00
2012-10-02 21:28:55 +02:00
# include "../compat.h"
2012-03-09 01:23:41 +01:00
# include "../dialog_detached_video.h"
2013-01-07 02:50:09 +01:00
# include "../dialog_manager.h"
2014-05-22 21:07:15 +02:00
# include "../dialogs.h"
2011-07-15 06:05:01 +02:00
# include "../frame_main.h"
2013-01-07 02:50:09 +01:00
# include "../include/aegisub/context.h"
2013-12-25 22:36:37 +01:00
# include "../libresrc/libresrc.h"
2013-01-07 02:50:09 +01:00
# include "../main.h"
# include "../options.h"
2014-05-22 01:23:28 +02:00
# include "../project.h"
2011-07-15 06:05:01 +02:00
# include "../utils.h"
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2011-07-15 06:05:01 +02:00
namespace {
using cmd : : Command ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2014-03-13 02:39:07 +01:00
struct app_about final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/about " )
2013-12-25 22:36:37 +01:00
CMD_ICON ( about_menu )
2012-02-07 02:22:50 +01:00
STR_MENU ( " &About " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " About " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " About Aegisub " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2013-11-21 18:13:36 +01:00
void operator ( ) ( agi : : Context * c ) override {
2014-05-22 21:07:15 +02:00
ShowAboutDialog ( c - > parent ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2014-03-13 02:39:07 +01:00
struct app_display_audio_subs final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/display/audio_subs " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " &Audio+Subs View " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Audio+Subs View " )
2013-10-25 22:54:20 +02:00
STR_HELP ( " Display audio and the subtitles grid only " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2014-03-25 17:51:38 +01:00
void operator ( ) ( agi : : Context * c ) override {
c - > frame - > SetDisplayMode ( 0 , 1 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
2011-07-15 06:05:22 +02:00
2013-11-21 18:13:36 +01:00
bool Validate ( const agi : : Context * c ) override {
2014-05-22 01:23:28 +02:00
return ! ! c - > project - > AudioProvider ( ) ;
2011-07-15 06:05:22 +02:00
}
2011-12-22 22:30:49 +01:00
2014-03-25 17:51:38 +01:00
bool IsActive ( const agi : : Context * c ) override {
return c - > frame - > IsAudioShown ( ) & & ! c - > frame - > IsVideoShown ( ) ;
2011-12-22 22:30:49 +01:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
} ;
2014-03-13 02:39:07 +01:00
struct app_display_full final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/display/full " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " &Full view " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Full view " )
2013-10-25 22:54:20 +02:00
STR_HELP ( " Display audio, video and then subtitles grid " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2013-11-21 18:13:36 +01:00
void operator ( ) ( agi : : Context * c ) override {
2014-03-25 17:51:38 +01:00
c - > frame - > SetDisplayMode ( 1 , 1 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
2011-07-15 06:05:22 +02:00
2013-11-21 18:13:36 +01:00
bool Validate ( const agi : : Context * c ) override {
2014-05-22 01:23:28 +02:00
return c - > project - > AudioProvider ( ) & & c - > project - > VideoProvider ( ) & & ! c - > dialog - > Get < DialogDetachedVideo > ( ) ;
2011-07-15 06:05:22 +02:00
}
2011-12-22 22:30:49 +01:00
2014-03-25 17:51:38 +01:00
bool IsActive ( const agi : : Context * c ) override {
return c - > frame - > IsAudioShown ( ) & & c - > frame - > IsVideoShown ( ) ;
2011-12-22 22:30:49 +01:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
} ;
2014-03-13 02:39:07 +01:00
struct app_display_subs final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/display/subs " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " S&ubs Only View " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Subs Only View " )
2013-10-25 22:54:20 +02:00
STR_HELP ( " Display the subtitles grid only " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2013-11-21 18:13:36 +01:00
void operator ( ) ( agi : : Context * c ) override {
2014-05-22 01:23:28 +02:00
c - > frame - > SetDisplayMode ( 0 , 0 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
2011-12-22 22:30:49 +01:00
2014-03-25 17:51:38 +01:00
bool IsActive ( const agi : : Context * c ) override {
return ! c - > frame - > IsAudioShown ( ) & & ! c - > frame - > IsVideoShown ( ) ;
2011-12-22 22:30:49 +01:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
} ;
2014-03-13 02:39:07 +01:00
struct app_display_video_subs final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/display/video_subs " )
2011-11-18 06:00:20 +01:00
STR_MENU ( " &Video+Subs View " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Video+Subs View " )
2013-10-25 22:54:20 +02:00
STR_HELP ( " Display video and the subtitles grid only " )
2011-07-15 06:05:56 +02:00
CMD_TYPE ( COMMAND_VALIDATE | COMMAND_RADIO )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2013-11-21 18:13:36 +01:00
void operator ( ) ( agi : : Context * c ) override {
2014-05-22 01:23:28 +02:00
c - > frame - > SetDisplayMode ( 1 , 0 ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
2011-07-15 06:05:22 +02:00
2013-11-21 18:13:36 +01:00
bool Validate ( const agi : : Context * c ) override {
2014-05-22 01:23:28 +02:00
return c - > project - > VideoProvider ( ) & & ! c - > dialog - > Get < DialogDetachedVideo > ( ) ;
2011-07-15 06:05:22 +02:00
}
2011-12-22 22:30:49 +01:00
2014-03-25 17:51:38 +01:00
bool IsActive ( const agi : : Context * c ) override {
return ! c - > frame - > IsAudioShown ( ) & & c - > frame - > IsVideoShown ( ) ;
2011-12-22 22:30:49 +01:00
}
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
} ;
2014-03-13 02:39:07 +01:00
struct app_exit final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/exit " )
STR_MENU ( " E&xit " )
STR_DISP ( " Exit " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Exit the application " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2015-08-31 03:18:07 +02:00
void operator ( ) ( agi : : Context * ) override {
wxGetApp ( ) . CloseAll ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2014-03-13 02:39:07 +01:00
struct app_language final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/language " )
2013-12-25 22:36:37 +01:00
CMD_ICON ( languages_menu )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_MENU ( " &Language... " )
STR_DISP ( " Language " )
STR_HELP ( " Select Aegisub interface language " )
2013-11-21 18:13:36 +01:00
void operator ( ) ( agi : : Context * c ) override {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
// Get language
2015-01-01 04:41:56 +01:00
auto new_language = wxGetApp ( ) . locale . PickLanguage ( ) ;
if ( new_language . empty ( ) ) return ;
2012-10-02 21:28:55 +02:00
2015-01-01 04:41:56 +01:00
OPT_SET ( " App/Language " ) - > SetString ( new_language ) ;
2012-10-02 21:28:55 +02:00
// Ask to restart program
int result = wxMessageBox ( " Aegisub needs to be restarted so that the new language can be applied. Restart now? " , " Restart Aegisub? " , wxYES_NO | wxICON_QUESTION | wxCENTER ) ;
if ( result = = wxYES ) {
// Restart Aegisub
2014-03-25 17:51:38 +01:00
if ( c - > frame - > Close ( ) ) {
2012-10-02 21:28:55 +02:00
RestartAegisub ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
}
}
} ;
2014-03-13 02:39:07 +01:00
struct app_log final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/log " )
2013-12-25 22:36:37 +01:00
CMD_ICON ( about_menu )
2012-02-07 02:22:50 +01:00
STR_MENU ( " &Log window " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Log window " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " View the event log " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2013-11-21 18:13:36 +01:00
void operator ( ) ( agi : : Context * c ) override {
2014-05-22 21:07:15 +02:00
ShowLogWindow ( c ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2014-03-13 02:39:07 +01:00
struct app_new_window final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/new_window " )
2013-12-25 22:36:37 +01:00
CMD_ICON ( new_window_menu )
2011-11-18 06:00:20 +01:00
STR_MENU ( " New &Window " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " New Window " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Open a new application window " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2015-08-24 03:17:54 +02:00
void operator ( ) ( agi : : Context * ) override {
wxGetApp ( ) . NewProjectContext ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
} ;
2014-03-13 02:39:07 +01:00
struct app_options final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/options " )
2013-12-25 22:36:37 +01:00
CMD_ICON ( options_button )
2011-10-01 20:35:12 +02:00
STR_MENU ( " &Options... " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Options " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Configure Aegisub " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2013-11-21 18:13:36 +01:00
void operator ( ) ( agi : : Context * c ) override {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
try {
2014-12-29 05:28:33 +01:00
ShowPreferences ( c - > parent ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
} catch ( agi : : Exception & e ) {
2014-05-29 14:57:27 +02:00
LOG_E ( " config/init " ) < < " Caught exception: " < < e . GetMessage ( ) ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
}
} ;
2014-03-13 02:39:07 +01:00
struct app_toggle_global_hotkeys final : public Command {
2011-07-28 00:59:11 +02:00
CMD_NAME ( " app/toggle/global_hotkeys " )
2013-12-25 22:36:37 +01:00
CMD_ICON ( toggle_audio_medusa )
2011-07-28 00:59:11 +02:00
STR_MENU ( " Toggle global hotkey overrides " )
STR_DISP ( " Toggle global hotkey overrides " )
2013-10-25 22:54:20 +02:00
STR_HELP ( " Toggle global hotkey overrides (Medusa Mode) " )
2011-07-28 00:59:11 +02:00
CMD_TYPE ( COMMAND_TOGGLE )
2014-03-25 17:51:38 +01:00
bool IsActive ( const agi : : Context * c ) override {
2011-07-28 00:59:11 +02:00
return OPT_GET ( " Audio/Medusa Timing Hotkeys " ) - > GetBool ( ) ;
}
2014-03-25 17:51:38 +01:00
void operator ( ) ( agi : : Context * c ) override {
2011-07-28 00:59:11 +02:00
agi : : OptionValue * opt = OPT_SET ( " Audio/Medusa Timing Hotkeys " ) ;
opt - > SetBool ( ! opt - > GetBool ( ) ) ;
}
} ;
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2014-03-13 02:39:07 +01:00
struct app_toggle_toolbar final : public Command {
2012-05-23 05:38:37 +02:00
CMD_NAME ( " app/toggle/toolbar " )
STR_HELP ( " Toggle the main toolbar " )
CMD_TYPE ( COMMAND_DYNAMIC_NAME )
2014-03-25 17:51:38 +01:00
wxString StrMenu ( const agi : : Context * c ) const override {
2012-05-23 05:38:37 +02:00
return OPT_GET ( " App/Show Toolbar " ) - > GetBool ( ) ?
_ ( " Hide Toolbar " ) :
_ ( " Show Toolbar " ) ;
}
2014-03-25 17:51:38 +01:00
wxString StrDisplay ( const agi : : Context * c ) const override {
2013-11-21 18:13:36 +01:00
return StrMenu ( nullptr ) ;
2012-05-23 05:38:37 +02:00
}
2014-03-25 17:51:38 +01:00
void operator ( ) ( agi : : Context * c ) override {
2012-05-23 05:38:37 +02:00
agi : : OptionValue * opt = OPT_SET ( " App/Show Toolbar " ) ;
opt - > SetBool ( ! opt - > GetBool ( ) ) ;
}
} ;
2014-03-13 02:39:07 +01:00
struct app_updates final : public Command {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
CMD_NAME ( " app/updates " )
2011-07-28 00:59:11 +02:00
STR_MENU ( " &Check for Updates... " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
STR_DISP ( " Check for Updates " )
2012-02-01 19:47:26 +01:00
STR_HELP ( " Check to see if there is a new version of Aegisub available " )
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
2014-03-25 17:51:38 +01:00
void operator ( ) ( agi : : Context * c ) override {
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
PerformVersionCheck ( true ) ;
}
} ;
2016-03-13 20:04:17 +01:00
# ifdef __WXMAC__
struct app_minimize final : public Command {
CMD_NAME ( " app/minimize " )
STR_MENU ( " Minimize " )
STR_DISP ( " Minimize " )
STR_HELP ( " Minimize the active window " )
void operator ( ) ( agi : : Context * c ) override {
c - > frame - > Iconize ( ) ;
}
} ;
struct app_maximize final : public Command {
CMD_NAME ( " app/maximize " )
STR_MENU ( " Zoom " )
STR_DISP ( " Zoom " )
STR_HELP ( " Maximize the active window " )
void operator ( ) ( agi : : Context * c ) override {
c - > frame - > Maximize ( ! c - > frame - > IsMaximized ( ) ) ;
}
} ;
struct app_bring_to_front final : public Command {
CMD_NAME ( " app/bring_to_front " )
STR_MENU ( " Bring All to Front " )
STR_DISP ( " Bring All to Front " )
STR_HELP ( " Bring forward all open documents to the front " )
void operator ( ) ( agi : : Context * ) override {
osx : : bring_to_front ( ) ;
}
} ;
# endif
Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 14:00:46 +01:00
}
2011-07-15 06:05:01 +02:00
namespace cmd {
void init_app ( ) {
2014-04-23 22:53:24 +02:00
reg ( agi : : make_unique < app_about > ( ) ) ;
reg ( agi : : make_unique < app_display_audio_subs > ( ) ) ;
reg ( agi : : make_unique < app_display_full > ( ) ) ;
reg ( agi : : make_unique < app_display_subs > ( ) ) ;
reg ( agi : : make_unique < app_display_video_subs > ( ) ) ;
reg ( agi : : make_unique < app_exit > ( ) ) ;
reg ( agi : : make_unique < app_language > ( ) ) ;
reg ( agi : : make_unique < app_log > ( ) ) ;
reg ( agi : : make_unique < app_new_window > ( ) ) ;
reg ( agi : : make_unique < app_options > ( ) ) ;
reg ( agi : : make_unique < app_toggle_global_hotkeys > ( ) ) ;
reg ( agi : : make_unique < app_toggle_toolbar > ( ) ) ;
2016-03-13 20:04:17 +01:00
# ifdef __WXMAC__
reg ( agi : : make_unique < app_minimize > ( ) ) ;
reg ( agi : : make_unique < app_maximize > ( ) ) ;
reg ( agi : : make_unique < app_bring_to_front > ( ) ) ;
# endif
2012-06-21 04:09:40 +02:00
# ifdef WITH_UPDATE_CHECKER
2014-04-23 22:53:24 +02:00
reg ( agi : : make_unique < app_updates > ( ) ) ;
2012-06-21 04:09:40 +02:00
# endif
2011-07-15 06:05:01 +02:00
}
}