Ejemplo n.º 1
0
 public static void Main(string[] args)
 {
     Gnome.Program program = new Gnome.Program("FastOpen", "1.0", Gnome.Modules.UI, args);
     FastOpenWindow fs = new FastOpenWindow ();
     fs.ShowAll ();
     program.Run ();
 }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            Gnome.Program  program = new Gnome.Program("FastOpen", "1.0", Gnome.Modules.UI, args);
            FastOpenWindow fs      = new FastOpenWindow();

            program.Run();
        }
Ejemplo n.º 3
0
        public void StartMainLoop()
        {
#if PANEL_APPLET
            program.Run();
#else
            Gtk.Application.Run();
#endif
        }
Ejemplo n.º 4
0
        public static void Main(string[] args)
        {
            bool dbus_enabled = true;

            try {
                // Init DBus
                BusG.Init();
            } catch (Exception e) {
                // Lack of specific exception
                Log.Error(e, "Failed to access dbus session bus. Make sure dbus session bus is running and the environment variable DBUS_SESSION_BUS_ADDRESS is set.");
                dbus_enabled = false;
            }

            string query = ParseArgs(args);

            // If there is already an instance of beagle-search running
            // request our search proxy object and open up a query in
            // that instance.

            if (dbus_enabled && Bus.Session.RequestName(BUS_NAME) != RequestNameReply.PrimaryOwner)
            {
                if (icon_enabled)
                {
                    Console.WriteLine("There is already an instance of beagle-search running.");
                    Console.WriteLine("Cannot run in --icon mode! Exiting...");
                    Environment.Exit(1);
                }

                ISearch s = Bus.Session.GetObject <ISearch> (BUS_NAME, new ObjectPath(PATH_NAME));
                s.Query(query);

                return;
            }

            SystemInformation.SetProcessName("beagle-search");
            Catalog.Init("beagle", ExternalStringsHack.LocaleDir);

            Gnome.Program program = new Gnome.Program("search", "0.0", Gnome.Modules.UI, args);
            Gtk.IconTheme.Default.AppendSearchPath(System.IO.Path.Combine(ExternalStringsHack.PkgDataDir, "icons"));

            if (icon_enabled && !dbus_enabled)
            {
                HigMessageDialog.RunHigMessageDialog(null,
                                                     Gtk.DialogFlags.Modal,
                                                     Gtk.MessageType.Error,
                                                     Gtk.ButtonsType.Close,
                                                     Catalog.GetString("Session D-Bus not accessible"),
                                                     Catalog.GetString("Cannot run with parameter '--icon' when session D-Bus is not accessible."));
                Environment.Exit(1);
            }

            Gnome.Vfs.Vfs.Initialize();

            // FIXME: Passing these icon and docs enabled properties
            // sucks. We really need to do something about them.
            Search search = new Search(icon_enabled, docs_enabled);

            if (!String.IsNullOrEmpty(query) || !icon_enabled)
            {
                search.Query(query);
            }

            if (dbus_enabled)
            {
                Bus.Session.Register(BUS_NAME, new ObjectPath(PATH_NAME), search);
            }

            program.Run();
        }
Ejemplo n.º 5
0
        static int RunApp(string[] args, int n)
        {
            Project = SteticApp.CreateProject();

            Project.WidgetAdded     += OnWidgetAdded;
            Project.WidgetRemoved   += OnWidgetRemoved;
            Project.ModifiedChanged += OnProjectModified;
            Project.ProjectReloaded += OnProjectReloaded;

            Palette      = SteticApp.PaletteWidget;
            widgetTree   = SteticApp.WidgetTreeWidget;
            Signals      = SteticApp.SignalsWidget;
            propertyTree = SteticApp.PropertiesWidget;
            ProjectView  = new WindowListWidget();

            UIManager = new Stetic.UIManager(Project);

            Glade.XML.CustomHandler = CustomWidgetHandler;
            Glade.XML glade = new Glade.XML("stetic.glade", "MainWindow");
            glade.Autoconnect(typeof(SteticMain));

            if (ProjectView.Parent is Gtk.Viewport &&
                ProjectView.Parent.Parent is Gtk.ScrolledWindow)
            {
                Gtk.Viewport       viewport = (Gtk.Viewport)ProjectView.Parent;
                Gtk.ScrolledWindow scrolled = (Gtk.ScrolledWindow)viewport.Parent;
                viewport.Remove(ProjectView);
                scrolled.Remove(viewport);
                scrolled.AddWithViewport(ProjectView);
            }

            foreach (Gtk.Widget w in glade.GetWidgetPrefix(""))
            {
                Gtk.Window win = w as Gtk.Window;
                if (win != null)
                {
                    win.AddAccelGroup(UIManager.AccelGroup);
                    win.ShowAll();
                }
            }
            MainWindow                      = (Gtk.Window)Palette.Toplevel;
            WidgetNotebook                  = (Gtk.Notebook)glade ["notebook"];
            WidgetNotebook.SwitchPage      += OnPageChanged;
            ProjectView.ComponentActivated += OnWidgetActivated;
            widgetTree.SelectionChanged    += OnSelectionChanged;

#if GTK_SHARP_2_6
            // This is needed for both our own About dialog and for ones
            // the user constructs
            Gtk.AboutDialog.SetUrlHook(ActivateUrl);
#endif

            if (n < args.Length)
            {
                LoadProject(args [n]);
            }

            ReadConfiguration();

            foreach (string s in Configuration.WidgetLibraries)
            {
                SteticApp.AddWidgetLibrary(s);
            }
            SteticApp.UpdateWidgetLibraries(false);

            ProjectView.Fill(Project);

            Program.Run();
            return(0);
        }
Ejemplo n.º 6
0
    public GladeApp(string[] args)
    {
        program = new Gnome.Program ("mCatalog", "1.0", Gnome.Modules.UI, args);
        Mono.Posix.Catalog.Init ("mcatalog", Defines.GNOME_LOCALE_DIR);

        // Proxy Setup
        bool use_proxy = Conf.Get ("/system/http_proxy/use_http_proxy", false);

        if (use_proxy) {
            string proxy_host = Conf.Get ("/system/http_proxy/host", "");
            int proxy_port = Conf.Get ("/system/http_proxy/port", 8080);
            string proxy = string.Format("http://{0}:{1}/", proxy_host, proxy_port);
            WebProxy proxyObject = new WebProxy(proxy, true);
            System.Net.GlobalProxySelection.Select = proxyObject;
        }

        database = new Database (Conf.HomeDir+"/db.db");
        database.Debug = true;

        Glade.XML gxml = new Glade.XML (null, "mainwindow.glade", "app1", "mcatalog");
        gxml.Autoconnect (this);
        app1.DeleteEvent += OnWindowDeleteEvent;

        presentation = new Presentation ();
        itemShelf = new ItemShelf (presentation);
        swPresentation.AddWithViewport (presentation);
        presentation.Init ();

        searchEntry.Activated += OnSearchEntryActivated;

        itemListPaned.SizeRequested += OnItemListPanedResized;

        // Fill the list hbox
        HBox hBoxList = (HBox)gxml["hBoxList"];
        buttonList = new ToggleButton ();
        buttonList.Clicked += OnButtonListClicked;
        Gtk.Image image1 = new Gtk.Image (new Gdk.Pixbuf (null, "list.png"));
        image1.Visible = true;
        buttonList.Add (image1);
        buttonList.Relief = ReliefStyle.Half;
        hBoxList.PackStart (buttonList, false, true, 0);
        buttonShelf = new ToggleButton ();
        buttonShelf.Clicked += OnButtonShelfClicked;
        Gtk.Image image2 = new Gtk.Image (new Gdk.Pixbuf (null, "shelf.png"));
        image2.Visible = true;
        buttonShelf.Add (image2);
        buttonShelf.Relief = ReliefStyle.Half;
        hBoxList.PackStart (buttonShelf, false, true, 0);
        titleWidget = new TitleWidget ();
        titleWidget.OnOrderChanged += OnOrderChanged;
        hBoxList.PackStart (titleWidget, true, true, 4);
        hBoxList.ShowAll();

        // Get the menu items we need to handle
        menuItemAddItem.Sensitive = false;
        menuItemRemoveItem.Sensitive = false;
        menuItemShelfView.Data["view"] = View.Shelf;
        menuItemListView.Data["view"] = View.List;

        menuItemShelfView.Toggled += OnViewToggled;

        // Buttons
        addItemButton.Sensitive = false;
        removeItemButton.Sensitive = false;
        lendItemButton.Sensitive = false;
        editItemButton.Sensitive = false;

        lendItemButton.Clicked += LendOrReturnItem;
        editItemButton.Clicked += EditItem;

        // Populate the catalog tree
        PopulateCatalogs ();
        PopulateBorrowers ();

        app1.ShowAll();
        RestoreWindowState ();
        program.Run();
    }
Ejemplo n.º 7
0
 public void StartMainLoop()
 {
     program.Run();
 }
Ejemplo n.º 8
0
		public static void Main (string[] args)
		{
			bool dbus_enabled = true;

			try {
				// Init DBus
				BusG.Init ();
			} catch (Exception e) {
				// Lack of specific exception
				Log.Error (e, "Failed to access dbus session bus. Make sure dbus session bus is running and the environment variable DBUS_SESSION_BUS_ADDRESS is set.");
				dbus_enabled = false;
			}

			string query = ParseArgs (args);

			// If there is already an instance of beagle-search running
			// request our search proxy object and open up a query in
			// that instance.

			if (dbus_enabled && Bus.Session.RequestName (BUS_NAME) != RequestNameReply.PrimaryOwner) {
				if (icon_enabled) {
					Console.WriteLine ("There is already an instance of beagle-search running.");
					Console.WriteLine ("Cannot run in --icon mode! Exiting...");
					Environment.Exit (1);
				}

				ISearch s = Bus.Session.GetObject<ISearch> (BUS_NAME, new ObjectPath (PATH_NAME));
				s.Query (query);

				return;
			}

			SystemInformation.SetProcessName ("beagle-search");
			Catalog.Init ("beagle", ExternalStringsHack.LocaleDir);

			Gnome.Program program = new Gnome.Program ("search", "0.0", Gnome.Modules.UI, args);
			Gtk.IconTheme.Default.AppendSearchPath (System.IO.Path.Combine (ExternalStringsHack.PkgDataDir, "icons"));

			if (icon_enabled && ! dbus_enabled) {
				HigMessageDialog.RunHigMessageDialog (null,
								      Gtk.DialogFlags.Modal,
								      Gtk.MessageType.Error, 
								      Gtk.ButtonsType.Close, 
								      Catalog.GetString ("Session D-Bus not accessible"), 
								      Catalog.GetString ("Cannot run with parameter '--icon' when session D-Bus is not accessible."));
				Environment.Exit (1);
			}

			Gnome.Vfs.Vfs.Initialize ();

			// FIXME: Passing these icon and docs enabled properties
			// sucks. We really need to do something about them.
			Search search = new Search (icon_enabled, docs_enabled);

			if (!String.IsNullOrEmpty (query) || !icon_enabled)
				search.Query (query);

			if (dbus_enabled)
				Bus.Session.Register (BUS_NAME, new ObjectPath (PATH_NAME), search);

			program.Run ();
		}