[gnome-subtitles] File Open/Save error dialogs: set "Save" as default action
- From: Pedro Castro <pcastro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-subtitles] File Open/Save error dialogs: set "Save" as default action
- Date: Mon, 20 May 2019 19:06:11 +0000 (UTC)
commit 1717f0a404b4cab0e2f11c9a34688152e6936d83
Author: Pedro Castro <pedro gnomesubtitles org>
Date: Mon May 20 20:04:51 2019 +0100
File Open/Save error dialogs: set "Save" as default action
Fixes #132: File Open/Save error dialogs have wrong action set as
default
gnome-subtitles.csproj | 18 +++++++++---------
src/GnomeSubtitles/Core/Command/TranslatorCommand.cs | 2 +-
.../Dialog/{Unmanaged => Message}/BasicErrorDialog.cs | 6 ++----
.../Dialog/{Unmanaged => Message}/ErrorDialog.cs | 4 ++--
.../{Unmanaged => Message}/FileOpenErrorDialog.cs | 6 ++++--
.../{Unmanaged => Message}/FileSaveErrorDialog.cs | 7 ++++---
.../Dialog/{ => Message}/MessageDialog.cs | 5 ++---
.../{Unmanaged => Message}/SaveConfirmationDialog.cs | 6 ++++--
.../SubtitleFileOpenErrorDialog.cs | 4 ++--
.../Dialog/{Unmanaged => Message}/VideoErrorDialog.cs | 4 ++--
.../Dialog/{Unmanaged => Message}/WarningDialog.cs | 6 ++----
src/GnomeSubtitles/Execution/BugReporter.cs | 2 +-
src/GnomeSubtitles/Ui/MainUi.cs | 7 ++-----
src/GnomeSubtitles/Ui/VideoPreview/Video.cs | 2 +-
src/Makefile.am | 2 +-
15 files changed, 39 insertions(+), 42 deletions(-)
---
diff --git a/gnome-subtitles.csproj b/gnome-subtitles.csproj
index 8146e39..dea2a47 100644
--- a/gnome-subtitles.csproj
+++ b/gnome-subtitles.csproj
@@ -147,21 +147,20 @@
<Compile Include="src\GnomeSubtitles\Dialog\EncodingsDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\FilePropertiesDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\FileTranslationOpenDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\MessageDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\PreferencesDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\SearchDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\TimingsAdjustDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\TimingsShiftDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\TimingsSynchronizeDialog.cs" />
<Compile Include="src\GnomeSubtitles\Dialog\VideoSeekToDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\BasicErrorDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\ErrorDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\FileOpenErrorDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\FileSaveErrorDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\SaveConfirmationDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\SubtitleFileOpenErrorDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\VideoErrorDialog.cs" />
- <Compile Include="src\GnomeSubtitles\Dialog\Unmanaged\WarningDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\BasicErrorDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\ErrorDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\FileOpenErrorDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\FileSaveErrorDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\SaveConfirmationDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\SubtitleFileOpenErrorDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\VideoErrorDialog.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\WarningDialog.cs" />
<Compile Include="src\GnomeSubtitles\Execution\AssemblyInfo.cs" />
<Compile Include="src\GnomeSubtitles\Execution\BugReporter.cs" />
<Compile Include="src\GnomeSubtitles\Execution\Executable.cs" />
@@ -280,6 +279,7 @@
<Compile Include="src\GnomeSubtitles\Core\ConfigBackendUnavailableException.cs" />
<Compile Include="src\GnomeSubtitles\Core\ConfigBackendInMemory.cs" />
<Compile Include="src\External\GtkSpell\SpellChecker.cs" />
+ <Compile Include="src\GnomeSubtitles\Dialog\Message\MessageDialog.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/src/GnomeSubtitles/Core/Command/TranslatorCommand.cs
b/src/GnomeSubtitles/Core/Command/TranslatorCommand.cs
index 78ee1be..18cb783 100644
--- a/src/GnomeSubtitles/Core/Command/TranslatorCommand.cs
+++ b/src/GnomeSubtitles/Core/Command/TranslatorCommand.cs
@@ -18,7 +18,7 @@
// */
//using GnomeSubtitles.Dialog;
-//using GnomeSubtitles.Dialog.Unmanaged;
+//using GnomeSubtitles.Dialog.Message;
//using GnomeSubtitles.Ui.Edit;
//using Gtk;
//using Mono.Unix;
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/BasicErrorDialog.cs
b/src/GnomeSubtitles/Dialog/Message/BasicErrorDialog.cs
similarity index 90%
rename from src/GnomeSubtitles/Dialog/Unmanaged/BasicErrorDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/BasicErrorDialog.cs
index ca92acb..40d5164 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/BasicErrorDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/BasicErrorDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2008-2009 Pedro Castro
+ * Copyright (C) 2008-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,10 +18,8 @@
*/
using Gtk;
-using Mono.Unix;
-using System;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public class BasicErrorDialog : ErrorDialog {
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/ErrorDialog.cs
b/src/GnomeSubtitles/Dialog/Message/ErrorDialog.cs
similarity index 94%
rename from src/GnomeSubtitles/Dialog/Unmanaged/ErrorDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/ErrorDialog.cs
index 272e773..5c2da91 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/ErrorDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/ErrorDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2007-2009 Pedro Castro
+ * Copyright (C) 2007-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ using Gtk;
using Mono.Unix;
using System;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public abstract class ErrorDialog : MessageDialog {
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/FileOpenErrorDialog.cs
b/src/GnomeSubtitles/Dialog/Message/FileOpenErrorDialog.cs
similarity index 94%
rename from src/GnomeSubtitles/Dialog/Unmanaged/FileOpenErrorDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/FileOpenErrorDialog.cs
index 9b74cd4..a6b813b 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/FileOpenErrorDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/FileOpenErrorDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2017 Pedro Castro
+ * Copyright (C) 2006-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@ using Mono.Unix;
using SubLib.Util;
using System;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public abstract class FileOpenErrorDialog : ErrorDialog {
@@ -47,6 +47,8 @@ public abstract class FileOpenErrorDialog : ErrorDialog {
Button actionButton = dialog.AddButton(actionLabel, ResponseType.Accept) as Button;
actionButton.Image = new Image(Stock.Open, IconSize.Button);
dialog.AddButton(Stock.Ok, ResponseType.Ok);
+
+ dialog.DefaultResponse = ResponseType.Accept;
}
protected virtual string GetPrimaryText (string filename) {
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/FileSaveErrorDialog.cs
b/src/GnomeSubtitles/Dialog/Message/FileSaveErrorDialog.cs
similarity index 94%
rename from src/GnomeSubtitles/Dialog/Unmanaged/FileSaveErrorDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/FileSaveErrorDialog.cs
index 2623aef..20c64a0 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/FileSaveErrorDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/FileSaveErrorDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2007-2017 Pedro Castro
+ * Copyright (C) 2007-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,13 +19,12 @@
using Gtk;
using Mono.Unix;
-using SubLib;
using System;
using System.IO;
using System.Security;
using SubLib.Util;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public class FileSaveErrorDialog : ErrorDialog {
@@ -47,6 +46,8 @@ public class FileSaveErrorDialog : ErrorDialog {
Button actionButton = dialog.AddButton(actionLabel, ResponseType.Accept) as Button;
actionButton.Image = new Image(Stock.Save, IconSize.Button);
dialog.AddButton(Stock.Ok, ResponseType.Ok);
+
+ dialog.DefaultResponse = ResponseType.Accept;
}
/* Private methods */
diff --git a/src/GnomeSubtitles/Dialog/MessageDialog.cs b/src/GnomeSubtitles/Dialog/Message/MessageDialog.cs
similarity index 97%
rename from src/GnomeSubtitles/Dialog/MessageDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/MessageDialog.cs
index 3c09234..409a7ed 100644
--- a/src/GnomeSubtitles/Dialog/MessageDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/MessageDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2008-2010 Pedro Castro
+ * Copyright (C) 2008-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,9 +19,8 @@
using GnomeSubtitles.Core;
using Gtk;
-using System;
-namespace GnomeSubtitles.Dialog {
+namespace GnomeSubtitles.Dialog.Message {
public abstract class MessageDialog : BaseDialog {
protected Gtk.MessageDialog dialog = null;
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/SaveConfirmationDialog.cs
b/src/GnomeSubtitles/Dialog/Message/SaveConfirmationDialog.cs
similarity index 97%
rename from src/GnomeSubtitles/Dialog/Unmanaged/SaveConfirmationDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/SaveConfirmationDialog.cs
index 990878c..34e7d23 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/SaveConfirmationDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/SaveConfirmationDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2010 Pedro Castro
+ * Copyright (C) 2006-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@ using Mono.Unix;
using SubLib.Core.Domain;
using System;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public abstract class SaveConfirmationDialog : WarningDialog {
private SubtitleTextType textType;
@@ -58,6 +58,8 @@ public abstract class SaveConfirmationDialog : WarningDialog {
dialog.AddButton(rejectLabel, ResponseType.Reject);
dialog.AddButton(Stock.Cancel, ResponseType.Cancel);
dialog.AddButton(Stock.Save, ResponseType.Accept);
+
+ dialog.DefaultResponse = ResponseType.Accept;
}
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/SubtitleFileOpenErrorDialog.cs
b/src/GnomeSubtitles/Dialog/Message/SubtitleFileOpenErrorDialog.cs
similarity index 96%
rename from src/GnomeSubtitles/Dialog/Unmanaged/SubtitleFileOpenErrorDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/SubtitleFileOpenErrorDialog.cs
index 0b2fab0..85c364a 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/SubtitleFileOpenErrorDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/SubtitleFileOpenErrorDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2009,2011 Pedro Castro
+ * Copyright (C) 2006-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@ using System;
using System.IO;
using System.Security;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public class SubtitleFileOpenErrorDialog : FileOpenErrorDialog {
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/VideoErrorDialog.cs
b/src/GnomeSubtitles/Dialog/Message/VideoErrorDialog.cs
similarity index 94%
rename from src/GnomeSubtitles/Dialog/Unmanaged/VideoErrorDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/VideoErrorDialog.cs
index f07ae5c..211edc8 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/VideoErrorDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/VideoErrorDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2007-2017 Pedro Castro
+ * Copyright (C) 2007-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@ using Mono.Unix;
using System;
using SubLib.Util;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public class VideoErrorDialog : FileOpenErrorDialog {
diff --git a/src/GnomeSubtitles/Dialog/Unmanaged/WarningDialog.cs
b/src/GnomeSubtitles/Dialog/Message/WarningDialog.cs
similarity index 89%
rename from src/GnomeSubtitles/Dialog/Unmanaged/WarningDialog.cs
rename to src/GnomeSubtitles/Dialog/Message/WarningDialog.cs
index e1d341d..998905e 100644
--- a/src/GnomeSubtitles/Dialog/Unmanaged/WarningDialog.cs
+++ b/src/GnomeSubtitles/Dialog/Message/WarningDialog.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2008-2009 Pedro Castro
+ * Copyright (C) 2008-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,10 +18,8 @@
*/
using Gtk;
-using Mono.Unix;
-using System;
-namespace GnomeSubtitles.Dialog.Unmanaged {
+namespace GnomeSubtitles.Dialog.Message {
public abstract class WarningDialog : MessageDialog {
diff --git a/src/GnomeSubtitles/Execution/BugReporter.cs b/src/GnomeSubtitles/Execution/BugReporter.cs
index b1daa8f..550914c 100644
--- a/src/GnomeSubtitles/Execution/BugReporter.cs
+++ b/src/GnomeSubtitles/Execution/BugReporter.cs
@@ -18,7 +18,7 @@
*/
using GnomeSubtitles.Core;
-//using GnomeSubtitles.Dialog.Unmanaged;
+//using GnomeSubtitles.Dialog.Message;
//using Mono.Unix;
using SubLib.Util;
using System;
diff --git a/src/GnomeSubtitles/Ui/MainUi.cs b/src/GnomeSubtitles/Ui/MainUi.cs
index 38609cd..3bd5f9a 100644
--- a/src/GnomeSubtitles/Ui/MainUi.cs
+++ b/src/GnomeSubtitles/Ui/MainUi.cs
@@ -1,6 +1,6 @@
/*
* This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2018 Pedro Castro
+ * Copyright (C) 2006-2019 Pedro Castro
*
* Gnome Subtitles is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,21 +18,18 @@
*/
using GnomeSubtitles.Core;
-using GnomeSubtitles.Core.Command;
using GnomeSubtitles.Dialog;
-using GnomeSubtitles.Dialog.Unmanaged;
+using GnomeSubtitles.Dialog.Message;
using GnomeSubtitles.Ui.Edit;
using GnomeSubtitles.Ui.VideoPreview;
using GnomeSubtitles.Ui.View;
using Gtk;
-using Mono.Unix;
using SubLib.Core.Domain;
using SubLib.Exceptions;
using SubLib.Util;
using System;
using System.IO;
using System.Text;
-using System.Reflection;
namespace GnomeSubtitles.Ui {
diff --git a/src/GnomeSubtitles/Ui/VideoPreview/Video.cs b/src/GnomeSubtitles/Ui/VideoPreview/Video.cs
index 9caf60b..246658d 100644
--- a/src/GnomeSubtitles/Ui/VideoPreview/Video.cs
+++ b/src/GnomeSubtitles/Ui/VideoPreview/Video.cs
@@ -19,7 +19,7 @@
using Gdk;
using GnomeSubtitles.Core;
-using GnomeSubtitles.Dialog.Unmanaged;
+using GnomeSubtitles.Dialog.Message;
using Gtk;
using GStreamer;
using SubLib.Core.Domain;
diff --git a/src/Makefile.am b/src/Makefile.am
index fb09aff..1b4d10f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,7 +25,7 @@ GSSOURCES = \
$(srcdir)/GnomeSubtitles/Core/*.cs \
$(srcdir)/GnomeSubtitles/Core/Command/*.cs \
$(srcdir)/GnomeSubtitles/Dialog/*.cs \
- $(srcdir)/GnomeSubtitles/Dialog/Unmanaged/*.cs \
+ $(srcdir)/GnomeSubtitles/Dialog/Message/*.cs \
$(srcdir)/GnomeSubtitles/Execution/*.cs \
$(srcdir)/GnomeSubtitles/Ui/*.cs \
$(srcdir)/GnomeSubtitles/Ui/Component/*.cs \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]