finish ui re-build

This commit is contained in:
2022-06-13 12:37:53 +02:00
parent 0cacb0d980
commit af527c1d7b
19 changed files with 944 additions and 1685 deletions

View File

@@ -10,10 +10,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Telerik.WinControls.UI;
namespace Pilz.Updating.Administration.GUI
{
public partial class DiscordPostDialog : OfficeForm
public partial class DiscordPostDialog : RadForm
{
// F i e l d s
@@ -28,22 +29,21 @@ namespace Pilz.Updating.Administration.GUI
this.package = package;
InitializeComponent();
UpdateAmbientColors();
textBoxX_AppName.Text = General.CurProject.DiscordBotConfig.DefaultAppName;
textBoxX_Msg.Text = General.CurProject.DiscordBotConfig.DefaultUpdateMessage;
radTextBoxControl_ProgramName.Text = General.CurProject.DiscordBotConfig.DefaultAppName;
radRichTextEditor_Message.Text = General.CurProject.DiscordBotConfig.DefaultUpdateMessage;
LoadBgrTree();
}
private void LoadBgrTree()
{
advTree1.BeginUpdate();
advTree1.Nodes.Clear();
radTreeView_Channels.BeginUpdate();
radTreeView_Channels.Nodes.Clear();
foreach (var guild in bot.GetGuilds())
{
var nGuild = new Node()
var nGuild = new RadTreeNode()
{
Name = "g" + guild.Key,
Text = guild.Value,
@@ -53,7 +53,7 @@ namespace Pilz.Updating.Administration.GUI
foreach (var channel in bot.GetTextChannels(guild.Key).OrderBy((n) => n.Value))
{
var nChannel = new Node()
var nChannel = new RadTreeNode()
{
Name = "c" + channel.Key,
Text = "#" + channel.Value,
@@ -63,22 +63,22 @@ namespace Pilz.Updating.Administration.GUI
nGuild.Nodes.Add(nChannel);
}
advTree1.Nodes.Add(nGuild);
radTreeView_Channels.Nodes.Add(nGuild);
}
advTree1.EndUpdate();
radTreeView_Channels.EndUpdate();
}
private async void ButtonX_SendMsg_Click(object sender, EventArgs e)
{
try
{
var selNode = advTree1.SelectedNode;
var selNode = radTreeView_Channels.SelectedNode;
ulong gID = (ulong)selNode.Parent.Tag;
ulong cID = (ulong)selNode.Tag;
var msg = textBoxX_Msg.Text;
var msg = radRichTextEditor_Message.Text;
await bot.SendUpdateNotification(package, gID, cID, textBoxX_AppName.Text, msg, checkBoxX_AddChangelog.Checked, checkBoxX_PingAtEveryone.Checked);
await bot.SendUpdateNotification(package, gID, cID, radTextBoxControl_ProgramName.Text, msg, radCheckBox_AttachDescription.Checked, radCheckBoxPingAtEveryone.Checked);
MessageBoxEx.Show(this, "Nachricht erfolgreich gesendet.", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;