Beispiel #1
0
 public void BeginProgress()
 {
     IdeApp.Workbench.ActiveLocationList = this;
     newStore = new ListStore(typeof(SearchResult), typeof(bool));
     newStore.DefaultSortFunc = DefaultSortFunc;
     newStore.SetSortFunc(1, CompareProjectFileNames);
     newStore.SetSortFunc(2, CompareFileNames);
     newStore.SetSortFunc(3, CompareFilePaths);
     Reset();
     buttonStop.Sensitive = true;
     treeviewSearchResults.FreezeChildNotify();
 }
        public SortFuncListViewDialog()
        {
            Title         = "Gtk Sort Func List View Box Dialog";
            WidthRequest  = 500;
            HeightRequest = 400;

            var vbox = new HBox();

            VBox.PackStart(vbox);

            listView = new TreeView();
            listView.HeadersVisible = false;
            vbox.PackStart(listView);

            listStore      = new ListStore(typeof(SortedListViewItem));
            listView.Model = listStore;

//			listStore.SetSortFunc (0,
//				(model, a, b) => string.Compare (GetItem (a).Id, GetItem (b).Id, StringComparison.Ordinal));
            listStore.SetSortFunc(0, SortListItems);

            listStore.SetSortColumnId(0, SortType.Ascending);

//			var textRenderer = new CellRendererText ();
//			listView.AppendColumn ("id", textRenderer,
//				(TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => {
//					((CellRendererText)cell).Text = GetItem (iter).Id;
//				}
//			);

            AddItems();

            ShowAll();
        }
Beispiel #3
0
        void LoadGames()
        {
            if (games_store != null)
            {
                return;
            }

            games_store = new ListStore(typeof(string), typeof(string), typeof(bool), typeof(Game), typeof(int));
            games_store.SetSortFunc(0, new Gtk.TreeIterCompareFunc(GameSort));
            games_store.SetSortColumnId(COL_TYPE, SortType.Ascending);

            // Data
            string type;
            Game   game;

            for (int i = 0; i < games.Length; i++)
            {
                if (games [i].IsGame == false)
                {
                    continue;
                }

                game = (Game)Activator.CreateInstance(games [i].TypeOf, true);
                game.Translations = Translations;
                game.Variant      = games [i].Variant;
                type = GameTypesDescription.GetLocalized(Translations, game.Type);
                games_store.AppendValues(game.Name, type, true, game, i);
            }
        }
Beispiel #4
0
        public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
        {
            Spacing           = 6;
            this.selectDialog = selectDialog;

            store    = new ListStore(typeof(string), typeof(string), typeof(AssemblyInfo), typeof(bool), typeof(string), typeof(IconId), typeof(int));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += AddReference;
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererImage crp = new CellRendererImage();

            secondColumn.PackStart(crp, false);
            secondColumn.AddAttribute(crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "markup", ColVersion);
            treeView.AppendColumn(GettextCatalog.GetString("Path"), new CellRendererText(), "text", ColPath);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId(0, SortType.Ascending);
            store.SetSortFunc(0, new TreeIterCompareFunc(Sort));

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            var but = new Gtk.Button(GettextCatalog.GetString("Browse..."));

            but.Clicked += HandleClicked;
            var hbox = new Gtk.HBox();

            hbox.PackEnd(but, false, false, 0);
            PackStart(hbox, false, false, 0);

            ShowAll();
            BorderWidth = 6;
        }
Beispiel #5
0
        public void DataBind()
        {
            if (dataSource == null)
            {
                Clear();
                return;
            }

            int index = 0;

            Type[] storeTypes = new Type[dataSource.Columns.Count];
            columnCount = dataSource.Columns.Count;
            foreach (DataColumn col in dataSource.Columns)
            {
                DataGridColumn dgCol = new DataGridColumn(this, col, index);
                grid.AppendColumn(dgCol);

                if (col.DataType == typeof(byte))
                {
                    //special case for gchar (TODO: look up the bugzilla bug id)
                    storeTypes[index] = typeof(string);
                    conversionLookup.Add(index, byteConvertFunc);
                }
                else if (col.DataType == typeof(sbyte))
                {
                    storeTypes[index] = typeof(string);
                    conversionLookup.Add(index, sbyteConvertFunc);
                }
                else if (col.DataType.IsPrimitive || col.DataType == typeof(string) || col.DataType.IsEnum)
                {
                    storeTypes[index] = col.DataType;
                }
                else
                {
                    //the ListStore doesn't allow types that can't be converted to a GType
                    storeTypes[index] = typeof(object);
                }

                index++;
            }
            store      = new ListStore(storeTypes);
            grid.Model = store;

            TreeIterCompareFunc sortFunc = new TreeIterCompareFunc(SortFunc);

            store.SetSortFunc(0, sortFunc);
            store.SetSortColumnId(0, SortType.Ascending);              //TODO: is this needed ?

            NavigateToRecord(0);
        }
Beispiel #6
0
        public RestoreBackupDialog(Gtk.Window parent) : base("Saves", parent)
        {
            this.IconName = "document-revert";

            XML gxml = new XML(null, "MultiMC.GTKGUI.RestoreBackupDialog.glade", "restoreRoot", null);

            gxml.Toplevel = this;
            gxml.Autoconnect(this);

            this.VBox.PackStart(restoreRoot);

            this.WidthRequest  = 620;
            this.HeightRequest = 380;

            // set default button states
            btnCancel.Sensitive = true;
            btnOK.Sensitive     = false;

            // FIXME: store date/time properly so ordering works.
            backupsStore      = new ListStore(typeof(string), typeof(DateTime), typeof(string), typeof(string));
            restoreView.Model = backupsStore;
            restoreView.AppendColumn("Backup name", new CellRendererText(), "text", 0);
            restoreView.AppendColumn("Date", new CellRendererText(), new TreeCellDataFunc(DateTimeCell));
            restoreView.AppendColumn("Hash", new CellRendererText(), "text", 2);
            restoreView.Selection.Mode = SelectionMode.Single;

            // this binds view and model columns together for sorting
            restoreView.Columns[0].SortColumnId = 0;
            restoreView.Columns[1].SortColumnId = 1;
            restoreView.Columns[2].SortColumnId = 2;
            // the date column needs a custom sorting function that can compare DateTime objects
            backupsStore.SetSortFunc(1, new TreeIterCompareFunc(DateTimeTreeIterCompareFunc));
            backupsStore.SetSortColumnId(1, SortType.Ascending);            // sort by date
            restoreView.Selection.Changed += (sender, e) =>
            {
                if (restoreView.Selection.CountSelectedRows() != 0)
                {
                    btnOK.Sensitive = true;
                    TreeIter iter;
                    restoreView.Selection.GetSelected(out iter);
                    currentHash = backupsStore.GetValue(iter, 3) as string;
                }
                else
                {
                    btnOK.Sensitive = false;
                }
            };
            ShowAll();
        }
Beispiel #7
0
        public PackageReferencePanel(SelectReferenceDialog selectDialog, bool showAll)
        {
            this.selectDialog = selectDialog;
            this.showAll      = showAll;

            store    = new ListStore(typeof(string), typeof(string), typeof(SystemAssembly), typeof(bool), typeof(string), typeof(string), typeof(IconId), typeof(int), typeof(ReferenceType));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererImage crp = new CellRendererImage();

            secondColumn.PackStart(crp, false);
            secondColumn.AddAttribute(crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "markup", ColVersion);
            treeView.AppendColumn(GettextCatalog.GetString("Package"), new CellRendererText(), "text", ColPackage);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId(0, SortType.Ascending);
            store.SetSortFunc(0, new TreeIterCompareFunc(Sort));

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            this.PackStart(sc, true, true, 0);
            ShowAll();
            BorderWidth = 6;
        }
Beispiel #8
0
    private ListStore CreateModel(int days, bool sum)
    {
        ListStore store = new ListStore(typeof(Task));

        store.SetSortFunc(0, (model, a, b) => {
            Task ta = (Task)model.GetValue(a, 0);
            Task tb = (Task)model.GetValue(b, 0);
            return(ta.Date.CompareTo(tb.Date));
        });
        foreach (Task task in dbManager.getEntries(days, sum))
        {
            store.AppendValues(task);
        }
        store.SetSortColumnId(0, SortType.Descending);
        return(store);
    }
        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store    = new ListStore(typeof(string), typeof(string), typeof(SystemAssembly), typeof(bool), typeof(string), typeof(string));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", 3);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererPixbuf crp = new CellRendererPixbuf();

            secondColumn.PackStart(crp, false);
            crp.StockId = "md-package";

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "text", 0);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "text", 1);
            treeView.AppendColumn(GettextCatalog.GetString("Package"), new CellRendererText(), "text", 5);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId(0, SortType.Ascending);
            store.SetSortFunc(0, new TreeIterCompareFunc(Sort));

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            this.PackStart(sc, true, true, 0);
            ShowAll();
            BorderWidth = 6;
        }
        public ProjectReferencePanel(SelectReferenceDialog selectDialog) : base(false, 6)
        {
            this.selectDialog = selectDialog;

            store = new ListStore(typeof(string), typeof(string), typeof(Project), typeof(bool), typeof(Xwt.Drawing.Image), typeof(bool), typeof(string));
            store.SetSortFunc(0, CompareNodes);
            treeView = new TreeView(store);

            TreeViewColumn firstColumn  = new TreeViewColumn();
            TreeViewColumn secondColumn = new TreeViewColumn();

            CellRendererToggle tog_render = new CellRendererToggle();

            tog_render.Xalign   = 0;
            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);
            firstColumn.AddAttribute(tog_render, "visible", ColVisible);

            secondColumn.Title = GettextCatalog.GetString("Project");
            CellRendererImage pix_render = new CellRendererImage();

            secondColumn.PackStart(pix_render, false);
            secondColumn.AddAttribute(pix_render, "image", ColPixbuf);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);
            secondColumn.AddAttribute(text_render, "foreground", ColColor);

            treeView.AppendColumn(firstColumn);
            treeView.AppendColumn(secondColumn);
            treeView.AppendColumn(GettextCatalog.GetString("Directory"), new CellRendererText(), "markup", ColPath);

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            store.SetSortColumnId(0, SortType.Ascending);
            ShowAll();

            BorderWidth = 6;
        }
Beispiel #11
0
        internal void Sort(DataGridColumn column)
        {
            sortColumn   = column.ColumnIndex;
            sortComparer = column.ContentComparer;

            if (column.SortIndicator)
            {
                column.SortOrder = ReverseSortOrder(column);
            }

            //show indicator on current column, remove on all others
            foreach (TreeViewColumn col in grid.Columns)
            {
                col.SortIndicator = col == column;
            }

            store.SetSortFunc(column.ColumnIndex, new TreeIterCompareFunc(SortFunc));
            store.SetSortColumnId(column.ColumnIndex, column.SortOrder);
        }
Beispiel #12
0
        private void InitPackTreeView()
        {
            packStore = new TreeStore(typeof(Packer.Item));

            folderStore                 = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Packer.Item));
            packTreeView.Model          = folderStore;
            packTreeView.HeadersVisible = false;
            packTreeView.Selection.Mode = SelectionMode.Multiple;
            packTreeView.EnableSearch   = true;
            packTreeView.SearchColumn   = 1;

            packTreeView.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
            packTreeView.AppendColumn("Name", new CellRendererText(), "text", 1);

            folderStore.SetSortFunc(0, (model, a, b) =>
            {
                Packer.Item itemA = model.GetValue(a, 2) as Packer.Item;
                Packer.Item itemB = model.GetValue(b, 2) as Packer.Item;

                var ItemCost = new Func <Packer.Item, int>(item =>
                {
                    return(null == item ? 0 : (item.IsFolder ? (item.IsRoot ? 3 : 2) : 1));
                });

                if (ItemCost(itemA) > ItemCost(itemB))
                {
                    return(-1);
                }
                else if (ItemCost(itemA) < ItemCost(itemB))
                {
                    return(1);
                }
                else if (null == itemA && null == itemB)
                {
                    return(0);
                }
                else
                {
                    return(itemA.Name.CompareTo(itemB.Name));
                }
            });
            folderStore.SetSortColumnId(0, SortType.Ascending);
        }
        public EventsWidget()
        {
            this.Build();

            Gtk.TreeViewColumn timeColumn = new Gtk.TreeViewColumn();
            timeColumn.Title     = "Time";
            timeColumn.Resizable = true;

            Gtk.TreeViewColumn notificationColumn = new Gtk.TreeViewColumn();
            notificationColumn.Title     = "Notification";
            notificationColumn.Resizable = true;

            Gtk.TreeViewColumn messageColumn = new Gtk.TreeViewColumn();
            messageColumn.Title = "Message";

            Gtk.CellRendererText timeCell         = new Gtk.CellRendererText();
            Gtk.CellRendererText notificationCell = new Gtk.CellRendererText();
            Gtk.CellRendererText messageCell      = new Gtk.CellRendererText();

            timeColumn.PackEnd(timeCell, false);
            notificationColumn.PackEnd(notificationCell, false);
            messageColumn.PackEnd(messageCell, false);

            timeColumn.SetCellDataFunc(timeCell, new Gtk.TreeCellDataFunc(RenderTimeCell));
            notificationColumn.SetCellDataFunc(notificationCell, new Gtk.TreeCellDataFunc(RenderNotificationCell));
            messageColumn.SetCellDataFunc(messageCell, new Gtk.TreeCellDataFunc(RenderMessageCell));

            treeviewEvents.AppendColumn(timeColumn);
            treeviewEvents.AppendColumn(notificationColumn);
            treeviewEvents.AppendColumn(messageColumn);

            EventListStore.SetSortFunc(0, delegate(TreeModel model, TreeIter a, TreeIter b) {
                TriggeredEvent s1 = (TriggeredEvent)model.GetValue(a, 0);
                TriggeredEvent s2 = (TriggeredEvent)model.GetValue(b, 0);
                return(DateTime.Compare(s1.TimeStamp, s2.TimeStamp));
            });
            EventListStore.SetSortColumnId(0, SortType.Descending);

            treeviewEvents.Model = EventListStore;

            RefreshTimer = GLib.Timeout.Add(5000, new GLib.TimeoutHandler(UpdateRows));
        }
        public SortedTableListStore(TableSchemaCollection tables)
        {
            if (tables == null)
            {
                throw new ArgumentNullException("tables");
            }

            this.tables = tables;

            store = new ListStore(typeof(bool), typeof(string), typeof(TableSchema));
            store.SetSortColumnId(ColNameIndex, SortType.Ascending);
            store.SetSortFunc(ColNameIndex, new TreeIterCompareFunc(SortName));

            foreach (TableSchema table in tables)
            {
                AddTable(table);
            }

            tables.ItemAdded   += new SortedCollectionItemEventHandler <TableSchema> (OnTableAdded);
            tables.ItemRemoved += new SortedCollectionItemEventHandler <TableSchema> (OnTableRemoved);
        }
Beispiel #15
0
        public SortedColumnListStore(ColumnSchemaCollection columns)
        {
            if (columns == null)
            {
                throw new ArgumentNullException("columns");
            }

            this.columns = columns;

            store = new ListStore(typeof(bool), typeof(string), typeof(ColumnSchema));
            store.SetSortColumnId(ColNameIndex, SortType.Ascending);
            store.SetSortFunc(ColNameIndex, new TreeIterCompareFunc(SortName));

            foreach (ColumnSchema col in columns)
            {
                AddColumn(col);
            }

            columns.ItemAdded   += new SortedCollectionItemEventHandler <ColumnSchema> (OnColumnAdded);
            columns.ItemRemoved += new SortedCollectionItemEventHandler <ColumnSchema> (OnColumnRemoved);
        }
Beispiel #16
0
        private void createMainList()
        {
            mainListBox                = new TreeView();
            mainListStore              = new ListStore(typeof(uint), typeof(string), typeof(uint), typeof(string), typeof(string), typeof(string));
            mainListBox.Model          = mainListStore;
            mainListBox.HeadersVisible = true;
            mainListBox.RulesHint      = true;
            mainListBox.Selection.Mode = SelectionMode.Multiple;

            TreeViewColumn index = new TreeViewColumn();

            index.Visible = false;
            mainListBox.AppendColumn(index);
            filenameColumn = mainListBox.AppendColumn("File name", new CellRendererText(), "text", 1);
            sizeColumn     = mainListBox.AppendColumn("Size", new CellRendererText(), "text", 2);
            TreeViewColumn type        = mainListBox.AppendColumn("Type", new CellRendererText(), "text", 3);
            TreeViewColumn barn        = mainListBox.AppendColumn("Barn", new CellRendererText(), "text", 4);
            TreeViewColumn compression = mainListBox.AppendColumn("Compression", new CellRendererText(), "text", 5);

            filenameColumn.Clickable = true;
            filenameColumn.Resizable = true;
            filenameColumn.Clicked  += new EventHandler(filename_column_clicked);

            sizeColumn.Clickable = true;
            sizeColumn.Resizable = true;
            sizeColumn.Clicked  += new EventHandler(size_column_clicked);

            type.Clickable = true;
            type.Resizable = true;
            type.Clicked  += new EventHandler(type_column_clicked);

            barn.Clickable = true;
            barn.Resizable = true;

            compression.Clickable = true;
            compression.Resizable = true;

            mainListStore.SetSortFunc(0, stringCompareFunc);
        }
Beispiel #17
0
        public PluginNodeView() :
            base()
        {
            ListStore    store;
            CellRenderer cell;

            filter   = "";
            category = "";

            RulesHint      = true;
            HeadersVisible = false;
            Model          = store = new ListStore(
                typeof(bool),
                typeof(string),
                typeof(string));

            cell = new CellRendererToggle();
            (cell as CellRendererToggle).Activatable = true;
            (cell as CellRendererToggle).Toggled    += OnPluginToggle;
            AppendColumn("Enable", cell, "active", Column.Enabled);

            cell = new CellRendererPixbuf();
            cell.SetFixedSize(IconSize + IconPadding, IconSize + IconPadding);
            AppendColumn("Icon", cell, (TreeCellDataFunc)IconDataFunc);

            cell = new Gtk.CellRendererText();
            (cell as CellRendererText).WrapWidth = WrapWidth;
            (cell as CellRendererText).WrapMode  = Pango.WrapMode.Word;
            AppendColumn("Plugin", cell, "markup", Column.Description);

            store.SetSortFunc((int)Column.Id, SortAlphabeticallyWithFilter);
            store.SetSortColumnId((int)Column.Id, SortType.Descending);

            Selection.Changed += OnSelectionChanged;

            Refresh(true);
        }
Beispiel #18
0
        public XmlSchemasPanelWidget()
        {
            this.Build();

            //set up tree view for default schemas
            var textRenderer = new CellRendererText();

            registeredSchemasStore      = new ListStore(typeof(XmlSchemaCompletionData));
            registeredSchemasView.Model = registeredSchemasStore;

            registeredSchemasView.AppendColumn(GettextCatalog.GetString("Namespace"), textRenderer,
                                               (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => {
                ((CellRendererText)cell).Text = GetSchema(iter).NamespaceUri;
            }
                                               );

            registeredSchemasView.AppendColumn(GettextCatalog.GetString("Type"), textRenderer,
                                               (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => {
                ((CellRendererText)cell).Text = GetSchema(iter).ReadOnly?
                                                GettextCatalog.GetString("Built in")
                                                : GettextCatalog.GetString("User schema");
            });

            registeredSchemasStore.SetSortFunc(0,
                                               (model, a, b) => string.Compare(GetSchema(a).NamespaceUri, GetSchema(b).NamespaceUri));

            registeredSchemasStore.SetSortColumnId(0, SortType.Ascending);

            //update state of "remove" button depending on whether schema is read-only and anything's slected
            registeredSchemasView.Selection.Changed += delegate {
                var data = GetSelectedSchema();
                registeredSchemasRemoveButton.Sensitive = (data != null && !data.ReadOnly);
            };
            registeredSchemasRemoveButton.Sensitive = false;

            //set up cells for associations
            var extensionTextRenderer = new CellRendererText();

            extensionTextRenderer.Editable = true;
            var prefixTextRenderer = new CellRendererText();

            prefixTextRenderer.Editable = true;

            var comboEditor = new CellRendererCombo();

            registeredSchemasComboModel = new ListStore(typeof(string));
            comboEditor.Model           = registeredSchemasComboModel;
            comboEditor.Mode            = CellRendererMode.Editable;
            comboEditor.TextColumn      = 0;
            comboEditor.Editable        = true;
            comboEditor.HasEntry        = false;

            //rebuild combo's model from default schemas whenever editing starts
            comboEditor.EditingStarted += delegate(object sender, EditingStartedArgs args) {
                registeredSchemasComboModel.Clear();
                registeredSchemasComboModel.AppendValues(string.Empty);
                foreach (TreeIter iter in WalkStore(registeredSchemasStore))
                {
                    registeredSchemasComboModel.AppendValues(
                        GetSchema(iter).NamespaceUri
                        );
                }
                args.RetVal = true;
                registeredSchemasComboModel.SetSortColumnId(0, SortType.Ascending);
            };

            //set up tree view for associations
            defaultAssociationsStore      = new ListStore(typeof(string), typeof(string), typeof(string), typeof(bool));
            defaultAssociationsView.Model = defaultAssociationsStore;
            defaultAssociationsView.AppendColumn(GettextCatalog.GetString("File Extension"), extensionTextRenderer, "text", COL_EXT);
            defaultAssociationsView.AppendColumn(GettextCatalog.GetString("Namespace"), comboEditor, "text", COL_NS);
            defaultAssociationsView.AppendColumn(GettextCatalog.GetString("Prefix"), prefixTextRenderer, "text", COL_PREFIX);
            defaultAssociationsStore.SetSortColumnId(COL_EXT, SortType.Ascending);

            //editing handlers
            extensionTextRenderer.Edited += handleExtensionSet;
            comboEditor.Edited           += delegate(object sender, EditedArgs args) {
                setAssocValAndMarkChanged(args.Path, COL_NS, args.NewText);
            };
            prefixTextRenderer.Edited += delegate(object sender, EditedArgs args) {
                foreach (char c in args.NewText)
                {
                    if (!char.IsLetterOrDigit(c))
                    {
                        //FIXME: give an error message?
                        return;
                    }
                }
                setAssocValAndMarkChanged(args.Path, COL_PREFIX, args.NewText);
            };

            //update state of "remove" button depending on whether anything's slected
            defaultAssociationsView.Selection.Changed += delegate {
                TreeIter iter;
                defaultAssociationsRemoveButton.Sensitive =
                    defaultAssociationsView.Selection.GetSelected(out iter);
            };
            defaultAssociationsRemoveButton.Sensitive = false;
        }
Beispiel #19
0
        private MainWindow(Builder builder) : base(builder.GetObject("_mainWin").Handle)
        {
            builder.Autoconnect(this);

            this.DeleteEvent      += Window_Close;
            _fullScreen.Activated += FullScreen_Toggled;

            ApplicationLibrary.ApplicationAdded        += Application_Added;
            ApplicationLibrary.ApplicationCountUpdated += ApplicationCount_Updated;
            GLRenderer.StatusUpdatedEvent += Update_StatusBar;

            _gameTable.ButtonReleaseEvent += Row_Clicked;

            // First we check that a migration isn't needed. (because VirtualFileSystem will create the new directory otherwise)
            bool continueWithStartup = Migration.PromptIfMigrationNeededForStartup(this, out bool migrationNeeded);

            if (!continueWithStartup)
            {
                End(null);
            }

            _virtualFileSystem = VirtualFileSystem.CreateInstance();
            _contentManager    = new ContentManager(_virtualFileSystem);

            if (migrationNeeded)
            {
                bool migrationSuccessful = Migration.DoMigrationForStartup(this, _virtualFileSystem);

                if (!migrationSuccessful)
                {
                    End(null);
                }
            }

            // Make sure that everything is loaded.
            _virtualFileSystem.Reload();

            _treeView = _gameTable;

            ApplyTheme();

            _mainWin.Icon            = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
            _mainWin.Title           = $"Ryujinx {Program.Version}";
            _stopEmulation.Sensitive = false;

            if (ConfigurationState.Instance.Ui.GuiColumns.FavColumn)
            {
                _favToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.IconColumn)
            {
                _iconToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.AppColumn)
            {
                _appToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.DevColumn)
            {
                _developerToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.VersionColumn)
            {
                _versionToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.TimePlayedColumn)
            {
                _timePlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.LastPlayedColumn)
            {
                _lastPlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileExtColumn)
            {
                _fileExtToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileSizeColumn)
            {
                _fileSizeToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.PathColumn)
            {
                _pathToggle.Active = true;
            }

#if USE_DEBUGGING
            _debugger = new Debugger.Debugger();
            _openDebugger.Activated += _openDebugger_Opened;
#else
            _openDebugger.Hide();
#endif

            _gameTable.Model = _tableStore = new ListStore(
                typeof(bool),
                typeof(Gdk.Pixbuf),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(BlitStruct <ApplicationControlProperty>));

            _tableStore.SetSortFunc(5, TimePlayedSort);
            _tableStore.SetSortFunc(6, LastPlayedSort);
            _tableStore.SetSortFunc(8, FileSizeSort);
            _tableStore.SetSortColumnId(0, SortType.Descending);

            UpdateColumns();
            UpdateGameTable();

            Task.Run(RefreshFirmwareLabel);

            _statusBar.Hide();
        }
Beispiel #20
0
        internal AnimeTreeView(AnimeWindow parent)
        {
            _parent = parent;
            Store   = new ListStore(typeof(Anime));
            Filter  = new TreeModelFilter(Store, null)
            {
                VisibleFunc = FilterTree
            };
            Model = Filter;
            Store.SetSortFunc((int)TreeColumns.Title, CompareTitle);             // sort by title by default

            // Create our columns
            _title = new TreeViewColumn()
            {
                Title        = "Title",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Title
            };
            _title.Clicked += TitleClicked;
            _title.PackStart(new CellRendererText(), true);
            _title.SetCellDataFunc(_title.CellRenderers[0], RenderTitle);
            AppendColumn(_title);

            _episode = new TreeViewColumn()
            {
                Title        = "Episode",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Episode
            };
            _episode.Clicked += EpisodeClicked;
            _episode.PackStart(new CellRendererText(), true);
            _episode.SetCellDataFunc(_episode.CellRenderers[0], RenderEpisode);
            AppendColumn(_episode);

            _progress = new TreeViewColumn()
            {
                Title = "Progress", SortColumnId = (int)TreeColumns.Progress
            };
            _progress.PackStart(new CellRendererProgress(), true);
            _progress.SetCellDataFunc(_progress.CellRenderers[0], RenderProgress);
            AppendColumn(_progress);

            _score = new TreeViewColumn()
            {
                Title        = "Score",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Score
            };
            _score.Clicked += ScoreClicked;
            _score.PackStart(new CellRendererText(), true);
            _score.SetCellDataFunc(_score.CellRenderers[0], RenderScore);
            AppendColumn(_score);

            _type = new TreeViewColumn()
            {
                Title        = "Type",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Type
            };
            _type.Clicked += TypeClicked;
            _type.PackStart(new CellRendererText(), true);
            _type.SetCellDataFunc(_type.CellRenderers[0], RenderAnimeType);
            AppendColumn(_type);

            _season = new TreeViewColumn()
            {
                Title        = "Season",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Season
            };
            _season.Clicked += SeasonClicked;
            _season.PackStart(new CellRendererText(), true);
            _season.SetCellDataFunc(_season.CellRenderers[0], RenderSeason);
            AppendColumn(_season);

            _next = new TreeViewColumn()
            {
                Title        = "Status",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.NextEp
            };
            _next.PackStart(new CellRendererText(), true);
            _next.SetCellDataFunc(_next.CellRenderers[0], RenderNextEpisode);
            AppendColumn(_next);

            RowActivated += OnRowActivated;
        }
        public SearchResultWidget()
        {
            var vbox    = new VBox();
            var toolbar = new Toolbar()
            {
                Orientation  = Orientation.Vertical,
                IconSize     = IconSize.Menu,
                ToolbarStyle = ToolbarStyle.Icons,
            };

            this.PackStart(vbox, true, true, 0);
            this.PackStart(toolbar, false, false, 0);
            labelStatus = new Label()
            {
                Xalign  = 0,
                Justify = Justification.Left,
            };
            var hpaned = new HPaned();

            vbox.PackStart(hpaned, true, true, 0);
            vbox.PackStart(labelStatus, false, false, 0);
            var resultsScroll = new CompactScrolledWindow();

            hpaned.Pack1(resultsScroll, true, true);
            scrolledwindowLogView = new CompactScrolledWindow();
            hpaned.Pack2(scrolledwindowLogView, true, true);
            textviewLog = new TextView()
            {
                Editable = false,
            };
            scrolledwindowLogView.Add(textviewLog);

            store = new ListStore(typeof(SearchResult),
                                  typeof(bool) // didRead
                                  );

            treeviewSearchResults = new PadTreeView()
            {
                Model            = store,
                HeadersClickable = true,
                RulesHint        = true,
            };

            treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
            resultsScroll.Add(treeviewSearchResults);

            var projectColumn = new TreeViewColumn {
                Resizable    = true,
                SortColumnId = 1,
                Title        = GettextCatalog.GetString("Project"),
                Sizing       = TreeViewColumnSizing.Fixed,
                FixedWidth   = 100
            };

            var projectPixbufRenderer = new CellRendererImage();

            projectColumn.PackStart(projectPixbufRenderer, false);
            projectColumn.SetCellDataFunc(projectPixbufRenderer, ResultProjectIconDataFunc);

            var renderer = treeviewSearchResults.TextRenderer;

            renderer.Ellipsize = Pango.EllipsizeMode.End;
            projectColumn.PackStart(renderer, true);
            projectColumn.SetCellDataFunc(renderer, ResultProjectDataFunc);
            treeviewSearchResults.AppendColumn(projectColumn);

            var fileNameColumn = new TreeViewColumn {
                Resizable    = true,
                SortColumnId = 2,
                Title        = GettextCatalog.GetString("File"),
                Sizing       = TreeViewColumnSizing.Fixed,
                FixedWidth   = 200
            };

            var fileNamePixbufRenderer = new CellRendererImage();

            fileNameColumn.PackStart(fileNamePixbufRenderer, false);
            fileNameColumn.SetCellDataFunc(fileNamePixbufRenderer, FileIconDataFunc);

            fileNameColumn.PackStart(renderer, true);
            fileNameColumn.SetCellDataFunc(renderer, FileNameDataFunc);
            treeviewSearchResults.AppendColumn(fileNameColumn);


            TreeViewColumn textColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Text"),
                                                                           renderer, ResultTextDataFunc);

            textColumn.Resizable  = true;
            textColumn.Sizing     = TreeViewColumnSizing.Fixed;
            textColumn.FixedWidth = 300;

            pathColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Path"),
                                                            renderer, ResultPathDataFunc);
            pathColumn.SortColumnId = 3;
            pathColumn.Resizable    = true;
            pathColumn.Sizing       = TreeViewColumnSizing.Fixed;
            pathColumn.FixedWidth   = 500;

            store.DefaultSortFunc = DefaultSortFunc;
            store.SetSortFunc(1, CompareProjectFileNames);
            store.SetSortFunc(2, CompareFileNames);
            store.SetSortFunc(3, CompareFilePaths);

            treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;

            buttonStop = new ToolButton(new ImageView(Gui.Stock.Stop, Gtk.IconSize.Menu), null)
            {
                Sensitive = false
            };
            buttonStop.Clicked    += ButtonStopClicked;
            buttonStop.TooltipText = GettextCatalog.GetString("Stop");
            toolbar.Insert(buttonStop, -1);

            var buttonClear = new ToolButton(new ImageView(Gui.Stock.Clear, Gtk.IconSize.Menu), null);

            buttonClear.Clicked    += ButtonClearClicked;
            buttonClear.TooltipText = GettextCatalog.GetString("Clear results");
            toolbar.Insert(buttonClear, -1);

            var buttonOutput = new ToggleToolButton();

            buttonOutput.IconWidget  = new ImageView(Gui.Stock.OutputIcon, Gtk.IconSize.Menu);
            buttonOutput.Clicked    += ButtonOutputClicked;
            buttonOutput.TooltipText = GettextCatalog.GetString("Show output");
            toolbar.Insert(buttonOutput, -1);

            buttonPin             = new ToggleToolButton();
            buttonPin.IconWidget  = new ImageView(Gui.Stock.PinUp, Gtk.IconSize.Menu);
            buttonPin.Clicked    += ButtonPinClicked;
            buttonPin.TooltipText = GettextCatalog.GetString("Pin results pad");
            toolbar.Insert(buttonPin, -1);

            // store.SetSortColumnId (3, SortType.Ascending);
            ShowAll();

            scrolledwindowLogView.Hide();
            treeviewSearchResults.FixedHeightMode = true;

            UpdateStyles();
            IdeApp.Preferences.ColorScheme.Changed += UpdateStyles;
        }
Beispiel #22
0
        private MainWindow(Builder builder) : base(builder.GetObject("_mainWin").Handle)
        {
            builder.Autoconnect(this);

            DeleteEvent += Window_Close;

            ApplicationLibrary.ApplicationAdded += Application_Added;

            _renderer = new OglRenderer();

            _audioOut = InitializeAudioEngine();

            _device = new HLE.Switch(_renderer, _audioOut);

            _treeView = _gameTable;

            Configuration.Load(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
            Configuration.InitialConfigure(_device);

            ApplyTheme();

            if (DiscordIntegrationEnabled)
            {
                DiscordClient   = new DiscordRpcClient("568815339807309834");
                DiscordPresence = new RichPresence
                {
                    Assets = new Assets
                    {
                        LargeImageKey  = "ryujinx",
                        LargeImageText = "Ryujinx is an emulator for the Nintendo Switch"
                    },
                    Details    = "Main Menu",
                    State      = "Idling",
                    Timestamps = new Timestamps(DateTime.UtcNow)
                };

                DiscordClient.Initialize();
                DiscordClient.SetPresence(DiscordPresence);
            }

            _mainWin.Icon            = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
            _stopEmulation.Sensitive = false;

            if (SwitchSettings.SwitchConfig.GuiColumns.FavColumn)
            {
                _favToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.IconColumn)
            {
                _iconToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.AppColumn)
            {
                _appToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.DevColumn)
            {
                _developerToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.VersionColumn)
            {
                _versionToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.TimePlayedColumn)
            {
                _timePlayedToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.LastPlayedColumn)
            {
                _lastPlayedToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.FileExtColumn)
            {
                _fileExtToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.FileSizeColumn)
            {
                _fileSizeToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns.PathColumn)
            {
                _pathToggle.Active = true;
            }

            _gameTable.Model = _tableStore = new ListStore(
                typeof(bool),
                typeof(Gdk.Pixbuf),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string));

            _tableStore.SetSortFunc(5, TimePlayedSort);
            _tableStore.SetSortFunc(6, LastPlayedSort);
            _tableStore.SetSortFunc(8, FileSizeSort);
            _tableStore.SetSortColumnId(0, SortType.Descending);

            UpdateColumns();
#pragma warning disable CS4014
            UpdateGameTable();
#pragma warning restore CS4014
        }
Beispiel #23
0
        internal AnimeSearchTreeView()
        {
            Store = new ListStore(typeof(Anime));
            Store.SetSortFunc((int)TreeColumns.Title, CompareTitle);
            Model = Store;

            // Create our columns
            _title = new TreeViewColumn()
            {
                Title        = "Title",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Title
            };
            _title.Clicked += TitleClicked;
            _title.PackStart(new CellRendererText(), true);
            _title.SetCellDataFunc(_title.CellRenderers[0], RenderTitle);
            AppendColumn(_title);

            _episodes = new TreeViewColumn()
            {
                Title        = "Episodes",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Episodes
            };
            _episodes.Clicked += EpisodesClicked;
            _episodes.PackStart(new CellRendererText(), true);
            _episodes.SetCellDataFunc(_episodes.CellRenderers[0], RenderEpisodes);
            AppendColumn(_episodes);

            _score = new TreeViewColumn()
            {
                Title        = "Score",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Score
            };
            _score.Clicked += ScoreClicked;
            _score.PackStart(new CellRendererText(), true);
            _score.SetCellDataFunc(_score.CellRenderers[0], RenderPublicScore);
            AppendColumn(_score);

            _type = new TreeViewColumn()
            {
                Title        = "Type",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Type
            };
            _type.Clicked += TypeClicked;
            _type.PackStart(new CellRendererText(), true);
            _type.SetCellDataFunc(_type.CellRenderers[0], RenderAnimeType);
            AppendColumn(_type);

            _season = new TreeViewColumn()
            {
                Title        = "Season",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Season
            };
            _season.Clicked += SeasonClicked;
            _season.PackStart(new CellRendererText(), true);
            _season.SetCellDataFunc(_season.CellRenderers[0], RenderSeason);
            AppendColumn(_season);

            _status = new TreeViewColumn()
            {
                Title        = "Status",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Status
            };
            _status.Clicked += StatusClicked;
            _status.PackStart(new CellRendererText(), true);
            _status.SetCellDataFunc(_status.CellRenderers[0], RenderStatus);
            AppendColumn(_status);

            _genre = new TreeViewColumn()
            {
                Title        = "Genre",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.Genre
            };
            _genre.Clicked += GenreClicked;
            _genre.PackStart(new CellRendererText(), true);
            //_genre.SetCellDataFunc(_genre.CellRenderers[0], RenderGenre);
            AppendColumn(_genre);

            _listStatus = new TreeViewColumn()
            {
                Title        = "List Status",
                Resizable    = true,
                Clickable    = true,
                SortColumnId = (int)TreeColumns.ListStatus
            };
            _listStatus.Clicked += ListStatusClicked;
            _listStatus.PackStart(new CellRendererText(), true);
            _listStatus.SetCellDataFunc(_listStatus.CellRenderers[0], RenderListStatus);
            AppendColumn(_listStatus);

            RowActivated += OnRowActivated;

            ShowAll();
        }
Beispiel #24
0
        public void Initialize(IPadWindow window)
        {
            this.window      = window;
            window.PadShown += delegate {
                if (needsReload)
                {
                    Refresh();
                }
            };

            DockItemToolbar toolbar = window.GetToolbar(PositionType.Top);

            errorBtn        = new ToggleButton();
            errorBtn.Active = (bool)PropertyService.Get(showErrorsPropertyName, true);
            string errorTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Error) != EnabledLoggingLevel.Error &&
                (InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Fatal) != EnabledLoggingLevel.Fatal)
            {
                errorBtn.Sensitive = false;
                errorTipText       = GettextCatalog.GetString("Logging of errors is not enabled");
            }
            else
            {
                errorTipText = GettextCatalog.GetString("Show errors");
            }
            errorBtn.Image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Menu);
            errorBtn.Image.Show();
            errorBtn.Toggled    += new EventHandler(FilterChanged);
            errorBtn.TooltipText = errorTipText;
            UpdateErrorsNum();
            toolbar.Add(errorBtn);

            warnBtn        = new ToggleButton();
            warnBtn.Active = (bool)PropertyService.Get(showWarningsPropertyName, true);
            string warnTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Warn) != EnabledLoggingLevel.Warn)
            {
                warnBtn.Sensitive = false;
                warnTipText       = GettextCatalog.GetString("Logging of warnings is not enabled");
            }
            else
            {
                warnTipText = GettextCatalog.GetString("Show warnings");
            }
            warnBtn.Image = new Gtk.Image(Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
            warnBtn.Image.Show();
            warnBtn.Toggled    += new EventHandler(FilterChanged);
            warnBtn.TooltipText = warnTipText;
            UpdateWarningsNum();
            toolbar.Add(warnBtn);

            msgBtn        = new ToggleButton();
            msgBtn.Active = (bool)PropertyService.Get(showMessagesPropertyName, true);
            string msgTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Info) != EnabledLoggingLevel.Info)
            {
                msgBtn.Sensitive = false;
                msgTipText       = GettextCatalog.GetString("Logging of informational messages is not enabled");
            }
            else
            {
                msgTipText = GettextCatalog.GetString("Show messages");
            }
            msgBtn.Image = new Gtk.Image(Gtk.Stock.DialogInfo, Gtk.IconSize.Menu);
            msgBtn.Image.Show();
            msgBtn.Toggled    += new EventHandler(FilterChanged);
            msgBtn.TooltipText = msgTipText;
            UpdateMessagesNum();
            toolbar.Add(msgBtn);

            debugBtn        = new ToggleButton();
            debugBtn.Active = (bool)PropertyService.Get(showDebugPropertyName, true);
            string debugTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Debug) != EnabledLoggingLevel.Debug)
            {
                debugBtn.Sensitive = false;
                debugTipText       = GettextCatalog.GetString("Logging of debug messages is not enabled");
            }
            else
            {
                debugTipText = GettextCatalog.GetString("Show debug");
            }
            debugBtn.Image = new Gtk.Image(Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu);
            debugBtn.Image.Show();
            debugBtn.Toggled    += new EventHandler(FilterChanged);
            debugBtn.TooltipText = debugTipText;
            UpdateDebugNum();
            toolbar.Add(debugBtn);

            toolbar.Add(new SeparatorToolItem());

            Gtk.Button clearBtn = new Gtk.Button(new Gtk.Image(Gtk.Stock.Clear, Gtk.IconSize.Menu));
            clearBtn.Clicked += new EventHandler(OnClearList);
            toolbar.Add(clearBtn);
            toolbar.ShowAll();

            // Content

            store = new Gtk.ListStore(typeof(Gdk.Pixbuf),                    // image - type
                                      typeof(string),                        // desc
                                      typeof(string),                        // time
                                      typeof(string),                        // type string
                                      typeof(LogMessage));                   // message

            TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTaskTypes);

            filter             = new TreeModelFilter(store, null);
            filter.VisibleFunc = filterFunct;

            view                  = new MonoDevelop.Ide.Gui.Components.PadTreeView(new Gtk.TreeModelSort(filter));
            view.RulesHint        = true;
            view.HeadersClickable = true;
            view.Selection.Mode   = SelectionMode.Multiple;

            view.DoPopupMenu = (evt) =>
                               IdeApp.CommandService.ShowContextMenu(view, evt, new CommandEntrySet()
            {
                new CommandEntry(EditCommands.Copy),
                new CommandEntry(EditCommands.SelectAll),
            });

            AddColumns();

            sw            = new Gtk.ScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(view);

            LoggingService.AddLogger(this);

            iconWarning = sw.RenderIcon(Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, "");
            iconError   = sw.RenderIcon(Gtk.Stock.DialogError, Gtk.IconSize.Menu, "");
            iconInfo    = sw.RenderIcon(Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
            iconDebug   = sw.RenderIcon(Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu, "");

            control = sw;
            sw.ShowAll();

            Refresh();

            store.SetSortFunc((int)Columns.Time, TimeSortFunc);
            ((TreeModelSort)view.Model).SetSortColumnId((int)Columns.Time, SortType.Descending);
        }
Beispiel #25
0
        private MainWindow(Builder builder) : base(builder.GetObject("_mainWin").Handle)
        {
            builder.Autoconnect(this);

            DeleteEvent += Window_Close;

            ApplicationLibrary.ApplicationAdded += Application_Added;

            _gameTable.ButtonReleaseEvent += Row_Clicked;

            _renderer = new OglRenderer();

            _audioOut = InitializeAudioEngine();

            // TODO: Initialization and dispose of HLE.Switch when starting/stoping emulation.
            _device = InitializeSwitchInstance();

            _treeView = _gameTable;

            ApplyTheme();

            _mainWin.Icon            = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
            _stopEmulation.Sensitive = false;

            if (ConfigurationState.Instance.Ui.GuiColumns.FavColumn)
            {
                _favToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.IconColumn)
            {
                _iconToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.AppColumn)
            {
                _appToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.DevColumn)
            {
                _developerToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.VersionColumn)
            {
                _versionToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.TimePlayedColumn)
            {
                _timePlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.LastPlayedColumn)
            {
                _lastPlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileExtColumn)
            {
                _fileExtToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileSizeColumn)
            {
                _fileSizeToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.PathColumn)
            {
                _pathToggle.Active = true;
            }

            _gameTable.Model = _tableStore = new ListStore(
                typeof(bool),
                typeof(Gdk.Pixbuf),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string));

            _tableStore.SetSortFunc(5, TimePlayedSort);
            _tableStore.SetSortFunc(6, LastPlayedSort);
            _tableStore.SetSortFunc(8, FileSizeSort);
            _tableStore.SetSortColumnId(0, SortType.Descending);

            UpdateColumns();
#pragma warning disable CS4014
            UpdateGameTable();
#pragma warning restore CS4014
        }
Beispiel #26
0
        public TypesView()
        {
            window         = new ScrolledWindow();
            list           = new TreeView();
            list.RulesHint = true;

            //                               icon            type            count            #bytes         avg size         avg age          # backtraces
            store      = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(object));
            list.Model = store;

            CellRendererPixbuf pixbufRenderer     = new CellRendererPixbuf();
            CellRendererText   typeRenderer       = new CellRendererText();
            CellRendererText   countRenderer      = new CellRendererText();
            CellRendererText   totalSizeRenderer  = new CellRendererText();
            CellRendererText   avgSizeRenderer    = new CellRendererText();
            CellRendererText   avgAgeRenderer     = new CellRendererText();
            CellRendererText   backtracesRenderer = new CellRendererText();

            TreeViewColumn columnType       = new TreeViewColumn();
            TreeViewColumn columnCount      = new TreeViewColumn();
            TreeViewColumn columnTotalSize  = new TreeViewColumn();
            TreeViewColumn columnAvgSize    = new TreeViewColumn();
            TreeViewColumn columnAvgAge     = new TreeViewColumn();
            TreeViewColumn columnBacktraces = new TreeViewColumn();

            columnType.Title       = GettextCatalog.GetString("Type");
            columnCount.Title      = GettextCatalog.GetString("Count");
            columnTotalSize.Title  = GettextCatalog.GetString("Total Size");
            columnAvgSize.Title    = GettextCatalog.GetString("Avg Size");
            columnAvgAge.Title     = GettextCatalog.GetString("Avg Age");
            columnBacktraces.Title = GettextCatalog.GetString("Backtraces");

            columnType.PackStart(pixbufRenderer, false);
            columnType.PackStart(typeRenderer, true);
            columnCount.PackStart(countRenderer, true);
            columnTotalSize.PackStart(totalSizeRenderer, true);
            columnAvgSize.PackStart(avgSizeRenderer, true);
            columnAvgAge.PackStart(avgAgeRenderer, true);
            columnBacktraces.PackStart(backtracesRenderer, true);

            columnType.AddAttribute(pixbufRenderer, "stock-id", 0);
            columnType.AddAttribute(typeRenderer, "text", 1);
            columnCount.AddAttribute(countRenderer, "text", 2);
            columnTotalSize.AddAttribute(totalSizeRenderer, "text", 3);
            columnAvgSize.AddAttribute(avgSizeRenderer, "text", 4);
            columnAvgAge.AddAttribute(avgAgeRenderer, "text", 5);
            columnBacktraces.AddAttribute(backtracesRenderer, "text", 6);

            list.AppendColumn(columnType);
            list.AppendColumn(columnCount);
            list.AppendColumn(columnTotalSize);
            list.AppendColumn(columnAvgSize);
            list.AppendColumn(columnAvgAge);
            list.AppendColumn(columnBacktraces);

            int nc = 0;

            foreach (TreeViewColumn c in list.Columns)
            {
                store.SetSortFunc(nc, CompareNodes);
                c.SortColumnId = nc++;
            }
            store.SetSortColumnId(1, SortType.Descending);

            window.Add(list);
            window.ShowAll();
        }
Beispiel #27
0
        public SearchResultWidget()
        {
            var vbox    = new VBox();
            var toolbar = new Toolbar()
            {
                Orientation  = Orientation.Vertical,
                IconSize     = IconSize.Menu,
                ToolbarStyle = ToolbarStyle.Icons,
            };

            this.PackStart(vbox, true, true, 0);
            this.PackStart(toolbar, false, false, 0);
            labelStatus = new Label()
            {
                Xalign  = 0,
                Justify = Justification.Left,
            };
            var hpaned = new HPaned();

            vbox.PackStart(hpaned, true, true, 0);
            vbox.PackStart(labelStatus, false, false, 0);
            var resultsScroll = new CompactScrolledWindow();

            hpaned.Pack1(resultsScroll, true, true);
            scrolledwindowLogView = new CompactScrolledWindow();
            hpaned.Pack2(scrolledwindowLogView, true, true);
            textviewLog = new TextView()
            {
                Editable = false,
            };
            scrolledwindowLogView.Add(textviewLog);

            store = new ListStore(typeof(SearchResult),
                                  typeof(bool) // didRead
                                  );

            treeviewSearchResults = new PadTreeView()
            {
                Model            = store,
                HeadersClickable = true,
                RulesHint        = true,
            };
            treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
            resultsScroll.Add(treeviewSearchResults);

            this.ShowAll();

            var fileNameColumn = new TreeViewColumn {
                Resizable    = false,
                SortColumnId = 0,
                Title        = GettextCatalog.GetString("File")
            };

            fileNameColumn.FixedWidth = 200;

            var fileNamePixbufRenderer = new CellRendererPixbuf();

            fileNameColumn.PackStart(fileNamePixbufRenderer, false);
            fileNameColumn.SetCellDataFunc(fileNamePixbufRenderer, FileIconDataFunc);

            fileNameColumn.PackStart(treeviewSearchResults.TextRenderer, true);
            fileNameColumn.SetCellDataFunc(treeviewSearchResults.TextRenderer, FileNameDataFunc);
            treeviewSearchResults.AppendColumn(fileNameColumn);

//			TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc);
//			lineColumn.SortColumnId = 1;
//			lineColumn.FixedWidth = 50;
//

            TreeViewColumn textColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Text"),
                                                                           treeviewSearchResults.TextRenderer, ResultTextDataFunc);

            textColumn.SortColumnId = 2;
            textColumn.Resizable    = false;
            textColumn.FixedWidth   = 300;


            TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Path"),
                                                                           treeviewSearchResults.TextRenderer, ResultPathDataFunc);

            pathColumn.SortColumnId = 3;
            pathColumn.Resizable    = false;
            pathColumn.FixedWidth   = 500;


            store.SetSortFunc(0, CompareFileNames);
//			store.SetSortFunc (1, CompareLineNumbers);
            store.SetSortFunc(3, CompareFilePaths);

            treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;

            buttonStop = new ToolButton(Stock.Stop)
            {
                Sensitive = false
            };

            buttonStop.Clicked += ButtonStopClicked;

            buttonStop.TooltipText = GettextCatalog.GetString("Stop");
            toolbar.Insert(buttonStop, -1);

            var buttonClear = new ToolButton(Gtk.Stock.Clear);

            buttonClear.Clicked    += ButtonClearClicked;
            buttonClear.TooltipText = GettextCatalog.GetString("Clear results");
            toolbar.Insert(buttonClear, -1);

            var buttonOutput = new ToggleToolButton(Gui.Stock.OutputIcon);

            buttonOutput.Clicked    += ButtonOutputClicked;
            buttonOutput.TooltipText = GettextCatalog.GetString("Show output");
            toolbar.Insert(buttonOutput, -1);

            buttonPin             = new ToggleToolButton(Gui.Stock.PinUp);
            buttonPin.Clicked    += ButtonPinClicked;
            buttonPin.TooltipText = GettextCatalog.GetString("Pin results pad");
            toolbar.Insert(buttonPin, -1);

            store.SetSortColumnId(3, SortType.Ascending);
            ShowAll();

            scrolledwindowLogView.Hide();
        }
Beispiel #28
0
        public UserTasksView()
        {
            highPrioColor   = StringToColor((string)PropertyService.Get("Monodevelop.UserTasksHighPrioColor", ""));
            normalPrioColor = StringToColor((string)PropertyService.Get("Monodevelop.UserTasksNormalPrioColor", ""));
            lowPrioColor    = StringToColor((string)PropertyService.Get("Monodevelop.UserTasksLowPrioColor", ""));

            store = new ListStore(
                typeof(string),                  // priority
                typeof(bool),                    // completed
                typeof(string),                  // desc
                typeof(Task),                    // user task
                typeof(Gdk.Color),               // foreground color
                typeof(int));                    // font style

            view                    = new MonoDevelop.Ide.Gui.Components.PadTreeView(store);
            view.RulesHint          = true;
            view.SearchColumn       = (int)Columns.Description;
            view.Selection.Changed += new EventHandler(SelectionChanged);
            view.PopupMenu         += new PopupMenuHandler(OnUserPopupMenu);
            view.ButtonPressEvent  += new ButtonPressEventHandler(OnUserButtonPressed);

            TreeViewColumn col;

            CellRendererComboBox cellRendPriority = new CellRendererComboBox();

            cellRendPriority.Values   = priorities;
            cellRendPriority.Editable = true;
            cellRendPriority.Changed += new ComboSelectionChangedHandler(UserTaskPriorityEdited);
            col           = view.AppendColumn(GettextCatalog.GetString("Priority"), cellRendPriority, "text", Columns.Priority, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
            col.Clickable = true;
            col.Resizable = true;
            TreeIterCompareFunc sortFunc = new TreeIterCompareFunc(PrioirtySortFunc);

            store.SetSortFunc((int)Columns.Priority, sortFunc);
            col.Clicked += new EventHandler(UserTaskPriorityResort);

            CellRendererToggle cellRendCompleted = new CellRendererToggle();

            cellRendCompleted.Toggled    += new ToggledHandler(UserTaskCompletedToggled);
            cellRendCompleted.Activatable = true;
            col           = view.AppendColumn(String.Empty, cellRendCompleted, "active", Columns.Completed);
            col.Clickable = true;
            col.Clicked  += new EventHandler(UserTaskCompletedResort);

            cellRendDesc          = view.TextRenderer;
            cellRendDesc.Editable = true;
            cellRendDesc.Edited  += new EditedHandler(UserTaskDescEdited);
            col           = view.AppendColumn(GettextCatalog.GetString("Description"), cellRendDesc, "text", Columns.Description, "strikethrough", Columns.Completed, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
            col.Clickable = true;
            col.Resizable = true;
            col.Clicked  += new EventHandler(UserTaskDescResort);

            newButton               = new Button();
            newButton.Image         = new Gtk.Image(Gtk.Stock.New, IconSize.Button);
            newButton.Label         = GettextCatalog.GetString("New Task");
            newButton.ImagePosition = PositionType.Left;
            newButton.Clicked      += new EventHandler(NewUserTaskClicked);
            newButton.TooltipText   = GettextCatalog.GetString("Create New Task");

            delButton             = new Button(new Gtk.Image(Gtk.Stock.Delete, IconSize.Button));
            delButton.Clicked    += new EventHandler(DeleteUserTaskClicked);
            delButton.TooltipText = GettextCatalog.GetString("Delete Task");

            TaskService.UserTasks.TasksChanged += DispatchService.GuiDispatch <TaskEventHandler> (UserTasksChanged);
            TaskService.UserTasks.TasksAdded   += DispatchService.GuiDispatch <TaskEventHandler> (UserTasksChanged);
            TaskService.UserTasks.TasksRemoved += DispatchService.GuiDispatch <TaskEventHandler> (UserTasksChanged);

            if (IdeApp.Workspace.IsOpen)
            {
                solutionLoaded = true;
            }

            IdeApp.Workspace.FirstWorkspaceItemOpened += CombineOpened;
            IdeApp.Workspace.LastWorkspaceItemClosed  += CombineClosed;
            PropertyService.PropertyChanged           += DispatchService.GuiDispatch <EventHandler <PropertyChangedEventArgs> > (OnPropertyUpdated);
            ValidateButtons();

            // Initialize with existing tags.
            UserTasksChanged(this, null);
        }
Beispiel #29
0
        private MainWindow(Builder builder) : base(builder.GetObject("_mainWin").Handle)
        {
            builder.Autoconnect(this);

            // Apply custom theme if needed.
            ThemeHelper.ApplyTheme();

            // Sets overridden fields.
            int monitorWidth  = Display.PrimaryMonitor.Geometry.Width * Display.PrimaryMonitor.ScaleFactor;
            int monitorHeight = Display.PrimaryMonitor.Geometry.Height * Display.PrimaryMonitor.ScaleFactor;

            DefaultWidth  = monitorWidth < 1280 ? monitorWidth  : 1280;
            DefaultHeight = monitorHeight < 760  ? monitorHeight : 760;

            Icon  = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.Resources.Logo_Ryujinx.png");
            Title = $"Ryujinx {Program.Version}";

            // Hide emulation context status bar.
            _statusBar.Hide();

            // Instanciate HLE objects.
            _virtualFileSystem      = VirtualFileSystem.CreateInstance();
            _contentManager         = new ContentManager(_virtualFileSystem);
            _userChannelPersistence = new UserChannelPersistence();

            // Instanciate GUI objects.
            _applicationLibrary = new ApplicationLibrary(_virtualFileSystem);
            _uiHandler          = new GtkHostUiHandler(this);
            _deviceExitStatus   = new AutoResetEvent(false);

            WindowStateEvent += WindowStateEvent_Changed;
            DeleteEvent      += Window_Close;

            _applicationLibrary.ApplicationAdded        += Application_Added;
            _applicationLibrary.ApplicationCountUpdated += ApplicationCount_Updated;

            _gameTable.ButtonReleaseEvent += Row_Clicked;
            _fullScreen.Activated         += FullScreen_Toggled;

            GlRenderer.StatusUpdatedEvent += Update_StatusBar;

            if (ConfigurationState.Instance.Ui.StartFullscreen)
            {
                _startFullScreen.Active = true;
            }

            _stopEmulation.Sensitive         = false;
            _simulateWakeUpMessage.Sensitive = false;

            if (ConfigurationState.Instance.Ui.GuiColumns.FavColumn)
            {
                _favToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.IconColumn)
            {
                _iconToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.AppColumn)
            {
                _appToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.DevColumn)
            {
                _developerToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.VersionColumn)
            {
                _versionToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.TimePlayedColumn)
            {
                _timePlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.LastPlayedColumn)
            {
                _lastPlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileExtColumn)
            {
                _fileExtToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileSizeColumn)
            {
                _fileSizeToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.PathColumn)
            {
                _pathToggle.Active = true;
            }

            _favToggle.Toggled        += Fav_Toggled;
            _iconToggle.Toggled       += Icon_Toggled;
            _appToggle.Toggled        += App_Toggled;
            _developerToggle.Toggled  += Developer_Toggled;
            _versionToggle.Toggled    += Version_Toggled;
            _timePlayedToggle.Toggled += TimePlayed_Toggled;
            _lastPlayedToggle.Toggled += LastPlayed_Toggled;
            _fileExtToggle.Toggled    += FileExt_Toggled;
            _fileSizeToggle.Toggled   += FileSize_Toggled;
            _pathToggle.Toggled       += Path_Toggled;

            _gameTable.Model = _tableStore = new ListStore(
                typeof(bool),
                typeof(Gdk.Pixbuf),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(BlitStruct <ApplicationControlProperty>));

            _tableStore.SetSortFunc(5, SortHelper.TimePlayedSort);
            _tableStore.SetSortFunc(6, SortHelper.LastPlayedSort);
            _tableStore.SetSortFunc(8, SortHelper.FileSizeSort);

            int  columnId  = ConfigurationState.Instance.Ui.ColumnSort.SortColumnId;
            bool ascending = ConfigurationState.Instance.Ui.ColumnSort.SortAscending;

            _tableStore.SetSortColumnId(columnId, ascending ? SortType.Ascending : SortType.Descending);

            _gameTable.EnableSearch = true;
            _gameTable.SearchColumn = 2;

            UpdateColumns();
            UpdateGameTable();

            ConfigurationState.Instance.Ui.GameDirs.Event += (sender, args) =>
            {
                if (args.OldValue != args.NewValue)
                {
                    UpdateGameTable();
                }
            };

            Task.Run(RefreshFirmwareLabel);
        }
Beispiel #30
0
        private MainWindow(Builder builder) : base(builder.GetObject("_mainWin").Handle)
        {
            builder.Autoconnect(this);

            int monitorWidth  = Display.PrimaryMonitor.Geometry.Width * Display.PrimaryMonitor.ScaleFactor;
            int monitorHeight = Display.PrimaryMonitor.Geometry.Height * Display.PrimaryMonitor.ScaleFactor;

            this.DefaultWidth  = monitorWidth < 1280 ? monitorWidth : 1280;
            this.DefaultHeight = monitorHeight < 760 ? monitorHeight : 760;

            this.WindowStateEvent += MainWindow_WindowStateEvent;
            this.DeleteEvent      += Window_Close;
            _fullScreen.Activated += FullScreen_Toggled;

            this.Icon  = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
            this.Title = $"Ryujinx {Program.Version}";

            ApplicationLibrary.ApplicationAdded        += Application_Added;
            ApplicationLibrary.ApplicationCountUpdated += ApplicationCount_Updated;
            GlRenderer.StatusUpdatedEvent += Update_StatusBar;

            _gameTable.ButtonReleaseEvent += Row_Clicked;

            // First we check that a migration isn't needed. (because VirtualFileSystem will create the new directory otherwise)
            bool continueWithStartup = Migration.PromptIfMigrationNeededForStartup(this, out bool migrationNeeded);

            if (!continueWithStartup)
            {
                End(null);
            }

            _virtualFileSystem = VirtualFileSystem.CreateInstance();
            _contentManager    = new ContentManager(_virtualFileSystem);

            if (migrationNeeded)
            {
                bool migrationSuccessful = Migration.DoMigrationForStartup(this, _virtualFileSystem);

                if (!migrationSuccessful)
                {
                    End(null);
                }
            }

            // Make sure that everything is loaded.
            _virtualFileSystem.Reload();

            ApplyTheme();

            _stopEmulation.Sensitive = false;

            if (ConfigurationState.Instance.Ui.GuiColumns.FavColumn)
            {
                _favToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.IconColumn)
            {
                _iconToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.AppColumn)
            {
                _appToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.DevColumn)
            {
                _developerToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.VersionColumn)
            {
                _versionToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.TimePlayedColumn)
            {
                _timePlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.LastPlayedColumn)
            {
                _lastPlayedToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileExtColumn)
            {
                _fileExtToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.FileSizeColumn)
            {
                _fileSizeToggle.Active = true;
            }
            if (ConfigurationState.Instance.Ui.GuiColumns.PathColumn)
            {
                _pathToggle.Active = true;
            }

#if USE_DEBUGGING
            _debugger = new Debugger.Debugger();
            _openDebugger.Activated += _openDebugger_Opened;
#else
            _openDebugger.Hide();
#endif

            _gameTable.Model = _tableStore = new ListStore(
                typeof(bool),
                typeof(Gdk.Pixbuf),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(string),
                typeof(BlitStruct <ApplicationControlProperty>));

            _tableStore.SetSortFunc(5, TimePlayedSort);
            _tableStore.SetSortFunc(6, LastPlayedSort);
            _tableStore.SetSortFunc(8, FileSizeSort);

            int  columnId  = ConfigurationState.Instance.Ui.ColumnSort.SortColumnId;
            bool ascending = ConfigurationState.Instance.Ui.ColumnSort.SortAscending;

            _tableStore.SetSortColumnId(columnId, ascending ? SortType.Ascending : SortType.Descending);

            _gameTable.EnableSearch = true;
            _gameTable.SearchColumn = 2;

            UpdateColumns();
            UpdateGameTable();

            ConfigurationState.Instance.Ui.GameDirs.Event += (sender, args) =>
            {
                if (args.OldValue != args.NewValue)
                {
                    UpdateGameTable();
                }
            };

            Task.Run(RefreshFirmwareLabel);

            _statusBar.Hide();

            _uiHandler = new GtkHostUiHandler(this);
        }