mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-21 18:03:54 +03:00
59 lines
1.7 KiB
C#
59 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Resources;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace uds.gui.forms
|
|
{
|
|
public partial class Config : Form
|
|
{
|
|
public Config()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Config_Load(object sender, EventArgs e)
|
|
{
|
|
brokerAddress.Text = config.broker;
|
|
useSecureConnection.SelectedIndex = config.ssl ? 0 : 1;
|
|
if (Info.Computer.IsUserAdministrator() == false)
|
|
{
|
|
MessageBox.Show(Lang.AdminNeeded, Lang.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
Close();
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
private void cancelButton_Click(object sender, EventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void testConnectionButton_Click(object sender, EventArgs e)
|
|
{
|
|
rpc.Initialize(brokerAddress.Text, useSecureConnection.SelectedIndex == 0);
|
|
if (rpc.Manager.Test() == false)
|
|
{
|
|
MessageBox.Show(Lang.ConnectionError, Lang.ConnectionTest, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show(Lang.ConnectionOK, Lang.ConnectionTest, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
|
}
|
|
}
|
|
|
|
private void acceptButton_Click(object sender, EventArgs e)
|
|
{
|
|
config.broker = brokerAddress.Text;
|
|
config.ssl = useSecureConnection.SelectedIndex == 0;
|
|
config.SaveConfig();
|
|
Close();
|
|
}
|
|
}
|
|
}
|