This commit is contained in:
niksedk 2015-08-08 16:12:03 +02:00
parent fe16298573
commit a1238ac902
8 changed files with 120 additions and 26 deletions

View File

@ -1507,7 +1507,7 @@ can edit in same subtitle file (collaboration)</Information>
<Tools>Tools</Tools>
<WordLists>Word lists</WordLists>
<SsaStyle>ASS/SSA Style</SsaStyle>
<Proxy>Proxy</Proxy>
<Network>Network</Network>
<ShowToolBarButtons>Show tool bar buttons</ShowToolBarButtons>
<New>New</New>
<Open>Open</Open>
@ -1633,6 +1633,8 @@ can edit in same subtitle file (collaboration)</Information>
<ProxyUserName>User name</ProxyUserName>
<ProxyPassword>Password</ProxyPassword>
<ProxyDomain>Domain</ProxyDomain>
<NetworkSessionSettings>Network session settings</NetworkSessionSettings>
<NetworkSessionNewSound>Play sound file when new message arrives</NetworkSessionNewSound>
<PlayXSecondsAndBack>Play X seconds and back, X is</PlayXSecondsAndBack>
<StartSceneIndex>Start scene paragraph is</StartSceneIndex>
<EndSceneIndex>End scene paragraph is</EndSceneIndex>

View File

@ -15842,6 +15842,19 @@ namespace Nikse.SubtitleEdit.Forms
{
_networkChat.AddChatMessage(update.User, update.Text);
}
if (!string.IsNullOrEmpty(Configuration.Settings.NetworkSettings.NewMessageSound) && File.Exists(Configuration.Settings.NetworkSettings.NewMessageSound))
{
try
{
using (var soundPlayer = new System.Media.SoundPlayer(Configuration.Settings.NetworkSettings.NewMessageSound))
{
soundPlayer.Play();
}
}
catch
{
}
}
_networkSession.AppendToLog(string.Format(_language.NetworkMessage, update.User.UserName, update.User.Ip, update.Text));
}
else if (update.Action == "DEL")

View File

@ -252,7 +252,11 @@
this.labelSSAFont = new System.Windows.Forms.Label();
this.buttonSSAChooseColor = new System.Windows.Forms.Button();
this.buttonSSAChooseFont = new System.Windows.Forms.Button();
this.tabPageProxy = new System.Windows.Forms.TabPage();
this.tabPageNetwork = new System.Windows.Forms.TabPage();
this.groupBoxNetworkSession = new System.Windows.Forms.GroupBox();
this.buttonNetworkSessionNewMessageSound = new System.Windows.Forms.Button();
this.textBoxNetworkSessionNewMessageSound = new System.Windows.Forms.TextBox();
this.labelNetworkSessionNewMessageSound = new System.Windows.Forms.Label();
this.groupBoxProxySettings = new System.Windows.Forms.GroupBox();
this.groupBoxProxyAuthentication = new System.Windows.Forms.GroupBox();
this.textBoxProxyDomain = new System.Windows.Forms.TextBox();
@ -336,7 +340,8 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPreview)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSsaShadow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSsaOutline)).BeginInit();
this.tabPageProxy.SuspendLayout();
this.tabPageNetwork.SuspendLayout();
this.groupBoxNetworkSession.SuspendLayout();
this.groupBoxProxySettings.SuspendLayout();
this.groupBoxProxyAuthentication.SuspendLayout();
this.tabPageShortcuts.SuspendLayout();
@ -377,7 +382,7 @@
this.tabControlSettings.Controls.Add(this.tabPageTools);
this.tabControlSettings.Controls.Add(this.tabPageWordLists);
this.tabControlSettings.Controls.Add(this.tabPageSsaStyle);
this.tabControlSettings.Controls.Add(this.tabPageProxy);
this.tabControlSettings.Controls.Add(this.tabPageNetwork);
this.tabControlSettings.Controls.Add(this.tabPageShortcuts);
this.tabControlSettings.Controls.Add(this.tabPageSyntaxColoring);
this.tabControlSettings.Location = new System.Drawing.Point(13, 13);
@ -2877,16 +2882,55 @@
this.buttonSSAChooseFont.UseVisualStyleBackColor = true;
this.buttonSSAChooseFont.Click += new System.EventHandler(this.ButtonSsaChooseFontClick);
//
// tabPageProxy
// tabPageNetwork
//
this.tabPageProxy.Controls.Add(this.groupBoxProxySettings);
this.tabPageProxy.Location = new System.Drawing.Point(4, 22);
this.tabPageProxy.Name = "tabPageProxy";
this.tabPageProxy.Padding = new System.Windows.Forms.Padding(3);
this.tabPageProxy.Size = new System.Drawing.Size(825, 444);
this.tabPageProxy.TabIndex = 4;
this.tabPageProxy.Text = "Proxy";
this.tabPageProxy.UseVisualStyleBackColor = true;
this.tabPageNetwork.Controls.Add(this.groupBoxNetworkSession);
this.tabPageNetwork.Controls.Add(this.groupBoxProxySettings);
this.tabPageNetwork.Location = new System.Drawing.Point(4, 22);
this.tabPageNetwork.Name = "tabPageNetwork";
this.tabPageNetwork.Padding = new System.Windows.Forms.Padding(3);
this.tabPageNetwork.Size = new System.Drawing.Size(825, 444);
this.tabPageNetwork.TabIndex = 4;
this.tabPageNetwork.Text = "Network";
this.tabPageNetwork.UseVisualStyleBackColor = true;
//
// groupBoxNetworkSession
//
this.groupBoxNetworkSession.Controls.Add(this.buttonNetworkSessionNewMessageSound);
this.groupBoxNetworkSession.Controls.Add(this.textBoxNetworkSessionNewMessageSound);
this.groupBoxNetworkSession.Controls.Add(this.labelNetworkSessionNewMessageSound);
this.groupBoxNetworkSession.Location = new System.Drawing.Point(6, 189);
this.groupBoxNetworkSession.Name = "groupBoxNetworkSession";
this.groupBoxNetworkSession.Size = new System.Drawing.Size(813, 249);
this.groupBoxNetworkSession.TabIndex = 30;
this.groupBoxNetworkSession.TabStop = false;
this.groupBoxNetworkSession.Text = "Network session settings";
//
// buttonNetworkSessionNewMessageSound
//
this.buttonNetworkSessionNewMessageSound.Location = new System.Drawing.Point(352, 49);
this.buttonNetworkSessionNewMessageSound.Name = "buttonNetworkSessionNewMessageSound";
this.buttonNetworkSessionNewMessageSound.Size = new System.Drawing.Size(29, 21);
this.buttonNetworkSessionNewMessageSound.TabIndex = 24;
this.buttonNetworkSessionNewMessageSound.Text = "...";
this.buttonNetworkSessionNewMessageSound.UseVisualStyleBackColor = true;
this.buttonNetworkSessionNewMessageSound.Click += new System.EventHandler(this.buttonNetworkSessionNewMessageSound_Click);
//
// textBoxNetworkSessionNewMessageSound
//
this.textBoxNetworkSessionNewMessageSound.Location = new System.Drawing.Point(28, 50);
this.textBoxNetworkSessionNewMessageSound.Name = "textBoxNetworkSessionNewMessageSound";
this.textBoxNetworkSessionNewMessageSound.Size = new System.Drawing.Size(318, 21);
this.textBoxNetworkSessionNewMessageSound.TabIndex = 20;
//
// labelNetworkSessionNewMessageSound
//
this.labelNetworkSessionNewMessageSound.AutoSize = true;
this.labelNetworkSessionNewMessageSound.Location = new System.Drawing.Point(25, 34);
this.labelNetworkSessionNewMessageSound.Name = "labelNetworkSessionNewMessageSound";
this.labelNetworkSessionNewMessageSound.Size = new System.Drawing.Size(209, 13);
this.labelNetworkSessionNewMessageSound.TabIndex = 3;
this.labelNetworkSessionNewMessageSound.Text = "Play sound file when new message arrives";
//
// groupBoxProxySettings
//
@ -2895,7 +2939,7 @@
this.groupBoxProxySettings.Controls.Add(this.labelProxyAddress);
this.groupBoxProxySettings.Location = new System.Drawing.Point(6, 6);
this.groupBoxProxySettings.Name = "groupBoxProxySettings";
this.groupBoxProxySettings.Size = new System.Drawing.Size(813, 432);
this.groupBoxProxySettings.Size = new System.Drawing.Size(813, 177);
this.groupBoxProxySettings.TabIndex = 1;
this.groupBoxProxySettings.TabStop = false;
this.groupBoxProxySettings.Text = "Proxy server settings";
@ -3448,7 +3492,9 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPreview)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSsaShadow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSsaOutline)).EndInit();
this.tabPageProxy.ResumeLayout(false);
this.tabPageNetwork.ResumeLayout(false);
this.groupBoxNetworkSession.ResumeLayout(false);
this.groupBoxNetworkSession.PerformLayout();
this.groupBoxProxySettings.ResumeLayout(false);
this.groupBoxProxySettings.PerformLayout();
this.groupBoxProxyAuthentication.ResumeLayout(false);
@ -3555,7 +3601,7 @@
private System.Windows.Forms.ListBox listBoxUserWordLists;
private System.Windows.Forms.TextBox textBoxUserWord;
private System.Windows.Forms.Button buttonAddUserWord;
private System.Windows.Forms.TabPage tabPageProxy;
private System.Windows.Forms.TabPage tabPageNetwork;
private System.Windows.Forms.GroupBox groupBoxProxySettings;
private System.Windows.Forms.Label labelProxyPassword;
private System.Windows.Forms.TextBox textBoxProxyAddress;
@ -3726,5 +3772,9 @@
private System.Windows.Forms.CheckBox checkBoxWaveformTextBold;
private System.Windows.Forms.ComboBox comboBoxWaveformTextSize;
private System.Windows.Forms.LinkLabel linkLabelOpenDictionaryFolder;
private System.Windows.Forms.GroupBox groupBoxNetworkSession;
private System.Windows.Forms.Button buttonNetworkSessionNewMessageSound;
private System.Windows.Forms.TextBox textBoxNetworkSessionNewMessageSound;
private System.Windows.Forms.Label labelNetworkSessionNewMessageSound;
}
}

View File

@ -45,10 +45,10 @@ namespace Nikse.SubtitleEdit.Forms
if (string.IsNullOrEmpty(fileName) || !fileName.StartsWith(folder.Substring(0, 2), StringComparison.OrdinalIgnoreCase))
return string.Empty;
Uri pathUri = new Uri(fileName);
var pathUri = new Uri(fileName);
if (!folder.EndsWith(Path.DirectorySeparatorChar))
folder += Path.DirectorySeparatorChar;
Uri folderUri = new Uri(folder);
var folderUri = new Uri(folder);
return Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', Path.DirectorySeparatorChar));
}
@ -138,7 +138,7 @@ namespace Nikse.SubtitleEdit.Forms
radioButtonVideoPlayerMPlayer.Enabled = false;
if (!Utilities.IsQuartsDllInstalled)
radioButtonVideoPlayerDirectShow.Enabled = false;
if (Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC.MpcHc.GetMpcHcFileName() == null)
if (Logic.VideoPlayers.MpcHC.MpcHc.GetMpcHcFileName() == null)
radioButtonVideoPlayerMpcHc.Enabled = false;
textBoxVlcPath.Text = gs.VlcLocation;
@ -207,6 +207,8 @@ namespace Nikse.SubtitleEdit.Forms
textBoxProxyPassword.Text = proxy.DecodePassword();
textBoxProxyDomain.Text = proxy.Domain;
textBoxNetworkSessionNewMessageSound.Text = Configuration.Settings.NetworkSettings.NewMessageSound;
checkBoxSyntaxColorDurationTooSmall.Checked = Configuration.Settings.Tools.ListViewSyntaxColorDurationSmall;
checkBoxSyntaxColorDurationTooLarge.Checked = Configuration.Settings.Tools.ListViewSyntaxColorDurationBig;
checkBoxSyntaxColorTextTooLong.Checked = Configuration.Settings.Tools.ListViewSyntaxColorLongLines;
@ -224,7 +226,7 @@ namespace Nikse.SubtitleEdit.Forms
tabPageWordLists.Text = language.WordLists;
tabPageTools.Text = language.Tools;
tabPageSsaStyle.Text = language.SsaStyle;
tabPageProxy.Text = language.Proxy;
tabPageNetwork.Text = language.Network;
tabPageToolBar.Text = language.Toolbar;
tabPageShortcuts.Text = language.Shortcuts;
tabPageSyntaxColoring.Text = language.SyntaxColoring;
@ -418,6 +420,9 @@ namespace Nikse.SubtitleEdit.Forms
labelProxyPassword.Text = language.ProxyPassword;
labelProxyDomain.Text = language.ProxyDomain;
groupBoxNetworkSession.Text = language.NetworkSessionSettings;
labelNetworkSessionNewMessageSound.Text = language.NetworkSessionNewSound;
groupBoxToolsVisualSync.Text = language.VisualSync;
labelVerifyButton.Text = language.PlayXSecondsAndBack;
labelToolsStartScene.Text = language.StartSceneIndex;
@ -1159,6 +1164,8 @@ namespace Nikse.SubtitleEdit.Forms
proxy.EncodePassword(textBoxProxyPassword.Text);
proxy.Domain = textBoxProxyDomain.Text;
Configuration.Settings.NetworkSettings.NewMessageSound = textBoxNetworkSessionNewMessageSound.Text;
Configuration.Settings.Tools.ListViewSyntaxColorDurationSmall = checkBoxSyntaxColorDurationTooSmall.Checked;
Configuration.Settings.Tools.ListViewSyntaxColorDurationBig = checkBoxSyntaxColorDurationTooLarge.Checked;
Configuration.Settings.Tools.ListViewSyntaxColorLongLines = checkBoxSyntaxColorTextTooLong.Checked;
@ -1842,8 +1849,6 @@ namespace Nikse.SubtitleEdit.Forms
if (result == DialogResult.Yes)
{
int removeCount = 0;
var namesEtc = new List<string>();
var globalNamesEtc = new List<string>();
var namesList = new NamesList(Configuration.DictionariesFolder, language, Configuration.Settings.WordLists.UseOnlineNamesEtc, Configuration.Settings.WordLists.NamesEtcUrl);
for (int idx = listBoxNamesEtc.SelectedIndices.Count - 1; idx >= 0; idx--)
{
@ -2565,5 +2570,14 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void buttonNetworkSessionNewMessageSound_Click(object sender, EventArgs e)
{
openFileDialogFFmpeg.FileName = string.Empty;
openFileDialogFFmpeg.Title = Configuration.Settings.Language.Settings.WaveformBrowseToFFmpeg;
openFileDialogFFmpeg.Filter = Configuration.Settings.Language.General.AudioFiles + "|*.wav";
if (openFileDialogFFmpeg.ShowDialog(this) == DialogResult.OK)
textBoxNetworkSessionNewMessageSound.Text = openFileDialogFFmpeg.FileName;
}
}
}

View File

@ -1784,7 +1784,9 @@ can edit in same subtitle file (collaboration)",
Tools = "Tools",
WordLists = "Word lists",
SsaStyle = "ASS/SSA Style",
Proxy = "Proxy",
Network = "Network",
NetworkSessionSettings = "Network session settings",
NetworkSessionNewSound = "Play sound file when new message arrives",
ShowToolBarButtons = "Show tool bar buttons",
New = "New",
Open = "Open",

View File

@ -3981,8 +3981,8 @@ namespace Nikse.SubtitleEdit.Logic
case "Settings/SsaStyle":
language.Settings.SsaStyle = reader.Value;
break;
case "Settings/Proxy":
language.Settings.Proxy = reader.Value;
case "Settings/Network":
language.Settings.Network = reader.Value;
break;
case "Settings/ShowToolBarButtons":
language.Settings.ShowToolBarButtons = reader.Value;
@ -4359,6 +4359,12 @@ namespace Nikse.SubtitleEdit.Logic
case "Settings/ProxyDomain":
language.Settings.ProxyDomain = reader.Value;
break;
case "Settings/NetworkSessionSettings":
language.Settings.NetworkSessionSettings = reader.Value;
break;
case "Settings/NetworkSessionNewSound":
language.Settings.NetworkSessionNewSound = reader.Value;
break;
case "Settings/PlayXSecondsAndBack":
language.Settings.PlayXSecondsAndBack = reader.Value;
break;

View File

@ -1666,7 +1666,7 @@
public string Tools { get; set; }
public string WordLists { get; set; }
public string SsaStyle { get; set; }
public string Proxy { get; set; }
public string Network { get; set; }
public string ShowToolBarButtons { get; set; }
public string New { get; set; }
public string Open { get; set; }
@ -1792,6 +1792,8 @@
public string ProxyUserName { get; set; }
public string ProxyPassword { get; set; }
public string ProxyDomain { get; set; }
public string NetworkSessionSettings { get; set; }
public string NetworkSessionNewSound { get; set; }
public string PlayXSecondsAndBack { get; set; }
public string StartSceneIndex { get; set; }
public string EndSceneIndex { get; set; }

View File

@ -744,6 +744,7 @@ namespace Nikse.SubtitleEdit.Logic
public string WebServiceUrl { get; set; }
public string SessionKey { get; set; }
public int PollIntervalSeconds { get; set; }
public string NewMessageSound { get; set; }
public NetworkSettings()
{
@ -2098,6 +2099,9 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("PollIntervalSeconds");
if (subNode != null)
settings.NetworkSettings.PollIntervalSeconds = Convert.ToInt32(subNode.InnerText);
subNode = node.SelectSingleNode("NewMessageSound");
if (subNode != null)
settings.NetworkSettings.NewMessageSound = subNode.InnerText;
}
settings.VobSubOcr = new VobSubOcrSettings();
@ -2993,6 +2997,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("UserName", settings.NetworkSettings.UserName);
textWriter.WriteElementString("WebServiceUrl", settings.NetworkSettings.WebServiceUrl);
textWriter.WriteElementString("PollIntervalSeconds", settings.NetworkSettings.PollIntervalSeconds.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("NewMessageSound", settings.NetworkSettings.NewMessageSound);
textWriter.WriteEndElement();
textWriter.WriteStartElement("VobSubOcr", "");