~unity-team/unity-lens-video/saucy

« back to all changes in this revision

Viewing changes to src/remote-video-main.vala

  • Committer: Tarmac
  • Author(s): Michal Hruby
  • Date: 2013-09-18 17:38:52 UTC
  • mfrom: (120.1.4 unity-lens-videos)
  • Revision ID: tarmac-20130918173852-berr9scs5ml4b4xv
Simplify the scope, use the non-deprecated API, and pass a form-factor hint to the server. Fixes: https://bugs.launchpad.net/bugs/1226004, https://bugs.launchpad.net/bugs/1226573.

Approved by Pawel Stolowski, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
namespace Unity.VideoLens {
21
21
 
22
 
  static const string BUS_NAME = "net.launchpad.scope.RemoteVideos";
23
 
  Unity.DeprecatedScope scope;
24
 
  static Application? app = null;
25
 
 
26
22
  public static int main (string[] args)
27
23
  {
28
24
    GLib.Environment.set_prgname ("unity-remote-video-scope");
34
30
    GLib.Intl.bind_textdomain_codeset (Config.PACKAGE, "UTF-8");
35
31
    GLib.Intl.setlocale(GLib.LocaleCategory.ALL, "");
36
32
 
 
33
    var scope = new RemoteVideoScope ();
 
34
    var exporter = new Unity.ScopeDBusConnector (scope);
37
35
    try
38
36
    {
39
 
      app = Extras.dbus_own_name (BUS_NAME, () =>
40
 
      {
41
 
        scope = new RemoteVideoScope ();
42
 
        scope.export ();
43
 
      });
44
 
    }
45
 
    catch (Error e)
46
 
    {
47
 
      warning ("Failed to start video lens daemon: %s\n", e.message);
48
 
      return 1;
49
 
    }
50
 
 
51
 
    if (app == null)
52
 
    {
53
 
      warning ("Another instance of the Unity Videos Lens " +
54
 
             "already appears to be running.\nBailing out.\n");
55
 
      return 2;
56
 
    }
57
 
 
58
 
    return app.run ();
 
37
      exporter.export ();
 
38
    }
 
39
    catch (GLib.Error e)
 
40
    {
 
41
      error ("Cannot export scope to DBus: %s", e.message);
 
42
    }
 
43
    Unity.ScopeDBusConnector.run ();
 
44
 
 
45
    return 0;
59
46
  }
60
47
 
61
48
} /* namespace */