Compare commits
4 Commits
e077e690f2
...
4a152416ff
Author | SHA1 | Date |
---|---|---|
Nefo Fortressia | 4a152416ff | |
Nefo Fortressia | 319bc3914b | |
Nefo Fortressia | 87fdfc8d9c | |
Nefo Fortressia | 0bd8b34cfe |
|
@ -14,6 +14,7 @@ pub trait FileImplementedEditor {
|
||||||
fn action_open_file(&self);
|
fn action_open_file(&self);
|
||||||
fn open_file(notebook: >k::Notebook, file: gio::File);
|
fn open_file(notebook: >k::Notebook, file: gio::File);
|
||||||
fn action_save_file_as(&self);
|
fn action_save_file_as(&self);
|
||||||
|
fn action_new_file(&self);
|
||||||
fn action_save_file(&self);
|
fn action_save_file(&self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,6 +103,14 @@ impl FileImplementedEditor for super::EchidnaWindow {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn action_new_file(&self) {
|
||||||
|
let editor_page = EchidnaCoreEditor::new(None);
|
||||||
|
|
||||||
|
self.to_imp()
|
||||||
|
.notebook
|
||||||
|
.prepend_closable_page(&editor_page, Some(>k::Label::new(Some(&"Untitled"))));
|
||||||
|
}
|
||||||
|
|
||||||
fn action_save_file(&self) {
|
fn action_save_file(&self) {
|
||||||
let page: EchidnaCoreEditor = self
|
let page: EchidnaCoreEditor = self
|
||||||
.get_current_tab()
|
.get_current_tab()
|
||||||
|
|
|
@ -122,6 +122,16 @@ impl MenubarImplementedEditor for EchidnaWindow {
|
||||||
window.action_save_file_as();
|
window.action_save_file_as();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
let action_new_file = SimpleAction::new("new-file", None);
|
||||||
|
|
||||||
|
self.add_action(&action_new_file);
|
||||||
|
|
||||||
|
action_new_file.connect_activate(clone!(@weak self as window =>
|
||||||
|
move |_action, _variant| {
|
||||||
|
window.action_new_file();
|
||||||
|
}));
|
||||||
|
}
|
||||||
{
|
{
|
||||||
let action_save = SimpleAction::new("save", None);
|
let action_save = SimpleAction::new("save", None);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue