Skip to content

Commit

Permalink
1.1.25
Browse files Browse the repository at this point in the history
- logSyntaxCtrl - made read-only. It will always point to the syntax
we've found for the current log, and the user can't change that.
- if the user sets a certain syntax, it will be applied to *the whole
context*.
The idea is that it doesn't make any sense to have two different files
from the same context have different syntax.
Even if theoretically that would happen, you can still have an extra
choice: file-to-syntax. You'll just add an entry that
finds the syntax based on something found in the file header.
done:
- on new file (that does not match any context)
- we will create a context matching the name of the file (if one exists,
we will automatically select it)
- by default, we'll never go to the "Default" context
- the idea is for the uesr not to have to mistakenly delete a context
when he's selecting a different type of file,
(since he would want new filters). thus, just create a new context where
he can do anything
- contexts - case-insensitive (when file -> context)
- syntax: if current context does not have any, use the one the user has
set for this log
- syntax: when changed -> refresh everything (even syntax!)
- test syntax : "Use it" -> if the context did not have a default
syntax(= invalid syntax) -> use it also
- at app start - delete empty contexts
  • Loading branch information
jtorjo committed Oct 3, 2015
1 parent e6bb6e2 commit c309cd0
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 59 deletions.
4 changes: 2 additions & 2 deletions context/find_log_syntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class find_log_syntax {

public const int READ_TO_GUESS_SYNTAX = 8192;

public string try_to_find_log_syntax(string file) {
public string try_find_log_syntax_file(string file) {
try {
using (var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) {
string found = new find_log_syntax().try_find_log_syntax(fs);
string found = try_find_log_syntax(fs);
if (found != UNKNOWN_SYNTAX)
return found;
}
Expand Down
16 changes: 13 additions & 3 deletions docs/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,27 @@







1.1.25
- logSyntaxCtrl - made read-only. It will always point to the syntax we've found for the current log, and the user can't change that.
- if the user sets a certain syntax, it will be applied to *the whole context*.
The idea is that it doesn't make any sense to have two different files from the same context have different syntax.
Even if theoretically that would happen, you can still have an extra choice: file-to-syntax. You'll just add an entry that
finds the syntax based on something found in the file header.
done:
- on new file (that does not match any context)
- we will create a context matching the name of the file (if one exists, we will automatically select it)
- by default, we'll never go to the "Default" context
- the idea is for the uesr not to have to mistakenly delete a context when he's selecting a different type of file,
(since he would want new filters). thus, just create a new context where he can do anything
- at app start - delete empty contexts
- contexts - case-insensitive (when file -> context)
- syntax: if current context does not have any, use the one the user has set for this log

- syntax: when changed -> refresh everything (even syntax!)
- q: should i keep log_syntax in the file or in the context??? (probably i should, but initially use context's default)
- test syntax : "Use it" -> if the context did not have a default syntax(= invalid syntax) -> use it also
- at app start - delete empty contexts


1.1.24b
Expand Down
17 changes: 15 additions & 2 deletions lw_common/ui_helpers/log_wizard_serializable_classes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public class ui_context {
public string name = "";
public string auto_match = "";

public string default_syntax = "";

public List<ui_view> views = new List<ui_view>();

public bool has_views {
Expand All @@ -104,15 +106,25 @@ public bool has_views {
if (views.Count < 1)
return false;
// in this case, we have a single view
// if (views[0].name == "New_1" && views[0].filters.Count < 1)
// return false;
if (views[0].is_default_name && views[0].filters.Count < 1)
return false;

return true;
}
}

public bool has_not_empty_views {
get {
if (views.Count < 1)
return false;
// in this case, we have a single view
if (views[0].is_default_name && views[0].filters.Count < 1)
return false;

return true;
}
}

public void copy_from(ui_context other) {
name = other.name;
auto_match = other.auto_match;
Expand All @@ -122,6 +134,7 @@ public void copy_from(ui_context other) {
private void load_save(bool load, string prefix) {
app.load_save(load, ref name, prefix + ".name", "Default" );
app.load_save(load, ref auto_match, prefix + ".auto_match");
app.load_save(load, ref default_syntax, prefix + ".default_syntax");

int view_count = views.Count;
app.load_save(load, ref view_count, prefix + ".view_count", 0);
Expand Down
2 changes: 1 addition & 1 deletion ui/log_view.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ui/log_view.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ public override string ToString() {
return name;
}

public void force_refresh_visible_columns() {
visible_columns_refreshed_ = false;
refresh_visible_columns();
}

private void load_font() {
string[] font_names = app.inst.sett.get("font_names").Split(',');
foreach ( string name in font_names)
Expand Down
3 changes: 0 additions & 3 deletions ui/log_view.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,4 @@
<metadata name="tip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="tip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
18 changes: 10 additions & 8 deletions ui/log_wizard.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c309cd0

Please sign in to comment.