Movie sources: add get_editable method - will determine UI behavior
authorPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 9 Nov 2009 09:39:53 +0000 (10:39 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Tue, 17 Nov 2009 21:32:46 +0000 (22:32 +0100)
For example, only editable sources will have a "Delete movie" button
in the movie menu.

src/plugin-interface.vala
src/plugins/google-plugin.vala
src/plugins/imdb-plugin.vala

index 27ebcd3..bdf1bbc 100644 (file)
@@ -37,6 +37,8 @@ public abstract class MovieSource : Object {
        public abstract unowned string get_name ();
 
        public abstract unowned string get_description ();
+
+       public abstract bool get_editable ();
 }
 
 public class MovieAction : Object {
index 457e683..7f26ad1 100644 (file)
@@ -104,6 +104,10 @@ class GoogleSource : MovieSource {
                }
                return description;
        }
+
+       public override bool get_editable () {
+               return false;
+       }
 }
 
 [ModuleInit]
index d95694f..85ece43 100644 (file)
@@ -191,6 +191,10 @@ class IMDBSource : MovieSource {
        public override unowned string get_description () {
                return "Movies on IMDb";
        }
+
+       public override bool get_editable () {
+               return false;
+       }
 }
 
 [ModuleInit]