Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            Application.Init();
            // Set the localeDirectory right both for developement or for installed versions
            String localeDirectory = Paths.LOCALE_DIR;

            if (localeDirectory.Contains("@" + "expanded_datadir" + "@"))
            {
                localeDirectory = "./locale";
            }

            System.Console.WriteLine(localeDirectory);

            Mono.Unix.Catalog.Init("opencachemanager", localeDirectory);
            OCMApp app = new OCMApp();


            try
            {
                //##AP BusG.Init ();
                Bus    bus     = Bus.Session;
                string busName = "org.ocm.dbus";
                if (bus.RequestName(busName) != RequestNameReply.PrimaryOwner)
                {
                    IDBusComm comm = bus.GetObject <IDBusComm> (busName, new ObjectPath("/org/ocm/dbus"));
                    if (args != null)
                    {
                        if (args.Length > 0)
                        {
                            comm.ImportGPX(args[0]);
                        }
                    }
                    comm.ShowOCM();
                    return;
                }
                else
                {
                    DBusComm comm = new DBusComm(app);
                    bus.Register(new ObjectPath("/org/ocm/dbus"), comm);
                }
            }
            catch
            {
                System.Console.Error.WriteLine("NO SESSION DBUS RUNNING");
            }
            if (args != null)
            {
                if (args.Length > 0)
                {
                    app.Start(args[0]);
                }
                else
                {
                    app.Start();
                }
            }
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            Application.Init ();
            try
            {
                BusG.Init ();
                Bus bus = Bus.Session;
                string busName = "org.ocm.dbus";
                if (bus.RequestName (busName) != RequestNameReply.PrimaryOwner)
                {
                    IDBusComm comm = bus.GetObject<IDBusComm> (busName, new ObjectPath ("/org/ocm/dbus"));
                    if (args != null)
                    {
                        if (args.Length > 0)
                            comm.ImportGPX (args[0]);
                    }
                    comm.ShowOCM();
                    return;
                }
                else
                {
                    DBusComm comm = new DBusComm ();
                    bus.Register (new ObjectPath ("/org/ocm/dbus"), comm);
                }
            }
            catch
            {
                System.Console.Error.WriteLine("NO SESSION DBUS RUNNING");
            }

            if (args != null)
                if (args.Length > 0)
                    m_file = args[0];
            //System.Console.WriteLine("Path is " + "@expanded_datadir@/locale");
            // Set the localeDirectory right both for developement or for installed versions
            String localeDirectory = "@expanded_datadir@/locale";
            if (localeDirectory.Contains("@" + "expanded_datadir" + "@")) {
                localeDirectory = "./locale";
            }
            Mono.Unix.Catalog.Init ("opencachemanager", localeDirectory);
            //Mono.Unix.Catalog.Init ("opencachemanager", "./locale");
            //Mono.Unix.Catalog.Init ("opencachemanager", "@expanded_datadir@/locale");
            Config config = new Config();
            bool runWizard = !config.WizardDone;

            if (runWizard) {
                UIMonitor.getInstance ().RunSetupAssistant ();
            }
            else
            {
                ShowSplash();
            }

            Application.Run ();
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            Application.Init ();
            // Set the localeDirectory right both for developement or for installed versions
            String localeDirectory = Paths.LOCALE_DIR;
            if (localeDirectory.Contains("@" + "expanded_datadir" + "@")) {
                localeDirectory = "./locale";
            }

            System.Console.WriteLine(localeDirectory);

            Mono.Unix.Catalog.Init ("opencachemanager", localeDirectory);
            OCMApp app = new OCMApp();

            try
            {
                BusG.Init ();
                Bus bus = Bus.Session;
                string busName = "org.ocm.dbus";
                if (bus.RequestName (busName) != RequestNameReply.PrimaryOwner)
                {
                    IDBusComm comm = bus.GetObject<IDBusComm> (busName, new ObjectPath ("/org/ocm/dbus"));
                    if (args != null)
                    {
                        if (args.Length > 0)
                            comm.ImportGPX (args[0]);
                    }
                    comm.ShowOCM();
                    return;
                }
                else
                {
                    DBusComm comm = new DBusComm (app);
                    bus.Register (new ObjectPath ("/org/ocm/dbus"), comm);
                }
            }
            catch
            {
                System.Console.Error.WriteLine("NO SESSION DBUS RUNNING");
            }
            if (args != null)
                if (args.Length > 0)
                    app.Start(args[0]);
            else
                app.Start();
        }