Movie list window: open the movie detail window on the current window stack
[cinaest] / src / movie-list-window.vala
index 1661859..fb08efb 100644 (file)
@@ -69,7 +69,7 @@ public class MovieListWindow : StackableWindow {
 
                // Movie list - connected to menu for sorting
                movie_list = new MovieListView (this, source.get_name () == _("Watched movies"));
-               menu.sortable = movie_list.store;
+               menu.store = movie_list.store;
                store = movie_list.store;
                store.source = source;
 
@@ -178,7 +178,10 @@ public class MovieListWindow : StackableWindow {
                        return;
                }
 
-               var dialog = new Note.confirmation (this, _("Delete %d movies?").printf (count));
+               var dialog = new Note.confirmation (this, 
+                                                   ngettext ("Delete %d movie?",
+                                                             "Delete %d movies?",
+                                                             count).printf (count));
                var res = dialog.run ();
 
                if (res == Gtk.ResponseType.OK) {
@@ -268,11 +271,17 @@ public class MovieListWindow : StackableWindow {
 
        private int movies_per_screen () {
                if (portrait_mode) {
-                       // 3x3 full posters or 10 full list items
-                       return movie_list.poster_mode ? 9 : 10;
+                       // 3x3 full posters or 10 full list items,
+                       // 10 full list items in list mode without search bar
+                       return (search_bar_visible || movie_list.poster_mode) ? 9 : 10;
                } else {
-                       // 5x2 posters or 6 list items
-                       return movie_list.poster_mode ? 10 : 6;
+                       if (search_bar_visible) {
+                               // 5x1 full posters or 5 list items
+                               return 5;
+                       } else {
+                               // 5x2 posters or 6 list items
+                               return movie_list.poster_mode ? 10 : 6;
+                       }
                }
        }
 
@@ -282,7 +291,7 @@ public class MovieListWindow : StackableWindow {
 
                movie_window = new MovieWindow.with_movie (movie, store);
                movie_window.destroy.connect (() => { movie_window = null; });
-               movie_window.show ();
+               get_stack ().push_1 (movie_window);
        }
 
        private void on_row_deleted (TreePath path) {