void Build()
        {
            Title = GettextCatalog.GetString("Add Application");
            Width = 480;

            var mainVBox = new VBox();

            Content = mainVBox;

            var applicationHBox = new HBox();

            mainVBox.PackStart(applicationHBox);

            applicationLabel      = new Label();
            applicationLabel.Text = GettextCatalog.GetString("Application:");
            applicationHBox.PackStart(applicationLabel);

            applicationTextEntry = new TextEntry();
            applicationHBox.PackStart(applicationTextEntry, true, true);

            browseButton       = new Button();
            browseButton.Label = GettextCatalog.GetString("Browse...");
            applicationHBox.PackStart(browseButton);

            var argumentsHBox = new HBox();

            mainVBox.PackStart(argumentsHBox);

            argumentsLabel      = new Label();
            argumentsLabel.Text = GettextCatalog.GetString("Arguments:");
            argumentsHBox.PackStart(argumentsLabel);

            argumentsTextEntry = new TextEntry();
            argumentsHBox.PackStart(argumentsTextEntry, true, true);

            argumentsInfoWidget          = new InformationPopoverWidget();
            argumentsInfoWidget.Severity = TaskSeverity.Information;
            argumentsHBox.PackStart(argumentsInfoWidget);

            var friendlyNameHBox = new HBox();

            mainVBox.PackStart(friendlyNameHBox);

            friendlyNameLabel      = new Label();
            friendlyNameLabel.Text = GettextCatalog.GetString("Friendly Name:");
            friendlyNameHBox.PackStart(friendlyNameLabel);

            friendlyNameTextEntry = new TextEntry();
            friendlyNameHBox.PackStart(friendlyNameTextEntry, true, true);

            cancelButton          = new DialogButton(Command.Cancel);
            cancelButton.Clicked += (sender, e) => Close();

            Buttons.Add(cancelButton);

            okButton = new DialogButton(Command.Ok);
            Buttons.Add(okButton);
        }
Пример #2
0
        void Build()
        {
            Padding   = 0;
            Resizable = false;
            Width     = 320;
            Title     = GettextCatalog.GetString("New Folder");

            var mainVBox = new VBox();

            var folderNameHBox = new HBox();

            folderNameHBox.Margin = 20;
            var folderNameLabel = new Label();

            folderNameLabel.Text = GettextCatalog.GetString("Folder Name:");
            folderNameHBox.PackStart(folderNameLabel);

            folderNameTextEntry = new TextEntry();
            folderNameHBox.PackStart(folderNameTextEntry, true, true);
            folderNameTextEntry.SetCommonAccessibilityAttributes(
                "NewFolderDialog.FolderNameTextEntry",
                folderNameLabel.Text,
                GettextCatalog.GetString("Enter the name for the new folder"));

            warningPopover         = new InformationPopoverWidget();
            warningPopover.Visible = false;
            folderNameHBox.PackStart(warningPopover);

            mainVBox.PackStart(folderNameHBox);

            var cancelButton = new DialogButton(Command.Cancel);

            Buttons.Add(cancelButton);

            addButton = new DialogButton(Command.Add);
            Buttons.Add(addButton);

            DefaultCommand = addButton.Command;

            Content = mainVBox;
        }
Пример #3
0
        public SshCredentialsWidget(SshUserKeyCredentials creds)
        {
            Credentials = creds ?? new SshUserKeyCredentials();

            DefaultRowSpacing = XwtCredentialsDialog.InputContainerContainerSpacing;

            int inputContainerCurrentRow = 0;

            var privateKeyLocationLabel = new Label(GettextCatalog.GetString("Private Key:"))
            {
                MinWidth      = XwtCredentialsDialog.DefaultlLabelWidth,
                TextAlignment = Alignment.End
            };

            Add(privateKeyLocationLabel, 0, inputContainerCurrentRow, hexpand: false, vpos: WidgetPlacement.Center);

            var privateKeyLocationContainer = new HBox();

            Add(privateKeyLocationContainer, 1, inputContainerCurrentRow, hexpand: true);

            privateKeyLocationTextEntry = new TextEntry {
                Text = Credentials.PrivateKey ?? string.Empty
            };
            privateKeyLocationTextEntry.Accessible.LabelWidget = privateKeyLocationLabel;
            privateKeyLocationTextEntry.Changed += PrivateKeyLocationTextEntry_Changed;
            privateKeyLocationContainer.PackStart(privateKeyLocationTextEntry, true, vpos: WidgetPlacement.Center);

            warningPrivateKey = new InformationPopoverWidget {
                Severity = Ide.Tasks.TaskSeverity.Warning
            };
            privateKeyLocationContainer.PackStart(warningPrivateKey);
            privateKeyLocationButton = new Button("…");
            privateKeyLocationButton.Accessible.LabelWidget = privateKeyLocationLabel;
            privateKeyLocationButton.Accessible.Title       = GettextCatalog.GetString("Select a key file");
            privateKeyLocationContainer.PackStart(privateKeyLocationButton);
            inputContainerCurrentRow++;

            //Public key location
            var publicKeyLocationLabel = new Label(GettextCatalog.GetString("Public Key:"))
            {
                MinWidth      = XwtCredentialsDialog.DefaultlLabelWidth,
                TextAlignment = Alignment.End
            };

            Add(publicKeyLocationLabel, 0, inputContainerCurrentRow, hexpand: false, vpos: WidgetPlacement.Center);

            var publicKeyLocationContainer = new HBox();

            Add(publicKeyLocationContainer, 1, inputContainerCurrentRow, hexpand: true);

            publicKeyLocationTextEntry = new TextEntry {
                Text = Credentials.PublicKey ?? string.Empty
            };
            publicKeyLocationTextEntry.Accessible.LabelWidget = publicKeyLocationLabel;
            publicKeyLocationTextEntry.Changed += PublicKeyLocationTextEntry_Changed;
            publicKeyLocationContainer.PackStart(publicKeyLocationTextEntry, true, vpos: WidgetPlacement.Center);

            warningPublicKey = new InformationPopoverWidget {
                Severity = Ide.Tasks.TaskSeverity.Warning
            };
            publicKeyLocationContainer.PackStart(warningPublicKey);
            publicKeyLocationButton = new Button("…");
            publicKeyLocationButton.Accessible.LabelWidget = publicKeyLocationLabel;
            publicKeyLocationButton.Accessible.Title       = GettextCatalog.GetString("Select a key file");
            publicKeyLocationContainer.PackStart(publicKeyLocationButton);
            inputContainerCurrentRow++;

            //password container
            var passwordLabel = new Label()
            {
                TextAlignment = Alignment.End,
                Text          = GettextCatalog.GetString("Passphrase:"),
                MinWidth      = XwtCredentialsDialog.DefaultlLabelWidth
            };

            Add(passwordLabel, 0, inputContainerCurrentRow, hexpand: false, vpos: WidgetPlacement.Center);

            passphraseEntry = new PasswordEntry()
            {
                MarginTop = 5
            };
            passphraseEntry.Accessible.LabelWidget = passwordLabel;
            Add(passphraseEntry, 1, inputContainerCurrentRow, hexpand: true, vpos: WidgetPlacement.Center, marginRight: Toolkit.CurrentEngine.Type == ToolkitType.XamMac ? 1 : -1);
            passphraseEntry.Changed += PasswordEntry_Changed;

            privateKeyLocationButton.Clicked += PrivateKeyLocationButton_Clicked;
            publicKeyLocationButton.Clicked  += PublicKeyLocationButton_Clicked;

            OnCredentialsChanged();
        }
Пример #4
0
        public DotNetRunConfigurationEditorWidget(bool includeAdvancedTab)
        {
            VBox mainBox = new VBox();

            mainBox.Margin = 12;
            var startActionlabel = new Label {
                Markup = GettextCatalog.GetString("Start Action")
            };

            mainBox.PackStart(startActionlabel);
            var table = new Table();

            table.Add(radioStartProject = new RadioButton(GettextCatalog.GetString("Start project")), 0, 0);
            table.Add(radioStartApp     = new RadioButton(GettextCatalog.GetString("Start external program:")), 0, 1);
            table.Add(appEntry          = new Xwt.FileSelector(), 1, 1, hexpand: true);
            table.Add(appEntryInfoIcon  = new InformationPopoverWidget(), 2, 1);
            appEntryInfoIcon.Hide();
            radioStartProject.Group = radioStartApp.Group;
            table.MarginLeft        = 12;
            mainBox.PackStart(table);

            radioStartProject.Accessible.LabelWidget = startActionlabel;
            radioStartApp.Accessible.LabelWidget     = startActionlabel;

            appEntry.Accessible.Label = GettextCatalog.GetString("External Program");

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });
            table = new Table();

            var argumentsLabel = new Label(GettextCatalog.GetString("Arguments:"));

            table.Add(argumentsLabel, 0, 0);
            table.Add(argumentsEntry = new TextEntry(), 1, 0, hexpand: true);
            argumentsEntry.Accessible.LabelWidget = argumentsLabel;

            var workingDirLabel = new Label(GettextCatalog.GetString("Run in directory:"));

            table.Add(workingDirLabel, 0, 1);
            table.Add(workingDir = new FolderSelector(), 1, 1, hexpand: true);
            workingDir.Accessible.LabelWidget = workingDirLabel;

            mainBox.PackStart(table);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            var envVarsLabel = new Label(GettextCatalog.GetString("Environment Variables"));

            mainBox.PackStart(envVarsLabel);
            envVars = new EnvironmentVariableCollectionEditor();
            envVars.Accessible.LabelWidget = envVarsLabel;

            mainBox.PackStart(envVars, true);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            HBox cbox = new HBox();

            cbox.PackStart(externalConsole = new CheckBox(GettextCatalog.GetString("Run on external console")));
            cbox.PackStart(pauseConsole    = new CheckBox(GettextCatalog.GetString("Pause console output")));
            mainBox.PackStart(cbox);

            Add(mainBox, GettextCatalog.GetString("General"));

            var adBox = new VBox();

            adBox.Margin = 12;

            table = new Table();
            table.Add(new Label(GettextCatalog.GetString("Execute in .NET Runtime:")), 0, 0);
            table.Add(runtimesCombo        = new ComboBox(), 1, 0, hexpand: true);
            runtimesCombo.Accessible.Label = GettextCatalog.GetString(".NET Runtime");

            var monoLabel = new Label(GettextCatalog.GetString("Mono runtime settings:"));

            table.Add(monoLabel, 0, 1);

            var    box = new HBox();
            Button monoSettingsButton = new Button(GettextCatalog.GetString("\u2026"));

            box.PackStart(monoSettingsEntry = new TextEntry {
                PlaceholderText = GettextCatalog.GetString("Default settings")
            }, true);
            box.PackStart(monoSettingsButton);
            monoSettingsEntry.ReadOnly = true;
            table.Add(box, 1, 1, hexpand: true);
            adBox.PackStart(table);

            monoSettingsButton.Accessible.LabelWidget = monoLabel;

            if (includeAdvancedTab)
            {
                Add(adBox, GettextCatalog.GetString("Advanced"));
            }

            monoSettingsButton.Clicked      += EditRuntimeClicked;
            radioStartProject.ActiveChanged += (sender, e) => UpdateStatus();
            externalConsole.Toggled         += (sender, e) => UpdateStatus();

            LoadRuntimes();

            appEntry.FileChanged           += (sender, e) => NotifyChanged();
            argumentsEntry.Changed         += (sender, e) => NotifyChanged();
            workingDir.FolderChanged       += (sender, e) => NotifyChanged();
            envVars.Changed                += (sender, e) => NotifyChanged();
            externalConsole.Toggled        += (sender, e) => NotifyChanged();
            pauseConsole.Toggled           += (sender, e) => NotifyChanged();
            runtimesCombo.SelectionChanged += (sender, e) => NotifyChanged();
            monoSettingsEntry.Changed      += (sender, e) => NotifyChanged();
        }