From aa518db69a84b0a1844fe6fe5c451aaa578e25c0 Mon Sep 17 00:00:00 2001 From: jtorjo Date: Wed, 2 Sep 2015 16:17:36 +0300 Subject: [PATCH] 1.0.61 - fix: test on deleted settings file (we used to have problems) --- Properties/AssemblyInfo.cs | 4 +- docs/history.txt | 7 ++- logwizard.txt | 90 +-------------------------- logwizard_debug.txt | 92 +--------------------------- logwizardsetup/logwizardsetup.vdproj | 6 +- ui/log_wizard.Designer.cs | 4 +- ui/log_wizard.cs | 44 ++++++++++--- 7 files changed, 52 insertions(+), 195 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 84f635a..2d57c41 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.60.0")] -[assembly: AssemblyFileVersion("1.0.60.0")] +[assembly: AssemblyVersion("1.0.61.0")] +[assembly: AssemblyFileVersion("1.0.61.0")] diff --git a/docs/history.txt b/docs/history.txt index 2af8eb7..4dcf1a5 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -1,7 +1,10 @@ -- test on deleted settings file (do we get exception) -1.0.60a +1.0.61 +- fix: test on deleted settings file (we used to have problems) + + +1.0.60 - added application manifest, to request admin credentials -> for topmost to work correctly (still did not work) - fixed setting topmost - forcing it via win32 messages diff --git a/logwizard.txt b/logwizard.txt index 7b9c42b..4fd90a8 100644 --- a/logwizard.txt +++ b/logwizard.txt @@ -6,93 +6,7 @@ context.0.show_filter=1 context.0.show_fulllog=1 context.0.show_source=1 context.0.show_tips=1 -context.0.view_count=1 -context.0.view0.filt0.dimmed=0 -context.0.view0.filt0.enabled=1 -context.0.view0.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view0.filt1.dimmed=0 -context.0.view0.filt1.enabled=1 -context.0.view0.filt1.text=$msg startswith [time] -context.0.view0.filt2.dimmed=0 -context.0.view0.filt2.enabled=1 -context.0.view0.filt2.text="$msg startswith [time\r\ncolor green" -context.0.view0.filt3.dimmed=0 -context.0.view0.filt3.enabled=1 -context.0.view0.filt3.text=$msg startswith [mouse] -context.0.view0.filter_count=0 -context.0.view0.name=New_1 -context.0.view1.filt0.dimmed=0 -context.0.view1.filt0.enabled=1 -context.0.view1.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view1.filt1.dimmed=0 -context.0.view1.filt1.enabled=1 -context.0.view1.filt1.text=$msg startswith [time] -context.0.view1.filt2.dimmed=0 -context.0.view1.filt2.enabled=1 -context.0.view1.filt2.text="$msg startswith [time\r\ncolor green" -context.0.view1.filt3.dimmed=0 -context.0.view1.filt3.enabled=1 -context.0.view1.filt3.text=$msg startswith [mouse] -context.0.view1.filter_count=3 -context.0.view1.name=time -context.0.view2.filt0.dimmed=0 -context.0.view2.filt0.enabled=1 -context.0.view2.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view2.filt1.dimmed=0 -context.0.view2.filt1.enabled=1 -context.0.view2.filt1.text=$msg startswith [time] -context.0.view2.filt2.dimmed=0 -context.0.view2.filt2.enabled=1 -context.0.view2.filt2.text="$msg startswith [time\r\ncolor green" -context.0.view2.filt3.dimmed=0 -context.0.view2.filt3.enabled=1 -context.0.view2.filt3.text=$msg startswith [mouse] -context.0.view2.filter_count=3 -context.0.view2.name=time -context.0.view3.filt0.dimmed=0 -context.0.view3.filt0.enabled=1 -context.0.view3.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view3.filt1.dimmed=0 -context.0.view3.filt1.enabled=1 -context.0.view3.filt1.text=$msg startswith [time] -context.0.view3.filt2.dimmed=0 -context.0.view3.filt2.enabled=1 -context.0.view3.filt2.text="$msg startswith [time\r\ncolor green" -context.0.view3.filter_count=3 -context.0.view3.name=time -context.0.view4.filt0.dimmed=0 -context.0.view4.filt0.enabled=1 -context.0.view4.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view4.filt1.dimmed=0 -context.0.view4.filt1.enabled=1 -context.0.view4.filt1.text=$msg startswith [time] -context.0.view4.filt2.dimmed=0 -context.0.view4.filt2.enabled=1 -context.0.view4.filt2.text="$msg startswith [time\r\ncolor green" -context.0.view4.filter_count=3 -context.0.view4.name=time -context.0.view5.filt0.dimmed=0 -context.0.view5.filt0.enabled=1 -context.0.view5.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view5.filt1.dimmed=0 -context.0.view5.filt1.enabled=1 -context.0.view5.filt1.text=$msg startswith [time] -context.0.view5.filt2.dimmed=0 -context.0.view5.filt2.enabled=1 -context.0.view5.filt2.text="$msg startswith [time\r\ncolor green" -context.0.view5.filter_count=3 -context.0.view5.name=time -context.0.view6.filt0.dimmed=0 -context.0.view6.filt0.enabled=1 -context.0.view6.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view6.filt1.dimmed=0 -context.0.view6.filt1.enabled=1 -context.0.view6.filt1.text=$msg startswith [time] -context.0.view6.filt2.dimmed=0 -context.0.view6.filt2.enabled=1 -context.0.view6.filt2.text="$msg startswith [time\r\ncolor green" -context.0.view6.filter_count=3 -context.0.view6.name=time +context.0.view_count=0 context.1.auto_match= context.1.name=TableNinja @@ -331,6 +245,7 @@ context.2.show_tips=1 context.2.view_count=1 context.2.view0.filter_count=0 context.2.view0.name=New_1 + context.3.auto_match= context.3.name=HM3 context.3.show_filter=1 @@ -340,6 +255,7 @@ context.3.show_tips=1 context.3.view_count=1 context.3.view0.filter_count=0 context.3.view0.name=New_1 + context.4.auto_match= context.4.name=SetupSample context.4.show_filter=1 diff --git a/logwizard_debug.txt b/logwizard_debug.txt index e64b94f..1b0a982 100644 --- a/logwizard_debug.txt +++ b/logwizard_debug.txt @@ -1,102 +1,14 @@ font_names=Consolas,Courier New,Terminal,Monoid,Tahoma,Arial context_count=2 + context.0.name=Default context.0.auto_match= context.0.show_filter=0 context.0.show_source=1 context.0.show_fulllog=1 context.0.show_tips=1 -context.0.view_count=7 -context.0.view0.name=Mostly all -context.0.view0.filter_count=4 - -context.0.view0.filt0.enabled=1 -context.0.view0.filt0.dimmed=0 -context.0.view0.filt0.text="$level = ERROR\r\ncolor red" -context.0.view0.filt1.enabled=1 -context.0.view0.filt1.dimmed=0 -context.0.view0.filt1.text="$level = FATAL\r\ncolor darkred" -context.0.view0.filt2.enabled=1 -context.0.view0.filt2.dimmed=0 -context.0.view0.filt2.text="$msg contains has theme\r\ncolor green" -context.0.view1.name=Errors+Notif -context.0.view1.filter_count=3 -context.0.view1.filt0.enabled=1 -context.0.view1.filt0.dimmed=0 -context.0.view1.filt0.text="$level = ERROR\r\ncolor red" -context.0.view1.filt1.enabled=1 -context.0.view1.filt1.dimmed=0 -context.0.view1.filt1.text="$level = FATAL\r\ncolor darkred" -context.0.view1.filt2.enabled=1 -context.0.view1.filt2.dimmed=0 -context.0.view1.filt2.text=$msg startswith Notification -context.0.view0.filt3.enabled=1 -context.0.view0.filt3.dimmed=0 -context.0.view0.filt3.text="$msg !startswith [hk] Target\r\n$msg !startswith [time\r\n$msg !startswith Process\r\n$msg !startswith [manual]" - -context.0.view2.name=mouse -context.0.view2.filter_count=4 -context.0.view2.filt0.enabled=1 -context.0.view2.filt0.dimmed=0 -context.0.view2.filt0.text="$level = ERROR\r\ncolor red" -context.0.view2.filt1.enabled=1 -context.0.view2.filt1.dimmed=0 -context.0.view2.filt1.text="$level = FATAL\r\ncolor darkred" -context.0.view2.filt2.enabled=0 -context.0.view2.filt2.dimmed=0 -context.0.view2.filt2.text="$msg !startswith [hk] Target\r\n$msg !startswith [time]\r\n" -context.0.view2.filt3.enabled=1 -context.0.view2.filt3.dimmed=0 -context.0.view2.filt3.text=$msg startswith [mouse] - -context.0.view3.name=set_bet -context.0.view3.filter_count=3 -context.0.view3.filt0.enabled=1 -context.0.view3.filt0.dimmed=0 -context.0.view3.filt0.text="$msg startswith [hk] Hotkey set_bet\r\n " -context.0.view3.filt1.enabled=1 -context.0.view3.filt1.dimmed=0 -context.0.view3.filt1.text="$msg contains pot not needed\r\ncolor red" -context.0.view3.filt2.enabled=1 -context.0.view3.filt2.dimmed=0 -context.0.view3.filt2.text="$msg startswith [bet]\r\ncolor gray" - -context.0.view4.name=bet -context.0.view4.filter_count=2 -context.0.view4.filt0.enabled=1 -context.0.view4.filt0.dimmed=0 -context.0.view4.filt0.text="$msg contains pot not needed\r\ncolor red" -context.0.view4.filt1.enabled=1 -context.0.view4.filt1.dimmed=0 -context.0.view4.filt1.text="$msg startswith [bet]\r\n" -context.0.view4.filt2.enabled=1 -context.0.view4.filt2.dimmed=0 -context.0.view4.filt2.text="$msg startswith [bet]\r\ncolor gray" - -context.0.view5.name=hotkeys -context.0.view5.filter_count=1 -context.0.view5.filt0.enabled=1 -context.0.view5.filt0.dimmed=0 -context.0.view5.filt0.text="$msg startswith [hk] Hotkey\r\n" -context.0.view5.filt1.enabled=1 -context.0.view5.filt1.dimmed=0 -context.0.view5.filt1.text="$msg startswith [hk] Hotkey\r\n" -context.0.view5.filt2.enabled=1 -context.0.view5.filt2.dimmed=0 -context.0.view5.filt2.text="$msg startswith [time\r\ncolor green" - -context.0.view6.name=time -context.0.view6.filter_count=3 -context.0.view6.filt0.enabled=1 -context.0.view6.filt0.dimmed=0 -context.0.view6.filt0.text="$msg contains open tables:\r\ncolor blue" -context.0.view6.filt1.enabled=1 -context.0.view6.filt1.dimmed=0 -context.0.view6.filt1.text=$msg startswith [time] -context.0.view6.filt2.enabled=1 -context.0.view6.filt2.dimmed=0 -context.0.view6.filt2.text="$msg startswith [time\r\ncolor green" +context.0.view_count=0 context.1.auto_match= context.1.name=TableNinja diff --git a/logwizardsetup/logwizardsetup.vdproj b/logwizardsetup/logwizardsetup.vdproj index 780a073..1ec343d 100644 --- a/logwizardsetup/logwizardsetup.vdproj +++ b/logwizardsetup/logwizardsetup.vdproj @@ -388,15 +388,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Log Wizard Setup" - "ProductCode" = "8:{28165485-976F-4630-A57F-E110646CA576}" - "PackageCode" = "8:{B05BF4F0-9913-499A-AB87-DCB79FC421C5}" + "ProductCode" = "8:{242BCC7E-97C3-4249-8227-6973B118DA22}" + "PackageCode" = "8:{08CB0142-18BB-42D2-936E-DA3A6A6A4A8B}" "UpgradeCode" = "8:{0E5BB812-A969-415B-9362-F64234C67C4A}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.0.60" + "ProductVersion" = "8:1.0.61" "Manufacturer" = "8:John Torjo" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" diff --git a/ui/log_wizard.Designer.cs b/ui/log_wizard.Designer.cs index adf36d6..374ce67 100644 --- a/ui/log_wizard.Designer.cs +++ b/ui/log_wizard.Designer.cs @@ -828,9 +828,9 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.dropHere.Font = new System.Drawing.Font("Segoe UI", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.dropHere.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.dropHere.Location = new System.Drawing.Point(8, 0); + this.dropHere.Location = new System.Drawing.Point(3, 3); this.dropHere.Name = "dropHere"; - this.dropHere.Size = new System.Drawing.Size(534, 432); + this.dropHere.Size = new System.Drawing.Size(534, 435); this.dropHere.TabIndex = 0; this.dropHere.Text = "Drop it Like it\'s Hot!\r\nJust drop a file here, and get to work!\r\n"; this.dropHere.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; diff --git a/ui/log_wizard.cs b/ui/log_wizard.cs index f1b62b7..e1f8bb6 100644 --- a/ui/log_wizard.cs +++ b/ui/log_wizard.cs @@ -302,7 +302,12 @@ private void save_contexts() { sett.set("context." + i + ".show_source", (contexts_[i].show_source ? "1" : "0")); sett.set("context." + i + ".show_fulllog", (contexts_[i].show_fulllog ? "1" : "0")); - sett.set("context." + i + ".view_count", "" + contexts_[i].views.Count); + int view_count = contexts_[i].views.Count; + if ( view_count == 1) + if (contexts_[i].views[0].filters.Count < 1) + // in this case, the user has not set any filters at all + view_count = 0; + sett.set("context." + i + ".view_count", "" + view_count); for ( int v = 0; v < contexts_[i].views.Count; ++v) { ui_view lv = contexts_[i].views[v]; sett.set("context." + i + ".view" + v + ".name", lv.name); @@ -552,10 +557,12 @@ private void load_filters() { List items = new List(); ui_context cur = cur_context(); int cur_view = viewsTab.SelectedIndex; - var filters = cur.views[cur_view].filters; - for (int idx = 0; idx < filters.Count; ++idx) { - item i = new item() {text = filters[idx].text, enabled = filters[idx].enabled, dimmed = filters[idx].dimmed}; - items.Add(i); + if (cur_view < cur.views.Count) { + var filters = cur.views[cur_view].filters; + for (int idx = 0; idx < filters.Count; ++idx) { + item i = new item() {text = filters[idx].text, enabled = filters[idx].enabled, dimmed = filters[idx].dimmed}; + items.Add(i); + } } filterCtrl.SetObjects(items); if ( old_sel != "") @@ -634,6 +641,11 @@ private void load_tabs() { // note: we only add the inner view when there's some source to read from ui_context cur = cur_context(); + // never allow "no view" whatsoever + bool has_views = cur.views.Count > 0; + if (cur.views.Count < 1) + cur.views.Add(new ui_view() { name = "New_1", filters = new List() }); + for ( int idx = 0; idx < cur.views.Count; ++idx) if ( viewsTab.TabCount < idx + 1) viewsTab.TabPages.Add(cur.views[idx].name); @@ -643,8 +655,16 @@ private void load_tabs() { ensure_we_have_log_view_for_tab(idx); } - while ( viewsTab.TabCount > cur.views.Count) - viewsTab.TabPages.RemoveAt(cur.views.Count); + while (viewsTab.TabCount > cur.views.Count) { + // TabControl.RemoveAt is buggy + var page = viewsTab.TabPages[cur.views.Count]; + viewsTab.TabPages.Remove(page); + } + + if (!has_views) { + log_view_for_tab(0).Visible = false; + dropHere.Visible = true; + } } private void load_toggles() { @@ -1084,6 +1104,7 @@ private int history_select(string name) { private int last_sel = -1; private void on_new_log() { + dropHere.Visible = false; // by default - try to find the syntax by reading the header info // otherwise, try to parse it @@ -1119,6 +1140,9 @@ private void on_new_log() { ensure_we_have_log_view_for_tab(idx); load_bookmarks(); logger.Info("new reader_ " + history_[logHistory.SelectedIndex].name); + + // at this point, some file has been dropped + log_view_for_tab(0).Visible = true; } private void add_reader_to_history() { @@ -1214,8 +1238,10 @@ private void LogWizard_FormClosing(object sender, FormClosingEventArgs e) { save(); } - private void logHistory_DropDownClosed(object sender, EventArgs e) - { + private void logHistory_DropDownClosed(object sender, EventArgs e) { + if (logHistory.Items.Count < 1) + return; // nothing is in history + //sourceName_TextChanged(null,null); on_log_listory_changed(); }