Skip to content
Open
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
29 changes: 24 additions & 5 deletions src/Widgets/PagesList.vala
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,30 @@ public class ENotes.PagesList : Gtk.Box {
refresh ();
});

listbox.row_selected.connect ((row) => {
if (row == null || loading_pages) return;
minus_button.set_sensitive (true);
ENotes.ViewEditStack.get_instance ().set_page (((ENotes.PageItem) row).page, false);
});
listbox.row_selected.connect ((last_selected_row) => {
if (last_selected_row == null || loading_pages) return;

var rows = listbox.get_selected_rows ();

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra white-space line

bool all_trashed = true;
bool all_not_trashed = true;

foreach (var row in rows) {
var pagerow = ((ENotes.PageItem) row).page;
var page_trashed = Trash.get_instance ().is_page_trashed (pagerow);

all_trashed = all_trashed && page_trashed;
all_not_trashed = all_not_trashed && !page_trashed;
}
if (all_not_trashed) {
minus_button.set_sensitive (true);
}
else {
minus_button.set_sensitive (false);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can replace all of this for minus_button.set_sensitive (all_not_trashed)


ENotes.ViewEditStack.get_instance ().set_page (((ENotes.PageItem) last_selected_row).page, false);
});

listbox.row_activated.connect ((row) => {
window.toggle_edit ();
Expand Down