[med-svn] [SCM] aghermann branch, master, updated. 06bda7dfaa687aaf0708a024d192024e2cd58421

Andrei Zavada johnhommer at gmail.com
Thu Jan 24 00:43:46 UTC 2013


The following commit has been merged in the master branch:
commit ba1bc44b73c8d21fe243e60aa5682215e7c8440b
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Wed Jan 16 02:09:02 2013 +0200

    patterns WIP

diff --git a/data/sf.glade b/data/sf.glade
index a914cd6..b52a7fa 100644
--- a/data/sf.glade
+++ b/data/sf.glade
@@ -1673,36 +1673,6 @@
                     <property name="position">1</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkLabel" id="label46">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="xpad">5</property>
-                    <property name="label" translatable="yes"> in channel </property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                      <attribute name="scale" value="1.1000000000000001"/>
-                    </attributes>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="ePatternChannel">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">end</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">3</property>
-                  </packing>
-                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -1728,493 +1698,694 @@
                 <property name="margin_top">5</property>
                 <property name="spacing">8</property>
                 <child>
-                  <object class="GtkTable" id="table26">
+                  <object class="GtkTable" id="cPatternControls">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="n_rows">13</property>
-                    <property name="n_columns">3</property>
-                    <property name="row_spacing">5</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternDZCDFSigma">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternDZCDFSigma</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">11</property>
-                        <property name="bottom_attach">12</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternBandPassFrom">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternBandPassFrom</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">5</property>
-                        <property name="bottom_attach">6</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label175">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Between:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">5</property>
-                        <property name="bottom_attach">6</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label176">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Sigma:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">11</property>
-                        <property name="bottom_attach">12</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label178">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">11</property>
-                        <property name="bottom_attach">12</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label179">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Order:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">7</property>
-                        <property name="bottom_attach">8</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternBandPassOrder">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternBandPassOrder</property>
-                        <property name="snap_to_ticks">True</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">7</property>
-                        <property name="bottom_attach">8</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label180">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">7</property>
-                        <property name="bottom_attach">8</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label181">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes"><b>Derivative ZC density</b></property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">9</property>
-                        <property name="bottom_attach">10</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label182">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes"><b>Target frequency</b></property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label183">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Step:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">10</property>
-                        <property name="bottom_attach">11</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternDZCDFStep">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternDZCDFStep</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">10</property>
-                        <property name="bottom_attach">11</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label184">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">sec</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">10</property>
-                        <property name="bottom_attach">11</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label185">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes"><b>Envelope</b></property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label186">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Tightness:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternEnvTightness">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternEnvTightness</property>
-                        <property name="snap_to_ticks">True</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label187">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">points</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHSeparator" id="hseparator8">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                        <property name="y_padding">8</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHSeparator" id="hseparator9">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">8</property>
-                        <property name="bottom_attach">9</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                        <property name="y_padding">8</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label188">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Smooth:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">12</property>
-                        <property name="bottom_attach">13</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternDZCDFSmooth">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternDZCDFSmooth</property>
-                        <property name="snap_to_ticks">True</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">12</property>
-                        <property name="bottom_attach">13</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
+                    <property name="n_rows">2</property>
                     <child>
-                      <object class="GtkLabel" id="label189">
+                      <object class="GtkTable" id="cPatternPatternParameters">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">points</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">12</property>
-                        <property name="bottom_attach">13</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label44">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">and </property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternBandPassUpto">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternBandPassUpto</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
+                        <property name="n_rows">12</property>
+                        <property name="n_columns">3</property>
+                        <property name="row_spacing">5</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternDZCDFSigma">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternDZCDFSigma</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">10</property>
+                            <property name="bottom_attach">11</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternBandPassFrom">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternBandPassFrom</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">4</property>
+                            <property name="bottom_attach">5</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label175">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Between:</property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">4</property>
+                            <property name="bottom_attach">5</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label176">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Sigma:</property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">10</property>
+                            <property name="bottom_attach">11</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label178">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">10</property>
+                            <property name="bottom_attach">11</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label179">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Order:</property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">6</property>
+                            <property name="bottom_attach">7</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternBandPassOrder">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternBandPassOrder</property>
+                            <property name="snap_to_ticks">True</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">6</property>
+                            <property name="bottom_attach">7</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label180">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">6</property>
+                            <property name="bottom_attach">7</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label181">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes"><b>Derivative ZC density</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                          <packing>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">8</property>
+                            <property name="bottom_attach">9</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label182">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes"><b>Target frequency</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                          <packing>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">3</property>
+                            <property name="bottom_attach">4</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label183">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Step:</property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">9</property>
+                            <property name="bottom_attach">10</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternDZCDFStep">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternDZCDFStep</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">9</property>
+                            <property name="bottom_attach">10</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label184">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">sec</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">9</property>
+                            <property name="bottom_attach">10</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label185">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes"><b>Envelope</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                          <packing>
+                            <property name="right_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label186">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Tightness:</property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternEnvTightness">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternEnvTightness</property>
+                            <property name="snap_to_ticks">True</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label187">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">points</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHSeparator" id="hseparator8">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                          </object>
+                          <packing>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                            <property name="y_padding">8</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHSeparator" id="hseparator9">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                          </object>
+                          <packing>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">7</property>
+                            <property name="bottom_attach">8</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                            <property name="y_padding">8</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label188">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Smooth:</property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">11</property>
+                            <property name="bottom_attach">12</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternDZCDFSmooth">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternDZCDFSmooth</property>
+                            <property name="snap_to_ticks">True</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">11</property>
+                            <property name="bottom_attach">12</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label189">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">points</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">11</property>
+                            <property name="bottom_attach">12</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label44">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">and </property>
+                          </object>
+                          <packing>
+                            <property name="top_attach">5</property>
+                            <property name="bottom_attach">6</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternBandPassUpto">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternBandPassUpto</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">5</property>
+                            <property name="bottom_attach">6</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label177">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Hz</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">5</property>
+                            <property name="bottom_attach">6</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
                       </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
                     </child>
                     <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label177">
+                      <object class="GtkTable" id="cPatternCriteria">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Hz</property>
+                        <property name="n_rows">6</property>
+                        <property name="n_columns">2</property>
+                        <property name="row_spacing">5</property>
+                        <child>
+                          <object class="GtkLabel" id="label191">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="has_tooltip">True</property>
+                            <property name="tooltip_markup" translatable="yes">Fit of envelope centre</property>
+                            <property name="tooltip_text" translatable="yes">Fit of envelope centre</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Env. mid:</property>
+                            <attributes>
+                              <attribute name="scale" value="0.90000000000000002"/>
+                            </attributes>
+                          </object>
+                          <packing>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternParameterA">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternStrictnessA</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label192">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="has_tooltip">True</property>
+                            <property name="tooltip_markup" translatable="yes">Fit of envelope breadth</property>
+                            <property name="tooltip_text" translatable="yes">Fit of envelope breadth</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Env. breadth:</property>
+                            <attributes>
+                              <attribute name="scale" value="0.90000000000000002"/>
+                            </attributes>
+                          </object>
+                          <packing>
+                            <property name="top_attach">3</property>
+                            <property name="bottom_attach">4</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternParameterB">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternStrictnessB</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">3</property>
+                            <property name="bottom_attach">4</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label193">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="has_tooltip">True</property>
+                            <property name="tooltip_markup" translatable="yes">Target frequency fit</property>
+                            <property name="tooltip_text" translatable="yes">Target frequency fit</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">Target freq:</property>
+                            <attributes>
+                              <attribute name="scale" value="0.90000000000000002"/>
+                            </attributes>
+                          </object>
+                          <packing>
+                            <property name="top_attach">4</property>
+                            <property name="bottom_attach">5</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternParameterC">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternStrictnessC</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">4</property>
+                            <property name="bottom_attach">5</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label194">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="has_tooltip">True</property>
+                            <property name="tooltip_markup" translatable="yes">Higher values mean looser fit criteria
+on individual parameters</property>
+                            <property name="tooltip_text" translatable="yes">Higher values mean looser fit criteria
+on individual parameters</property>
+                            <property name="xalign">0</property>
+                            <property name="yalign">1</property>
+                            <property name="label" translatable="yes"><b>Strictness criteria:</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                          <packing>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSeparator" id="separator3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="valign">end</property>
+                          </object>
+                          <packing>
+                            <property name="right_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label49">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="has_tooltip">True</property>
+                            <property name="tooltip_markup" translatable="yes">Deriv. zerocrossing density</property>
+                            <property name="tooltip_text" translatable="yes">Deriv. zerocrossing density</property>
+                            <property name="xalign">1</property>
+                            <property name="xpad">5</property>
+                            <property name="label" translatable="yes">DZCDF:</property>
+                            <attributes>
+                              <attribute name="scale" value="0.90000000000000002"/>
+                            </attributes>
+                          </object>
+                          <packing>
+                            <property name="top_attach">5</property>
+                            <property name="bottom_attach">6</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="ePatternParameterD">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="has_frame">False</property>
+                            <property name="invisible_char">•</property>
+                            <property name="xalign">1</property>
+                            <property name="overwrite_mode">True</property>
+                            <property name="invisible_char_set">True</property>
+                            <property name="primary_icon_activatable">False</property>
+                            <property name="secondary_icon_activatable">False</property>
+                            <property name="adjustment">jPatternParameterD</property>
+                            <property name="digits">2</property>
+                            <property name="numeric">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">5</property>
+                            <property name="bottom_attach">6</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options">GTK_FILL</property>
+                          </packing>
+                        </child>
                       </object>
                       <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
                       </packing>
                     </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -2228,9 +2399,6 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
-                      <placeholder/>
-                    </child>
-                    <child>
                       <object class="GtkScrolledWindow" id="swPatternSelection">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
@@ -2259,6 +2427,21 @@
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkLabel" id="lPatternParametersBrief">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="xpad">5</property>
+                        <property name="ypad">3</property>
+                        <property name="label" translatable="yes">(parameters brief)</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
                       <object class="GtkScrolledWindow" id="swPatternField">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
@@ -2283,12 +2466,84 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="bPatternSearch">
-                        <property name="label" translatable="yes">Search</property>
+                      <object class="GtkBox" id="box12">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="focus_on_click">False</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">center</property>
+                        <property name="valign">end</property>
+                        <property name="orientation">vertical</property>
+                        <child>
+                          <object class="GtkTable" id="cPatternSearchButton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="n_columns">3</property>
+                            <child>
+                              <object class="GtkButton" id="bPatternSearch">
+                                <property name="label" translatable="yes">Search</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="focus_on_click">False</property>
+                              </object>
+                              <packing>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="label46">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="xpad">5</property>
+                                <property name="label" translatable="yes"> in channel </property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkComboBox" id="ePatternChannel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="halign">end</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">2</property>
+                                <property name="right_attach">3</property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkTable" id="cPatternAgainButton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkButton" id="bPatternAgain">
+                                <property name="label" translatable="yes">Modify pattern</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                              </object>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
                       </object>
                       <packing>
                         <property name="expand">True</property>
@@ -2302,6 +2557,7 @@
                         <property name="can_focus">False</property>
                         <property name="xalign">1</property>
                         <property name="xpad">5</property>
+                        <property name="label" translatable="yes">(similarity info)</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -2316,223 +2572,6 @@
                     <property name="position">1</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkTable" id="table27">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="n_rows">6</property>
-                    <property name="n_columns">2</property>
-                    <property name="row_spacing">5</property>
-                    <child>
-                      <object class="GtkLabel" id="label191">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="tooltip_text" translatable="yes">Fit of envelope centre</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Env. mid:</property>
-                        <attributes>
-                          <attribute name="scale" value="0.90000000000000002"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternParameterA">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternStrictnessA</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label192">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="tooltip_text" translatable="yes">Fit of envelope breadth</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Env. breadth:</property>
-                        <attributes>
-                          <attribute name="scale" value="0.90000000000000002"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternParameterB">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternStrictnessB</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label193">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="tooltip_text" translatable="yes">Target frequency fit</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">Target freq:</property>
-                        <attributes>
-                          <attribute name="scale" value="0.90000000000000002"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternParameterC">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternStrictnessC</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label194">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="tooltip_markup" translatable="yes">Higher values mean looser fit criteria
-on individual parameters</property>
-                        <property name="xalign">0</property>
-                        <property name="yalign">1</property>
-                        <property name="label" translatable="yes"><b>Strictness:</b></property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSeparator" id="separator3">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="valign">end</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label49">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="has_tooltip">True</property>
-                        <property name="tooltip_text" translatable="yes">Deriv. zerocrossing density</property>
-                        <property name="xalign">1</property>
-                        <property name="xpad">5</property>
-                        <property name="label" translatable="yes">DZCDF:</property>
-                        <attributes>
-                          <attribute name="scale" value="0.90000000000000002"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="top_attach">5</property>
-                        <property name="bottom_attach">6</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="ePatternParameterD">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="has_frame">False</property>
-                        <property name="invisible_char">•</property>
-                        <property name="xalign">1</property>
-                        <property name="overwrite_mode">True</property>
-                        <property name="invisible_char_set">True</property>
-                        <property name="primary_icon_activatable">False</property>
-                        <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">jPatternParameterD</property>
-                        <property name="digits">2</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">5</property>
-                        <property name="bottom_attach">6</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
diff --git a/src/ui/sf/Makefile.am b/src/ui/sf/Makefile.am
index 9c47b04..4dc15b3 100644
--- a/src/ui/sf/Makefile.am
+++ b/src/ui/sf/Makefile.am
@@ -22,6 +22,8 @@ liba_a_SOURCES := \
 	sf-montage-overlays.cc \
 	sf-montage_cb.cc \
 	sf-patterns.cc \
+	sf-patterns-draw.cc \
+	sf-patterns-enumerate.cc \
 	sf-patterns_cb.cc \
 	sf-phasediff.cc \
 	sf-phasediff_cb.cc \
diff --git a/src/ui/sf/sf-construct.cc b/src/ui/sf/sf-construct.cc
index f03c414..72afc77 100644
--- a/src/ui/sf/sf-construct.cc
+++ b/src/ui/sf/sf-construct.cc
@@ -382,10 +382,15 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 
 	if ( !AGH_GBGETOBJ (GtkDialog,		wPattern) ||
 	     !AGH_GBGETOBJ (GtkDrawingArea,	daPatternSelection) ||
-	     !AGH_GBGETOBJ (GtkScrolledWindow,	vpPatternSelection) ||
+	     !AGH_GBGETOBJ (GtkScrolledWindow,	swPatternSelection) ||
 	     !AGH_GBGETOBJ (GtkDrawingArea,	daPatternField) ||
-	     !AGH_GBGETOBJ (GtkScrolledWindow,	vpPatternField) ||
+	     !AGH_GBGETOBJ (GtkScrolledWindow,	swPatternField) ||
+	     !AGH_GBGETOBJ (GtkTable,		cPatternSearchButton) ||
+	     !AGH_GBGETOBJ (GtkTable,		cPatternAgainButton) ||
+	     !AGH_GBGETOBJ (GtkTable,		cPatternPatternParameters) ||
+	     !AGH_GBGETOBJ (GtkTable,		cPatternCriteria) ||
 	     !AGH_GBGETOBJ (GtkButton,		bPatternSearch) ||
+	     !AGH_GBGETOBJ (GtkButton,		bPatternAgain) ||
 	     !AGH_GBGETOBJ (GtkButton,		bPatternGotoPrevious) ||
 	     !AGH_GBGETOBJ (GtkButton,		bPatternGotoNext) ||
 	     !AGH_GBGETOBJ (GtkButton,		bPatternSave) ||
@@ -402,6 +407,7 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 	     !AGH_GBGETOBJ (GtkSpinButton,	ePatternParameterC) ||
 	     !AGH_GBGETOBJ (GtkSpinButton,	ePatternParameterD) ||
 	     !AGH_GBGETOBJ (GtkHBox,		cPatternLabelBox) ||
+	     !AGH_GBGETOBJ (GtkLabel,		lPatternParametersBrief) ||
 	     !AGH_GBGETOBJ (GtkLabel,		lPatternSimilarity) ||
 	     !AGH_GBGETOBJ (GtkComboBox,	ePatternList) ||
 	     !AGH_GBGETOBJ (GtkComboBox,	ePatternChannel) ||
@@ -424,6 +430,8 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 	G_CONNECT_2 (daPatternField, scroll, event);
 	G_CONNECT_1 (bPatternSave, clicked);
 	G_CONNECT_1 (bPatternDiscard, clicked);
+	G_CONNECT_1 (bPatternSearch, clicked);
+	G_CONNECT_1 (bPatternAgain, clicked);
 
 	for ( auto& W : {bPatternGotoNext, bPatternGotoPrevious} )
 		g_signal_connect( W, "clicked",
diff --git a/src/ui/sf/sf-patterns-draw.cc b/src/ui/sf/sf-patterns-draw.cc
new file mode 100644
index 0000000..f3e283c
--- /dev/null
+++ b/src/ui/sf/sf-patterns-draw.cc
@@ -0,0 +1,178 @@
+// ;-*-C++-*-
+/*
+ *       File name:  ui/sf/sf-patterns-draw.cc
+ *         Project:  Aghermann
+ *          Author:  Andrei Zavada <johnhommer at gmail.com>
+ * Initial version:  2013-01-16
+ *
+ *         Purpose:  scoring facility patterns (drawing functions)
+ *
+ *         License:  GPL
+ */
+
+#include "ui/misc.hh"
+#include "sf.hh"
+
+using namespace std;
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+set_pattern_da_width( int width)
+{
+	g_object_set( (GObject*)_p.daPatternSelection,
+		      "width-request", da_thing_wd = width,
+		      "height-request", da_thing_ht,
+		      NULL);
+	g_object_set( (GObject*)_p.swPatternSelection,
+		      "width-request", min( width+5, 600),
+		      "height-request", da_thing_ht + 30,
+		      NULL);
+}
+
+void
+aghui::SScoringFacility::SFindDialog::
+set_field_da_width( int width)
+{
+	g_object_set( (GObject*)_p.daPatternField,
+		      "width-request", da_field_wd = width,
+		      "height-request", da_field_ht,
+		      NULL);
+	g_object_set( (GObject*)_p.swPatternField,
+		      "width-request", min( width+5, 600),
+		      "height-request", da_thing_ht + 30,
+		      NULL);
+}
+
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+draw_thing( cairo_t *cr)
+{
+	if ( thing.size() == 0 ) {
+		set_pattern_da_width( 200);
+		aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "(no selection)");
+		return;
+	} else {
+	}
+
+      // ticks
+	cairo_select_font_face( cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
+	cairo_set_font_size( cr, 9);
+	double	seconds = (double)thing.size() / samplerate;
+	for ( size_t i8 = 0; (float)i8 / 8 < seconds; ++i8 ) {
+		_p._p.CwB[SExpDesignUI::TColour::sf_ticks].set_source_rgba( cr);
+		cairo_set_line_width( cr, (i8%8 == 0) ? 1. : (i8%4 == 0) ? .6 : .3);
+		guint x = (float)i8/8 / seconds * da_thing_wd;
+		cairo_move_to( cr, x, 0);
+		cairo_rel_line_to( cr, 0, da_thing_ht);
+		cairo_stroke( cr);
+
+		if ( i8 % 8 == 0 ) {
+			_p._p.CwB[SExpDesignUI::TColour::sf_labels].set_source_rgba( cr);
+			cairo_move_to( cr, x + 5, da_thing_ht-2);
+			snprintf_buf( "%g", (float)i8/8);
+			cairo_show_text( cr, __buf__);
+			cairo_stroke( cr);
+		}
+	}
+
+	size_t	run = pattern_size_essential();
+
+      // snippet
+	cairo_set_source_rgb( cr, 0., 0., 0.);
+	cairo_set_line_width( cr, .8);
+	aghui::cairo_draw_signal( cr, thing, 0, thing.size(),
+				  da_thing_wd, 0, da_thing_ht/3, thing_display_scale);
+	cairo_stroke( cr);
+
+	// lines marking out context
+	cairo_set_source_rgba( cr, 0.9, 0.9, 0.9, .5);
+	cairo_set_line_width( cr, 1.);
+	cairo_rectangle( cr, 0., 0., (float)context_before / thing.size() * da_thing_wd, da_thing_ht);
+	cairo_rectangle( cr, (float)(context_before + run) / thing.size() * da_thing_wd, 0,
+			 (float)(context_after) / thing.size() * da_thing_wd, da_thing_ht);
+	cairo_fill( cr);
+	cairo_stroke( cr);
+
+	if ( draw_details ) {
+		valarray<TFloat>
+			env_u, env_l,
+			course,
+			dzcdf;
+	      // envelope
+		{
+			if ( sigproc::envelope( {thing, samplerate}, Pp.env_tightness,
+						1./samplerate,
+						&env_l, &env_u) == 0 ) {
+				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Selection is too short");
+				goto out;
+			}
+
+			_p._p.CwB[SExpDesignUI::TColour::sf_selection].set_source_rgba_contrasting( cr, .3);
+			aghui::cairo_draw_signal( cr, env_u, 0, env_u.size(),
+						  da_thing_wd, 0, da_thing_ht/2, thing_display_scale);
+			aghui::cairo_draw_signal( cr, env_l, 0, env_l.size(),
+						  da_thing_wd, 0, da_thing_ht/2, thing_display_scale, 1,
+						  aghui::TDrawSignalDirection::backward, true);
+			cairo_close_path( cr);
+			cairo_fill( cr);
+			cairo_stroke( cr);
+		}
+
+	      // target frequency
+		{
+			if ( Pp.bwf_ffrom >= Pp.bwf_fupto ) {
+				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Bad band-pass range");
+				goto out;
+			}
+			course = exstrom::band_pass(
+				thing, samplerate,
+				Pp.bwf_ffrom, Pp.bwf_fupto, Pp.bwf_order, true);
+
+			cairo_set_source_rgba( cr, 0.3, 0.3, 0.3, .5);
+			cairo_set_line_width( cr, 3.);
+			aghui::cairo_draw_signal( cr, course, 0, course.size(),
+						  da_thing_wd, 0, da_thing_ht/3, thing_display_scale);
+			cairo_stroke( cr);
+		}
+
+	      // dzcdf
+		{
+			if ( samplerate < 10 ) {
+				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Samplerate is too low");
+				goto out;
+			}
+			if ( Pp.dzcdf_step * 10 > pattern_length() ) { // require at least 10 dzcdf points
+				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Selection is too short");
+				goto out;
+			}
+
+			dzcdf = sigproc::dzcdf( sigproc::SSignalRef<TFloat> {thing, samplerate},
+						Pp.dzcdf_step, Pp.dzcdf_sigma, Pp.dzcdf_smooth);
+			float	dzcdf_display_scale = da_thing_ht/4. / dzcdf.max();
+
+			cairo_set_source_rgba( cr, 0.3, 0.3, 0.99, .8);
+			cairo_set_line_width( cr, 1.);
+			aghui::cairo_draw_signal( cr, dzcdf, 0, dzcdf.size(),
+						  da_thing_wd, 0, da_thing_ht/2-5, dzcdf_display_scale);
+			cairo_stroke( cr);
+		}
+	}
+out:
+	;
+}
+
+void
+aghui::SScoringFacility::SFindDialog::
+draw_field( cairo_t *cr)
+{
+	aghui::cairo_draw_signal(
+		cr,
+		field_channel->psd.course, 0, field_channel->psd.course.size(),
+		da_field_wd, 0., da_field_ht/2, field_display_scale);
+
+}
+
+// eof
diff --git a/src/ui/sf/sf-patterns-enumerate.cc b/src/ui/sf/sf-patterns-enumerate.cc
new file mode 100644
index 0000000..4ff74f4
--- /dev/null
+++ b/src/ui/sf/sf-patterns-enumerate.cc
@@ -0,0 +1,283 @@
+// ;-*-C++-*-
+/*
+ *       File name:  ui/sf/sf-patterns-enumerate.cc
+ *         Project:  Aghermann
+ *          Author:  Andrei Zavada <johnhommer at gmail.com>
+ * Initial version:  2013-01-16
+ *
+ *         Purpose:  scoring facility patterns (enumerating & io)
+ *
+ *         License:  GPL
+ */
+
+#include <tuple>
+#include <dirent.h>
+#include <sys/stat.h>
+
+#include "ui/misc.hh"
+#include "sf.hh"
+
+using namespace std;
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+load_pattern( SScoringFacility::SChannel& field)
+{
+	// double check, possibly redundant after due check in callback
+	size_t	run = field.selection_end - field.selection_start;
+	if ( run == 0 )
+		return;
+
+	field_channel = &field;
+	context_before = (field.selection_start < context_pad)
+		? context_pad - field.selection_start
+		: context_pad;
+	context_after  = (field.selection_end + context_pad > field.n_samples())
+		? field.n_samples() - field.selection_end
+		: context_pad;
+	size_t	full_sample = context_before + run + context_after;
+
+	thing.resize( full_sample);
+	thing = field.signal_filtered[ slice (field.selection_start - context_before,
+						full_sample, 1) ];
+				// or _p.selection_*
+	samplerate = field.samplerate();
+	thing_display_scale = field.signal_display_scale;
+
+	set_pattern_da_width( full_sample / field.spp());
+
+	preselect_channel( field.name);
+	preselect_entry( NULL, 0);
+	gtk_label_set_markup( _p.lPatternSimilarity, "");
+
+	gtk_widget_queue_draw( (GtkWidget*)_p.daPatternSelection);
+}
+
+
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+load_pattern( const char *label, bool do_globally)
+{
+	if ( do_globally ) {
+		snprintf_buf( "%s/.patterns/%s", _p._p.ED->session_dir().c_str(), label);
+	} else {
+		string j_dir = _p._p.ED->subject_dir( _p.csubject());
+		snprintf_buf( "%s/.patterns/%s", j_dir.c_str(), label);
+	}
+
+	FILE *fd = fopen( __buf__, "r");
+	if ( fd ) {
+		size_t	full_sample;
+		if ( fscanf( fd,
+			     (sizeof(TFloat) == sizeof(float))
+			     ?
+			     "%u  %u %lg %lg  %lg %lg %u "
+			     " %g %g %g %g\n"
+			     "%zu %zu %zu %zu\n"
+			     "--DATA--\n"
+			     :
+			     "%u  %u %lg %lg  %lg %lg %u "
+			     " %lg %lg %lg %lg\n"
+			     "%zu %zu %zu %zu\n"
+			     "--DATA--\n"
+			     ,
+			     &Pp.env_tightness,
+			     &Pp.bwf_order, &Pp.bwf_ffrom, &Pp.bwf_fupto,
+			     &Pp.dzcdf_step, &Pp.dzcdf_sigma, &Pp.dzcdf_smooth,
+			     &get<0>(criteria), &get<1>(criteria), &get<2>(criteria), &get<3>(criteria),
+			     &samplerate, &full_sample, &context_before, &context_after) == 14 ) {
+
+			thing.resize( full_sample);
+			for ( size_t i = 0; i < full_sample; ++i ) {
+				double d;
+				if ( fscanf( fd, "%la", &d) != 1 ) {
+					fprintf( stderr, "load_pattern(): short read at sample %zu from %s; "
+						 "Removing file\n", i, __buf__);
+					thing.resize( 0);
+					fclose( fd);
+					unlink( __buf__);
+					enumerate_patterns_to_combo();
+					return;
+				} else
+					thing[i] = d;
+			}
+
+			if ( samplerate != field_channel->samplerate() ) {
+				printf( "Loaded pattern has samplerate different from the current samplerate (%zu vs %zu); it will be resampled now.",
+					samplerate, field_channel->samplerate());
+				double fac = (double)field_channel->samplerate() / samplerate;
+				thing =
+					sigproc::resample( thing, 0, full_sample,
+							   fac * full_sample);
+				context_before *= fac;
+				context_after  *= fac;
+			}
+
+			thing_display_scale = field_channel->signal_display_scale;
+			W_V.up();
+
+			set_pattern_da_width( full_sample / field_channel->spp());
+
+		} else {
+			thing.resize( 0);
+			fprintf( stderr, "load_pattern(): corrupted %s; "
+				 "Removing file\n", __buf__);
+			thing.resize( 0);
+			unlink( __buf__);
+			enumerate_patterns_to_combo();
+		}
+
+		fclose( fd);
+
+	} else {
+		fprintf( stderr, "load_pattern(): failed to open %s; "
+			 "Removing file\n", __buf__);
+		unlink( __buf__);
+	}
+}
+
+
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+save_pattern( const char *label, bool do_globally)
+{
+	if ( do_globally ) {
+		snprintf_buf( "%s/.patterns", _p._p.ED->session_dir().c_str());
+		if ( mkdir( __buf__, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) )
+			fprintf( stderr, "SScoringFacility::SFindDialog::save_pattern(): mkdir('%s') failed\n", __buf__);
+		snprintf_buf( "%s/.patterns/%s", _p._p.ED->session_dir().c_str(), label);
+	} else {
+		string j_dir = _p._p.ED->subject_dir( _p.csubject());
+		snprintf_buf( "%s/.patterns", j_dir.c_str());
+		if ( mkdir( __buf__, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) )
+			fprintf( stderr, "SScoringFacility::SFindDialog::save_pattern(): mkdir('%s') failed\n", __buf__);
+		snprintf_buf( "%s/.patterns/%s", j_dir.c_str(), label);
+	}
+	FILE *fd = fopen( __buf__, "w");
+	if ( fd ) {
+		fprintf( fd,
+			 "%u  %u %g %g  %g %g %u  %g %g %g %g\n"
+			 "%zu  %zu %zu %zu\n"
+			 "--DATA--\n",
+			 Pp.env_tightness, Pp.bwf_order, Pp.bwf_ffrom, Pp.bwf_fupto,
+			 Pp.dzcdf_step, Pp.dzcdf_sigma, Pp.dzcdf_smooth,
+			 get<0>(criteria), get<1>(criteria), get<2>(criteria), get<3>(criteria),
+			 samplerate, thing.size(), context_before, context_after);
+		for ( size_t i = 0; i < thing.size(); ++i )
+			fprintf( fd, "%a\n", (double)thing[i]);
+		fclose( fd);
+	}
+}
+
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+discard_pattern( const char *label, bool do_globally)
+{
+	if ( do_globally ) {
+		snprintf_buf( "%s/.patterns/%s", _p._p.ED->session_dir().c_str(), label);
+	} else {
+		string j_dir = _p._p.ED->subject_dir( _p.csubject());
+		snprintf_buf( "%s/.patterns/%s", j_dir.c_str(), label);
+	}
+	unlink( __buf__);
+	enumerate_patterns_to_combo();
+}
+
+
+
+
+inline namespace {
+int
+scandir_filter( const struct dirent *e)
+{
+	return strcmp( e->d_name, ".") && strcmp( e->d_name, "..");
+}
+const char
+	*globally_marker = "[global] ";
+}
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+enumerate_patterns_to_combo()
+{
+	g_signal_handler_block( _p.ePatternList, _p.ePatternList_changed_cb_handler_id);
+	gtk_list_store_clear( _p.mPatterns);
+
+	GtkTreeIter iter;
+
+	struct dirent **eps;
+	int n;
+	snprintf_buf( "%s/.patterns", _p._p.ED->session_dir().c_str());
+	n = scandir( __buf__, &eps, scandir_filter, alphasort);
+//	printf( "n = %d in %s\n", n, __buf__);
+	if ( n >= 0 ) {
+		for ( int cnt = 0; cnt < n; ++cnt ) {
+			snprintf_buf( "%s%s", globally_marker, eps[cnt]->d_name);
+			gtk_list_store_append( _p.mPatterns, &iter);
+			gtk_list_store_set( _p.mPatterns, &iter,
+					    0, __buf__,
+					    -1);
+			free( eps[cnt]);
+		}
+		free( (void*)eps);
+	}
+	string j_dir = _p._p.ED->subject_dir( _p.csubject());
+	snprintf_buf( "%s/.patterns", j_dir.c_str());
+	n = scandir( __buf__, &eps, scandir_filter, alphasort);
+//	printf( "n = %d in %s\n", n, __buf__);
+	if ( n >= 0 ) {
+		for ( int cnt = 0; cnt < n; ++cnt ) {
+			gtk_list_store_append( _p.mPatterns, &iter);
+			gtk_list_store_set( _p.mPatterns, &iter,
+					    0, eps[cnt]->d_name,
+					    -1);
+			free( eps[cnt]);
+		}
+		free( (void*)eps);
+	}
+	gtk_combo_box_set_active_iter( _p.ePatternList, NULL);
+	g_signal_handler_unblock( _p.ePatternList, _p.ePatternList_changed_cb_handler_id);
+}
+
+
+
+
+
+void
+aghui::SScoringFacility::SFindDialog::
+preselect_entry( const char *label, bool do_globally)
+{
+	if ( label == NULL ) {
+		gtk_combo_box_set_active_iter( _p.ePatternList, NULL);
+		return;
+	}
+
+	GtkTreeIter iter;
+	gboolean valid;
+	valid = gtk_tree_model_get_iter_first( (GtkTreeModel*)_p.mPatterns, &iter);
+	while ( valid ) {
+		char *entry;
+		gtk_tree_model_get( (GtkTreeModel*)_p.mPatterns, &iter,
+				    0, &entry,
+				    -1);
+		if ( (!do_globally && strcmp( entry, label) == 0) ||
+		     (do_globally && (strlen( entry) > strlen( globally_marker) && strcmp( entry+strlen(globally_marker), label) == 0)) ) {
+			gtk_combo_box_set_active_iter( _p.ePatternList, &iter);
+			free( entry);
+			return;
+		}
+		free( entry);
+		valid = gtk_tree_model_iter_next( (GtkTreeModel*)_p.mPatterns, &iter);
+	}
+}
+
+
+// eof
diff --git a/src/ui/sf/sf-patterns.cc b/src/ui/sf/sf-patterns.cc
index 11fb626..57c6b96 100644
--- a/src/ui/sf/sf-patterns.cc
+++ b/src/ui/sf/sf-patterns.cc
@@ -10,10 +10,6 @@
  *         License:  GPL
  */
 
-#include <tuple>
-#include <dirent.h>
-#include <sys/stat.h>
-
 #include "ui/misc.hh"
 #include "sf.hh"
 
@@ -41,9 +37,6 @@ SFindDialog (SScoringFacility& parent)
 	W_V.reg( _p.ePatternParameterB, 	&get<1>(criteria));
 	W_V.reg( _p.ePatternParameterC, 	&get<2>(criteria));
 	W_V.reg( _p.ePatternParameterD, 	&get<3>(criteria));
-
-	gtk_widget_set_visible( (GtkWidget*)_p.daPatternField, FALSE);
-	gtk_widget_set_visible( (GtkWidget*)_p.bPatternSearch, TRUE);
 }
 
 aghui::SScoringFacility::SFindDialog::
@@ -92,8 +85,6 @@ search()
 		agh::alg::calibrate_display_scale(
 			field_channel->psd.course, _p.total_pages(),
 			da_field_ht);
-	gtk_widget_set_visible( (GtkWidget*)_p.daPatternField, TRUE);
-	gtk_widget_set_visible( (GtkWidget*)_p.bPatternSearch, FALSE);
 }
 
 
@@ -114,446 +105,33 @@ find_occurrences()
 
 
 
-void
-aghui::SScoringFacility::SFindDialog::
-set_pattern_da_width( int width)
-{
-	g_object_set( (GObject*)_p.daPatternSelection,
-		      "width-request", da_thing_wd = width,
-		      "height-request", da_thing_ht,
-		      NULL);
-	g_object_set( (GObject*)_p.vpPatternSelection,
-		      "width-request", min( width+5, 600),
-		      "height-request", da_thing_ht + 30,
-		      NULL);
-}
-
-void
-aghui::SScoringFacility::SFindDialog::
-set_field_da_width( int width)
-{
-	g_object_set( (GObject*)_p.daPatternField,
-		      "width-request", da_field_wd = width,
-		      "height-request", da_field_ht,
-		      NULL);
-	g_object_set( (GObject*)_p.vpPatternField,
-		      "width-request", min( width+5, 600),
-		      "height-request", da_thing_ht + 30,
-		      NULL);
-}
-
-
-
-void
-aghui::SScoringFacility::SFindDialog::
-draw_thing( cairo_t *cr)
-{
-	if ( thing.size() == 0 ) {
-		set_pattern_da_width( 200);
-		aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "(no selection)");
-		enable_controls( false);
-		return;
-	} else {
-		enable_controls( true);
-	}
-
-      // ticks
-	cairo_select_font_face( cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-	cairo_set_font_size( cr, 9);
-	double	seconds = (double)thing.size() / samplerate;
-	for ( size_t i8 = 0; (float)i8 / 8 < seconds; ++i8 ) {
-		_p._p.CwB[SExpDesignUI::TColour::sf_ticks].set_source_rgba( cr);
-		cairo_set_line_width( cr, (i8%8 == 0) ? 1. : (i8%4 == 0) ? .6 : .3);
-		guint x = (float)i8/8 / seconds * da_thing_wd;
-		cairo_move_to( cr, x, 0);
-		cairo_rel_line_to( cr, 0, da_thing_ht);
-		cairo_stroke( cr);
-
-		if ( i8 % 8 == 0 ) {
-			_p._p.CwB[SExpDesignUI::TColour::sf_labels].set_source_rgba( cr);
-			cairo_move_to( cr, x + 5, da_thing_ht-2);
-			snprintf_buf( "%g", (float)i8/8);
-			cairo_show_text( cr, __buf__);
-			cairo_stroke( cr);
-		}
-	}
-
-	size_t	run = pattern_size_essential();
-
-      // snippet
-	cairo_set_source_rgb( cr, 0., 0., 0.);
-	cairo_set_line_width( cr, .8);
-	aghui::cairo_draw_signal( cr, thing, 0, thing.size(),
-				  da_thing_wd, 0, da_thing_ht/3, thing_display_scale);
-	cairo_stroke( cr);
-
-	// lines marking out context
-	cairo_set_source_rgba( cr, 0.9, 0.9, 0.9, .5);
-	cairo_set_line_width( cr, 1.);
-	cairo_rectangle( cr, 0., 0., (float)context_before / thing.size() * da_thing_wd, da_thing_ht);
-	cairo_rectangle( cr, (float)(context_before + run) / thing.size() * da_thing_wd, 0,
-			 (float)(context_after) / thing.size() * da_thing_wd, da_thing_ht);
-	cairo_fill( cr);
-	cairo_stroke( cr);
-
-	if ( draw_details ) {
-		valarray<TFloat>
-			env_u, env_l,
-			course,
-			dzcdf;
-	      // envelope
-		{
-			if ( sigproc::envelope( {thing, samplerate}, Pp.env_tightness,
-						1./samplerate,
-						&env_l, &env_u) == 0 ) {
-				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Selection is too short");
-				enable_controls( false);
-				goto out;
-			}
-			enable_controls( true);
-
-			_p._p.CwB[SExpDesignUI::TColour::sf_selection].set_source_rgba_contrasting( cr, .3);
-			aghui::cairo_draw_signal( cr, env_u, 0, env_u.size(),
-						  da_thing_wd, 0, da_thing_ht/2, thing_display_scale);
-			aghui::cairo_draw_signal( cr, env_l, 0, env_l.size(),
-						  da_thing_wd, 0, da_thing_ht/2, thing_display_scale, 1,
-						  aghui::TDrawSignalDirection::backward, true);
-			cairo_close_path( cr);
-			cairo_fill( cr);
-			cairo_stroke( cr);
-		}
-
-	      // target frequency
-		{
-			if ( Pp.bwf_ffrom >= Pp.bwf_fupto ) {
-				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Bad band-pass range");
-				enable_controls( false);
-				goto out;
-			}
-			course = exstrom::band_pass(
-				thing, samplerate,
-				Pp.bwf_ffrom, Pp.bwf_fupto, Pp.bwf_order, true);
-
-			cairo_set_source_rgba( cr, 0.3, 0.3, 0.3, .5);
-			cairo_set_line_width( cr, 3.);
-			aghui::cairo_draw_signal( cr, course, 0, course.size(),
-						  da_thing_wd, 0, da_thing_ht/3, thing_display_scale);
-			cairo_stroke( cr);
-		}
-
-	      // dzcdf
-		{
-			if ( samplerate < 10 ) {
-				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Samplerate is too low");
-				enable_controls( false);
-				goto out;
-			}
-			if ( Pp.dzcdf_step * 10 > pattern_length() ) { // require at least 10 dzcdf points
-				aghui::cairo_put_banner( cr, da_thing_wd, da_thing_ht, "Selection is too short");
-				enable_controls( false);
-				goto out;
-			}
-			enable_controls( true);
-
-			dzcdf = sigproc::dzcdf( sigproc::SSignalRef<TFloat> {thing, samplerate},
-						Pp.dzcdf_step, Pp.dzcdf_sigma, Pp.dzcdf_smooth);
-			float	dzcdf_display_scale = da_thing_ht/4. / dzcdf.max();
-
-			cairo_set_source_rgba( cr, 0.3, 0.3, 0.99, .8);
-			cairo_set_line_width( cr, 1.);
-			aghui::cairo_draw_signal( cr, dzcdf, 0, dzcdf.size(),
-						  da_thing_wd, 0, da_thing_ht/2-5, dzcdf_display_scale);
-			cairo_stroke( cr);
-		}
-	}
-out:
-	;
-}
-
-void
-aghui::SScoringFacility::SFindDialog::
-draw_field( cairo_t *cr)
-{
-	aghui::cairo_draw_signal(
-		cr,
-		field_channel->psd.course, 0, field_channel->psd.course.size(),
-		da_field_wd, 0., da_field_ht/2, field_display_scale);
-
-}
-
-
-void
-aghui::SScoringFacility::SFindDialog::
-load_pattern( SScoringFacility::SChannel& field)
-{
-	// double check, possibly redundant after due check in callback
-	size_t	run = field.selection_end - field.selection_start;
-	if ( run == 0 )
-		return;
-
-	field_channel = &field;
-	context_before = (field.selection_start < context_pad)
-		? context_pad - field.selection_start
-		: context_pad;
-	context_after  = (field.selection_end + context_pad > field.n_samples())
-		? field.n_samples() - field.selection_end
-		: context_pad;
-	size_t	full_sample = context_before + run + context_after;
-
-	thing.resize( full_sample);
-	thing = field.signal_filtered[ slice (field.selection_start - context_before,
-						full_sample, 1) ];
-				// or _p.selection_*
-	samplerate = field.samplerate();
-	thing_display_scale = field.signal_display_scale;
-
-	set_pattern_da_width( full_sample / field.spp());
-
-	preselect_channel( field.name);
-	preselect_entry( NULL, 0);
-	gtk_label_set_markup( _p.lPatternSimilarity, "");
-
-	gtk_widget_queue_draw( (GtkWidget*)_p.daPatternSelection);
-}
-
-
-
-
-void
-aghui::SScoringFacility::SFindDialog::
-load_pattern( const char *label, bool do_globally)
-{
-	if ( do_globally ) {
-		snprintf_buf( "%s/.patterns/%s", _p._p.ED->session_dir().c_str(), label);
-	} else {
-		string j_dir = _p._p.ED->subject_dir( _p.csubject());
-		snprintf_buf( "%s/.patterns/%s", j_dir.c_str(), label);
-	}
-
-	FILE *fd = fopen( __buf__, "r");
-	if ( fd ) {
-		size_t	full_sample;
-		if ( fscanf( fd,
-			     (sizeof(TFloat) == sizeof(float))
-			     ?
-			     "%u  %u %lg %lg  %lg %lg %u "
-			     " %g %g %g %g\n"
-			     "%zu %zu %zu %zu\n"
-			     "--DATA--\n"
-			     :
-			     "%u  %u %lg %lg  %lg %lg %u "
-			     " %lg %lg %lg %lg\n"
-			     "%zu %zu %zu %zu\n"
-			     "--DATA--\n"
-			     ,
-			     &Pp.env_tightness,
-			     &Pp.bwf_order, &Pp.bwf_ffrom, &Pp.bwf_fupto,
-			     &Pp.dzcdf_step, &Pp.dzcdf_sigma, &Pp.dzcdf_smooth,
-			     &get<0>(criteria), &get<1>(criteria), &get<2>(criteria), &get<3>(criteria),
-			     &samplerate, &full_sample, &context_before, &context_after) == 14 ) {
-
-			thing.resize( full_sample);
-			for ( size_t i = 0; i < full_sample; ++i ) {
-				double d;
-				if ( fscanf( fd, "%la", &d) != 1 ) {
-					fprintf( stderr, "load_pattern(): short read at sample %zu from %s; "
-						 "Removing file\n", i, __buf__);
-					thing.resize( 0);
-					fclose( fd);
-					unlink( __buf__);
-					enumerate_patterns_to_combo();
-					return;
-				} else
-					thing[i] = d;
-			}
-
-			if ( samplerate != field_channel->samplerate() ) {
-				printf( "Loaded pattern has samplerate different from the current samplerate (%zu vs %zu); it will be resampled now.",
-					samplerate, field_channel->samplerate());
-				double fac = (double)field_channel->samplerate() / samplerate;
-				thing =
-					sigproc::resample( thing, 0, full_sample,
-							   fac * full_sample);
-				context_before *= fac;
-				context_after  *= fac;
-			}
-
-			thing_display_scale = field_channel->signal_display_scale;
-			W_V.up();
-
-			set_pattern_da_width( full_sample / field_channel->spp());
-
-		} else {
-			thing.resize( 0);
-			fprintf( stderr, "load_pattern(): corrupted %s; "
-				 "Removing file\n", __buf__);
-			thing.resize( 0);
-			unlink( __buf__);
-			enumerate_patterns_to_combo();
-		}
-
-		fclose( fd);
-
-	} else {
-		fprintf( stderr, "load_pattern(): failed to open %s; "
-			 "Removing file\n", __buf__);
-		unlink( __buf__);
-	}
-}
-
-
-
-
-void
-aghui::SScoringFacility::SFindDialog::
-save_pattern( const char *label, bool do_globally)
-{
-	if ( do_globally ) {
-		snprintf_buf( "%s/.patterns", _p._p.ED->session_dir().c_str());
-		if ( mkdir( __buf__, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) )
-			fprintf( stderr, "SScoringFacility::SFindDialog::save_pattern(): mkdir('%s') failed\n", __buf__);
-		snprintf_buf( "%s/.patterns/%s", _p._p.ED->session_dir().c_str(), label);
-	} else {
-		string j_dir = _p._p.ED->subject_dir( _p.csubject());
-		snprintf_buf( "%s/.patterns", j_dir.c_str());
-		if ( mkdir( __buf__, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) )
-			fprintf( stderr, "SScoringFacility::SFindDialog::save_pattern(): mkdir('%s') failed\n", __buf__);
-		snprintf_buf( "%s/.patterns/%s", j_dir.c_str(), label);
-	}
-	FILE *fd = fopen( __buf__, "w");
-	if ( fd ) {
-		fprintf( fd,
-			 "%u  %u %g %g  %g %g %u  %g %g %g %g\n"
-			 "%zu  %zu %zu %zu\n"
-			 "--DATA--\n",
-			 Pp.env_tightness, Pp.bwf_order, Pp.bwf_ffrom, Pp.bwf_fupto,
-			 Pp.dzcdf_step, Pp.dzcdf_sigma, Pp.dzcdf_smooth,
-			 get<0>(criteria), get<1>(criteria), get<2>(criteria), get<3>(criteria),
-			 samplerate, thing.size(), context_before, context_after);
-		for ( size_t i = 0; i < thing.size(); ++i )
-			fprintf( fd, "%a\n", (double)thing[i]);
-		fclose( fd);
-	}
-}
-
-
-
-void
-aghui::SScoringFacility::SFindDialog::
-discard_pattern( const char *label, bool do_globally)
-{
-	if ( do_globally ) {
-		snprintf_buf( "%s/.patterns/%s", _p._p.ED->session_dir().c_str(), label);
-	} else {
-		string j_dir = _p._p.ED->subject_dir( _p.csubject());
-		snprintf_buf( "%s/.patterns/%s", j_dir.c_str(), label);
-	}
-	unlink( __buf__);
-	enumerate_patterns_to_combo();
-}
-
-
-
-
 
 void
 aghui::SScoringFacility::SFindDialog::
-enable_controls( bool indeed)
+setup_controls_for_find()
 {
-	gtk_widget_set_sensitive( (GtkWidget*)_p.bPatternGotoNext, (gboolean)indeed);
-	gtk_widget_set_sensitive( (GtkWidget*)_p.bPatternGotoPrevious, (gboolean)indeed);
-	gtk_widget_set_sensitive( (GtkWidget*)_p.bPatternSave, (gboolean)indeed);
-	gtk_widget_set_sensitive( (GtkWidget*)_p.bPatternDiscard, (gboolean)indeed);
-}
-
-
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternSearchButton, TRUE);
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternPatternParameters, TRUE);
 
-
-
-
-inline namespace {
-int
-scandir_filter( const struct dirent *e)
-{
-	return strcmp( e->d_name, ".") && strcmp( e->d_name, "..");
+	gtk_widget_set_visible( (GtkWidget*)_p.swPatternField, FALSE);
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternCriteria, FALSE);
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternAgainButton, FALSE);
 }
-const char
-	*globally_marker = "[global] ";
-}
-
 
 void
 aghui::SScoringFacility::SFindDialog::
-enumerate_patterns_to_combo()
+setup_controls_for_tune()
 {
-	g_signal_handler_block( _p.ePatternList, _p.ePatternList_changed_cb_handler_id);
-	gtk_list_store_clear( _p.mPatterns);
-
-	GtkTreeIter iter;
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternSearchButton, FALSE);
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternPatternParameters, FALSE);
 
-	struct dirent **eps;
-	int n;
-	snprintf_buf( "%s/.patterns", _p._p.ED->session_dir().c_str());
-	n = scandir( __buf__, &eps, scandir_filter, alphasort);
-//	printf( "n = %d in %s\n", n, __buf__);
-	if ( n >= 0 ) {
-		for ( int cnt = 0; cnt < n; ++cnt ) {
-			snprintf_buf( "%s%s", globally_marker, eps[cnt]->d_name);
-			gtk_list_store_append( _p.mPatterns, &iter);
-			gtk_list_store_set( _p.mPatterns, &iter,
-					    0, __buf__,
-					    -1);
-			free( eps[cnt]);
-		}
-		free( (void*)eps);
-	}
-	string j_dir = _p._p.ED->subject_dir( _p.csubject());
-	snprintf_buf( "%s/.patterns", j_dir.c_str());
-	n = scandir( __buf__, &eps, scandir_filter, alphasort);
-//	printf( "n = %d in %s\n", n, __buf__);
-	if ( n >= 0 ) {
-		for ( int cnt = 0; cnt < n; ++cnt ) {
-			gtk_list_store_append( _p.mPatterns, &iter);
-			gtk_list_store_set( _p.mPatterns, &iter,
-					    0, eps[cnt]->d_name,
-					    -1);
-			free( eps[cnt]);
-		}
-		free( (void*)eps);
-	}
-	gtk_combo_box_set_active_iter( _p.ePatternList, NULL);
-	g_signal_handler_unblock( _p.ePatternList, _p.ePatternList_changed_cb_handler_id);
+	gtk_widget_set_visible( (GtkWidget*)_p.swPatternField, TRUE);
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternCriteria, TRUE);
+	gtk_widget_set_visible( (GtkWidget*)_p.cPatternAgainButton, TRUE);
 }
 
 
 
-void
-aghui::SScoringFacility::SFindDialog::
-preselect_entry( const char *label, bool do_globally)
-{
-	if ( label == NULL ) {
-		gtk_combo_box_set_active_iter( _p.ePatternList, NULL);
-		return;
-	}
-
-	GtkTreeIter iter;
-	gboolean valid;
-	valid = gtk_tree_model_get_iter_first( (GtkTreeModel*)_p.mPatterns, &iter);
-	while ( valid ) {
-		char *entry;
-		gtk_tree_model_get( (GtkTreeModel*)_p.mPatterns, &iter,
-				    0, &entry,
-				    -1);
-		if ( (!do_globally && strcmp( entry, label) == 0) ||
-		     (do_globally && (strlen( entry) > strlen( globally_marker) && strcmp( entry+strlen(globally_marker), label) == 0)) ) {
-			gtk_combo_box_set_active_iter( _p.ePatternList, &iter);
-			free( entry);
-			return;
-		}
-		free( entry);
-		valid = gtk_tree_model_iter_next( (GtkTreeModel*)_p.mPatterns, &iter);
-	}
-}
 
 void
 aghui::SScoringFacility::SFindDialog::
diff --git a/src/ui/sf/sf-patterns_cb.cc b/src/ui/sf/sf-patterns_cb.cc
index 0341712..10d4465 100644
--- a/src/ui/sf/sf-patterns_cb.cc
+++ b/src/ui/sf/sf-patterns_cb.cc
@@ -113,8 +113,17 @@ bPatternSearch_clicked_cb( GtkButton *button, gpointer userdata)
 	auto& SF = *(SScoringFacility*)userdata;
 	auto& FD = SF.find_dialog;
 
-	
+	FD.setup_controls_for_tune();
+}
 
+void
+bPatternAgain_clicked_cb( GtkButton *button, gpointer userdata)
+{
+	auto& SF = *(SScoringFacility*)userdata;
+	auto& FD = SF.find_dialog;
+
+	
+	FD.setup_controls_for_find();
 }
 
 void
@@ -285,6 +294,7 @@ wPattern_show_cb( GtkWidget *widget, gpointer userdata)
 		FD._p.using_channel = &FD._p.channels.front();
 	FD.field_channel = FD.field_channel_saved = FD._p.using_channel;
 	FD.samplerate = FD.field_channel->samplerate();
+
 	FD.preselect_channel( FD.field_channel->name);
 }
 
diff --git a/src/ui/sf/sf-widgets.hh b/src/ui/sf/sf-widgets.hh
index b44a95f..d5aa6ba 100644
--- a/src/ui/sf/sf-widgets.hh
+++ b/src/ui/sf/sf-widgets.hh
@@ -184,13 +184,18 @@ struct SScoringFacilityWidgets {
 		*ePatternChannel,
 		*ePatternList;
 	GtkScrolledWindow
-		*vpPatternSelection,
-		*vpPatternField;
+		*swPatternSelection,
+		*swPatternField;
+	GtkTable
+		*cPatternPatternParameters,
+		*cPatternCriteria,
+		*cPatternSearchButton,
+		*cPatternAgainButton;
 	GtkDrawingArea
 		*daPatternSelection,
 		*daPatternField;
 	GtkButton
-		*bPatternSearch,
+		*bPatternSearch, *bPatternAgain,
 		*bPatternGotoNext, *bPatternGotoPrevious,
 		*bPatternSave, *bPatternDiscard;
 	GtkSpinButton
@@ -202,6 +207,7 @@ struct SScoringFacilityWidgets {
 	GtkHBox
 		*cPatternLabelBox;
 	GtkLabel
+		*lPatternParametersBrief,
 		*lPatternSimilarity;
 	GtkDialog
 		*wPatternName;
diff --git a/src/ui/sf/sf.hh b/src/ui/sf/sf.hh
index 878dc20..6606414 100644
--- a/src/ui/sf/sf.hh
+++ b/src/ui/sf/sf.hh
@@ -557,7 +557,9 @@ class SScoringFacility
 		void enumerate_patterns_to_combo();
 		void preselect_entry( const char*, bool globally);
 		void preselect_channel( const char*);
-		void enable_controls( bool);
+
+		void setup_controls_for_find();
+		void setup_controls_for_tune();
 
 		static const int
 			da_thing_ht = 220,
diff --git a/src/ui/sf/sf_cb.cc b/src/ui/sf/sf_cb.cc
index 847996e..8a96d51 100644
--- a/src/ui/sf/sf_cb.cc
+++ b/src/ui/sf/sf_cb.cc
@@ -193,7 +193,8 @@ bSFShowFindDialog_toggled_cb( GtkToggleButton *togglebutton, gpointer userdata)
 {
 	auto& SF = *(SScoringFacility*)userdata;
 	if ( gtk_toggle_button_get_active( togglebutton) ) {
-		gtk_widget_show_all( (GtkWidget*)SF.wPattern);
+		SF.find_dialog.setup_controls_for_find();
+		gtk_widget_show( (GtkWidget*)SF.wPattern);
 	} else
 		gtk_widget_hide( (GtkWidget*)SF.wPattern);
 }
@@ -205,7 +206,7 @@ bSFShowPhaseDiffDialog_toggled_cb( GtkToggleButton *togglebutton, gpointer userd
 {
 	auto& SF = *(SScoringFacility*)userdata;
 	if ( gtk_toggle_button_get_active( togglebutton) ) {
-		gtk_widget_show_all( (GtkWidget*)SF.wSFPD);
+		gtk_widget_show( (GtkWidget*)SF.wSFPD);
 	} else
 		gtk_widget_hide( (GtkWidget*)SF.wSFPD);
 }
diff --git a/src/ui/sf/sf_cb.hh b/src/ui/sf/sf_cb.hh
index d456ebf..29fd518 100644
--- a/src/ui/sf/sf_cb.hh
+++ b/src/ui/sf/sf_cb.hh
@@ -156,6 +156,7 @@ gboolean daPatternField_scroll_event_cb( GtkWidget*, GdkEventScroll*, gpointer);
 gboolean daPatternSelection_draw_cb( GtkWidget*, cairo_t*, gpointer);
 gboolean daPatternSelection_scroll_event_cb( GtkWidget*, GdkEventScroll*, gpointer);
 void bPatternSearch_clicked_cb( GtkButton*, gpointer);
+void bPatternAgain_clicked_cb( GtkButton*, gpointer);
 void bPatternGoto_clicked_cb( GtkButton*, gpointer);
 void bPatternSave_clicked_cb( GtkButton*, gpointer);
 void bPatternDiscard_clicked_cb( GtkButton*, gpointer);

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list