Пример #1
0
        /// <summary>
        /// Raises the button ok clicked event.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        protected void OnButtonOkClicked(object sender, EventArgs e)
        {
            Application.Invoke(delegate
            {
                progressbar3.Text = Mono.Unix.Catalog.GetString("Verifying...");
            });

            bool bAreAllSettingsOK = true;

            Config.SetGameName(GameName_entry.Text);

            ESystemTarget SystemTarget = Utilities.ParseSystemTarget(combobox_SystemTarget.ActiveText);

            if (SystemTarget != ESystemTarget.Invalid)
            {
                Config.SetSystemTarget(SystemTarget);
            }
            else
            {
                bAreAllSettingsOK = false;
            }

            if (FTPURL_entry.Text.StartsWith("ftp://"))
            {
                Config.SetBaseFTPUrl(FTPURL_entry.Text);
            }
            else
            {
                bAreAllSettingsOK = false;
                Gdk.Color col = new Gdk.Color(255, 128, 128);
                FTPURL_entry.ModifyBase(StateType.Normal, col);
                FTPURL_entry.TooltipText = Mono.Unix.Catalog.GetString("The URL needs to begin with \"ftp://\". Please correct the URL.");
            }

            Config.SetFTPPassword(FTPPassword_entry.Text);
            Config.SetFTPUsername(FTPUsername_entry.Text);


            if (bAreAllSettingsOK)
            {
                if (Checks.CanConnectToFTP())
                {
                    Destroy();
                }
                else
                {
                    MessageDialog dialog = new MessageDialog(
                        null, DialogFlags.Modal,
                        MessageType.Warning,
                        ButtonsType.Ok,
                        Mono.Unix.Catalog.GetString("Failed to connect to the FTP server. Please check your FTP settings."));

                    dialog.Run();
                    dialog.Destroy();
                }
            }

            progressbar3.Text = Mono.Unix.Catalog.GetString("Idle");
        }
Пример #2
0
 /// <summary>
 /// Raises the FTPURL entry changed event.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 protected void OnFTPURLEntryChanged(object sender, EventArgs e)
 {
     //Set the base colour back to normal
     FTPURL_entry.ModifyBase(StateType.Normal);
 }