private dynamic DBus.Object server;
List<MovieSource> sources;
private weak Osso.Context osso_context;
+ private Gtk.Window _window;
public override void hello (Gtk.Window window, Osso.Context context) {
string filename = Path.build_filename (Environment.get_user_cache_dir(),
sources.append (source);
osso_context = context;
+ _window = window;
// FIXME - this forces the inclusion of config.h
(void) Config.GETTEXT_PACKAGE;
public override List<MovieAction> get_actions (Movie movie) {
List<MovieAction> list = null;
+ if (movie.year > 0)
+ list.append (new MovieAction (_("IMDb page"), on_visit_imdb, movie));
+ else
+ list.append (new MovieAction (_("Lookup on IMDb"), on_visit_imdb, movie));
+
return list;
}
+ private void on_visit_imdb (Movie movie) {
+ var url = "http://www.imdb.com/find?s=tt&q=" + movie.title.replace(" ", "+");
+ if (movie.year > 0)
+ url += "+(%d)".printf (movie.year);
+
+ var status = osso_context.rpc_run_with_defaults ("osso_browser", "open_new_window", null, 's', url, 'b', false);
+ if (status != Osso.Status.OK) {
+ var banner = (Banner) Hildon.Banner.show_information_with_markup (_window, null, "Failed to open browser.");
+ banner.set_timeout (1500);
+ }
+ }
+
public override void settings_dialog (Gtk.Window window) {
var dialog = new Gtk.Dialog ();
dialog.set_transient_for (window);