Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added: Checking for updates (manually or optionally on start).

Updated: CHANGELOG.
  • Loading branch information...
commit 329785f421fefe23577eadc26a418fab018808c4 1 parent f4f1d1e
@margru authored
View
2  CHANGELOG
@@ -8,6 +8,8 @@ CHANGELOG for "XBMC on iMON Display"
v0.1.9.2 Beta: January 18, 2012
-------------------------------
+ - General
+ [+] Checking for updates available
- XBMC
[x] Control messages displayed correctly and with 1000ms timeout now (Issue #13)
View
12 Properties/Settings.Designer.cs
@@ -671,5 +671,17 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio
this["XbmcOnConnectedText"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool GeneralCheckForUpdateOnStart {
+ get {
+ return ((bool)(this["GeneralCheckForUpdateOnStart"]));
+ }
+ set {
+ this["GeneralCheckForUpdateOnStart"] = value;
+ }
+ }
}
}
View
3  Properties/Settings.settings
@@ -164,5 +164,8 @@
<Setting Name="XbmcOnConnectedText" Type="System.String" Scope="User">
<Value Profile="(Default)">Connected</Value>
</Setting>
+ <Setting Name="GeneralCheckForUpdateOnStart" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
</Settings>
</SettingsFile>
View
146 Updating.cs
@@ -0,0 +1,146 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Net;
+using System.Reflection;
+using System.Windows.Forms;
+
+namespace iMon.XBMC
+{
+ internal static class Updating
+ {
+ # region Constants
+
+ private const string ChangelogFile = "CHANGELOG";
+ private const string ChangelogUrl = "https://raw.github.com/BlackMan82/xbmc-on-imon/master/";
+ private const string UpdateBaseUrl = "https://github.com/downloads/BlackMan82/";
+ private const string ProjectName = "xbmc-on-imon";
+ //private const string VersionNumberIndicator = "*";
+ private const string VersionNumberIndicator = "v";
+ //private const int VersionNumberPosition = 1;
+ private const int VersionNumberPosition = 0;
+
+ private const string LoggingArea = "Update";
+
+ # endregion
+
+ # region Private variables
+
+ private static Version currentVersion;
+ private static Version newestVersion;
+
+ # endregion
+
+ # region Constructor
+
+ static Updating()
+ {
+ Updating.currentVersion = new Version(Assembly.GetExecutingAssembly().GetName().Version.ToString());
+
+ // For testing purposes only
+ //Updating.currentVersion = new Version("0.1.8.0");
+ }
+
+ # endregion
+
+ # region Private functions
+
+ private static string getDownloadUrl()
+ {
+ return UpdateBaseUrl + ProjectName + "/" + ProjectName + "-v" + newestVersion.ToString() + ".zip";
+ }
+
+ private static bool getNewestVersionNumber()
+ {
+ WebResponse response;
+ string sourceUrl = ChangelogUrl + ChangelogFile;
+ string line;
+ bool result = false;
+ WebRequest request = WebRequest.Create(sourceUrl);
+
+ Logging.Log(LoggingArea, "Source for updates: " + sourceUrl);
+
+ try
+ {
+ response = request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ Logging.Error(LoggingArea, ex.Message);
+ return result;
+ }
+
+ Logging.Log(LoggingArea, "CHANGELOG found");
+
+ StreamReader reader = new StreamReader(response.GetResponseStream());
+ while (!reader.EndOfStream)
+ {
+ line = reader.ReadLine();
+ if (line.StartsWith(VersionNumberIndicator))
+ {
+ Logging.Log(LoggingArea, "Version number found, trying to parse: " + line);
+ try
+ {
+ string versionNumber = line.Split(' ')[VersionNumberPosition].Substring(1);
+ Version.TryParse(versionNumber, out Updating.newestVersion);
+ }
+ catch (Exception)
+ {
+ result = false;
+ Logging.Error(LoggingArea, "Version number parsing failed");
+ continue;
+ }
+
+ result = true;
+ Logging.Log(LoggingArea, "Latest version number parsed: " + newestVersion);
+ break;
+ }
+ }
+
+ if (!result)
+ Logging.Error(LoggingArea, "Version number not found!");
+
+ return result;
+
+ //Updating.newestVersion = new Version(reader.ReadLine()); // the first line in the file is a version number
+ //Updating.dNewestVersion = double.Parse(Updating.sNewestVersion, CultureInfo.InvariantCulture);
+ //string Link = reader.ReadLine(); // the second line in the file is a link to the latest update
+ }
+
+ # endregion
+
+ # region Public functions
+
+ public static bool update(bool automaticUpdate)
+ {
+ bool updateIsAvailable = false;
+
+ Logging.Log(LoggingArea, "Checking for update");
+
+ if (!getNewestVersionNumber())
+ return false;
+
+ if (Updating.newestVersion > Updating.currentVersion)
+ {
+ updateIsAvailable = true;
+ Logging.Log(LoggingArea, "Update available");
+ if (MessageBox.Show("An update is available! (" + Updating.newestVersion.ToString() + ")\nDo you wish to download it?", Assembly.GetExecutingAssembly().GetName().Name + ": Update available", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
+ {
+ Process.Start(Updating.getDownloadUrl());
+ }
+
+ }
+ else
+ {
+ updateIsAvailable = false;
+ Logging.Log(LoggingArea, "Update not available");
+ if (!automaticUpdate)
+ MessageBox.Show("You are using the most up to date version!", Assembly.GetExecutingAssembly().GetName().Name + ": Update not available");
+ }
+
+ return updateIsAvailable;
+ }
+
+ # endregion
+ }
+}
View
235 XBMC.Designer.cs
@@ -42,10 +42,14 @@ private void InitializeComponent()
this.miImonInitialize = new System.Windows.Forms.ToolStripMenuItem();
this.miImonUninitialize = new System.Windows.Forms.ToolStripMenuItem();
this.miAbout = new System.Windows.Forms.ToolStripMenuItem();
+ this.miAboutCheckForUpdates = new System.Windows.Forms.ToolStripMenuItem();
this.miAboutXbmcOniMon = new System.Windows.Forms.ToolStripMenuItem();
this.splitter = new System.Windows.Forms.SplitContainer();
this.pNavigation = new System.Windows.Forms.Panel();
+ this.bNavigationXbmc = new iMon.XBMC.NavigationButton();
this.iLOptions = new System.Windows.Forms.ImageList(this.components);
+ this.bNavigationImon = new iMon.XBMC.NavigationButton();
+ this.bNavigationGeneral = new iMon.XBMC.NavigationButton();
this.tabOptions = new System.Windows.Forms.TabControl();
this.tpImon = new System.Windows.Forms.TabPage();
this.groupBox14 = new System.Windows.Forms.GroupBox();
@@ -94,6 +98,7 @@ private void InitializeComponent()
this.label1 = new System.Windows.Forms.Label();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.rbXbmcMovieStayIdle = new System.Windows.Forms.RadioButton();
+ this.tbXbmcMovieSingleText = new iMon.XBMC.SuggestionBox();
this.rbXbmcMovieSingleText = new System.Windows.Forms.RadioButton();
this.groupBox16 = new System.Windows.Forms.GroupBox();
this.cbXbmcControlModeShowWindow = new System.Windows.Forms.CheckBox();
@@ -102,14 +107,17 @@ private void InitializeComponent()
this.cbXbmcControlModeEnable = new System.Windows.Forms.CheckBox();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.rbXbmcTvStayIdle = new System.Windows.Forms.RadioButton();
+ this.tbXbmcTvSingleText = new iMon.XBMC.SuggestionBox();
this.rbXbmcTvSingleText = new System.Windows.Forms.RadioButton();
this.cbXbmcTvShowTvHdtvIcon = new System.Windows.Forms.CheckBox();
this.cbXbmcTvMediaTypeIcon = new System.Windows.Forms.CheckBox();
this.groupBox11 = new System.Windows.Forms.GroupBox();
this.rbXbmcMusicVideoStayIdle = new System.Windows.Forms.RadioButton();
+ this.tbXbmcMusicVideoSingleText = new iMon.XBMC.SuggestionBox();
this.rbXbmcMusicVideoSingleText = new System.Windows.Forms.RadioButton();
this.groupBox10 = new System.Windows.Forms.GroupBox();
this.rbXbmcMusicStayIdle = new System.Windows.Forms.RadioButton();
+ this.tbXbmcMusicSingleText = new iMon.XBMC.SuggestionBox();
this.rbXbmcMusicSingleText = new System.Windows.Forms.RadioButton();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.cbXbmcIdleShowSeconds = new System.Windows.Forms.CheckBox();
@@ -136,13 +144,7 @@ private void InitializeComponent()
this.trayMenuImon = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.trayMenuClose = new System.Windows.Forms.ToolStripMenuItem();
- this.bNavigationXbmc = new iMon.XBMC.NavigationButton();
- this.bNavigationImon = new iMon.XBMC.NavigationButton();
- this.bNavigationGeneral = new iMon.XBMC.NavigationButton();
- this.tbXbmcMovieSingleText = new iMon.XBMC.SuggestionBox();
- this.tbXbmcTvSingleText = new iMon.XBMC.SuggestionBox();
- this.tbXbmcMusicVideoSingleText = new iMon.XBMC.SuggestionBox();
- this.tbXbmcMusicSingleText = new iMon.XBMC.SuggestionBox();
+ this.cbGeneralCheckForUpdateOnStart = new System.Windows.Forms.CheckBox();
this.menu.SuspendLayout();
((System.ComponentModel.ISupportInitialize) (this.splitter)).BeginInit();
this.splitter.Panel1.SuspendLayout();
@@ -269,11 +271,19 @@ private void InitializeComponent()
// miAbout
//
this.miAbout.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.miAboutCheckForUpdates,
this.miAboutXbmcOniMon});
this.miAbout.Name = "miAbout";
this.miAbout.Size = new System.Drawing.Size(52, 20);
this.miAbout.Text = "About";
//
+ // miAboutCheckForUpdates
+ //
+ this.miAboutCheckForUpdates.Name = "miAboutCheckForUpdates";
+ this.miAboutCheckForUpdates.Size = new System.Drawing.Size(191, 22);
+ this.miAboutCheckForUpdates.Text = "Check for updates ...";
+ this.miAboutCheckForUpdates.Click += new System.EventHandler(this.miAboutCheckForUpdates_Click);
+ //
// miAboutXbmcOniMon
//
this.miAboutXbmcOniMon.Name = "miAboutXbmcOniMon";
@@ -311,6 +321,24 @@ private void InitializeComponent()
this.pNavigation.Size = new System.Drawing.Size(76, 425);
this.pNavigation.TabIndex = 0;
//
+ // bNavigationXbmc
+ //
+ this.bNavigationXbmc.ActiveImageIndex = 7;
+ this.bNavigationXbmc.BackColor = System.Drawing.Color.Transparent;
+ this.bNavigationXbmc.DefaultImageIndex = 6;
+ this.bNavigationXbmc.FlatAppearance.BorderSize = 0;
+ this.bNavigationXbmc.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.bNavigationXbmc.HoverImageIndex = 8;
+ this.bNavigationXbmc.ImageIndex = 6;
+ this.bNavigationXbmc.ImageList = this.iLOptions;
+ this.bNavigationXbmc.Location = new System.Drawing.Point(-1, 147);
+ this.bNavigationXbmc.Margin = new System.Windows.Forms.Padding(0);
+ this.bNavigationXbmc.Name = "bNavigationXbmc";
+ this.bNavigationXbmc.Size = new System.Drawing.Size(74, 74);
+ this.bNavigationXbmc.TabIndex = 5;
+ this.bNavigationXbmc.UseVisualStyleBackColor = false;
+ this.bNavigationXbmc.Click += new System.EventHandler(this.bNavigationXbmc_Click);
+ //
// iLOptions
//
this.iLOptions.ImageStream = ((System.Windows.Forms.ImageListStreamer) (resources.GetObject("iLOptions.ImageStream")));
@@ -325,6 +353,42 @@ private void InitializeComponent()
this.iLOptions.Images.SetKeyName(7, "XBMCActive");
this.iLOptions.Images.SetKeyName(8, "XBMCHover");
//
+ // bNavigationImon
+ //
+ this.bNavigationImon.ActiveImageIndex = 4;
+ this.bNavigationImon.BackColor = System.Drawing.Color.Transparent;
+ this.bNavigationImon.DefaultImageIndex = 3;
+ this.bNavigationImon.FlatAppearance.BorderSize = 0;
+ this.bNavigationImon.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.bNavigationImon.HoverImageIndex = 5;
+ this.bNavigationImon.ImageIndex = 3;
+ this.bNavigationImon.ImageList = this.iLOptions;
+ this.bNavigationImon.Location = new System.Drawing.Point(-1, 73);
+ this.bNavigationImon.Margin = new System.Windows.Forms.Padding(0);
+ this.bNavigationImon.Name = "bNavigationImon";
+ this.bNavigationImon.Size = new System.Drawing.Size(74, 74);
+ this.bNavigationImon.TabIndex = 4;
+ this.bNavigationImon.UseVisualStyleBackColor = false;
+ this.bNavigationImon.Click += new System.EventHandler(this.bNavigationImon_Click);
+ //
+ // bNavigationGeneral
+ //
+ this.bNavigationGeneral.ActiveImageIndex = 1;
+ this.bNavigationGeneral.BackColor = System.Drawing.Color.Transparent;
+ this.bNavigationGeneral.DefaultImageIndex = 0;
+ this.bNavigationGeneral.FlatAppearance.BorderSize = 0;
+ this.bNavigationGeneral.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.bNavigationGeneral.HoverImageIndex = 2;
+ this.bNavigationGeneral.ImageIndex = 0;
+ this.bNavigationGeneral.ImageList = this.iLOptions;
+ this.bNavigationGeneral.Location = new System.Drawing.Point(-1, -1);
+ this.bNavigationGeneral.Margin = new System.Windows.Forms.Padding(0);
+ this.bNavigationGeneral.Name = "bNavigationGeneral";
+ this.bNavigationGeneral.Size = new System.Drawing.Size(74, 74);
+ this.bNavigationGeneral.TabIndex = 3;
+ this.bNavigationGeneral.UseVisualStyleBackColor = false;
+ this.bNavigationGeneral.Click += new System.EventHandler(this.bNavigationGeneral_Click);
+ //
// tabOptions
//
this.tabOptions.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -502,7 +566,7 @@ private void InitializeComponent()
// groupBox15
//
this.groupBox15.Controls.Add(this.cbGeneralDebugEnable);
- this.groupBox15.Location = new System.Drawing.Point(10, 220);
+ this.groupBox15.Location = new System.Drawing.Point(10, 243);
this.groupBox15.Name = "groupBox15";
this.groupBox15.Size = new System.Drawing.Size(385, 45);
this.groupBox15.TabIndex = 2;
@@ -526,7 +590,7 @@ private void InitializeComponent()
this.groupBox4.Controls.Add(this.cbGeneralTrayHideOnClose);
this.groupBox4.Controls.Add(this.cbGeneralTrayStartMinimized);
this.groupBox4.Controls.Add(this.cbGeneralTrayEnabled);
- this.groupBox4.Location = new System.Drawing.Point(10, 80);
+ this.groupBox4.Location = new System.Drawing.Point(10, 103);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(386, 134);
this.groupBox4.TabIndex = 1;
@@ -586,11 +650,12 @@ private void InitializeComponent()
//
// groupBox2
//
+ this.groupBox2.Controls.Add(this.cbGeneralCheckForUpdateOnStart);
this.groupBox2.Controls.Add(this.cbGeneralStartupConnect);
this.groupBox2.Controls.Add(this.cbGeneralStartupAuto);
this.groupBox2.Location = new System.Drawing.Point(10, 6);
this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(386, 68);
+ this.groupBox2.Size = new System.Drawing.Size(386, 91);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Startup";
@@ -877,6 +942,17 @@ private void InitializeComponent()
this.rbXbmcMovieStayIdle.Text = "Stay Idle";
this.rbXbmcMovieStayIdle.UseVisualStyleBackColor = true;
//
+ // tbXbmcMovieSingleText
+ //
+ this.tbXbmcMovieSingleText.Delimiter = "%";
+ this.tbXbmcMovieSingleText.Enabled = false;
+ this.tbXbmcMovieSingleText.Location = new System.Drawing.Point(33, 40);
+ this.tbXbmcMovieSingleText.MaximumRows = 2;
+ this.tbXbmcMovieSingleText.Name = "tbXbmcMovieSingleText";
+ this.tbXbmcMovieSingleText.Size = new System.Drawing.Size(336, 20);
+ this.tbXbmcMovieSingleText.StartAndEnd = true;
+ this.tbXbmcMovieSingleText.TabIndex = 5;
+ //
// rbXbmcMovieSingleText
//
this.rbXbmcMovieSingleText.AutoSize = true;
@@ -971,6 +1047,17 @@ private void InitializeComponent()
this.rbXbmcTvStayIdle.Text = "Stay Idle";
this.rbXbmcTvStayIdle.UseVisualStyleBackColor = true;
//
+ // tbXbmcTvSingleText
+ //
+ this.tbXbmcTvSingleText.Delimiter = "%";
+ this.tbXbmcTvSingleText.Enabled = false;
+ this.tbXbmcTvSingleText.Location = new System.Drawing.Point(33, 64);
+ this.tbXbmcTvSingleText.MaximumRows = 2;
+ this.tbXbmcTvSingleText.Name = "tbXbmcTvSingleText";
+ this.tbXbmcTvSingleText.Size = new System.Drawing.Size(336, 20);
+ this.tbXbmcTvSingleText.StartAndEnd = true;
+ this.tbXbmcTvSingleText.TabIndex = 9;
+ //
// rbXbmcTvSingleText
//
this.rbXbmcTvSingleText.AutoSize = true;
@@ -1026,6 +1113,17 @@ private void InitializeComponent()
this.rbXbmcMusicVideoStayIdle.Text = "Stay Idle";
this.rbXbmcMusicVideoStayIdle.UseVisualStyleBackColor = true;
//
+ // tbXbmcMusicVideoSingleText
+ //
+ this.tbXbmcMusicVideoSingleText.Delimiter = "%";
+ this.tbXbmcMusicVideoSingleText.Enabled = false;
+ this.tbXbmcMusicVideoSingleText.Location = new System.Drawing.Point(33, 40);
+ this.tbXbmcMusicVideoSingleText.MaximumRows = 2;
+ this.tbXbmcMusicVideoSingleText.Name = "tbXbmcMusicVideoSingleText";
+ this.tbXbmcMusicVideoSingleText.Size = new System.Drawing.Size(336, 20);
+ this.tbXbmcMusicVideoSingleText.StartAndEnd = true;
+ this.tbXbmcMusicVideoSingleText.TabIndex = 9;
+ //
// rbXbmcMusicVideoSingleText
//
this.rbXbmcMusicVideoSingleText.AutoSize = true;
@@ -1061,6 +1159,17 @@ private void InitializeComponent()
this.rbXbmcMusicStayIdle.Text = "Stay Idle";
this.rbXbmcMusicStayIdle.UseVisualStyleBackColor = true;
//
+ // tbXbmcMusicSingleText
+ //
+ this.tbXbmcMusicSingleText.Delimiter = "%";
+ this.tbXbmcMusicSingleText.Enabled = false;
+ this.tbXbmcMusicSingleText.Location = new System.Drawing.Point(33, 40);
+ this.tbXbmcMusicSingleText.MaximumRows = 2;
+ this.tbXbmcMusicSingleText.Name = "tbXbmcMusicSingleText";
+ this.tbXbmcMusicSingleText.Size = new System.Drawing.Size(336, 20);
+ this.tbXbmcMusicSingleText.StartAndEnd = true;
+ this.tbXbmcMusicSingleText.TabIndex = 9;
+ //
// rbXbmcMusicSingleText
//
this.rbXbmcMusicSingleText.AutoSize = true;
@@ -1327,103 +1436,15 @@ private void InitializeComponent()
this.trayMenuClose.Text = "Close";
this.trayMenuClose.Click += new System.EventHandler(this.trayMenuClose_Click);
//
- // bNavigationXbmc
+ // cbGeneralCheckForUpdateOnStart
//
- this.bNavigationXbmc.ActiveImageIndex = 7;
- this.bNavigationXbmc.BackColor = System.Drawing.Color.Transparent;
- this.bNavigationXbmc.DefaultImageIndex = 6;
- this.bNavigationXbmc.FlatAppearance.BorderSize = 0;
- this.bNavigationXbmc.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.bNavigationXbmc.HoverImageIndex = 8;
- this.bNavigationXbmc.ImageIndex = 6;
- this.bNavigationXbmc.ImageList = this.iLOptions;
- this.bNavigationXbmc.Location = new System.Drawing.Point(-1, 147);
- this.bNavigationXbmc.Margin = new System.Windows.Forms.Padding(0);
- this.bNavigationXbmc.Name = "bNavigationXbmc";
- this.bNavigationXbmc.Size = new System.Drawing.Size(74, 74);
- this.bNavigationXbmc.TabIndex = 5;
- this.bNavigationXbmc.UseVisualStyleBackColor = false;
- this.bNavigationXbmc.Click += new System.EventHandler(this.bNavigationXbmc_Click);
- //
- // bNavigationImon
- //
- this.bNavigationImon.ActiveImageIndex = 4;
- this.bNavigationImon.BackColor = System.Drawing.Color.Transparent;
- this.bNavigationImon.DefaultImageIndex = 3;
- this.bNavigationImon.FlatAppearance.BorderSize = 0;
- this.bNavigationImon.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.bNavigationImon.HoverImageIndex = 5;
- this.bNavigationImon.ImageIndex = 3;
- this.bNavigationImon.ImageList = this.iLOptions;
- this.bNavigationImon.Location = new System.Drawing.Point(-1, 73);
- this.bNavigationImon.Margin = new System.Windows.Forms.Padding(0);
- this.bNavigationImon.Name = "bNavigationImon";
- this.bNavigationImon.Size = new System.Drawing.Size(74, 74);
- this.bNavigationImon.TabIndex = 4;
- this.bNavigationImon.UseVisualStyleBackColor = false;
- this.bNavigationImon.Click += new System.EventHandler(this.bNavigationImon_Click);
- //
- // bNavigationGeneral
- //
- this.bNavigationGeneral.ActiveImageIndex = 1;
- this.bNavigationGeneral.BackColor = System.Drawing.Color.Transparent;
- this.bNavigationGeneral.DefaultImageIndex = 0;
- this.bNavigationGeneral.FlatAppearance.BorderSize = 0;
- this.bNavigationGeneral.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.bNavigationGeneral.HoverImageIndex = 2;
- this.bNavigationGeneral.ImageIndex = 0;
- this.bNavigationGeneral.ImageList = this.iLOptions;
- this.bNavigationGeneral.Location = new System.Drawing.Point(-1, -1);
- this.bNavigationGeneral.Margin = new System.Windows.Forms.Padding(0);
- this.bNavigationGeneral.Name = "bNavigationGeneral";
- this.bNavigationGeneral.Size = new System.Drawing.Size(74, 74);
- this.bNavigationGeneral.TabIndex = 3;
- this.bNavigationGeneral.UseVisualStyleBackColor = false;
- this.bNavigationGeneral.Click += new System.EventHandler(this.bNavigationGeneral_Click);
- //
- // tbXbmcMovieSingleText
- //
- this.tbXbmcMovieSingleText.Delimiter = "%";
- this.tbXbmcMovieSingleText.Enabled = false;
- this.tbXbmcMovieSingleText.Location = new System.Drawing.Point(33, 40);
- this.tbXbmcMovieSingleText.MaximumRows = 2;
- this.tbXbmcMovieSingleText.Name = "tbXbmcMovieSingleText";
- this.tbXbmcMovieSingleText.Size = new System.Drawing.Size(336, 20);
- this.tbXbmcMovieSingleText.StartAndEnd = true;
- this.tbXbmcMovieSingleText.TabIndex = 5;
- //
- // tbXbmcTvSingleText
- //
- this.tbXbmcTvSingleText.Delimiter = "%";
- this.tbXbmcTvSingleText.Enabled = false;
- this.tbXbmcTvSingleText.Location = new System.Drawing.Point(33, 64);
- this.tbXbmcTvSingleText.MaximumRows = 2;
- this.tbXbmcTvSingleText.Name = "tbXbmcTvSingleText";
- this.tbXbmcTvSingleText.Size = new System.Drawing.Size(336, 20);
- this.tbXbmcTvSingleText.StartAndEnd = true;
- this.tbXbmcTvSingleText.TabIndex = 9;
- //
- // tbXbmcMusicVideoSingleText
- //
- this.tbXbmcMusicVideoSingleText.Delimiter = "%";
- this.tbXbmcMusicVideoSingleText.Enabled = false;
- this.tbXbmcMusicVideoSingleText.Location = new System.Drawing.Point(33, 40);
- this.tbXbmcMusicVideoSingleText.MaximumRows = 2;
- this.tbXbmcMusicVideoSingleText.Name = "tbXbmcMusicVideoSingleText";
- this.tbXbmcMusicVideoSingleText.Size = new System.Drawing.Size(336, 20);
- this.tbXbmcMusicVideoSingleText.StartAndEnd = true;
- this.tbXbmcMusicVideoSingleText.TabIndex = 9;
- //
- // tbXbmcMusicSingleText
- //
- this.tbXbmcMusicSingleText.Delimiter = "%";
- this.tbXbmcMusicSingleText.Enabled = false;
- this.tbXbmcMusicSingleText.Location = new System.Drawing.Point(33, 40);
- this.tbXbmcMusicSingleText.MaximumRows = 2;
- this.tbXbmcMusicSingleText.Name = "tbXbmcMusicSingleText";
- this.tbXbmcMusicSingleText.Size = new System.Drawing.Size(336, 20);
- this.tbXbmcMusicSingleText.StartAndEnd = true;
- this.tbXbmcMusicSingleText.TabIndex = 9;
+ this.cbGeneralCheckForUpdateOnStart.AutoSize = true;
+ this.cbGeneralCheckForUpdateOnStart.Location = new System.Drawing.Point(7, 67);
+ this.cbGeneralCheckForUpdateOnStart.Name = "cbGeneralCheckForUpdateOnStart";
+ this.cbGeneralCheckForUpdateOnStart.Size = new System.Drawing.Size(158, 17);
+ this.cbGeneralCheckForUpdateOnStart.TabIndex = 2;
+ this.cbGeneralCheckForUpdateOnStart.Text = "Check for update on startup";
+ this.cbGeneralCheckForUpdateOnStart.UseVisualStyleBackColor = true;
//
// XBMC
//
@@ -1605,6 +1626,8 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox cbXbmcIdleShowSeconds;
private System.Windows.Forms.TextBox tbXbmcTcpPort;
private System.Windows.Forms.Label label9;
+ private System.Windows.Forms.ToolStripMenuItem miAboutCheckForUpdates;
+ private System.Windows.Forms.CheckBox cbGeneralCheckForUpdateOnStart;
}
View
6 XBMC.Logic.cs
@@ -110,6 +110,10 @@ private void constructor()
this.settingsUpdate();
this.setupSettingsChanges(this.tabOptions);
+ // Check for update
+ if (Settings.Default.GeneralCheckForUpdateOnStart)
+ Updating.update(true);
+
// Setting up iMON
Logging.Log("Setting up iMON");
this.imon = new iMonWrapperApi();
@@ -219,6 +223,7 @@ private void settingsUpdate()
// General settings
this.cbGeneralStartupAuto.Checked = Settings.Default.GeneralStartupAuto;
this.cbGeneralStartupConnect.Checked = Settings.Default.GeneralStartupConnect;
+ this.cbGeneralCheckForUpdateOnStart.Checked = Settings.Default.GeneralCheckForUpdateOnStart;
this.cbGeneralTrayEnabled.Checked = Settings.Default.GeneralTrayEnabled;
this.cbGeneralTrayStartMinimized.Checked = Settings.Default.GeneralTrayStartMinimized;
@@ -379,6 +384,7 @@ private void settingsSave()
// General settings
Settings.Default.GeneralStartupAuto = this.cbGeneralStartupAuto.Checked;
Settings.Default.GeneralStartupConnect = this.cbGeneralStartupConnect.Checked;
+ Settings.Default.GeneralCheckForUpdateOnStart = this.cbGeneralCheckForUpdateOnStart.Checked;
Settings.Default.GeneralTrayEnabled = this.cbGeneralTrayEnabled.Checked;
Settings.Default.GeneralTrayStartMinimized = this.cbGeneralTrayStartMinimized.Checked;
View
6 XBMC.cs
@@ -289,6 +289,11 @@ private void miAboutXbmcOniMon_Click(object sender, EventArgs e)
this.aboutDialog.ShowDialog();
}
+ private void miAboutCheckForUpdates_Click(object sender, EventArgs e)
+ {
+ Updating.update(false);
+ }
+
#endregion
#region Event handling
@@ -330,5 +335,6 @@ private static void wrapperApiXbmcLog(object sender, XbmcJsonRpcLogEventArgs e)
}
#endregion
+
}
}
View
2  XBMC.resx
@@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA4
- AwMAAk1TRnQBSQFMAgEBCQEAAagBCAGoAQgBSAEAAUgBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAEg
+ AwMAAk1TRnQBSQFMAgEBCQEAAcABCAHAAQgBSAEAAUgBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAEg
AQECAAHYAwABAQEAARgGAAHZAQIRAAH5AfcB9QHwAbwBjwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHw
Aa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHw
Aa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHwAa8BdwHw
View
3  app.config
@@ -184,6 +184,9 @@
<setting name="XbmcOnConnectedText" serializeAs="String">
<value>Connected</value>
</setting>
+ <setting name="GeneralCheckForUpdateOnStart" serializeAs="String">
+ <value>False</value>
+ </setting>
</iMon.XBMC.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
View
1  xbmc-on-imon.csproj
@@ -135,6 +135,7 @@
<Compile Include="SuggestionBox.cs">
<SubType>Component</SubType>
</Compile>
+ <Compile Include="Updating.cs" />
<Compile Include="XbmcHandler.cs">
<SubType>Component</SubType>
</Compile>
Please sign in to comment.
Something went wrong with that request. Please try again.