[synchronicity-commits] SF.net SVN: synchronicity:[147] trunk/Create Synchronicity
Easy, fast, and lightweight backup and synchronization app for Windows
Brought to you by:
createsoftware
From: <cre...@us...> - 2010-01-30 16:56:56
|
Revision: 147 http://synchronicity.svn.sourceforge.net/synchronicity/?rev=147&view=rev Author: createsoftware Date: 2010-01-30 16:56:49 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Step 5: * Add language selection dialog. * Fix links detection * Load program settings before loading language files Modified Paths: -------------- trunk/Create Synchronicity/AboutForm.designer.vb trunk/Create Synchronicity/AboutForm.resx trunk/Create Synchronicity/AboutForm.vb trunk/Create Synchronicity/LanguageHandling.vb trunk/Create Synchronicity/MainForm.vb trunk/Create Synchronicity/SettingsHandling.vb trunk/Create Synchronicity/languages/en.lng Modified: trunk/Create Synchronicity/AboutForm.designer.vb =================================================================== --- trunk/Create Synchronicity/AboutForm.designer.vb 2010-01-30 15:50:00 UTC (rev 146) +++ trunk/Create Synchronicity/AboutForm.designer.vb 2010-01-30 16:56:49 UTC (rev 147) @@ -40,6 +40,8 @@ Me.About_LinkToLicense = New System.Windows.Forms.LinkLabel Me.About_BugReport = New System.Windows.Forms.LinkLabel Me.About_Updates = New System.Windows.Forms.CheckBox + Me.About_LanguageLabel = New System.Windows.Forms.Label + Me.About_LanguagesList = New System.Windows.Forms.ComboBox CType(Me.About_Logo, System.ComponentModel.ISupportInitialize).BeginInit() Me.About_FlowLayoutPanel.SuspendLayout() Me.SuspendLayout() @@ -71,28 +73,25 @@ ' Me.About_LinkToProductPage.Location = New System.Drawing.Point(3, 0) Me.About_LinkToProductPage.Name = "About_LinkToProductPage" - Me.About_LinkToProductPage.Size = New System.Drawing.Size(301, 20) + Me.About_LinkToProductPage.Size = New System.Drawing.Size(325, 20) Me.About_LinkToProductPage.TabIndex = 0 Me.About_LinkToProductPage.TabStop = True Me.About_LinkToProductPage.Text = "Create Synchronicity" ' 'About_LinkToWebsite ' - Me.About_LinkToWebsite.LinkArea = New System.Windows.Forms.LinkArea(18, 6) Me.About_LinkToWebsite.Location = New System.Drawing.Point(3, 20) Me.About_LinkToWebsite.Name = "About_LinkToWebsite" - Me.About_LinkToWebsite.Size = New System.Drawing.Size(301, 20) + Me.About_LinkToWebsite.Size = New System.Drawing.Size(325, 20) Me.About_LinkToWebsite.TabIndex = 1 Me.About_LinkToWebsite.TabStop = True Me.About_LinkToWebsite.Text = "\LINKTOWEBSITE_TEXT" - Me.About_LinkToWebsite.UseCompatibleTextRendering = True ' 'About_VersionInfo ' - Me.About_VersionInfo.LinkArea = New System.Windows.Forms.LinkArea(19, 18) Me.About_VersionInfo.Location = New System.Drawing.Point(3, 40) Me.About_VersionInfo.Name = "About_VersionInfo" - Me.About_VersionInfo.Size = New System.Drawing.Size(301, 20) + Me.About_VersionInfo.Size = New System.Drawing.Size(325, 20) Me.About_VersionInfo.TabIndex = 2 Me.About_VersionInfo.TabStop = True Me.About_VersionInfo.Text = "\VERSION_TEXT" @@ -100,10 +99,9 @@ ' 'About_ContactLink ' - Me.About_ContactLink.LinkArea = New System.Windows.Forms.LinkArea(0, 18) Me.About_ContactLink.Location = New System.Drawing.Point(3, 60) Me.About_ContactLink.Name = "About_ContactLink" - Me.About_ContactLink.Size = New System.Drawing.Size(301, 20) + Me.About_ContactLink.Size = New System.Drawing.Size(325, 20) Me.About_ContactLink.TabIndex = 3 Me.About_ContactLink.TabStop = True Me.About_ContactLink.Text = "\CONTACT_LINK" @@ -111,10 +109,9 @@ ' 'About_LinkToLicense ' - Me.About_LinkToLicense.LinkArea = New System.Windows.Forms.LinkArea(15, 7) Me.About_LinkToLicense.Location = New System.Drawing.Point(3, 80) Me.About_LinkToLicense.Name = "About_LinkToLicense" - Me.About_LinkToLicense.Size = New System.Drawing.Size(301, 20) + Me.About_LinkToLicense.Size = New System.Drawing.Size(325, 20) Me.About_LinkToLicense.TabIndex = 4 Me.About_LinkToLicense.TabStop = True Me.About_LinkToLicense.Text = "\LICENSE_TEXT" @@ -122,30 +119,50 @@ ' 'About_BugReport ' - Me.About_BugReport.LinkArea = New System.Windows.Forms.LinkArea(0, 12) Me.About_BugReport.Location = New System.Drawing.Point(3, 100) Me.About_BugReport.Name = "About_BugReport" Me.About_BugReport.RightToLeft = System.Windows.Forms.RightToLeft.No - Me.About_BugReport.Size = New System.Drawing.Size(301, 20) + Me.About_BugReport.Size = New System.Drawing.Size(325, 20) Me.About_BugReport.TabIndex = 5 Me.About_BugReport.TabStop = True Me.About_BugReport.Text = "\BUG_REPORT" + Me.About_BugReport.UseCompatibleTextRendering = True ' 'About_Updates ' Me.About_Updates.AutoSize = True Me.About_Updates.Location = New System.Drawing.Point(12, 147) Me.About_Updates.Name = "About_Updates" - Me.About_Updates.Size = New System.Drawing.Size(427, 17) + Me.About_Updates.Size = New System.Drawing.Size(85, 17) Me.About_Updates.TabIndex = 2 Me.About_Updates.Text = "\UPDATES" Me.About_Updates.UseVisualStyleBackColor = True ' + 'About_LanguageLabel + ' + Me.About_LanguageLabel.AutoSize = True + Me.About_LanguageLabel.Location = New System.Drawing.Point(12, 173) + Me.About_LanguageLabel.Name = "About_LanguageLabel" + Me.About_LanguageLabel.Size = New System.Drawing.Size(75, 13) + Me.About_LanguageLabel.TabIndex = 3 + Me.About_LanguageLabel.Text = "\LANGUAGE" + Me.About_LanguageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'About_LanguagesList + ' + Me.About_LanguagesList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.About_LanguagesList.Location = New System.Drawing.Point(353, 170) + Me.About_LanguagesList.Name = "About_LanguagesList" + Me.About_LanguagesList.Size = New System.Drawing.Size(121, 21) + Me.About_LanguagesList.TabIndex = 4 + ' 'AboutForm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(486, 170) + Me.ClientSize = New System.Drawing.Size(486, 202) + Me.Controls.Add(Me.About_LanguageLabel) + Me.Controls.Add(Me.About_LanguagesList) Me.Controls.Add(Me.About_Updates) Me.Controls.Add(Me.About_FlowLayoutPanel) Me.Controls.Add(Me.About_Logo) @@ -169,4 +186,6 @@ Friend WithEvents About_LinkToLicense As System.Windows.Forms.LinkLabel Friend WithEvents About_BugReport As System.Windows.Forms.LinkLabel Friend WithEvents About_Updates As System.Windows.Forms.CheckBox + Friend WithEvents About_LanguageLabel As System.Windows.Forms.Label + Friend WithEvents About_LanguagesList As System.Windows.Forms.ComboBox End Class Modified: trunk/Create Synchronicity/AboutForm.resx =================================================================== --- trunk/Create Synchronicity/AboutForm.resx 2010-01-30 15:50:00 UTC (rev 146) +++ trunk/Create Synchronicity/AboutForm.resx 2010-01-30 16:56:49 UTC (rev 147) @@ -121,8 +121,8 @@ <data name="About_Logo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAKsAAACrCAYAAAAZ6GwZAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOxAAA - DsQBlSsOGwAAETdJREFUeF7tnb2OJEkRgG9vtdrl9pa5O5ZjWa0YhIQwkBgcJLwWeFgjTCSkESY4YyKs + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOwgAA + DsIBFShKgAAAETdJREFUeF7tnb2OJEkRgG9vtdrl9pa5O5ZjWa0YhIQwkBgcJLwWeFgjTCSkESY4YyKs kRD+iCfoF0AaG2u8c8fBn0eYR2j625uE2truyoisyL+qSKk1e1dZVZmRX0bGT2b3J594cQm4BFwCLgGX gEvAJeAScAm4BFwCLgGXgEvAJeAScAm4BFwCLgGXgEvAJeASmJTA6f7qZvC52P/76sCH/z+sx31eXALm EjjbP/H8EcCb/d/b/Wdn9Hl4fB7PBXLew/u8uASiEjh5BObaGMoUuJkUAWDa5aURCbAsbvef+0eNhcZB Modified: trunk/Create Synchronicity/AboutForm.vb =================================================================== --- trunk/Create Synchronicity/AboutForm.vb 2010-01-30 15:50:00 UTC (rev 146) +++ trunk/Create Synchronicity/AboutForm.vb 2010-01-30 16:56:49 UTC (rev 147) @@ -7,14 +7,38 @@ 'Web site: http://synchronicity.sourceforge.net. Public Class AboutForm + Private Sub SetLinkArea(ByVal Link As LinkLabel) + If Link.Text.IndexOf("\") = -1 Or Link.Text.IndexOf("/") = -1 Then Exit Sub + + Dim Area As New LinkArea + Area.Start = Link.Text.IndexOf("\") + Link.Text = Link.Text.Remove(Area.Start, 1) + Area.Length = Link.Text.IndexOf("/") - Area.Start + Link.Text = Link.Text.Remove(Area.Start + Area.Length, 1) + Link.LinkArea = Area + End Sub + Private Sub About_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Translation As LanguageHandler = LanguageHandler.GetSingleton Translation.TranslateControl(Me) About_VersionInfo.Text = About_VersionInfo.Text.Replace("%version%", Application.ProductVersion) - About_VersionInfo.LinkArea = New LinkArea(About_VersionInfo.Text.IndexOf("(") + 1, About_VersionInfo.Text.Length - (About_VersionInfo.Text.IndexOf("(") + 1) - 1) + + SetLinkArea(About_BugReport) + SetLinkArea(About_ContactLink) + SetLinkArea(About_LinkToLicense) + SetLinkArea(About_LinkToProductPage) + SetLinkArea(About_LinkToWebsite) + SetLinkArea(About_VersionInfo) + + About_LanguagesList.Items.Clear() + For Each File As String In IO.Directory.GetFiles(ConfigOptions.LanguageRootDir) + About_LanguagesList.Items.Add(File.Remove(File.LastIndexOf(".")).Substring(File.LastIndexOf("\") + 1)) + Next + ConfigOptions.LoadProgramSettings() About_Updates.Checked = ConfigOptions.GetProgramSetting(ConfigOptions.AutoUpdates, "False") + About_LanguagesList.SelectedIndex = About_LanguagesList.Items.IndexOf(ConfigOptions.GetProgramSetting(ConfigOptions.Language, "")) End Sub Private Sub About_LinkToProductPage_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles About_LinkToProductPage.LinkClicked @@ -41,15 +65,9 @@ Diagnostics.Process.Start("http://sourceforge.net/tracker/?group_id=264348&atid=1130882") End Sub - Private Sub About_Updates_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles About_Updates.CheckedChanged - If About_Updates.Checked Then - ConfigOptions.SetProgramSetting(ConfigOptions.AutoUpdates, "True") - Else - ConfigOptions.SetProgramSetting(ConfigOptions.AutoUpdates, "False") - End If - End Sub - Private Sub AboutForm_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed + ConfigOptions.SetProgramSetting(ConfigOptions.AutoUpdates, About_Updates.Checked) + ConfigOptions.SetProgramSetting(ConfigOptions.Language, About_LanguagesList.SelectedItem) ConfigOptions.SaveProgramSettings() End Sub End Class Modified: trunk/Create Synchronicity/LanguageHandling.vb =================================================================== --- trunk/Create Synchronicity/LanguageHandling.vb 2010-01-30 15:50:00 UTC (rev 146) +++ trunk/Create Synchronicity/LanguageHandling.vb 2010-01-30 16:56:49 UTC (rev 147) @@ -10,12 +10,16 @@ Private Shared Instance As LanguageHandler Protected Sub New() + LoadProgramSettings() + Strings = New Dictionary(Of String, String) - Dim File As String = ConfigOptions.LanguageRootDir & "\" & ConfigOptions.GetProgramSetting(ConfigOptions.Language, "en") & ".lng" + Dim DictFile As String = ConfigOptions.LanguageRootDir & "\" & ConfigOptions.GetProgramSetting(ConfigOptions.Language, ConfigOptions.DefaultLanguage) & ".lng" - If Not IO.File.Exists(File) Then Exit Sub - Dim Reader As New IO.StreamReader(File, Text.Encoding.UTF8) + If Not IO.File.Exists(DictFile) Then DictFile = ConfigOptions.LanguageRootDir & "\" & ConfigOptions.DefaultLanguage & ".lng" + If Not IO.File.Exists(DictFile) Then MessageBox.Show("No language file found!") + Dim Reader As New IO.StreamReader(DictFile, Text.Encoding.UTF8) + While Reader.Peek() > -1 Dim Line As String = Reader.ReadLine Modified: trunk/Create Synchronicity/MainForm.vb =================================================================== --- trunk/Create Synchronicity/MainForm.vb 2010-01-30 15:50:00 UTC (rev 146) +++ trunk/Create Synchronicity/MainForm.vb 2010-01-30 16:56:49 UTC (rev 147) @@ -33,7 +33,7 @@ End If If Not ConfigOptions.ProgramSettingsSet(ConfigOptions.Language) Then - ConfigOptions.SetProgramSetting(ConfigOptions.Language, "en") + ConfigOptions.SetProgramSetting(ConfigOptions.Language, ConfigOptions.DefaultLanguage) End If ConfigOptions.SaveProgramSettings() Modified: trunk/Create Synchronicity/SettingsHandling.vb =================================================================== --- trunk/Create Synchronicity/SettingsHandling.vb 2010-01-30 15:50:00 UTC (rev 146) +++ trunk/Create Synchronicity/SettingsHandling.vb 2010-01-30 16:56:49 UTC (rev 147) @@ -21,7 +21,9 @@ Public Const StrictMirror As String = "Strict mirror" Public Const TimeOffset As String = "Time Offset" + 'Main program settings Public Const Language As String = "Language" + Public Const DefaultLanguage As String = "english" Public Const AutoUpdates As String = "Auto updates" Public ConfigRootDir As String = Application.StartupPath & "\config" Modified: trunk/Create Synchronicity/languages/en.lng =================================================================== --- trunk/Create Synchronicity/languages/en.lng 2010-01-30 15:50:00 UTC (rev 146) +++ trunk/Create Synchronicity/languages/en.lng 2010-01-30 16:56:49 UTC (rev 147) @@ -34,11 +34,11 @@ SETTING_UNSET="{0}" setting is not set. LOGFILE_WRITE_ERROR=Error writing to the log file! LOGFILE_OPEN_ERROR=Unable to open the log file! -LINKTOWEBSITE_TEXT=An application by Create (Clément Pit--Claudel) -VERSION_TEXT=Version %version% (Search for updates) -CONTACT_LINK=Contact the author (cre...@ya...) -LICENSE_TEXT=Licensed under GNU GPL -BUG_REPORT=Report a bug +LINKTOWEBSITE_TEXT=An application by \Create/ (Clément Pit--Claudel) +VERSION_TEXT=Version %version% (\Search for updates/) +CONTACT_LINK=\Contact the author/ (cre...@ya...) +LICENSE_TEXT=Licensed under \GNU GPL/ +BUG_REPORT=\Report a bug/ UPDATES=Check for updates on startup (requires a working internet connection) ABOUT=About ACTIONS=Actions @@ -115,4 +115,5 @@ RUNNING_TASK=Create Synchronicity is running "{0}"\nClick on the icon for more information. SYNCHRONIZING=Synchronizing LR=Left->Right -RL=Right->Left \ No newline at end of file +RL=Right->Left +LANGUAGE=Language (needs restarting): \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |