Run chats independently
This commit is contained in:
@@ -9,6 +9,7 @@ const NEW_CHAT: &str = "new-chat";
|
||||
const EXPORT_CHAT: &str = "export-chat";
|
||||
const TOGGLE_SIDEBAR: &str = "toggle-sidebar";
|
||||
const HELP: &str = "help";
|
||||
const QUIT: &str = "quit";
|
||||
const UNDO: &str = "undo";
|
||||
const REDO: &str = "redo";
|
||||
const CUT: &str = "cut";
|
||||
@@ -37,6 +38,7 @@ pub(crate) enum NativeMenuEvent {
|
||||
ExportChat,
|
||||
ToggleSidebar,
|
||||
Help,
|
||||
Quit,
|
||||
Edit(EditCommand),
|
||||
}
|
||||
|
||||
@@ -100,6 +102,12 @@ pub(crate) fn install() -> Result<NativeMenu, String> {
|
||||
let copy = edit_item(COPY, "Copy", Code::KeyC, None);
|
||||
let paste = edit_item(PASTE, "Paste", Code::KeyV, None);
|
||||
let select_all = edit_item(SELECT_ALL, "Select All", Code::KeyA, None);
|
||||
let quit = MenuItem::with_id(
|
||||
QUIT,
|
||||
"Quit DS4Server",
|
||||
true,
|
||||
Some(Accelerator::new(Some(Modifiers::SUPER), Code::KeyQ)),
|
||||
);
|
||||
|
||||
application
|
||||
.append_items(&[
|
||||
@@ -113,7 +121,7 @@ pub(crate) fn install() -> Result<NativeMenu, String> {
|
||||
&PredefinedMenuItem::hide_others(None),
|
||||
&PredefinedMenuItem::show_all(None),
|
||||
&PredefinedMenuItem::separator(),
|
||||
&PredefinedMenuItem::quit(None),
|
||||
&quit,
|
||||
])
|
||||
.map_err(|error| error.to_string())?;
|
||||
file.append_items(&[
|
||||
@@ -191,6 +199,7 @@ pub(crate) fn next_event() -> Option<NativeMenuEvent> {
|
||||
EXPORT_CHAT => NativeMenuEvent::ExportChat,
|
||||
TOGGLE_SIDEBAR => NativeMenuEvent::ToggleSidebar,
|
||||
HELP => NativeMenuEvent::Help,
|
||||
QUIT => NativeMenuEvent::Quit,
|
||||
UNDO => NativeMenuEvent::Edit(EditCommand::Undo),
|
||||
REDO => NativeMenuEvent::Edit(EditCommand::Redo),
|
||||
CUT => NativeMenuEvent::Edit(EditCommand::Cut),
|
||||
|
||||
Reference in New Issue
Block a user