diff --git a/Src/A69WD/Properties/AssemblyInfo.cs b/Src/A69WD/Properties/AssemblyInfo.cs index de16525..983fffc 100644 --- a/Src/A69WD/Properties/AssemblyInfo.cs +++ b/Src/A69WD/Properties/AssemblyInfo.cs @@ -32,8 +32,8 @@ using System.Runtime.InteropServices; // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // usando l'asterisco '*' come illustrato di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.5.0")] -[assembly: AssemblyFileVersion("0.4.5.0")] +[assembly: AssemblyVersion("0.4.6.0")] +[assembly: AssemblyFileVersion("0.4.6.0")] /* diff --git a/Src/A69WD/Service/Service_Crawler.cs b/Src/A69WD/Service/Service_Crawler.cs index 0466d0e..dfe5e41 100644 --- a/Src/A69WD/Service/Service_Crawler.cs +++ b/Src/A69WD/Service/Service_Crawler.cs @@ -81,13 +81,13 @@ namespace A69WD.Service { try { List urls = await _site.CrawlPageAsync(link); Logger.Information("ProcessQueue: end url " + link.FileName + " - URL trovati: " + urls.Count.ToString("000")); - foreach (iLink url in urls) { + foreach (iLink url in urls) { if (url.Validate) { - // Logger.Warning("URL Validato: " + url.FileName); + // Logger.Warning("URL Validato: " + url.FileName); App.DB.LinkLog(url); _urlQueue.Add(url); - //} else { - // Logger.Warning("URL NON Validato: " + url.FileName); + //} else { + // Logger.Warning("URL NON Validato: " + url.FileName); } } } catch (Exception ex) { @@ -122,7 +122,7 @@ namespace A69WD.Service { _sb.Items["sbStatusLabel"].Text = $"{totale}|{_inCorso}|{fatti}|{_errori}"; _sb.Items["sbStatusLabel"].ToolTipText = "Totali | In Corso | Fatti | Error"; - (_sb.Items["sbProgressBar"] as ToolStripProgressBar).Maximum = totale > 0 ? totale : 1; + (_sb.Items["sbProgressBar"] as ToolStripProgressBar).Maximum = totale > 0 ? totale : 1; (_sb.Items["sbProgressBar"] as ToolStripProgressBar).Value = fatti; } diff --git a/Src/A69WD/Service/Service_Importer.cs b/Src/A69WD/Service/Service_Importer.cs index c14c1f1..6fc9e38 100644 --- a/Src/A69WD/Service/Service_Importer.cs +++ b/Src/A69WD/Service/Service_Importer.cs @@ -19,17 +19,15 @@ namespace A69WD.Service { // Thread worker che consuma la coda private Thread _workerThread; - private readonly Label _lblInCorso; - private readonly ProgressBar _progressBar; + private readonly StatusStrip _sb; private string _path; // Contatori private int _totali = 0; private int _completati = 0; private int _errori = 0; - public Service_Importer(Label lblInCorso, ProgressBar pbStatus) { - _lblInCorso = lblInCorso; - _progressBar = pbStatus; + public Service_Importer(StatusStrip sb) { + _sb = sb; } public void StartWorker(string path) { @@ -104,17 +102,18 @@ namespace A69WD.Service { private void UpdateCounters() { - if (_lblInCorso.InvokeRequired) { - _lblInCorso.Invoke(new Action(UpdateCounters)); + if (_sb.InvokeRequired) { + _sb.Invoke(new Action(UpdateCounters)); return; } int daFare = _totali - _completati - _errori; - _lblInCorso.Text = $"Totali: {_totali} - Completati: {_completati} - Errori: {_errori} - Da fare: {daFare}"; + _sb.Items["sbStatusLabel"].Text = $"{_totali}|{_completati}|{_errori}"; + _sb.Items["sbStatusLabel"].ToolTipText = "Totali | Completati | Error"; - _progressBar.Maximum = _totali > 0 ? _totali : 1; - _progressBar.Value = _completati + _errori; + (_sb.Items["sbProgressBar"] as ToolStripProgressBar).Maximum = _totali > 0 ? _totali : 1; + (_sb.Items["sbProgressBar"] as ToolStripProgressBar).Value = _completati + _errori; } diff --git a/Src/A69WD/UI/frmReader.cs b/Src/A69WD/UI/frmReader.cs index 0c38343..02154d4 100644 --- a/Src/A69WD/UI/frmReader.cs +++ b/Src/A69WD/UI/frmReader.cs @@ -720,14 +720,14 @@ namespace A69WD.UI { mImpStart.Enabled = false; mImpStop.Enabled = true; - //// Preparo il servizio - //ServiceImporter = new Service_Importer(sb); - // - //// Per ora uso la directory di default, poi metteremo selezione - //string path = Cfg.Settings.PathDownloadWorking; - // - //// avvio il servizio - //ServiceImporter.StartWorker(path); + // Preparo il servizio + ServiceImporter = new Service_Importer(sb); + + // Per ora uso la directory di default, poi metteremo selezione + string path = Cfg.Settings.PathDownloadWorking; + + // avvio il servizio + ServiceImporter.StartWorker(path); } void MenuItem_Importer_Stop_Click(object sender, EventArgs e) {; }