Aggiunto comportamento tray-enabled

This commit is contained in:
Samuele E. Locatelli
2020-08-13 20:18:21 +02:00
parent 71f27e6561
commit fcd162bbd0
5 changed files with 4686 additions and 63 deletions
Vendored
+1 -1
View File
@@ -7,7 +7,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=82']) {
withEnv(['NEXT_BUILD_NUMBER=83']) {
// env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'LPA'
+5
View File
@@ -341,11 +341,15 @@
//
this.trayMenu.Name = "trayMenu";
this.trayMenu.Size = new System.Drawing.Size(61, 4);
this.trayMenu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.trayMenu_ItemClicked);
//
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.trayMenu;
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "notifyIcon1";
this.notifyIcon1.Visible = true;
this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
//
// MainForm
//
@@ -360,6 +364,7 @@
this.MainMenuStrip = this.menuStrip1;
this.Name = "MainForm";
this.Text = "Steamware LPA";
this.Resize += new System.EventHandler(this.MainForm_Resize);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.tabControl1.ResumeLayout(false);
+16 -5
View File
@@ -105,6 +105,7 @@ namespace LPA
lblAppName.Text = memLayer.ML.CRS("appName");
lblVers.Text = $" v.{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}";
spoolerRun = true;
createTrayMenu();
setupConf();
setupTimers();
setupQueuePrinter();
@@ -221,17 +222,20 @@ namespace LPA
/// </summary>
private void createTrayMenu()
{
// fix icon!
notifyIcon1.Text = string.Format("Steamware LPA | {0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
// Fix testi menù tray...
trayMenu.Items.Clear();
// SE permessa massimizzazione...
if (memLayer.ML.CRB("windowCanMax"))
{
trayMenu.Items.Add("Show IOB-WIN");
trayMenu.Items.Add("Show LPA");
}
// se è permesso tray close...
if (memLayer.ML.CRB("trayClose"))
{
trayMenu.Items.Add("Close IOB-WIN");
trayMenu.Items.Add("Close LPA");
}
}
@@ -250,6 +254,15 @@ namespace LPA
}
}
/// <summary>
/// evento resize
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainForm_Resize(object sender, EventArgs e)
{
checkFormVisibility();
}
/// <summary>
/// Verifica stato windows (minimized/normal) e visibilità con tray...
/// </summary>
private void checkFormVisibility()
@@ -277,8 +290,6 @@ namespace LPA
{
notifyIcon1.Visible = false;
}
// fix child!
this.LayoutMdi(MdiLayout.TileHorizontal);
}
/// <summary>
/// Gestisce "andata nel tray" della form
@@ -288,7 +299,7 @@ namespace LPA
if (!notifyIcon1.Visible)
{
notifyIcon1.BalloonTipTitle = memLayer.ML.CRS("appName");
notifyIcon1.BalloonTipText = string.Format("{0} running on tray", memLayer.ML.CRS("appName"));
notifyIcon1.BalloonTipText = $"{memLayer.ML.CRS("appName")} running on tray";
notifyIcon1.Visible = true;
notifyIcon1.ShowBalloonTip(100);
}
+4664
View File
File diff suppressed because it is too large Load Diff
-57
View File
@@ -267,63 +267,6 @@ namespace LPA
}
return answ;
}
#if false
/// <summary>
/// Caricamento file come multipart in modalità async
/// </summary>
/// <param name="machineId"></param>
/// <param name="fileName"></param>
/// <param name="localFileName"></param>
/// <returns></returns>
public static async Task<string> ftpUploadAsync(string machineId, string fileName, string localFileName)
{
// test: user=scm, pwd=viaemilia_2019
string remoteFtpPath = @"ftp://fow.steamware.net/httpdocs/SCM/";
lgInfo($"[ftpUploadAsync]: Calling FTP: {remoteFtpPath} | Remote Path {machineId} | local file name: {localFileName}");
GatewayPayload rispo = new GatewayPayload()
{
success = false
};
string answ = "";
try
{
await Task.Run(() =>
{
/* Create Object Instance */
ftp ftpClient = new ftp(@"ftp://fow.steamware.net/httpdocs/SCM/", "scm", "Viaemilia_2019!");
// creo folder...
DateTime adesso = DateTime.Now;
ftpClient.createDirectory($"{adesso:yyyyMMdd}");
ftpClient.createDirectory($"{adesso:yyyyMMdd}/{machineId}");
ftpClient.createDirectory($"{adesso:yyyyMMdd}/{machineId}/{adesso:HHmmss}");
// genero nome remoto...
string remFileName = $"{adesso:yyyyMMdd}/{machineId}/{adesso:HHmmss}/{fileName}";
/* Upload a File */
ftpClient.upload(remFileName, localFileName);
// compogo risposta
rispo = new GatewayPayload()
{
expiry = "2 days",
link = "http://fow.steamware.net/SCM/" + remFileName,
key = remFileName,
error = "",
success = true
};
});
}
catch (Exception exc)
{
lgError($"EXC in uploadAsync: {Environment.NewLine}{exc}");
throw;
}
answ = JsonConvert.SerializeObject(rispo);
return answ;
}
#endif
/// <summary>
/// Caricamento file come multipart in modalità async
/// </summary>