From f4fe982aef85522ab474a35554e7cd2fcad71604 Mon Sep 17 00:00:00 2001 From: "kenneth.skovhede@gmail.com" Date: Thu, 16 Jul 2009 20:01:46 +0000 Subject: [PATCH] Fixed issue #81, Unicode support, thanks to Colm. Fixed a debug commit which made the CommandLine version exit immediately. Added a safeguard for broken language selections in the database. git-svn-id: https://duplicati.googlecode.com/svn/trunk@224 59da171f-624f-0410-aa54-27559c288bec --- Duplicati/CommandLine/Program.cs | 3 --- Duplicati/GUI/Program.cs | 14 +++++++++++--- Duplicati/GUI/Strings/Program.Designer.cs | 9 +++++++++ Duplicati/GUI/Strings/Program.resx | 4 ++++ Duplicati/Library/Compression/FileArchiveZip.cs | 7 ++++++- changelog.txt | 6 ++++++ 6 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 changelog.txt diff --git a/Duplicati/CommandLine/Program.cs b/Duplicati/CommandLine/Program.cs index 39b09128d..0801c7cc0 100644 --- a/Duplicati/CommandLine/Program.cs +++ b/Duplicati/CommandLine/Program.cs @@ -27,9 +27,6 @@ namespace Duplicati.CommandLine { static void Main(string[] args) { - Console.WriteLine(Strings.Program.AddedFoldersHeader); - return; - List cargs = new List(args); string filter = Duplicati.Library.Core.FilenameFilter.EncodeAsFilter(Duplicati.Library.Core.FilenameFilter.ParseCommandLine(cargs, true)); diff --git a/Duplicati/GUI/Program.cs b/Duplicati/GUI/Program.cs index 9c8fa04e8..b16dd3c8e 100644 --- a/Duplicati/GUI/Program.cs +++ b/Duplicati/GUI/Program.cs @@ -136,9 +136,17 @@ namespace Duplicati.GUI DataConnection = new DataFetcherWithRelations(new SQLiteDataProvider(con)); if (!string.IsNullOrEmpty(new Datamodel.ApplicationSettings(DataConnection).DisplayLanguage)) - System.Threading.Thread.CurrentThread.CurrentUICulture = - System.Threading.Thread.CurrentThread.CurrentCulture = - System.Globalization.CultureInfo.GetCultureInfo(new Datamodel.ApplicationSettings(DataConnection).DisplayLanguage); + try + { + System.Threading.Thread.CurrentThread.CurrentUICulture = + System.Threading.Thread.CurrentThread.CurrentCulture = + System.Globalization.CultureInfo.GetCultureInfo(new Datamodel.ApplicationSettings(DataConnection).DisplayLanguage); + } + catch(Exception ex) + { + MessageBox.Show(string.Format(Strings.Program.LanguageSelectionError, ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } TrayIcon = new NotifyIcon(); TrayIcon.ContextMenuStrip = new ContextMenuStrip(); diff --git a/Duplicati/GUI/Strings/Program.Designer.cs b/Duplicati/GUI/Strings/Program.Designer.cs index 27055e73c..0f0be0e54 100644 --- a/Duplicati/GUI/Strings/Program.Designer.cs +++ b/Duplicati/GUI/Strings/Program.Designer.cs @@ -78,6 +78,15 @@ namespace Duplicati.GUI.Strings { } } + /// + /// Looks up a localized string similar to Failed to set the user interface language: {0}. + /// + internal static string LanguageSelectionError { + get { + return ResourceManager.GetString("LanguageSelectionError", resourceCulture); + } + } + /// /// Looks up a localized string similar to Quit. /// diff --git a/Duplicati/GUI/Strings/Program.resx b/Duplicati/GUI/Strings/Program.resx index 301b8607e..63d704c7c 100644 --- a/Duplicati/GUI/Strings/Program.resx +++ b/Duplicati/GUI/Strings/Program.resx @@ -125,6 +125,10 @@ Failed to create, open or upgrade the database.\r\nError message: {0} An error message displayed when opening the database fails + + Failed to set the user interface language: {0} + An error message displayed if the language cannot be selected + Quit Text for the quit menu in the trayicon context menu diff --git a/Duplicati/Library/Compression/FileArchiveZip.cs b/Duplicati/Library/Compression/FileArchiveZip.cs index a4d338f64..79630b292 100644 --- a/Duplicati/Library/Compression/FileArchiveZip.cs +++ b/Duplicati/Library/Compression/FileArchiveZip.cs @@ -235,7 +235,12 @@ namespace Duplicati.Library.Compression return new StreamWrapper(new Duplicati.Library.Core.TempFile(), PathFromFilesystem(file), m_zip); #else //This automatically sets DateTime to now - m_stream.PutNextEntry(new ICSharpCode.SharpZipLib.Zip.ZipEntry(PathFromFilesystem(file))); + ICSharpCode.SharpZipLib.Zip.ZipEntry ze = new ICSharpCode.SharpZipLib.Zip.ZipEntry(PathFromFilesystem(file)); + + //Encode filenames as unicode, we do this for all files, to avoid codepage issues + ze.Flags |= (int)ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.UnicodeText; + + m_stream.PutNextEntry(ze); return new StreamWrapper2(m_stream); #endif } diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 000000000..853d81e15 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,6 @@ +1.0.1 r215 05 jul 2009 +Fixes to a restore problem when restoring the setup +Added a debug option for the SSH backend +Added localization support + +1.0.0 - 09 jun 2009