Add update option to the app menu.
This commit is contained in:
parent
35009e2574
commit
4c8c1f0013
@ -57,6 +57,7 @@ fn build_ui(app: >k::Application) {
|
|||||||
let menu = gio::Menu::new();
|
let menu = gio::Menu::new();
|
||||||
menu.append("Quit", "app.quit");
|
menu.append("Quit", "app.quit");
|
||||||
menu.append("Checkup", "app.check");
|
menu.append("Checkup", "app.check");
|
||||||
|
menu.append("Update feeds", "app.update");
|
||||||
app.set_app_menu(&menu);
|
app.set_app_menu(&menu);
|
||||||
|
|
||||||
// Get the main window
|
// Get the main window
|
||||||
@ -90,6 +91,13 @@ fn build_ui(app: >k::Application) {
|
|||||||
});
|
});
|
||||||
app.add_action(&check);
|
app.add_action(&check);
|
||||||
|
|
||||||
|
let update = gio::SimpleAction::new("update", None);
|
||||||
|
let ct_clone = ct.clone();
|
||||||
|
update.connect_activate(move |_, _| {
|
||||||
|
utils::refresh_feed(ct_clone.clone(), None);
|
||||||
|
});
|
||||||
|
app.add_action(&update);
|
||||||
|
|
||||||
// Update on startup
|
// Update on startup
|
||||||
gtk::timeout_add_seconds(
|
gtk::timeout_add_seconds(
|
||||||
30,
|
30,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user