Skip to content

Commit

Permalink
Application: don't handle main loop manually (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored and Corentin Noël committed Jan 5, 2019
1 parent a9cc136 commit 5083f96
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,20 @@ namespace Maya {
if (Option.ADD_EVENT) {
window.on_tb_add_clicked (window.calview.selected_date);
}

Gtk.main ();
}

public override void open (File[] files, string hint) {
bool first_start = false;
if (get_windows () == null) {
var calmodel = Model.CalendarModel.get_default ();
calmodel.load_all_sources ();

init_gui ();
window.show_all ();
first_start = true;
}

var dialog = new Maya.View.ImportDialog (files);
dialog.transient_for = window;
dialog.show_all ();

if (first_start) {
Gtk.main ();
}
}

/**
Expand Down Expand Up @@ -137,9 +129,8 @@ namespace Maya {
set_accels_for_action("app.quit", new string[] { "<Control>q" });
}

void on_quit () {
private void on_quit () {
Model.CalendarModel.get_default ().delete_trashed_calendars ();
Gtk.main_quit ();
}
}

Expand Down

0 comments on commit 5083f96

Please sign in to comment.