Skip to content

Commit

Permalink
Various fixes (#24)
Browse files Browse the repository at this point in the history
* Various fixes, mostly warnings

* Update description
  • Loading branch information
leolost2605 committed Dec 23, 2023
1 parent db356b1 commit 40dc5c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
9 changes: 8 additions & 1 deletion data/io.github.leolost2605.gradebook.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@

<description>
<p>
A simple tool to keep track of your grades! It supports numerical grading systems as well as percentage grades.
Gradebook is a simple tool that helps you keep track of your grades. This way you always know how you are doing in your courses.
</p>
<p>Features:</p>
<ul>
<li>Support for numerical and percentage systems</li>
<li>Assign your grades to categories with different weighting</li>
<li>Add notes to your grades so that you later know how you could improve</li>
<li>Your average is calculated automatically taking the weighting of the different categories into account</li>
</ul>
</description>

<developer_name>Leonhard Kargl</developer_name>
Expand Down
13 changes: 4 additions & 9 deletions src/application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,16 @@ public class MyApp : Adw.Application {

construct {
ActionEntry[] action_entries = {
{ "test", this.on_test_action },
{ "help", this.on_help_action },
{ "about", this.on_about_action },
{ "newsubject", this.on_newsubject_action},
};
this.add_action_entries (action_entries, this);
}

public void on_test_action () {
print ("test_action");
}


public void on_help_action () {
Gtk.show_uri (main_window, "https://github.com/leolost2605/Gradebook/wiki", 0);
var uri_launcher = new Gtk.UriLauncher ("https://github.com/leolost2605/Gradebook/wiki");
uri_launcher.launch.begin (main_window, null);
}

public void on_newsubject_action () {
Expand All @@ -34,7 +29,7 @@ public class MyApp : Adw.Application {
SubjectManager.get_default ().new_subject (dialog.name_entry_box.get_text (), dialog.get_categories ());
}
dialog.destroy ();
return true;
return true;
});
dialog.present ();
}
Expand All @@ -47,7 +42,7 @@ public class MyApp : Adw.Application {
translator_credits = _("translator-credits"),
application_name = _("Gradebook"),
application_icon = "io.github.leolost2605.gradebook",
version = "1.1.1",
version = "1.2",
license_type = GPL_3_0,
website = "https://github.com/leolost2605/Gradebook",
issue_url = "https://github.com/leolost2605/Gradebook/issues",
Expand Down
3 changes: 1 addition & 2 deletions src/subject-manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class SubjectManager : Object {

public async void read_data () {
yield read_data_legacy ();

var keyfile = new KeyFile ();

try {
Expand All @@ -70,7 +70,6 @@ public class SubjectManager : Object {
public async void write_data () {
var keyfile = new KeyFile ();

var parser = new SubjectParser ();
for (int i = 0; i < subjects.get_n_items (); i++) {
var subject = (Subject) subjects.get_item (i);

Expand Down
4 changes: 2 additions & 2 deletions src/window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public class Window : Adw.ApplicationWindow {
navigation_sidebar.select_row (navigation_sidebar.get_row_at_index ((int) pos));
});

subject_manager.read_data ();
subject_manager.read_data.begin ();

close_request.connect (() => {
set_visible (false);
visible = false;
subject_manager.write_data.begin (() => {
destroy ();
});
Expand Down

0 comments on commit 40dc5c6

Please sign in to comment.