Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Runtime + Fix #49 #50

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-aux/flatpak/io.github.diegoivanme.flowtime.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"app-id" : "io.github.diegoivanme.flowtime",
"runtime" : "org.gnome.Platform",
"runtime-version" : "43",
"runtime-version" : "44",
"sdk" : "org.gnome.Sdk",
"command" : "flowtime",
"sdk-extensions" : [
Expand Down
5 changes: 4 additions & 1 deletion src/Services/Timer.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Timer.vala
*
* Copyright 2022 Diego Iván <diegoivan.mae@gmail.com>
* Copyright 2022-2023 Diego Iván <diegoivan.mae@gmail.com>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
Expand Down Expand Up @@ -54,6 +54,9 @@ public class Flowtime.Services.Timer : Object {

public void stop () {
running = false;
if (timeout_id == null) {
return;
}
Source.remove (timeout_id);
}

Expand Down
25 changes: 13 additions & 12 deletions src/Widgets/StatsWindow.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* StatsWindow.vala
*
* Copyright 2022 Diego Iván <diegoivan.mae@gmail.com>
* Copyright 2022-2023 Diego Iván <diegoivan.mae@gmail.com>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
Expand Down Expand Up @@ -66,19 +66,20 @@ namespace Flowtime {

[GtkCallback]
private void on_save_button_clicked () {
var filechooser = new Gtk.FileChooserNative (null,
this, SAVE,
null, null
);
filechooser.response.connect (on_filechooser_response);
filechooser.show ();
save_action.begin ();
}

private void on_filechooser_response (Gtk.NativeDialog dialog, int response)
{
var filechooser = (Gtk.FileChooserNative) dialog;
if (response == Gtk.ResponseType.ACCEPT) {
save_as_csv.begin (filechooser.get_file ());
private async void save_action () {
var file_dialog = new Gtk.FileDialog () {
modal = true
};

try {
File file = yield file_dialog.save (this, null);
yield save_as_csv (file);
}
catch (Error e) {
critical (e.message);
}
}

Expand Down