/[xmltv_parser]/trunk/xmltv_parser/main.cs
ViewVC logotype

Diff of /trunk/xmltv_parser/main.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/xmltv_parser/main.cs	2013/03/08 12:05:33	56
+++ trunk/xmltv_parser/main.cs	2013/03/08 13:40:32	59
@@ -30,9 +30,26 @@
             InitializeComponent();
             string log_path = Application.StartupPath;
             string log_filename = string.Format("{0}.log", typeof(main).Assembly.GetName().Name);
-            gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush));
+            gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All_NoProgress, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush));
+            gLog.SetLogLevel(gLog.LogLevel & ~LogLevel.kLogLevel_VerboseDebug);
+            gLog.ReportProgressEvent += new EventHandler<ReportProgressEventArgs>(gLog_ReportProgress);
         }
 
+        private void ReportProgress(int progress)
+        {
+            if (this.InvokeRequired)
+            {
+                try
+                {
+                    this.Invoke((Action)(delegate { ReportProgress(progress); }));
+                }
+                catch { }
+                return;
+            }
+            progress_status.Value = progress;
+        }
+        private void gLog_ReportProgress(object sender, ReportProgressEventArgs e) { ReportProgress(e.Progress); }
+
         StringBuilder log_flusher = new StringBuilder();
         
         void Log_OnFlush(object sender, LoggerOnFlushEventArgs e)
@@ -99,6 +116,7 @@
 
         void XMLTV_OnInstanceCreated(object sender, EventArgs e)
         {
+            ReportProgress(0);
             var instance = XMLTV.GetInstance();
             if (instance != null)
             {
@@ -142,6 +160,7 @@
         {
             try
             {
+                lstPrograms.Items.Clear();
                 //LoadXMLTVShcedule("20130307_continuum_schedule.xml");
                 var result = xmltv_file_chooser.ShowDialog();
                 if (result != DialogResult.OK) return;

 

  ViewVC Help
Powered by ViewVC 1.1.22