Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        public SelectFolder(Widget caller, Entry entry)
        {
            this.caller = caller;
            this.entry  = entry;

            if ((caller == null) || (entry == null))
            {
                throw new ArgumentNullException();
            }

            Builder builder = Tools.ReadGlade("SelectFolder");

            // Window
            window       = (Window)builder.GetObject("window");
            window.Title = "";

            // File chooser
            chooser = (FileChooserWidget)builder.GetObject("chooser");
            chooser.SetCurrentFolder(entry.Text);

            // Buttons
            selectbtn = (Button)builder.GetObject("selectbtn");
            cancelbtn = (Button)builder.GetObject("cancelbtn");

            // Button events
            selectbtn.Clicked += OnSelectClicked;
            cancelbtn.Clicked += OnCancelClicked;

            builder.Dispose();
        }
Ejemplo n.º 3
0
        public DatabaseChooser() : base("Wähle eine Datenbank")
        {
            // Init global data
            dbChecker            = new DatabaseChecker(this);
            fileChooser          = new FileChooserWidget(new FileChooserAction());
            statusLabel          = new Label();
            textEntry            = new Entry();
            textEntry.IsEditable = false;             // Only FileChooserWidget can choose
            dbStatus             = (int)status.NO_FILE;

            // Data chooser
            Label pathLabel = new Label("Datei");
            var   pathBox   = new HBox();

            pathBox.PackStart(pathLabel, false, true, 5);
            pathBox.PackStart(textEntry, true, true, 0);

            // FileFilter
            var allFilter = new FileFilter();

            allFilter.Name = "Alle Dateien";
            allFilter.AddPattern("*");

            var dbFilter = new FileFilter();

            dbFilter.Name = "Datenbanken";
            dbFilter.AddPattern("*.db");
            dbFilter.AddMimeType("application/sql");
            dbFilter.AddMimeType("text/sql");
            dbFilter.AddMimeType("text/x-sql");
            //dbFilter.AddMimeType("text/plain"); //XXX: Wait for feedback
            fileChooser.AddFilter(dbFilter);
            fileChooser.AddFilter(allFilter);
            // On Action handler
            fileChooser.FileActivated += OnFileChoosed;
            // Show current File on the side
            fileChooser.ExtraWidget = pathBox;
            fileChooser.ExtraWidget.WidthRequest = 500;

            // Buttons
            Button validateButton = new Button("Datenbank prüfen");

            validateButton.Clicked += delegate { Validate(true); };
            Button okButton = new Button("Ok");

            okButton.Clicked += OnOk;
            var buttonBox = new Table(1, 5, true);

            buttonBox.Attach(validateButton, 3, 4, 0, 1);
            buttonBox.Attach(okButton, 4, 5, 0, 1);

            // Pack on this
            var mainBox = new VBox();

            mainBox.PackStart(fileChooser, true, true, 0);
            mainBox.PackStart(new HSeparator(), false, false, 2);
            mainBox.PackStart(buttonBox, false, false, 3);
            this.Add(mainBox);
        }
Ejemplo n.º 4
0
        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);

            VBox.PackStart(vbox, true, true, 0);

            DefaultResponse = ResponseType.Cancel;

            VBox.ShowAll();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
 private void InitUI()
 {
     //Init Font Description
     Pango.FontDescription fontDescription = Pango.FontDescription.FromString(GlobalFramework.Settings["fontEntryBoxValue"]);
     //Init FileChooserWidget
     _filePicker = new FileChooserWidget(_fileChooserAction, "none");
     if (_fileFilter != null)
     {
         _filePicker.Filter = _fileFilter;
     }
     //Assign FilePicker StartPath
     if (Directory.Exists(GlobalApp.FilePickerStartPath))
     {
         _filePicker.SetCurrentFolder(GlobalApp.FilePickerStartPath);
     }
     //Size and Put
     _filePicker.SetSizeRequest(_windowSize.Width - 13, _windowSize.Height - 120);
     _fixedContent.Put(_filePicker, 0, 0);
     //Events
     _filePicker.CurrentFolderChanged += delegate { GlobalApp.FilePickerStartPath = _filePicker.CurrentFolder; };
 }
        private void Build()
        {
            Gui.Initialize(this);
            // Widget Launchpad.Utilities.Interface.MainWindow
            UIManager = new UIManager();
            ActionGroup w1 = new ActionGroup("Default");

            UIManager.InsertActionGroup(w1, 0);
            AddAccelGroup(UIManager.AccelGroup);
            WidthRequest   = 640;
            HeightRequest  = 384;
            Name           = "Launchpad.Utilities.Interface.MainWindow";
            Title          = LocalizationCatalog.GetString("Launchpad Utilities - Manifest");
            Icon           = Pixbuf.LoadFromResource("Launchpad.Utilities.Resources.Icons8-Android-Industry-Engineering.ico");
            WindowPosition = (WindowPosition)4;
            // Container child Launchpad.Utilities.Interface.MainWindow.Gtk.Container+ContainerChild
            vbox3 = new VBox
            {
                Name    = "vbox3",
                Spacing = 6
            };
            // Container child vbox3.Gtk.Box+BoxChild
            UIManager.AddUiFromString("<ui><menubar name='menubar1'/></ui>");
            menubar1      = (MenuBar)(UIManager.GetWidget("/menubar1"));
            menubar1.Name = "menubar1";
            vbox3.Add(menubar1);
            Box.BoxChild w2 = (Box.BoxChild)vbox3 [menubar1];
            w2.Position = 0;
            w2.Expand   = false;
            w2.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            alignment14 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name         = "alignment14",
                LeftPadding  = 8,
                RightPadding = 8
            };
            // Container child alignment14.Gtk.Container+ContainerChild
            fileChooser = new FileChooserWidget((FileChooserAction)2)
            {
                Name      = "fileChooser",
                LocalOnly = false
            };
            alignment14.Add(fileChooser);
            vbox3.Add(alignment14);
            Box.BoxChild w4 = (Box.BoxChild)vbox3 [alignment14];
            w4.Position = 1;
            // Container child vbox3.Gtk.Box+BoxChild
            alignment12 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name = "alignment12"
            };
            // Container child alignment12.Gtk.Container+ContainerChild
            hseparator3 = new HSeparator
            {
                Name = "hseparator3"
            };
            alignment12.Add(hseparator3);
            vbox3.Add(alignment12);
            Box.BoxChild w6 = (Box.BoxChild)vbox3 [alignment12];
            w6.Position = 2;
            w6.Expand   = false;
            w6.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            hbox4 = new HBox
            {
                Name    = "hbox4",
                Spacing = 6
            };
            // Container child hbox4.Gtk.Box+BoxChild
            alignment18 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name        = "alignment18",
                LeftPadding = 8
            };
            // Container child alignment18.Gtk.Container+ContainerChild
            label4 = new Label
            {
                Name      = "label4",
                LabelProp = LocalizationCatalog.GetString("Progress: ")
            };
            alignment18.Add(label4);
            hbox4.Add(alignment18);
            Box.BoxChild w8 = (Box.BoxChild)hbox4 [alignment18];
            w8.Position = 0;
            w8.Expand   = false;
            w8.Fill     = false;
            // Container child hbox4.Gtk.Box+BoxChild
            alignment19 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name         = "alignment19",
                RightPadding = 8
            };
            // Container child alignment19.Gtk.Container+ContainerChild
            progressLabel = new Label
            {
                Name      = "progressLabel",
                LabelProp = LocalizationCatalog.GetString("/some/file/path : 1 out of 100")
            };
            alignment19.Add(progressLabel);
            hbox4.Add(alignment19);
            Box.BoxChild w10 = ((Box.BoxChild)(hbox4 [alignment19]));
            w10.Position = 1;
            w10.Expand   = false;
            w10.Fill     = false;
            vbox3.Add(hbox4);
            Box.BoxChild w11 = (Box.BoxChild)vbox3 [hbox4];
            w11.Position = 3;
            w11.Expand   = false;
            w11.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            alignment17 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name         = "alignment17",
                LeftPadding  = 8,
                RightPadding = 8
            };
            // Container child alignment17.Gtk.Container+ContainerChild
            progressbar = new ProgressBar
            {
                Name = "progressbar"
            };
            alignment17.Add(progressbar);
            vbox3.Add(alignment17);
            Box.BoxChild w13 = (Box.BoxChild)vbox3 [alignment17];
            w13.Position = 4;
            w13.Expand   = false;
            w13.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            hbox3 = new HBox
            {
                Name    = "hbox3",
                Spacing = 6
            };
            // Container child hbox3.Gtk.Box+BoxChild
            alignment15 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name          = "alignment15",
                RightPadding  = 8,
                BottomPadding = 8
            };
            // Container child alignment15.Gtk.Container+ContainerChild
            generateGameManifestButton = new Button
            {
                CanFocus     = true,
                Name         = "generateGameManifestButton",
                UseUnderline = true,
                Label        = LocalizationCatalog.GetString("Generate Game Manifest")
            };
            alignment15.Add(generateGameManifestButton);
            hbox3.Add(alignment15);
            Box.BoxChild w15 = (Box.BoxChild)hbox3 [alignment15];
            w15.PackType = (PackType)1;
            w15.Position = 0;
            w15.Expand   = false;
            w15.Fill     = false;
            // Container child hbox3.Gtk.Box+BoxChild
            alignment1 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name          = "alignment1",
                RightPadding  = 8,
                BottomPadding = 8
            };
            // Container child alignment1.Gtk.Container+ContainerChild
            generateLaunchpadManifestButton = new Button
            {
                CanFocus     = true,
                Name         = "generateLaunchpadManifestButton",
                UseUnderline = true,
                Label        = LocalizationCatalog.GetString("Generate Launchpad Manifest")
            };
            alignment1.Add(generateLaunchpadManifestButton);
            hbox3.Add(alignment1);
            Box.BoxChild w17 = ((Box.BoxChild)(hbox3 [alignment1]));
            w17.PackType = ((PackType)(1));
            w17.Position = 1;
            w17.Expand   = false;
            w17.Fill     = false;
            vbox3.Add(hbox3);
            Box.BoxChild w18 = ((Box.BoxChild)(vbox3 [hbox3]));
            w18.Position = 5;
            w18.Expand   = false;
            w18.Fill     = false;
            Add(vbox3);
            if ((Child != null))
            {
                Child.ShowAll();
            }

            this.DefaultWidth  = 640;
            this.DefaultHeight = 384;

            this.Show();

            DeleteEvent += OnDeleteEvent;
            generateLaunchpadManifestButton.Clicked += OnGenerateLaunchpadManifestButtonClicked;
            generateGameManifestButton.Clicked      += OnGenerateGameManifestButtonClicked;
        }