Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
* - Fixing startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lains committed Oct 22, 2018
1 parent a305697 commit f63cc6f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,17 @@ namespace Yishu {
toggle_show_completed();
});

if (read_file(settings.todo_txt_file_path)) {
window.welcome.hide();
window.tree_view.show();
} else if (settings.todo_txt_file_path == "" && read_file(null)) {
window.welcome.show();
window.tree_view.hide();
}
string homedir = GLib.Environment.get_home_dir ();
string home = homedir + "/todo.txt";
settings.todo_txt_file_path = home;

if (read_file(null)) {
window.welcome.hide();
window.tree_view.show();
} else {
window.welcome.show();
window.tree_view.hide();
}

settings.changed.connect (() => {
if (read_file(settings.todo_txt_file_path)) {
Expand Down Expand Up @@ -378,7 +382,7 @@ namespace Yishu {
var infobar_label = new Gtk.Label ("The task has been deleted");
infobar.get_content_area ().add (infobar_label);
infobar.add_button("_Undo", Gtk.ResponseType.ACCEPT);
infobar.show_close_button = false;
infobar.show_close_button = true;
infobar.message_type = Gtk.MessageType.INFO;
infobar.show_all();

Expand All @@ -387,8 +391,10 @@ namespace Yishu {
});

window.info_bar_box.pack_start(infobar, true, true, 0);
infobar.response.connect( () => {
undelete();
infobar.response.connect( (response) => {
if (response == Gtk.ResponseType.ACCEPT) {
undelete();
}
infobar.destroy();
});

Expand Down
1 change: 1 addition & 0 deletions src/Preferences.vala
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace Yishu.Widgets {
string nc = homedir + "/Nextcloud/todo.txt";
string oc = homedir + "/ownCloud/todo.txt";
string other = homedir + "/bin/todo.txt/todo.txt";
settings.todo_txt_file_path = home;
string file_used = settings.todo_txt_file_path;

if (file_used == home) {
Expand Down

0 comments on commit f63cc6f

Please sign in to comment.