private void BuildWidgets() { HBox split_box = new HBox(); VBox content_box = new VBox(); content_box.BorderWidth = 5; title = new Label(); SetTitleText(dap.Name); title.Xalign = 0.0f; Banshee.Preferences.Gui.NotebookPage properties = new Banshee.Preferences.Gui.NotebookPage(dap.Preferences); properties.BorderWidth = 0; content_box.PackStart(title, false, false, 0); content_box.PackStart(properties, false, false, 0); Image image = new Image(LargeIcon); image.Yalign = 0.0f; split_box.PackStart(image, false, true, 0); split_box.PackEnd(content_box, true, true, 0); Add(split_box); ShowAll(); }
public NotebookPage(Page page) { this.page = page; BorderWidth = 5; Spacing = 10; tab_widget = new Label(page.Name); tab_widget.Show(); Widget page_widget = page.DisplayWidget as Widget; if (page_widget != null) { page_widget.Show(); PackStart(page_widget, true, true, 0); } else { foreach (Section section in page) { AddSection(section); } if (page.ChildPages.Count > 0) { Notebook notebook = new Notebook(); notebook.ShowBorder = false; notebook.ShowTabs = false; notebook.Show(); PageComboBox page_combo = new PageComboBox(page.ChildPages, notebook); PackStart(page_combo, false, false, 0); HSeparator sep = new HSeparator(); sep.Show(); PackStart(sep, false, false, 0); foreach (Page child_page in page.ChildPages) { NotebookPage page_ui = new NotebookPage(child_page); page_ui.BorderWidth = 0; page_ui.Show(); notebook.AppendPage(page_ui, null); } PackStart(notebook, true, true, 0); } } }
private void BuildWidgets() { HBox split_box = new HBox(); VBox content_box = new VBox(); content_box.BorderWidth = 5; title = new Label(); SetTitleText(dap.Name); title.Xalign = 0.0f; // Define custom preference widgetry var hbox = new HBox(); table = new SimpleTable <DapLibrarySync> (); dap.Sync.LibraryAdded += l => AddLibrary(l); dap.Sync.LibraryRemoved += l => RemoveLibrary(l); foreach (var sync in dap.Sync.Libraries) { AddLibrary(sync); } hbox.PackStart(table, false, false, 0); hbox.ShowAll(); dap.Preferences["sync"]["library-options"].DisplayWidget = hbox; var properties = new Banshee.Preferences.Gui.NotebookPage(dap.Preferences) { BorderWidth = 0 }; content_box.PackStart(title, false, false, 0); content_box.PackStart(properties, false, false, 0); var image = new Image(LargeIcon) { Yalign = 0.0f }; split_box.PackStart(image, false, true, 0); split_box.PackEnd(content_box, true, true, 0); Add(split_box); ShowAll(); }
public void ShowSourcePageId(string id) { if (pages.ContainsKey("source-specific")) { NotebookPage notebook_page = pages["source-specific"]; notebook.CurrentPage = notebook.PageNum(notebook_page); PageComboBox page_combo; foreach (Widget child in notebook_page.Children) { page_combo = child as PageComboBox; if (page_combo != null) { page_combo.ActivePageId = id; break; } } } }
private void LoadPage(Page page) { if (pages.ContainsKey(page.Id)) { Log.Warning(String.Format("Preferences notebook already contains a page with the id `{0}'", page.Id), false); return; } NotebookPage page_ui = new NotebookPage(page); page_ui.Show(); pages.Add(page.Id, page_ui); if (service.Count == 1) { VBox.PackStart(page_ui, false, false, 0); } else { notebook.AppendPage(page_ui, page_ui.TabWidget); } }
public NotebookPage(Page page) { this.page = page; BorderWidth = 5; Spacing = 10; tab_widget = new Label(page.Name); tab_widget.Show(); Widget page_widget = page.DisplayWidget as Widget; if (page_widget != null) { page_widget.Show(); PackStart(page_widget, true, true, 0); } else { foreach (Section section in page) { AddSection(section); } if (page.ChildPages.Count > 0) { Notebook notebook = new Notebook(); notebook.ShowBorder = false; notebook.ShowTabs = false; notebook.Show(); var hbox = new HBox() { Spacing = 6 }; // FIXME this shouldn't be hard-coded to 'Source:', but this is the only // user of this code atm... var page_label = new Label(Mono.Unix.Catalog.GetString("Source:")); var page_combo = new PageComboBox(page.ChildPages, notebook); hbox.PackStart(page_label, false, false, 0); hbox.PackStart(page_combo, true, true, 0); hbox.ShowAll(); PackStart(hbox, false, false, 0); HSeparator sep = new HSeparator(); sep.Show(); PackStart(sep, false, false, 0); foreach (Page child_page in page.ChildPages) { NotebookPage page_ui = new NotebookPage(child_page); page_ui.BorderWidth = 0; page_ui.Show(); notebook.AppendPage(page_ui, null); } PackStart(notebook, true, true, 0); } } }
private void BuildWidgets() { HBox split_box = new HBox (); VBox content_box = new VBox (); content_box.BorderWidth = 5; title = new Label (); SetTitleText (dap.Name); title.Xalign = 0.0f; // Define custom preference widgetry var hbox = new HBox (); table = new SimpleTable<DapLibrarySync> (); dap.Sync.LibraryAdded += l => AddLibrary (l); dap.Sync.LibraryRemoved += l => RemoveLibrary (l); foreach (var sync in dap.Sync.Libraries) { AddLibrary (sync); } hbox.PackStart (table, false, false, 0); hbox.ShowAll (); dap.Preferences["sync"]["library-options"].DisplayWidget = hbox; var properties = new Banshee.Preferences.Gui.NotebookPage (dap.Preferences) { BorderWidth = 0 }; content_box.PackStart (title, false, false, 0); content_box.PackStart (properties, false, false, 0); var image = new Image (LargeIcon) { Yalign = 0.0f }; split_box.PackStart (image, false, true, 0); split_box.PackEnd (content_box, true, true, 0); Add (split_box); ShowAll (); }