Spostamento update in MainForm

This commit is contained in:
Samuele E. Locatelli
2017-12-19 16:32:16 +01:00
parent 67cbbca86c
commit 4847c2892d
4 changed files with 87 additions and 37 deletions
+2 -13
View File
@@ -45,7 +45,6 @@
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.FileTSMI = new System.Windows.Forms.ToolStripMenuItem();
this.mLoadConf = new System.Windows.Forms.ToolStripMenuItem();
this.mCheckUpdates = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.trayMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
@@ -190,8 +189,7 @@
// FileTSMI
//
this.FileTSMI.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mLoadConf,
this.mCheckUpdates});
this.mLoadConf});
this.FileTSMI.Name = "FileTSMI";
this.FileTSMI.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F)));
this.FileTSMI.Size = new System.Drawing.Size(47, 24);
@@ -201,18 +199,10 @@
//
this.mLoadConf.Name = "mLoadConf";
this.mLoadConf.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.L)));
this.mLoadConf.Size = new System.Drawing.Size(244, 26);
this.mLoadConf.Size = new System.Drawing.Size(214, 26);
this.mLoadConf.Text = "&LOAD CONF";
this.mLoadConf.Click += new System.EventHandler(this.mLoadConf_Click);
//
// mCheckUpdates
//
this.mCheckUpdates.Name = "mCheckUpdates";
this.mCheckUpdates.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.U)));
this.mCheckUpdates.Size = new System.Drawing.Size(244, 26);
this.mCheckUpdates.Text = "CHECK &UPDATES";
this.mCheckUpdates.Click += new System.EventHandler(this.mCheckUpdates_Click);
//
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.trayMenu;
@@ -668,7 +658,6 @@
private System.Windows.Forms.Timer displTimer;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label lblRawData;
private System.Windows.Forms.ToolStripMenuItem mCheckUpdates;
private System.Windows.Forms.Label lblOutMessage3;
private System.Windows.Forms.Label lblOutMessage2;
private System.Windows.Forms.Button btnClose;
+16 -10
View File
@@ -1,4 +1,6 @@
using AutoUpdaterDotNET;
#if false
using AutoUpdaterDotNET;
#endif
using IOB_UT;
using NLog;
using NLog.Targets;
@@ -74,6 +76,7 @@ namespace IOB_WIN
/// tipo di adapter prescelto...
/// </summary>
public tipoAdapter tipoScelto = tipoAdapter.DEMO;
#if false
/// <summary>
/// Ramo applicazione (x update)
/// </summary>
@@ -88,7 +91,8 @@ namespace IOB_WIN
//string branchName = utils.CRS("appVers");
return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/IOB-WIN/{0}/manifest.xml", branchName);
}
}
}
#endif
#endregion
@@ -630,13 +634,13 @@ namespace IOB_WIN
displayTaskAndLog(string.Format("Loading iniConfFile: {0}", iniConfFile));
IniFile fIni = new IniFile(iniConfFile);
// salvo branchName...
branchName = fIni.ReadString("BRANCH", "NAME", "develop");
// se NON sono in DEBUG faccio check update...
#if !(DEBUG)
// avvio autoupdater...
AutoUpdater.Start(updateUrl);
#endif
// // salvo branchName...
// branchName = fIni.ReadString("BRANCH", "NAME", "develop");
// // se NON sono in DEBUG faccio check update...
//#if !(DEBUG)
// // avvio autoupdater...
// AutoUpdater.Start(updateUrl);
//#endif
// verifico tipo adapter
tipoScelto = (tipoAdapter)Enum.Parse(typeof(tipoAdapter), fIni.ReadString("IOB", "CNCTYPE", "DEMO"));
@@ -1090,12 +1094,14 @@ namespace IOB_WIN
tslUptime.Text = string.Format("Uptime: {0}gg {1:00}:{2:00}:{3:00}", uptime.Days, uptime.Hours, uptime.Minutes, uptime.Seconds);
}
#if false
private void mCheckUpdates_Click(object sender, EventArgs e)
{
AutoUpdater.ShowSkipButton = false;
AutoUpdater.ShowRemindLaterButton = false;
AutoUpdater.Start(updateUrl);
}
}
#endif
}
}
+15 -14
View File
@@ -31,10 +31,10 @@
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.windowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mCheckUpdates = new System.Windows.Forms.ToolStripMenuItem();
this.openChildToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.closeChildToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.windowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
@@ -64,22 +64,17 @@
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.checkForUpdatesToolStripMenuItem});
this.mCheckUpdates});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24);
this.fileToolStripMenuItem.Text = "&File";
//
// windowToolStripMenuItem
// mCheckUpdates
//
this.windowToolStripMenuItem.Name = "windowToolStripMenuItem";
this.windowToolStripMenuItem.Size = new System.Drawing.Size(76, 24);
this.windowToolStripMenuItem.Text = "&Window";
//
// checkForUpdatesToolStripMenuItem
//
this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem";
this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(205, 26);
this.checkForUpdatesToolStripMenuItem.Text = "Check for &Updates";
this.mCheckUpdates.Name = "mCheckUpdates";
this.mCheckUpdates.Size = new System.Drawing.Size(205, 26);
this.mCheckUpdates.Text = "Check for &Updates";
this.mCheckUpdates.Click += new System.EventHandler(this.mCheckUpdates_Click);
//
// openChildToolStripMenuItem
//
@@ -95,6 +90,12 @@
this.closeChildToolStripMenuItem.Text = "Child -";
this.closeChildToolStripMenuItem.Click += new System.EventHandler(this.closeChildToolStripMenuItem_Click);
//
// windowToolStripMenuItem
//
this.windowToolStripMenuItem.Name = "windowToolStripMenuItem";
this.windowToolStripMenuItem.Size = new System.Drawing.Size(76, 24);
this.windowToolStripMenuItem.Text = "&Window";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
@@ -118,7 +119,7 @@
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mCheckUpdates;
private System.Windows.Forms.ToolStripMenuItem windowToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openChildToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem closeChildToolStripMenuItem;
+54
View File
@@ -7,14 +7,66 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AutoUpdaterDotNET;
using IOB_UT;
using NLog;
using NLog.Targets;
using NLog.Config;
namespace IOB_WIN
{
public partial class MainForm : Form
{
/// <summary>
/// URL stringa di UPDATE...
/// </summary>
protected string updateUrl
{
get
{
//string branchName = utils.CRS("appVers");
return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/IOB-WIN/{0}/manifest.xml", branchName);
}
}
/// <summary>
/// Ramo applicazione (x update)
/// </summary>
protected string branchName = "develop";
public MainForm()
{
InitializeComponent();
myInit();
}
protected void myInit()
{
loadIniFile(utils.defConfFilePath);
}
/// <summary>
/// Carica file ini della configurazione richiesta
/// </summary>
/// <param name="iniConfFile"></param>
private void loadIniFile(string iniConfFile)
{
#if false
displayTaskAndLog(string.Format("Loading iniConfFile: {0}", iniConfFile));
#endif
IniFile fIni = new IniFile(iniConfFile);
// salvo branchName...
branchName = fIni.ReadString("BRANCH", "NAME", "develop");
// se NON sono in DEBUG faccio check update...
#if !(DEBUG)
// avvio autoupdater...
AutoUpdater.Start(updateUrl);
#endif
}
private void mCheckUpdates_Click(object sender, EventArgs e)
{
AutoUpdater.ShowSkipButton = false;
AutoUpdater.ShowRemindLaterButton = false;
AutoUpdater.Start(updateUrl);
}
protected void closeActiveChild()
@@ -48,5 +100,7 @@ namespace IOB_WIN
{
openChild();
}
}
}