4 class IdentityManagerApp : Window {
5 public IdentityManagerModel model;
6 private IdentityManagerView view;
7 private MoonshotServer ipc_server;
9 public OSXApplication osxApp;
11 private const int WINDOW_WIDTH = 400;
12 private const int WINDOW_HEIGHT = 500;
16 public IdentityManagerApp () {
17 model = new IdentityManagerModel(this);
18 view = new IdentityManagerView(this);
21 osxApp = OSXApplication.get_instance();
27 private void init_ipc_server ()
29 // Errors will currently be sent via g_log - ie. to an
30 // obtrusive message box, on Windows
32 this.ipc_server = MoonshotServer.get_instance ();
33 MoonshotServer.start (this.view);
36 private void init_ipc_server ()
40 var conn = DBus.Bus.get (DBus.BusType.SESSION);
41 dynamic DBus.Object bus = conn.get_object ("org.freedesktop.DBus",
42 "/org/freedesktop/DBus",
43 "org.freedesktop.DBus");
45 // try to register service in session bus
46 uint reply = bus.request_name ("org.janet.Moonshot", (uint) 0);
47 assert (reply == DBus.RequestNameReply.PRIMARY_OWNER);
49 this.ipc_server = new MoonshotServer (this.view);
50 conn.register_object ("/org/janet/moonshot", ipc_server);
54 stderr.printf ("%s\n", e.message);
58 private void bus_acquired_cb (DBusConnection conn)
61 conn.register_object ("/org/janet/moonshot", ipc_server);
65 stderr.printf ("%s\n", e.message);
69 private void init_ipc_server ()
71 this.ipc_server = new MoonshotServer (this.view);
72 GLib.Bus.own_name (GLib.BusType.SESSION,
74 GLib.BusNameOwnerFlags.NONE,
78 error ("Couldn't own name %s on DBus.", name);
85 public static int main(string[] args){
87 stdout.printf("Hello\n");
88 foreach (string arg in args)
89 stdout.printf("arg %s\n", arg);
92 // Force specific theme settings on Windows without requiring a gtkrc file
93 Gtk.Settings settings = Gtk.Settings.get_default ();
94 settings.set_string_property ("gtk-theme-name", "ms-windows", "moonshot");
95 settings.set_long_property ("gtk-menu-images", 0, "moonshot");
98 Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
99 Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
100 Intl.textdomain (Config.GETTEXT_PACKAGE);
103 var app = new IdentityManagerApp();