IMDb & MoviePilot plugins: fix settings dialog layout
[cinaest] / src / movie-menu.vala
index a3e2544..8891626 100644 (file)
@@ -50,7 +50,10 @@ public class MovieMenu : AppMenu {
                        append (button);
                }
                if (store.get_editable ()) {
-                       var button = new Gtk.Button.with_label (_("Delete movie"));
+                       var button = new Gtk.Button.with_label (_("Edit movie"));
+                       button.clicked.connect (on_edit_movie);
+                       append (button);
+                       button = new Gtk.Button.with_label (_("Delete movie"));
                        button.clicked.connect (on_delete_movie);
                        append (button);
                }
@@ -77,7 +80,7 @@ public class MovieMenu : AppMenu {
                dialog.destroy ();
                if (res == Gtk.ResponseType.OK) {
                        movie.julian_date = get_julian_date (date);
-                       movie.rating = 10 * rating.get_rating ();
+                       movie.rating = rating.rating;
                        Banner.show_information (parent_window, null, _("Rated movie '%s': %.1f").printf (movie.title, movie.rating/10.0));
                        foreach (Plugin plugin in CinaestProgram.plugins) {
                                foreach (MovieSource source in plugin.get_sources ()) {
@@ -108,5 +111,10 @@ public class MovieMenu : AppMenu {
                        movie_deleted ();
                }
        }
+
+       private void on_edit_movie () {
+               var dialog = new MovieEditDialog (parent_window, movie);
+               var res = dialog.run ();
+       }
 }