1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-06 14:34:05 +02:00

Fix some dialogs not having default enter/escape actions

This commit is contained in:
chylex 2017-03-30 23:24:00 +02:00
parent cf525a3929
commit dee99caa7d
3 changed files with 11 additions and 6 deletions

View File

@ -278,7 +278,7 @@ private void soundNotification_PlaybackError(object sender, PlaybackErrorEventAr
e.Ignore = true;
using(FormMessage form = new FormMessage("Notification Sound Error", "Could not play custom notification sound."+Environment.NewLine+e.Message, MessageBoxIcon.Error)){
form.AddButton("Ignore");
form.CancelButton = form.AddButton("Ignore");
Button btnOpenSettings = form.AddButton("Open Settings");
btnOpenSettings.Width += 16;

View File

@ -76,8 +76,8 @@ private static void Main(){
}
else if (attempt == 20){
using(FormMessage form = new FormMessage(BrandName+" Cannot Restart", BrandName+" is taking too long to close.", MessageBoxIcon.Warning)){
form.AddButton("Exit");
form.AddButton("Retry", DialogResult.Retry);
form.CancelButton = form.AddButton("Exit");
form.ActiveControl = form.AddButton("Retry", DialogResult.Retry);
if (form.ShowDialog() == DialogResult.Retry){
attempt /= 2;

View File

@ -47,8 +47,13 @@ public void HandleException(string caption, string message, bool canIgnore, Exce
bool loggedSuccessfully = Log(e.ToString());
FormMessage form = new FormMessage(caption, message+"\r\nError: "+e.Message, canIgnore ? MessageBoxIcon.Warning : MessageBoxIcon.Error);
form.AddButton("Exit");
form.AddButton("Ignore", DialogResult.Ignore).Enabled = canIgnore;
Button btnExit = form.AddButton("Exit");
Button btnIgnore = form.AddButton("Ignore", DialogResult.Ignore);
btnIgnore.Enabled = canIgnore;
form.ActiveControl = canIgnore ? btnIgnore : btnExit;
form.CancelButton = btnIgnore;
Button btnOpenLog = new Button{
Anchor = AnchorStyles.Bottom | AnchorStyles.Left,
@ -83,7 +88,7 @@ public static void HandleEarlyFailure(string caption, string message){
Application.SetCompatibleTextRenderingDefault(false);
FormMessage form = new FormMessage(caption, message, MessageBoxIcon.Error);
form.AddButton("Exit");
form.ActiveControl = form.AddButton("Exit");
form.ShowDialog();
try{