public AssemblyReferencePanel (SelectReferenceDialog selectDialog) { this.selectDialog = selectDialog; chooser = new FileChooserWidget (FileChooserAction.Open, ""); chooser.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal)); chooser.SelectMultiple = true; // this should only allow dll's and exe's FileFilter filter = new FileFilter (); filter.Name = GettextCatalog.GetString ("Assemblies"); filter.AddPattern ("*.[Dd][Ll][Ll]"); filter.AddPattern ("*.[Ee][Xx][Ee]"); chooser.AddFilter (filter); chooser.FileActivated += new EventHandler (SelectReferenceDialog); PackStart (chooser, true, true, 0); PackStart (new Gtk.VSeparator(), false, false, 0); VBox box = new VBox (); Gtk.Button addButton = new Gtk.Button (Gtk.Stock.Add); addButton.Clicked += new EventHandler(SelectReferenceDialog); box.PackStart (addButton, false, false, 0); PackStart (box, false, false, 0); BorderWidth = 6; Spacing = 6; ShowAll(); }
private void ImportDirectoryMenuItemOnActivated(object sender, EventArgs eventArgs) { var fileChooser = new FileChooserWidget(FileChooserAction.SelectFolder); fileChooser.SelectMultiple = true; var window = new Window(WindowType.Toplevel); window.Add(fileChooser); window.ShowAll(); }
public iFolderAcceptDialog(iFolderWeb ifolder, string initialPath) : base() { this.Title = string.Format(Util.GS("Download \"{0}\"..."), ifolder.Name); this.SetDefaultSize (600, 500); this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder24.png")); this.ifolder = ifolder; this.initialPath = initialPath; VBox dialogBox = new VBox(); dialogBox.Spacing = 10; dialogBox.BorderWidth = 10; dialogBox.Homogeneous = false; this.VBox.PackStart(dialogBox, true, true, 0); VBox detailBox = new VBox(); dialogBox.PackStart(detailBox, false, false, 0); Label l = new Label(Util.GS("Details:")); l.Xalign = 0; detailBox.PackStart(l, false, false, 0); TextView tv = new TextView(); tv.LeftMargin = 10; tv.RightMargin = 10; tv.Editable = false; tv.CursorVisible = false; TextBuffer buffer = tv.Buffer; buffer.Text = string.Format(Util.GS("Name: {0}\nShared by: {1}\nAccess: {2}"), ifolder.Name, ifolder.Owner, GetDisplayRights(ifolder.CurrentUserRights)); ScrolledWindow sw = new ScrolledWindow(); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add(tv); detailBox.PackStart(sw, false, false, 0); l = new Label(Util.GS("The iFolder will be downloaded into this folder:")); l.LineWrap = false; l.Xalign = 0; l.Yalign = 1; dialogBox.PackStart(l, false, false, 0); previewPath = new Label(); previewPath.Xalign = 0; previewPath.Yalign = 0; previewPath.Wrap = true; dialogBox.PackStart(previewPath, false, false, 0); fileChooserWidget = new FileChooserWidget(FileChooserAction.SelectFolder, ""); fileChooserWidget.SelectMultiple = false; fileChooserWidget.LocalOnly = true; fileChooserWidget.CurrentName = ifolder.Name; if (this.initialPath != null && this.initialPath.Length > 0) fileChooserWidget.SetCurrentFolder(this.initialPath); fileChooserWidget.SelectionChanged += new EventHandler(OnFileChooserSelectionChanged); dialogBox.PackStart(fileChooserWidget, true, true, 0); this.VBox.ShowAll(); this.AddButton(Stock.Cancel, ResponseType.Cancel); this.AddButton(Stock.Ok, ResponseType.Ok); if (this.initialPath != null && this.initialPath.Length > 0) this.SetResponseSensitive(ResponseType.Ok, true); else this.SetResponseSensitive(ResponseType.Ok, false); }
public AssemblyReferencePanel(SelectReferenceDialog selectDialog) { this.selectDialog = selectDialog; chooser = new FileChooserWidget (FileChooserAction.Open, ""); chooser.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal)); chooser.SelectMultiple = true; // this should only allow dll's and exe's FileFilter filter = new FileFilter (); filter.Name = GettextCatalog.GetString ("Assemblies"); filter.AddPattern ("*.[Dd][Ll][Ll]"); filter.AddPattern ("*.[Ee][Xx][Ee]"); chooser.AddFilter (filter); chooser.FileActivated += new EventHandler (SelectReferenceDialog); chooser.SelectionChanged += HandleChooserSelectionChanged; chooser.BorderWidth = 6; PackStart (chooser, true, true, 0); HeaderBox hbox = new HeaderBox (1, 0, 0, 0); hbox.GradientBackground = true; hbox.SetPadding (6,6,6,6); HBox box = new HBox (); detailsLabel = new Label (); detailsLabel.Xalign = 0; detailsLabel.Ellipsize = Pango.EllipsizeMode.End; box.PackStart (detailsLabel, true, true, 0); addButton = new Gtk.Button (Gtk.Stock.Add); box.PackEnd (addButton, false, false, 0); hbox.Add (box); PackStart (hbox, false, false, 0); addButton.Clicked += SelectReferenceDialog; Spacing = 6; ShowAll(); }
public ItunesMusicDirectoryDialog(string itunes_music_directory) : base() { Title = Catalog.GetString ("Locate iTunes Music Directory"); DefaultHeight = 650; DefaultWidth = 814; Button cancel_button = new Button (Stock.Cancel); cancel_button.Clicked += delegate { Respond (ResponseType.Cancel); }; cancel_button.ShowAll (); AddActionWidget (cancel_button, ResponseType.Cancel); cancel_button.CanDefault = true; cancel_button.GrabFocus (); Button ok_button = new Button (Stock.Ok); ok_button.Clicked += delegate { Respond (ResponseType.Ok); }; ok_button.ShowAll (); AddActionWidget (ok_button, ResponseType.Ok); VBox vbox = new VBox (); vbox.BorderWidth = 8; vbox.Spacing = 10; HBox hbox = new HBox (); hbox.Spacing = 10; Image image = new Image (Stock.DialogWarning, IconSize.Dialog); hbox.PackStart (image, false, true, 0); Label message = new Label (); message.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText( String.Format (Catalog.GetString( "The iTunes library refers to your music directory as \"{0}\" but " + "Banshee was not able to infer the location of this directory. Please locate it."), itunes_music_directory))); message.Justify = Justification.Left; message.WidthRequest = 750; message.LineWrap = true; hbox.PackStart (message, true, true, 0); vbox.PackStart (hbox, false, true, 0); chooser = new FileChooserWidget (FileChooserAction.SelectFolder); chooser.ShowAll (); vbox.PackStart (chooser, true, true, 0); ContentArea.PackStart (vbox, true, true, 0); DefaultResponse = ResponseType.Cancel; ContentArea.ShowAll (); }