Skip to content

Commit 039189f

Browse files
committed
Restore search note
1 parent 8d156b2 commit 039189f

File tree

3 files changed

+109
-26
lines changed

3 files changed

+109
-26
lines changed

src/Connection.vala

+16-17
Original file line numberDiff line numberDiff line change
@@ -681,24 +681,23 @@ public class Connection : Object {
681681
Populates the given ListStore with all nodes that have names that match
682682
the given string pattern.
683683
*/
684-
public void get_match_items(string tabname, string pattern, bool[] search_opts, ref Gtk.ListStore matches ) {
685-
string str = "";
686-
string type = "";
687-
if( search_opts[2] && (title != null) ) {
688-
str = Utils.match_string( pattern, title.text.text);
689-
if(str.length > 0) {
690-
type += "<b><i>%s:</i></b>".printf( _( "Connection Title" ) );
691-
TreeIter it;
692-
matches.append( out it );
693-
matches.set( it, 0, type, 1, str, 2, null, 3, this, 4, tabname, -1 );
694-
}
684+
public void get_match_items(string tabname, string pattern, bool[] search_opts, ref Gtk.ListStore matches ) {
685+
if( search_opts[2] && (title != null) ) {
686+
string str = Utils.match_string( pattern, title.text.text);
687+
if(str.length > 0) {
688+
TreeIter it;
689+
matches.append( out it );
690+
matches.set( it, 0, "<b><i>%s:</i></b>".printf( _( "Connection Title" ) ), 1, str, 2, null, 3, this, 4, tabname, -1 );
695691
}
696-
/* if( search_opts[3] ) {
697-
str = Utils.match_string( pattern, note);
698-
if(str.length > 0) {
699-
type += "<b><i>%s:</i></b>".printf( _( "Connection Note" ) );
700-
}
701-
}*/
692+
}
693+
if( search_opts[3] ) {
694+
string str = Utils.match_string( pattern, note);
695+
if(str.length > 0) {
696+
TreeIter it;
697+
matches.append( out it );
698+
matches.set( it, 0, "<b><i>%s:</i></b>".printf( _( "Connection Note" ) ), 1, str, 2, null, 3, this, 4, tabname, -1 );
699+
}
700+
}
702701
}
703702
/* Draws the connection to the given context */
704703
public virtual void draw( Cairo.Context ctx, Theme theme ) {

src/Node.vala

+8-9
Original file line numberDiff line numberDiff line change
@@ -1761,27 +1761,26 @@ public class Node : Object {
17611761
the given string pattern.
17621762
*/
17631763
public void get_match_items(string tabname, string pattern, bool[] search_opts, ref Gtk.ListStore matches ) {
1764-
string str = "";
1765-
string type = "";
17661764
if( ((((_task_count == 0) || !is_leaf()) && search_opts[7]) ||
17671765
((_task_count != 0) && is_leaf() && search_opts[6])) &&
17681766
(((parent != null) && parent.folded && search_opts[4]) ||
17691767
(((parent == null) || !parent.folded) && search_opts[5])) ) {
17701768
if( search_opts[2] ) {
1771-
str = Utils.match_string( pattern, name.text.text);
1769+
string str = Utils.match_string( pattern, name.text.text);
17721770
if(str.length > 0) {
1773-
type += "<b><i>%s:</i></b><br\\>".printf( _( "Node Title" ) );
17741771
TreeIter it;
17751772
matches.append( out it );
1776-
matches.set( it, 0, type, 1, str, 2, this, 3, null, 4, tabname, -1 );
1773+
matches.set( it, 0, "<b><i>%s:</i></b>".printf( _( "Node Title" ) ), 1, str, 2, this, 3, null, 4, tabname, -1 );
17771774
}
17781775
}
1779-
/* if( search_opts[3] ) {
1780-
str = Utils.match_string( pattern, name.text.text);
1776+
if( search_opts[3] ) {
1777+
string str = Utils.match_string( pattern, note);
17811778
if(str.length > 0) {
1782-
type += "<b><i>%s:</i></b>".printf( _( "Node Note" ) );
1779+
TreeIter it;
1780+
matches.append( out it );
1781+
matches.set( it, 0, "<b><i>%s:</i></b>".printf( _( "Node Note" ) ), 1, str, 2, this, 3, null, 4, tabname, -1 );
17831782
}
1784-
}*/
1783+
}
17851784
}
17861785
for( int i=0; i<_children.length; i++ ) {
17871786
_children.index( i ).get_match_items(tabname, pattern, search_opts, ref matches );

tests/TEST.minder

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0"?>
2+
<minder version="1.11.3">
3+
<theme name="Custom" label="Custom #1" index="-1" foreground="#93a1a1" textsel_foreground="#002b36" url_foreground="#0000ff" match_background="#ffd700" link_color0="#b5835a" text_cursor="#93a1a1" syntax="#808080" link_color1="#c061cb" background="#002b36" nodesel_foreground="#ffffff" textsel_background="#657b83" attachable="#9bdb4d" connection_foreground="#d4d4d4" link_color2="#b58900" root_foreground="#000000" tag="#c00000" link_color3="#859900" link_color4="#268bd2" root_background="#d4d4d4" match_foreground="#000000" markdown_listitem="#ff0000" link_color5="#6c71c4" url_background="#808080" link_color6="#d33682" link_color7="#2aa198" nodesel_background="#586e75" connection_background="#7e8087" prefer_dark="true"/>
4+
<styles>
5+
<style level="0" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="rounded" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="10" nodepadding="10" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
6+
<style level="1" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
7+
<style level="2" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
8+
<style level="3" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
9+
<style level="4" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
10+
<style level="5" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
11+
<style level="6" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
12+
<style level="7" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
13+
<style level="8" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
14+
<style level="9" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
15+
<style level="10" isset="false" branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
16+
</styles>
17+
<drawarea x="360" y="0" scale="1"/>
18+
<images/>
19+
<nodes>
20+
<node id="0" posx="570" posy="484.3927001953125" width="76" height="45" side="right" fold="false" treesize="180" layout="Horizontal" group="false">
21+
<style branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true"/>
22+
<nodename posx="584" posy="498.3927001953125" maxwidth="200">
23+
<text data="TEST"/>
24+
</nodename>
25+
<nodenote>Test des noeuds et notes</nodenote>
26+
<nodes>
27+
<node id="1" posx="746" posy="416.8927001953125" width="56" height="45" side="right" fold="false" treesize="45" color="#b58900" colorroot="false" layout="Horizontal" group="false">
28+
<style branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true"/>
29+
<nodename posx="760" posy="430.8927001953125" maxwidth="200">
30+
<text data="Pere"/>
31+
</nodename>
32+
<nodenote></nodenote>
33+
</node>
34+
<node id="2" posx="746" posy="506.8927001953125" width="59" height="45" side="right" fold="false" treesize="135" color="#859900" colorroot="false" layout="Horizontal" group="false">
35+
<style branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true"/>
36+
<nodename posx="760" posy="520.8927001953125" maxwidth="200">
37+
<text data="Mere"/>
38+
</nodename>
39+
<nodenote></nodenote>
40+
<nodes>
41+
<node id="3" posx="905" posy="484.3927001953125" width="68" height="45" side="right" fold="false" treesize="90" color="#859900" colorroot="false" layout="Horizontal" group="false">
42+
<style branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true"/>
43+
<nodename posx="919" posy="498.3927001953125" maxwidth="200">
44+
<text data="Fille"/>
45+
</nodename>
46+
<nodenote>enfant</nodenote>
47+
<nodes>
48+
<node id="4" posx="1073" posy="461.8927001953125" width="89" height="45" side="right" fold="false" treesize="45" color="#859900" colorroot="false" layout="Horizontal" group="false">
49+
<style branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true"/>
50+
<nodename posx="1087" posy="475.8927001953125" maxwidth="200">
51+
<text data="Petite-fille"/>
52+
</nodename>
53+
<nodenote></nodenote>
54+
</node>
55+
<node id="5" posx="1073" posy="506.8927001953125" width="95" height="45" side="right" fold="false" treesize="45" color="#859900" colorroot="false" layout="Horizontal" group="false">
56+
<style branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true"/>
57+
<nodename posx="1087" posy="520.8927001953125" maxwidth="200">
58+
<text data="Petit-fils"/>
59+
</nodename>
60+
<nodenote>petit enfant</nodenote>
61+
</node>
62+
</nodes>
63+
</node>
64+
<node id="6" posx="905" posy="551.8927001953125" width="65" height="45" side="right" fold="false" treesize="45" color="#859900" colorroot="false" layout="Horizontal" group="false">
65+
<style branchmargin="100" linktype="straight" linkwidth="4" linkarrow="false" linkdash="solid" nodeborder="underlined" nodewidth="200" nodeborderwidth="4" nodefill="false" nodemargin="8" nodepadding="6" nodefont="Sans 11" nodemarkup="true"/>
66+
<nodename posx="919" posy="565.8927001953125" maxwidth="200">
67+
<text data="Fils"/>
68+
</nodename>
69+
<nodenote>solitaire</nodenote>
70+
</node>
71+
</nodes>
72+
</node>
73+
</nodes>
74+
</node>
75+
</nodes>
76+
<groups/>
77+
<connections>
78+
<connection from_id="2" to_id="1" drag_x="774.75" drag_y="484.3927001953125">
79+
<style connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
80+
<title></title>
81+
<note>couple</note>
82+
</connection>
83+
</connections>
84+
<stickers/>
85+
</minder>

0 commit comments

Comments
 (0)