Add a Close command to the file menu on OS X

This commit is contained in:
Thomas Goyne 2015-09-20 18:18:19 -07:00
parent ead12de8b6
commit f28e46c2e3
3 changed files with 20 additions and 2 deletions

View file

@ -36,6 +36,7 @@
#include "../compat.h"
#include "../dialog_search_replace.h"
#include "../dialogs.h"
#include "../frame_main.h"
#include "../include/aegisub/context.h"
#include "../libresrc/libresrc.h"
#include "../main.h"
@ -249,6 +250,18 @@ struct subtitle_new final : public Command {
}
};
struct subtitle_close final : public Command {
CMD_NAME("subtitle/close")
CMD_ICON(new_toolbutton)
STR_MENU("Close")
STR_DISP("Close")
STR_HELP("Close")
void operator()(agi::Context *c) override {
c->frame->Close();
}
};
struct subtitle_open final : public Command {
CMD_NAME("subtitle/open")
CMD_ICON(open_toolbutton)
@ -447,6 +460,7 @@ namespace cmd {
reg(agi::make_unique<subtitle_insert_before>());
reg(agi::make_unique<subtitle_insert_before_videotime>());
reg(agi::make_unique<subtitle_new>());
reg(agi::make_unique<subtitle_close>());
reg(agi::make_unique<subtitle_open>());
reg(agi::make_unique<subtitle_open_autosave>());
reg(agi::make_unique<subtitle_open_charset>());

View file

@ -167,6 +167,9 @@
"subtitle/new" : [
"Ctrl-N"
],
"subtitle/close" : [
"Ctrl-W"
],
"subtitle/open" : [
"Ctrl-O"
],
@ -363,4 +366,4 @@
"J"
]
}
}
}

View file

@ -45,6 +45,8 @@
{ "command" : "subtitle/open/video" },
{ "command" : "subtitle/open/autosave" },
{ "recent" : "Subtitle" },
{},
{ "command" : "subtitle/close" },
{ "command" : "subtitle/save" },
{ "command" : "subtitle/save/as" },
{ "command" : "tool/export", "text" : "&Export As..." },
@ -53,7 +55,6 @@
{ "command" : "subtitle/attachment" },
{ "command" : "tool/font_collector" },
{},
{ "command" : "app/new_window" },
{ "command" : "app/exit", "special" : "exit" }
],
"main/edit" : [