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/
|
|
|
|
|
|
|
|
/// @file tool.cpp
|
|
|
|
/// @brief tool/ commands.
|
|
|
|
/// @ingroup command
|
|
|
|
///
|
|
|
|
|
2011-01-05 19:40:37 +01:00
|
|
|
#include "../config.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"
|
|
|
|
|
2011-12-26 23:21:19 +01:00
|
|
|
#include "../compat.h"
|
2011-01-21 07:09:20 +01:00
|
|
|
#include "../dialog_export.h"
|
2013-01-07 02:50:09 +01:00
|
|
|
#include "../dialog_fonts_collector.h"
|
|
|
|
#include "../dialog_kara_timing_copy.h"
|
2012-03-09 01:23:41 +01:00
|
|
|
#include "../dialog_manager.h"
|
2011-01-05 19:40:37 +01:00
|
|
|
#include "../dialog_resample.h"
|
|
|
|
#include "../dialog_selection.h"
|
|
|
|
#include "../dialog_style_manager.h"
|
2013-01-07 02:50:09 +01:00
|
|
|
#include "../dialog_styling_assistant.h"
|
2011-01-05 19:40:37 +01:00
|
|
|
#include "../dialog_timing_processor.h"
|
|
|
|
#include "../dialog_translation.h"
|
2013-01-07 02:50:09 +01:00
|
|
|
#include "../include/aegisub/context.h"
|
2013-01-30 04:35:37 +01:00
|
|
|
#include "../options.h"
|
2013-07-05 01:28:43 +02:00
|
|
|
#include "../resolution_resampler.h"
|
2013-01-07 02:50:09 +01:00
|
|
|
#include "../video_context.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
|
|
|
|
2013-01-04 16:01:50 +01:00
|
|
|
#include <libaegisub/fs.h>
|
2013-01-30 04:35:37 +01:00
|
|
|
#include <libaegisub/path.h>
|
2013-06-08 06:19:40 +02:00
|
|
|
#include <libaegisub/util.h>
|
2013-01-04 16:01:50 +01:00
|
|
|
|
|
|
|
#include <wx/msgdlg.h>
|
|
|
|
#include <wx/utils.h>
|
|
|
|
|
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
|
|
|
/// @defgroup cmd-tool Various tool and utilities
|
|
|
|
/// @{
|
|
|
|
|
|
|
|
|
|
|
|
/// Launch ASSDraw3 tool for vector drawing.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_assdraw : 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("tool/assdraw")
|
|
|
|
STR_MENU("ASSDraw3...")
|
|
|
|
STR_DISP("ASSDraw3")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Launch ASSDraw3 tool for vector drawing")
|
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:09:31 +01:00
|
|
|
void operator()(agi::Context *) {
|
2013-01-30 04:35:37 +01:00
|
|
|
wxExecute("\"" + config::path->Decode("?data/ASSDraw3.exe").wstring() + "\"");
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Saves a copy of subtitles with processing applied to it.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_export : 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("tool/export")
|
2011-11-18 06:00:20 +01:00
|
|
|
STR_MENU("&Export Subtitles...")
|
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("Export Subtitles")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Saves a copy of subtitles with processing applied to it")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2011-01-16 08:16:54 +01:00
|
|
|
c->videoController->Stop();
|
2011-09-28 21:46:41 +02:00
|
|
|
DialogExport(c).ShowModal();
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Open fonts collector.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_font_collector : 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("tool/font_collector")
|
2011-10-01 20:35:12 +02:00
|
|
|
STR_MENU("&Fonts Collector...")
|
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("Fonts Collector")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Open fonts collector")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:24:01 +01:00
|
|
|
c->dialog->Show<DialogFontsCollector>(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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-09-15 07:16:47 +02:00
|
|
|
/// Selects lines based on defined criteria.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_line_select : 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("tool/line/select")
|
2011-11-18 06:00:20 +01:00
|
|
|
STR_MENU("S&elect Lines...")
|
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("Select Lines")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Selects lines based on defined criteria")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Show<DialogSelection>(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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Changes resolution and modifies subtitles to conform to change.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_resampleres : 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("tool/resampleres")
|
2011-11-18 06:00:20 +01:00
|
|
|
STR_MENU("&Resample Resolution...")
|
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("Resample Resolution")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Changes resolution and modifies subtitles to conform to change")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2011-01-16 08:16:54 +01:00
|
|
|
c->videoController->Stop();
|
2012-03-25 06:04:59 +02:00
|
|
|
ResampleSettings settings;
|
|
|
|
if (DialogResample(c, settings).ShowModal() == wxID_OK)
|
|
|
|
ResampleResolution(c->ass, settings);
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Open styling assistant.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_style_assistant : 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("tool/style/assistant")
|
2011-10-01 20:35:12 +02:00
|
|
|
STR_MENU("St&yling Assistant...")
|
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("Styling Assistant")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Open styling assistant")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Show<DialogStyling>(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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-07-27 07:36:09 +02:00
|
|
|
struct tool_styling_assistant_validator : public Command {
|
|
|
|
CMD_TYPE(COMMAND_VALIDATE)
|
|
|
|
|
2011-11-07 07:18:34 +01:00
|
|
|
bool Validate(const agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
return !!c->dialog->Get<DialogStyling>();
|
2011-07-27 07:36:09 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Commit changes and move to the next line.
|
|
|
|
struct tool_styling_assistant_commit : public tool_styling_assistant_validator {
|
|
|
|
CMD_NAME("tool/styling_assistant/commit")
|
|
|
|
STR_MENU("&Accept changes")
|
|
|
|
STR_DISP("Accept changes")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Commit changes and move to the next line")
|
2011-07-27 07:36:09 +02:00
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Get<DialogStyling>()->Commit(true);
|
2011-07-27 07:36:09 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Commit changes and stay on the current line.
|
|
|
|
struct tool_styling_assistant_preview : public tool_styling_assistant_validator {
|
|
|
|
CMD_NAME("tool/styling_assistant/preview")
|
|
|
|
STR_MENU("&Preview changes")
|
|
|
|
STR_DISP("Preview changes")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Commit changes and stay on the current line")
|
2011-07-27 07:36:09 +02:00
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Get<DialogStyling>()->Commit(false);
|
2011-07-27 07:36:09 +02: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
|
|
|
|
|
|
|
/// Open styles manager.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_style_manager : 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("tool/style/manager")
|
2011-10-01 20:35:12 +02:00
|
|
|
STR_MENU("&Styles Manager...")
|
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("Styles Manager")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Open styles manager")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Show<DialogStyleManager>(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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Open Kanji timer.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_time_kanji : 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("tool/time/kanji")
|
2011-11-18 06:00:20 +01:00
|
|
|
STR_MENU("&Kanji Timer...")
|
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("Kanji Timer")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Open Kanji timer")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2011-01-16 08:17:36 +01:00
|
|
|
DialogKanjiTimer(c).ShowModal();
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Launch timing post-processor.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_time_postprocess : 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("tool/time/postprocess")
|
2011-11-18 06:00:20 +01:00
|
|
|
STR_MENU("&Timing Post-Processor...")
|
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("Timing Post-Processor")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Runs a post-processor for timing to deal with lead-ins, lead-outs, scene timing and etc")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2011-01-16 08:17:36 +01:00
|
|
|
DialogTimingProcessor(c).ShowModal();
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Open translation assistant.
|
2011-01-16 08:15:32 +01:00
|
|
|
struct tool_translation_assistant : 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("tool/translation_assistant")
|
2011-10-01 20:35:12 +02:00
|
|
|
STR_MENU("&Translation Assistant...")
|
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("Translation Assistant")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Open translation assistant")
|
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
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2011-01-16 08:16:54 +01:00
|
|
|
c->videoController->Stop();
|
2011-12-26 23:21:19 +01:00
|
|
|
try {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->ShowModal<DialogTranslation>(c);
|
2011-12-26 23:21:19 +01:00
|
|
|
}
|
|
|
|
catch (agi::Exception const& e) {
|
2012-12-23 00:18:38 +01:00
|
|
|
wxMessageBox(to_wx(e.GetChainedMessage()));
|
2011-12-26 23:21:19 +01:00
|
|
|
}
|
2011-07-27 07:36:15 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tool_translation_assistant_validator : public Command {
|
|
|
|
CMD_TYPE(COMMAND_VALIDATE)
|
|
|
|
|
2011-11-07 07:18:34 +01:00
|
|
|
bool Validate(const agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
return !!c->dialog->Get<DialogTranslation>();
|
2011-07-27 07:36:15 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Commit changes and move to the next line.
|
|
|
|
struct tool_translation_assistant_commit : public tool_translation_assistant_validator {
|
|
|
|
CMD_NAME("tool/translation_assistant/commit")
|
|
|
|
STR_MENU("&Accept changes")
|
|
|
|
STR_DISP("Accept changes")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Commit changes and move to the next line")
|
2011-07-27 07:36:15 +02:00
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Get<DialogTranslation>()->Commit(true);
|
2011-07-27 07:36:15 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Commit changes and stay on the current line.
|
|
|
|
struct tool_translation_assistant_preview : public tool_translation_assistant_validator {
|
|
|
|
CMD_NAME("tool/translation_assistant/preview")
|
|
|
|
STR_MENU("&Preview changes")
|
|
|
|
STR_DISP("Preview changes")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Commit changes and stay on the current line")
|
2011-07-27 07:36:15 +02:00
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Get<DialogTranslation>()->Commit(false);
|
2011-07-27 07:36:15 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Move to the next line without committing changes.
|
|
|
|
struct tool_translation_assistant_next : public tool_translation_assistant_validator {
|
|
|
|
CMD_NAME("tool/translation_assistant/next")
|
2012-01-08 02:05:25 +01:00
|
|
|
STR_MENU("&Next Line")
|
|
|
|
STR_DISP("Next Line")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Move to the next line without committing changes")
|
2011-07-27 07:36:15 +02:00
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Get<DialogTranslation>()->NextBlock();
|
2011-07-27 07:36:15 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Move to the previous line without committing changes.
|
|
|
|
struct tool_translation_assistant_prev : public tool_translation_assistant_validator {
|
|
|
|
CMD_NAME("tool/translation_assistant/prev")
|
2012-01-08 02:05:25 +01:00
|
|
|
STR_MENU("&Previous Line")
|
|
|
|
STR_DISP("Previous Line")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Move to the previous line without committing changes")
|
2011-07-27 07:36:15 +02:00
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Get<DialogTranslation>()->PrevBlock();
|
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
|
|
|
}
|
2011-07-27 07:36:15 +02:00
|
|
|
|
|
|
|
/// Insert the untranslated text.
|
|
|
|
struct tool_translation_assistant_insert : public tool_translation_assistant_validator {
|
|
|
|
CMD_NAME("tool/translation_assistant/insert_original")
|
|
|
|
STR_MENU("&Insert Original")
|
|
|
|
STR_DISP("Insert Original")
|
2012-02-01 19:47:26 +01:00
|
|
|
STR_HELP("Insert the untranslated text")
|
2011-07-27 07:36:15 +02:00
|
|
|
|
|
|
|
void operator()(agi::Context *c) {
|
2012-03-09 01:23:41 +01:00
|
|
|
c->dialog->Get<DialogTranslation>()->InsertOriginal();
|
2011-07-27 07:36:15 +02: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
|
|
|
/// @}
|
|
|
|
|
2011-07-15 06:05:01 +02:00
|
|
|
namespace cmd {
|
|
|
|
void init_tool() {
|
2013-06-08 06:19:40 +02:00
|
|
|
reg(agi::util::make_unique<tool_export>());
|
|
|
|
reg(agi::util::make_unique<tool_font_collector>());
|
|
|
|
reg(agi::util::make_unique<tool_line_select>());
|
|
|
|
reg(agi::util::make_unique<tool_resampleres>());
|
|
|
|
reg(agi::util::make_unique<tool_style_assistant>());
|
|
|
|
reg(agi::util::make_unique<tool_styling_assistant_commit>());
|
|
|
|
reg(agi::util::make_unique<tool_styling_assistant_preview>());
|
|
|
|
reg(agi::util::make_unique<tool_style_manager>());
|
|
|
|
reg(agi::util::make_unique<tool_time_kanji>());
|
|
|
|
reg(agi::util::make_unique<tool_time_postprocess>());
|
|
|
|
reg(agi::util::make_unique<tool_translation_assistant>());
|
2013-01-04 16:01:50 +01:00
|
|
|
#ifdef _WIN32
|
2013-01-30 04:35:37 +01:00
|
|
|
if (agi::fs::FileExists(config::path->Decode("?data/ASSDraw3.exe")))
|
2013-06-08 06:19:40 +02:00
|
|
|
reg(agi::util::make_unique<tool_assdraw>());
|
2011-07-16 01:44:03 +02:00
|
|
|
#endif
|
2013-06-08 06:19:40 +02:00
|
|
|
reg(agi::util::make_unique<tool_translation_assistant_commit>());
|
|
|
|
reg(agi::util::make_unique<tool_translation_assistant_preview>());
|
|
|
|
reg(agi::util::make_unique<tool_translation_assistant_next>());
|
|
|
|
reg(agi::util::make_unique<tool_translation_assistant_prev>());
|
|
|
|
reg(agi::util::make_unique<tool_translation_assistant_insert>());
|
2011-07-15 06:05:01 +02: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
|
|
|
}
|