Skip to content

Commit

Permalink
fix: loading input file after loading settings
Browse files Browse the repository at this point in the history
  • Loading branch information
flxzt committed Dec 13, 2021
1 parent b12eedf commit 52f8e45
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/ui/appwindow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,28 +504,6 @@ impl RnoteAppWindow {
priv_.canvas.get().sheet().format().init(self);
priv_.canvas.get().selection_modifier().init(self);

// Loading in input file
if let Some(input_file) = self
.application()
.unwrap()
.downcast::<RnoteApp>()
.unwrap()
.input_file()
.to_owned()
{
if self
.application()
.unwrap()
.downcast::<RnoteApp>()
.unwrap()
.unsaved_changes()
{
dialogs::dialog_open_overwrite(self);
} else if let Err(e) = self.load_in_file(&input_file, None) {
log::error!("failed to load in input file, {}", e);
}
}

self.flap()
.connect_reveal_flap_notify(clone!(@weak self as appwindow => move |flap| {
if appwindow.mainheader().appmenu().parent().is_some() {
Expand Down Expand Up @@ -736,6 +714,28 @@ impl RnoteAppWindow {
actions::setup_actions(self);
actions::setup_accels(self);
appsettings::load_settings(self);

// Loading in input file, if Some
if let Some(input_file) = self
.application()
.unwrap()
.downcast::<RnoteApp>()
.unwrap()
.input_file()
.to_owned()
{
if self
.application()
.unwrap()
.downcast::<RnoteApp>()
.unwrap()
.unsaved_changes()
{
dialogs::dialog_open_overwrite(self);
} else if let Err(e) = self.load_in_file(&input_file, None) {
log::error!("failed to load in input file, {}", e);
}
}
}

pub fn open_file_w_dialogs(&self, file: &gio::File, target_pos: Option<na::Vector2<f64>>) {
Expand Down

0 comments on commit 52f8e45

Please sign in to comment.