diff options
author | sr55 <[email protected]> | 2010-08-29 20:41:07 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-08-29 20:41:07 +0000 |
commit | 466ea9a1a522e58dc972ffbba9deba3f615394a2 (patch) | |
tree | cf7b1ab9b3144d05b47c44967273c3f19cf74dd8 /win/C#/HandBrake.ApplicationServices | |
parent | c9973fa6ab5ed42b2219faa9a0c12e06ef74139e (diff) |
WinGui:
- Created an error service, renamed the frmExceptionWindow to ExceptionWindow and removed it's duplicate from the main project. It's all in the AppServices library.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3503 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices')
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj | 11 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs | 47 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs | 32 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.cs (renamed from win/C#/HandBrake.ApplicationServices/frmExceptionWindow.cs) | 14 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.designer.cs (renamed from win/C#/HandBrake.ApplicationServices/frmExceptionWindow.Designer.cs) | 28 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.resx (renamed from win/C#/HandBrake.ApplicationServices/frmExceptionWindow.resx) | 3 |
6 files changed, 105 insertions, 30 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index f4286cf5a..fb2202e62 100644 --- a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -105,11 +105,19 @@ <DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Services\Encode.cs" />
+ <Compile Include="Services\ErrorService.cs" />
<Compile Include="Services\Interfaces\IEncode.cs" />
+ <Compile Include="Services\Interfaces\IErrorService.cs" />
<Compile Include="Services\Interfaces\IQueue.cs" />
<Compile Include="Services\Interfaces\IScan.cs" />
<Compile Include="Services\Queue.cs" />
<Compile Include="Services\Scan.cs" />
+ <Compile Include="Views\ExceptionWindow.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Views\ExceptionWindow.designer.cs">
+ <DependentUpon>ExceptionWindow.cs</DependentUpon>
+ </Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
@@ -124,6 +132,9 @@ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="Views\ExceptionWindow.resx">
+ <DependentUpon>ExceptionWindow.cs</DependentUpon>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\logo64.png" />
diff --git a/win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs b/win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs new file mode 100644 index 000000000..039cae727 --- /dev/null +++ b/win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs @@ -0,0 +1,47 @@ +/* ErrorService.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices.Services
+{
+ using System;
+ using Interfaces;
+ using Views;
+
+ /// <summary>
+ /// The Error Service
+ /// </summary>
+ public class ErrorService : IErrorService
+ {
+ /// <summary>
+ /// Show an Error Window
+ /// </summary>
+ /// <param name="shortError">
+ /// The short error message for the user to read
+ /// </param>
+ /// <param name="longError">
+ /// Exception string or advanced details
+ /// </param>
+ public void ShowError(string shortError, string longError)
+ {
+ ExceptionWindow window = new ExceptionWindow();
+ window.Setup(shortError, longError);
+ window.Show();
+ }
+
+ /// <summary>
+ /// Show a Notice or Warning Message.
+ /// </summary>
+ /// <param name="notice">
+ /// The text to display to the user
+ /// </param>
+ /// <param name="isWarning">
+ /// Is a warning window, show the warning icon instead of the notice
+ /// </param>
+ public void ShowNotice(string notice, bool isWarning)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs new file mode 100644 index 000000000..385f67f09 --- /dev/null +++ b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs @@ -0,0 +1,32 @@ +/* IErrorService.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices.Services.Interfaces
+{
+ public interface IErrorService
+ {
+ /// <summary>
+ /// Show an Error Window
+ /// </summary>
+ /// <param name="shortError">
+ /// The short error message for the user to read
+ /// </param>
+ /// <param name="longError">
+ /// Exception string or advanced details
+ /// </param>
+ void ShowError(string shortError, string longError);
+
+ /// <summary>
+ /// Show a Notice or Warning Message.
+ /// </summary>
+ /// <param name="notice">
+ /// The text to display to the user
+ /// </param>
+ /// <param name="isWarning">
+ /// Is a warning window, show the warning icon instead of the notice
+ /// </param>
+ void ShowNotice(string notice, bool isWarning);
+ }
+}
\ No newline at end of file diff --git a/win/C#/HandBrake.ApplicationServices/frmExceptionWindow.cs b/win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.cs index 3be1cf219..7d18fc1a3 100644 --- a/win/C#/HandBrake.ApplicationServices/frmExceptionWindow.cs +++ b/win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.cs @@ -3,7 +3,7 @@ Homepage: <http://handbrake.fr>.
It may be used under the terms of the GNU General Public License. */
-namespace HandBrake.ApplicationServices
+namespace HandBrake.ApplicationServices.Views
{
using System;
using System.Windows.Forms;
@@ -11,12 +11,12 @@ namespace HandBrake.ApplicationServices /// <summary>
/// A window to display Exceptions in a form which can be easily copied and reported by users.
/// </summary>
- public partial class frmExceptionWindow : Form
+ public partial class ExceptionWindow : Form
{
/// <summary>
- /// Initializes a new instance of the <see cref="frmExceptionWindow"/> class.
+ /// Initializes a new instance of the <see cref="ExceptionWindow"/> class.
/// </summary>
- public frmExceptionWindow()
+ public ExceptionWindow()
{
InitializeComponent();
}
@@ -45,7 +45,7 @@ namespace HandBrake.ApplicationServices /// <param name="e">
/// The e.
/// </param>
- private void btn_copy_Click(object sender, EventArgs e)
+ private void BtnCopyClick(object sender, EventArgs e)
{
Clipboard.SetDataObject(rtf_exceptionFull.SelectedText != string.Empty ? rtf_exceptionFull.SelectedText : rtf_exceptionFull.Text, true);
}
@@ -59,7 +59,7 @@ namespace HandBrake.ApplicationServices /// <param name="e">
/// The e.
/// </param>
- private void mnu_copy_log_Click(object sender, EventArgs e)
+ private void MnuCopyLogClick(object sender, EventArgs e)
{
Clipboard.SetDataObject(rtf_exceptionFull.SelectedText != string.Empty ? rtf_exceptionFull.SelectedText : rtf_exceptionFull.Text, true);
}
@@ -73,7 +73,7 @@ namespace HandBrake.ApplicationServices /// <param name="e">
/// The e.
/// </param>
- private void btn_close_Click(object sender, EventArgs e)
+ private void BtnCloseClick(object sender, EventArgs e)
{
this.Close();
}
diff --git a/win/C#/HandBrake.ApplicationServices/frmExceptionWindow.Designer.cs b/win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.designer.cs index bdc47995e..697d75c78 100644 --- a/win/C#/HandBrake.ApplicationServices/frmExceptionWindow.Designer.cs +++ b/win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.designer.cs @@ -1,6 +1,6 @@ -namespace HandBrake.ApplicationServices
+namespace HandBrake.ApplicationServices.Views
{
- partial class frmExceptionWindow
+ partial class ExceptionWindow
{
/// <summary>
/// Required designer variable.
@@ -28,8 +28,7 @@ /// </summary>
private void InitializeComponent()
{
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmExceptionWindow));
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExceptionWindow));
this.panel1 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.PictureBox1 = new System.Windows.Forms.PictureBox();
@@ -43,13 +42,11 @@ this.btn_close = new System.Windows.Forms.Button();
this.btn_copy = new System.Windows.Forms.Button();
this.rtf_exceptionFull = new System.Windows.Forms.RichTextBox();
- this.rightClickMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mnu_copy_log = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).BeginInit();
this.panel4.SuspendLayout();
this.panel6.SuspendLayout();
- this.rightClickMenu.SuspendLayout();
this.SuspendLayout();
//
// panel1
@@ -162,7 +159,7 @@ this.btn_close.TabIndex = 56;
this.btn_close.Text = "OK";
this.btn_close.UseVisualStyleBackColor = false;
- this.btn_close.Click += new System.EventHandler(this.btn_close_Click);
+ this.btn_close.Click += new System.EventHandler(this.BtnCloseClick);
//
// btn_copy
//
@@ -178,11 +175,10 @@ this.btn_copy.TabIndex = 57;
this.btn_copy.Text = "Copy";
this.btn_copy.UseVisualStyleBackColor = false;
- this.btn_copy.Click += new System.EventHandler(this.btn_copy_Click);
+ this.btn_copy.Click += new System.EventHandler(this.BtnCopyClick);
//
// rtf_exceptionFull
//
- this.rtf_exceptionFull.ContextMenuStrip = this.rightClickMenu;
this.rtf_exceptionFull.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtf_exceptionFull.Location = new System.Drawing.Point(76, 97);
this.rtf_exceptionFull.Name = "rtf_exceptionFull";
@@ -190,22 +186,15 @@ this.rtf_exceptionFull.TabIndex = 70;
this.rtf_exceptionFull.Text = "";
//
- // rightClickMenu
- //
- this.rightClickMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnu_copy_log});
- this.rightClickMenu.Name = "rightClickMenu";
- this.rightClickMenu.Size = new System.Drawing.Size(153, 48);
- //
// mnu_copy_log
//
this.mnu_copy_log.Image = global::HandBrake.ApplicationServices.Properties.Resources.copy;
this.mnu_copy_log.Name = "mnu_copy_log";
this.mnu_copy_log.Size = new System.Drawing.Size(152, 22);
this.mnu_copy_log.Text = "Copy";
- this.mnu_copy_log.Click += new System.EventHandler(this.mnu_copy_log_Click);
+ this.mnu_copy_log.Click += new System.EventHandler(this.MnuCopyLogClick);
//
- // frmExceptionWindow
+ // ExceptionWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -216,14 +205,13 @@ this.Controls.Add(this.panel4);
this.Controls.Add(this.panel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "frmExceptionWindow";
+ this.Name = "ExceptionWindow";
this.Text = "Error";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).EndInit();
this.panel4.ResumeLayout(false);
this.panel6.ResumeLayout(false);
- this.rightClickMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
diff --git a/win/C#/HandBrake.ApplicationServices/frmExceptionWindow.resx b/win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.resx index 6df001c71..ff217dc4f 100644 --- a/win/C#/HandBrake.ApplicationServices/frmExceptionWindow.resx +++ b/win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.resx @@ -117,9 +117,6 @@ <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="rightClickMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
|