diff options
author | sr55 <[email protected]> | 2009-03-15 14:12:48 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-03-15 14:12:48 +0000 |
commit | 48f7c00f4e9aa893f97c425746dd1cace8215620 (patch) | |
tree | d8ed24114ff8744e21c74ee60662d16f13e4a16e /win/C#/Functions/Main.cs | |
parent | 30b537ed1847e996f74338bab2441e59c8c8d05f (diff) |
WinGui:
- Enable tabstops on the add preset window.
- Confirm closing of program if Queue is running (ExDeus)
- Minor fixes/cleanup from Exdeus (Destination Browse Button, Tools > Show Queue, MessageBox in frmQueue)
- Code cleanup in a few other files.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2260 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions/Main.cs')
-rw-r--r-- | win/C#/Functions/Main.cs | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 13579c9ff..59af6bf85 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -30,7 +30,7 @@ namespace Handbrake.Functions // Get the durations between the 2 chapter points and add them together.
if (chapter_start != "Auto" && chapter_end != "Auto")
{
- int start_chapter, end_chapter = 0;
+ int start_chapter, end_chapter;
int.TryParse(chapter_start, out start_chapter);
int.TryParse(chapter_end, out end_chapter);
@@ -56,6 +56,11 @@ namespace Handbrake.Functions /// Calculate the non-anamorphic resoltuion of the source
/// </summary>
/// <param name="width"></param>
+ /// <param name="top"></param>
+ /// <param name="bottom"></param>
+ /// <param name="left"></param>
+ /// <param name="right"></param>
+ /// <param name="selectedTitle"></param>
/// <returns></returns>
public int cacluateNonAnamorphicHeight(int width, decimal top, decimal bottom, decimal left, decimal right, Parsing.Title selectedTitle)
{
@@ -109,18 +114,18 @@ namespace Handbrake.Functions public Parsing.Title selectLongestTitle(ComboBox drp_dvdtitle)
{
int current_largest = 0;
- Handbrake.Parsing.Title title2Select;
+ Parsing.Title title2Select;
// Check if there are titles in the DVD title dropdown menu and make sure, it's not just "Automatic"
if (drp_dvdtitle.Items[0].ToString() != "Automatic")
- title2Select = (Handbrake.Parsing.Title)drp_dvdtitle.Items[0];
+ title2Select = (Parsing.Title)drp_dvdtitle.Items[0];
else
title2Select = null;
// So, If there are titles in the DVD Title dropdown menu, lets select the longest.
if (title2Select != null)
{
- foreach (Handbrake.Parsing.Title x in drp_dvdtitle.Items)
+ foreach (Parsing.Title x in drp_dvdtitle.Items)
{
string title = x.ToString();
if (title != "Automatic")
@@ -156,7 +161,6 @@ namespace Handbrake.Functions /// <summary>
/// Set's up the DataGridView on the Chapters tab (frmMain)
/// </summary>
- /// <param name="mainWindow"></param>
public DataGridView chapterNaming(DataGridView data_chpt, string chapter_end)
{
int i = 0, finish = 0;
@@ -181,7 +185,6 @@ namespace Handbrake.Functions /// Function which generates the filename and path automatically based on
/// the Source Name, DVD title and DVD Chapters
/// </summary>
- /// <param name="mainWindow"></param>
public string autoName(ComboBox drp_dvdtitle, string chapter_start, string chatper_end, string source, string dest, int format)
{
string AutoNamePath = string.Empty;
@@ -202,7 +205,7 @@ namespace Handbrake.Functions combinedChapterTag = chapterStart + "-" + chapterFinish;
// Get the destination filename.
- string destination_filename = "";
+ string destination_filename;
if (Properties.Settings.Default.autoNameFormat != "")
{
destination_filename = Properties.Settings.Default.autoNameFormat;
@@ -228,15 +231,10 @@ namespace Handbrake.Functions if (!dest.Contains(Path.DirectorySeparatorChar.ToString()))
{
// If there is an auto name path, use it...
- if (Properties.Settings.Default.autoNamePath.Trim() != "" &&
- Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")
- {
+ if (Properties.Settings.Default.autoNamePath.Trim() != "" && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")
AutoNamePath = Path.Combine(Properties.Settings.Default.autoNamePath, destination_filename);
- }
else // ...otherwise, output to the source directory
- {
AutoNamePath = null;
- }
}
else // Otherwise, use the path that is already there.
{
@@ -258,7 +256,7 @@ namespace Handbrake.Functions {
try
{
- Functions.AppcastReader rssRead = new Functions.AppcastReader();
+ Functions.AppcastReader rssRead = new AppcastReader();
rssRead.getInfo(); // Initializes the class.
string build = rssRead.build();
@@ -268,16 +266,14 @@ namespace Handbrake.Functions if (latest == skip)
return false;
- else
- {
- Boolean update = (latest > current);
- return update;
- }
+
+ Boolean update = (latest > current);
+ return update;
}
catch (Exception exc)
{
- if (debug == true)
- MessageBox.Show("Unable to check for updates, Please try again later. \n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ if (debug)
+ MessageBox.Show("Unable to check for updates, Please try again later. \n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
|