コード例 #1
0
ファイル: Main.cs プロジェクト: balihb/basenji
        public static void Main(string[] args)
        {
            string dbPath;
            bool   debug;

            if (!GetOptions(args, out dbPath, out debug))
            {
                return;
            }

            if (debug)
            {
                Basenji.Global.EnableDebugging  = true;
                VolumeDB.Global.EnableDebugging = true;
            }

            if (!string.IsNullOrEmpty(App.Settings.EnforceCulture))
            {
                Basenji.Global.EnforceCulture(App.Settings.EnforceCulture);
                VolumeDB.Global.EnforceCulture(App.Settings.EnforceCulture);
            }

            Debug.WriteLine(string.Format("{0} {1}", App.Name, App.Version));
            Debug.WriteLine(string.Format("Used runtime: {0}",
                                          System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()));

            if (CurrentPlatform.IsUnix)
            {
                Util.SetProcName(App.Name.ToLower());
            }

            Application.Init();

            // see http://bugzilla.ximian.com/show_bug.cgi?id=77130
            if (!GLib.Thread.Supported)
            {
                GLib.Thread.Init();
            }

            using (new InstanceLock()) {
                // load custom icon theme
                string themeName = App.Settings.CustomThemeName;
                if (!string.IsNullOrEmpty(themeName))
                {
                    string path     = System.IO.Path.Combine(App.CUSTOM_THEME_PATH, themeName);
                    string fullPath = System.IO.Path.GetFullPath(path);
                    Icons.CustomIconTheme.Load(fullPath);
                }

                Gui.MainWindow win = new Gui.MainWindow(dbPath);
                Gui.Base.WindowBase.MainWindow = win;

                win.Show();
                Application.Run();
            }
        }
コード例 #2
0
ファイル: ItemSearch.cs プロジェクト: pulb/basenji
        public ItemSearch(MainWindow mainWindow, VolumeDatabase db)
        {
            windowDeleted = false;
            this.mainWindow = mainWindow;
            this.database = db;
            BuildGui();
            btnSearch.Sensitive = false;
            txtSearchString.GrabFocus();

            // the widget should be visible the first time
            // when the user clicks on an item
            itemInfo.Hide();
        }
コード例 #3
0
ファイル: Main.cs プロジェクト: pulb/basenji
        public static void Main(string[] args)
        {
            string dbPath;
            bool debug;

            if (!GetOptions(args, out dbPath, out debug))
                return;

            if (debug) {
                Basenji.Global.EnableDebugging = true;
                VolumeDB.Global.EnableDebugging = true;
            }

            if (!string.IsNullOrEmpty(App.Settings.EnforceCulture)) {
                Basenji.Global.EnforceCulture(App.Settings.EnforceCulture);
                VolumeDB.Global.EnforceCulture(App.Settings.EnforceCulture);
            }

            Debug.WriteLine(string.Format("{0} {1}", App.Name, App.Version));
            Debug.WriteLine(string.Format("Used runtime: {0}",
                                          System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()));

            if (CurrentPlatform.IsUnix)
                Util.SetProcName(App.Name.ToLower());

            Application.Init();

            // see http://bugzilla.ximian.com/show_bug.cgi?id=77130
            if (!GLib.Thread.Supported)
                GLib.Thread.Init();

            using (new InstanceLock()) {
                // load custom icon theme
                string themeName = App.Settings.CustomThemeName;
                if (!string.IsNullOrEmpty(themeName)) {
                    string path = System.IO.Path.Combine(App.CUSTOM_THEME_PATH, themeName);
                    string fullPath = System.IO.Path.GetFullPath(path);
                    Icons.CustomIconTheme.Load(fullPath);
                }

                Gui.MainWindow win = new Gui.MainWindow (dbPath);
                Gui.Base.WindowBase.MainWindow = win;

                win.Show();
                Application.Run();
            }
        }