[med-svn] [SCM] aghermann branch, master, updated. 4f7a3b774136ffffbaf9b05d90bd568347bc5461

andrei zavada johnhommer at gmail.com
Fri Nov 16 00:50:20 UTC 2012


The following commit has been merged in the master branch:
commit 1a02c9c0fee9cad41bc8dbac5f5d1f51c58dd37b
Author: andrei zavada <johnhommer at gmail.com>
Date:   Tue Oct 16 02:41:09 2012 +0300

    widgets for artifact detection

diff --git a/data/dialogs.glade.in b/data/dialogs.glade.in
index ee569d5..4efa03e 100644
--- a/data/dialogs.glade.in
+++ b/data/dialogs.glade.in
@@ -1483,6 +1483,177 @@ GPL-2+</property>
       <action-widget response="-7">button6</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkDialog" id="wGlobalArtifactDetection">
+    <property name="can_focus">False</property>
+    <property name="border_width">10</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="type_hint">dialog</property>
+    <signal name="close" handler="gtk_widget_hide" swapped="no"/>
+    <signal name="damage-event" handler="gtk_widget_hide_on_delete" swapped="no"/>
+    <signal name="response" handler="gtk_widget_hide" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox14">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkBox" id="box6">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkLabel" id="label24">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="ypad">8</property>
+                <property name="label" translatable="yes"><b><big>Global artifact detection</big></b></property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparator" id="separator8">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="padding">6</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="grid5">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin_top">5</property>
+                <property name="margin_bottom">5</property>
+                <property name="row_spacing">10</property>
+                <property name="column_spacing">5</property>
+                <child>
+                  <object class="GtkLabel" id="label25">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Profile to use:</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="eGlobalADKeepExisting">
+                    <property name="label" translatable="yes">_Keep existing artifacts</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">2</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="eGlobalADProfiles">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</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">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkSeparator" id="separator9">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area14">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button7">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="bGADApply">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button7</action-widget>
+      <action-widget response="-5">bGADApply</action-widget>
+    </action-widgets>
+  </object>
   <object class="GtkDialog" id="wMontageDefaults">
     <property name="can_focus">False</property>
     <property name="border_width">10</property>
@@ -1734,7 +1905,7 @@ GPL-2+</property>
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="bSubjectDetailsOK1">
+              <object class="GtkButton" id="bMDApply">
                 <property name="label">gtk-ok</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -1761,7 +1932,7 @@ GPL-2+</property>
     </child>
     <action-widgets>
       <action-widget response="-6">button5</action-widget>
-      <action-widget response="-5">bSubjectDetailsOK1</action-widget>
+      <action-widget response="-5">bMDApply</action-widget>
     </action-widgets>
   </object>
   <object class="GtkDialog" id="wScanLog">
diff --git a/data/main.glade b/data/main.glade
index d8c935b..2324b22 100644
--- a/data/main.glade
+++ b/data/main.glade
@@ -658,83 +658,91 @@ rm */*/*/.*.{psd,mc}</property>
                                       <object class="GtkMenuItem" id="menuitem9">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="label" translatable="yes">_Basic sleep analysis</property>
+                                        <property name="label" translatable="yes">_Global operations</property>
                                         <property name="use_underline">True</property>
                                         <child type="submenu">
                                           <object class="GtkMenu" id="menu1">
                                             <property name="visible">True</property>
                                             <property name="can_focus">False</property>
                                             <child>
-                                              <object class="GtkMenuItem" id="iExpBasicSADetectUltradianCycles">
-                                                <property name="visible">True</property>
-                                                <property name="can_focus">False</property>
-                                                <property name="label" translatable="yes">Detect NREM-REM cycle</property>
-                                                <property name="use_underline">True</property>
-                                              </object>
-                                            </child>
-                                          </object>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkMenuItem" id="menuitem5">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="valign">center</property>
-                                        <property name="label" translatable="yes">_Montage</property>
-                                        <property name="use_underline">True</property>
-                                        <child type="submenu">
-                                          <object class="GtkMenu" id="menu2">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <child>
-                                              <object class="GtkMenuItem" id="iMontageSetDefaults">
+                                              <object class="GtkMenuItem" id="iExpGloballyDetectArtifacts">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
-                                                <property name="label" translatable="yes">Set _defaults...</property>
+                                                <property name="label" translatable="yes">Detect _artifacts...</property>
                                                 <property name="use_underline">True</property>
                                               </object>
                                             </child>
                                             <child>
-                                              <object class="GtkMenuItem" id="iMontageResetAll">
+                                              <object class="GtkMenuItem" id="iExpBasicSADetectUltradianCycles">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
-                                                <property name="label" translatable="yes">_Reset all</property>
+                                                <property name="label" translatable="yes">Detect NREM-REM _cycle</property>
                                                 <property name="use_underline">True</property>
                                               </object>
                                             </child>
                                             <child>
-                                              <object class="GtkMenuItem" id="iMontageApplyNotchFilter">
+                                              <object class="GtkMenuItem" id="menuitem5">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
-                                                <property name="label" translatable="yes">Global notch _filter</property>
+                                                <property name="valign">center</property>
+                                                <property name="label" translatable="yes">_Montage</property>
                                                 <property name="use_underline">True</property>
                                                 <child type="submenu">
-                                                  <object class="GtkMenu" id="menu3">
+                                                  <object class="GtkMenu" id="menu2">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                     <child>
-                                                      <object class="GtkMenuItem" id="iMontageNotchNone">
+                                                      <object class="GtkMenuItem" id="iMontageSetDefaults">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
-                                                        <property name="label" translatable="yes">_None</property>
+                                                        <property name="label" translatable="yes">Set _defaults...</property>
                                                         <property name="use_underline">True</property>
                                                       </object>
                                                     </child>
                                                     <child>
-                                                      <object class="GtkMenuItem" id="iMontageNotch50Hz">
+                                                      <object class="GtkMenuItem" id="iMontageResetAll">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
-                                                        <property name="label" translatable="yes">At _50 Hz</property>
+                                                        <property name="label" translatable="yes">_Reset all</property>
                                                         <property name="use_underline">True</property>
                                                       </object>
                                                     </child>
                                                     <child>
-                                                      <object class="GtkMenuItem" id="iMontageNotch60Hz">
+                                                      <object class="GtkMenuItem" id="iMontageApplyNotchFilter">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
-                                                        <property name="label" translatable="yes">At _60 Hz</property>
+                                                        <property name="label" translatable="yes">Global notch _filter</property>
                                                         <property name="use_underline">True</property>
+                                                        <child type="submenu">
+                                                          <object class="GtkMenu" id="menu3">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <object class="GtkMenuItem" id="iMontageNotchNone">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">_None</property>
+                                                            <property name="use_underline">True</property>
+                                                            </object>
+                                                            </child>
+                                                            <child>
+                                                            <object class="GtkMenuItem" id="iMontageNotch50Hz">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">At _50 Hz</property>
+                                                            <property name="use_underline">True</property>
+                                                            </object>
+                                                            </child>
+                                                            <child>
+                                                            <object class="GtkMenuItem" id="iMontageNotch60Hz">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">At _60 Hz</property>
+                                                            <property name="use_underline">True</property>
+                                                            </object>
+                                                            </child>
+                                                          </object>
+                                                        </child>
                                                       </object>
                                                     </child>
                                                   </object>
@@ -6672,6 +6680,12 @@ EEG microcontinuity algorithm. Read more <a href="http://johnhommer.com/acade
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </object>
                         </child>
                         <child>
diff --git a/data/sf.glade b/data/sf.glade
index eb07b4c..49696a0 100644
--- a/data/sf.glade
+++ b/data/sf.glade
@@ -1,6 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkMenu" id="iiSFAccept">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="iSFAcceptAndTakeNext">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Accept and proceed to next episode</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
   <object class="GtkAdjustment" id="jHighPassCutoff">
     <property name="upper">100</property>
     <property name="step_increment">0.25</property>
@@ -266,18 +278,6 @@
       </row>
     </data>
   </object>
-  <object class="GtkMenu" id="mSFAccept">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <child>
-      <object class="GtkMenuItem" id="iSFAcceptAndTakeNext">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">_Accept and proceed to next episode</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-  </object>
   <object class="GtkMenu" id="mSFAnnotationsToRemove">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -2832,15 +2832,15 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="bScoreWake">
-                        <property name="label" translatable="yes">☺</property>
+                      <object class="GtkButton" id="bScoreClear">
+                        <property name="label" translatable="yes">⌫</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
-                        <property name="tooltip_markup" translatable="yes">Wake (<b>w</b>)</property>
+                        <property name="tooltip_markup" translatable="yes">Clear (<b>q</b>)</property>
                         <property name="valign">center</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="w" signal="activate"/>
+                        <accelerator key="q" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -2849,15 +2849,15 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="bScoreClear">
-                        <property name="label" translatable="yes">⌫</property>
+                      <object class="GtkButton" id="bScoreWake">
+                        <property name="label" translatable="yes">☺</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
-                        <property name="tooltip_markup" translatable="yes">Clear (<b>q</b>)</property>
+                        <property name="tooltip_markup" translatable="yes">Wake (<b>w</b>)</property>
                         <property name="valign">center</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="q" signal="activate"/>
+                        <accelerator key="w" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -3092,17 +3092,18 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkToggleButton" id="bSFShowPhaseDiffDialog">
-                        <property name="label" translatable="yes">Δφ</property>
+                      <object class="GtkToggleButton" id="bSFShowFindDialog">
+                        <property name="label" translatable="yes">_Find</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup" translatable="yes">Interchannel signal shift (<b>F4</b>)</property>
-                        <property name="tooltip_text" translatable="yes">Interchannel signal shift (F4)</property>
+                        <property name="tooltip_markup" translatable="yes">Find/manage patterns (<b>F3</b>)</property>
+                        <property name="tooltip_text" translatable="yes">Find/manage patterns (F3)</property>
                         <property name="valign">center</property>
+                        <property name="use_underline">True</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="F4" signal="activate"/>
+                        <accelerator key="F3" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -3112,18 +3113,17 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkToggleButton" id="bSFShowFindDialog">
-                        <property name="label" translatable="yes">_Find</property>
+                      <object class="GtkToggleButton" id="bSFShowPhaseDiffDialog">
+                        <property name="label" translatable="yes">Δφ</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup" translatable="yes">Find/manage patterns (<b>F3</b>)</property>
-                        <property name="tooltip_text" translatable="yes">Find/manage patterns (F3)</property>
+                        <property name="tooltip_markup" translatable="yes">Interchannel signal shift (<b>F4</b>)</property>
+                        <property name="tooltip_text" translatable="yes">Interchannel signal shift (F4)</property>
                         <property name="valign">center</property>
-                        <property name="use_underline">True</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="F3" signal="activate"/>
+                        <accelerator key="F4" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -3911,7 +3911,7 @@ skew:	𝑔(𝑢) = 𝑢2</property>
       </object>
     </child>
   </object>
-  <object class="GtkDialog" id="wSFArtifactDetectionSetup">
+  <object class="GtkDialog" id="wSFArtifactDetection">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
     <property name="title" translatable="yes">Artifact Autodetect</property>
diff --git a/src/ui/expdesign-construct.cc b/src/ui/expdesign-construct.cc
index 542d9a3..d26d576 100644
--- a/src/ui/expdesign-construct.cc
+++ b/src/ui/expdesign-construct.cc
@@ -51,7 +51,7 @@ SExpDesignUIWidgets ()
 				    G_TYPE_STRING, // channel
 				    G_TYPE_STRING, // label
 				    G_TYPE_BOOLEAN, G_TYPE_POINTER);
-	mGlobalArtifactDetectionProfiles =
+	mGlobalADProfiles =
 		gtk_list_store_new( 1, G_TYPE_STRING);
 	mSimulations =
 		gtk_tree_store_new( 16,
@@ -88,6 +88,7 @@ SExpDesignUIWidgets ()
 	     !AGH_GBGETOBJ (GtkMenuItem,	iExpPurgeComputed) ||
 	     !AGH_GBGETOBJ (GtkMenuItem,	iExpAnnotations) ||
 	     !AGH_GBGETOBJ (GtkMenuItem,	iExpBasicSADetectUltradianCycles) ||
+	     !AGH_GBGETOBJ (GtkMenuItem,	iExpGloballyDetectArtifacts) ||
 	     !AGH_GBGETOBJ (GtkMenuItem,	iExpClose) ||
 	     !AGH_GBGETOBJ (GtkMenuItem,	iExpQuit) ||
 	     !AGH_GBGETOBJ (GtkMenuItem,	iMontageSetDefaults) ||
@@ -114,6 +115,9 @@ SExpDesignUIWidgets ()
 	g_signal_connect( iExpBasicSADetectUltradianCycles, "activate",
 			  (GCallback)iExpBasicSADetectUltradianCycles_activate_cb,
 			  this);
+	g_signal_connect( iExpGloballyDetectArtifacts, "activate",
+			  (GCallback)iExpGloballyDetectArtifacts_activate_cb,
+			  this);
 	g_signal_connect( iExpQuit, "activate",
 			  (GCallback)iExpQuit_activate_cb,
 			  this);
@@ -200,20 +204,18 @@ SExpDesignUIWidgets ()
 				     gtk_tree_view_column_new());
 
 	// artifact detection profiles
-	gtk_combo_box_set_model( e,
-				 (GtkTreeModel*)mSessions);
-	gtk_combo_box_set_id_column( eMsmtSession, 0);
+	if ( !AGH_GBGETOBJ (GtkDialog,		wGlobalArtifactDetection) ||
+	     !AGH_GBGETOBJ (GtkComboBox,	eGlobalADProfiles) )
+		throw runtime_error ("Failed to construct widgets");
+	gtk_combo_box_set_model( eGlobalADProfiles,
+				 (GtkTreeModel*)mGlobalADProfiles);
+	gtk_combo_box_set_id_column( eGlobalADProfiles, 0);
 
-	eMsmtSession_changed_cb_handler_id =
-		g_signal_connect( eMsmtSession, "changed",
-				  (GCallback)eMsmtSession_changed_cb,
-				  this);
 	renderer = gtk_cell_renderer_text_new();
-	gtk_cell_layout_pack_start( (GtkCellLayout*)eMsmtSession, renderer, FALSE);
-	gtk_cell_layout_set_attributes( (GtkCellLayout*)eMsmtSession, renderer,
+	gtk_cell_layout_pack_start( (GtkCellLayout*)eGlobalADProfiles, renderer, FALSE);
+	gtk_cell_layout_set_attributes( (GtkCellLayout*)eGlobalADProfiles, renderer,
 					"text", 0,
 					NULL);
-	
 
      // --------- tabs
 	if ( !AGH_GBGETOBJ (GtkNotebook,	tTaskSelector) ||
@@ -773,7 +775,7 @@ aghui::SExpDesignUIWidgets::
 	g_object_unref( (GObject*)mAllChannels);
 	g_object_unref( (GObject*)mSessions);
 	g_object_unref( (GObject*)mGlobalAnnotations);
-	g_object_unref( (GObject*)mGlobalArtifactDetectionProfiles);
+	g_object_unref( (GObject*)mGlobalADProfiles);
 	g_object_unref( (GObject*)mSimulations);
 
 	g_object_unref( (GObject*)mScoringPageSize);
diff --git a/src/ui/expdesign-widgets.hh b/src/ui/expdesign-widgets.hh
index 8d1a54c..870c498 100644
--- a/src/ui/expdesign-widgets.hh
+++ b/src/ui/expdesign-widgets.hh
@@ -44,10 +44,10 @@ struct SExpDesignUIWidgets {
 	GtkListStore
 		*mSessions,
 		*mEEGChannels,
-		*mAllChannels;
+		*mAllChannels,
+		*mGlobalADProfiles;
 	GtkTreeStore
 		*mGlobalAnnotations,
-		*mGlobalArtifactDetectionProfiles,
 		*mSimulations;
 
 	gulong 	wMainWindow_delete_event_cb_handler_id,
@@ -92,6 +92,7 @@ struct SExpDesignUIWidgets {
 	GtkMenuItem
 		*iExpRefresh, *iExpPurgeComputed, *iExpAnnotations, *iExpClose, *iExpQuit,
 		*iExpBasicSADetectUltradianCycles,
+		*iExpGloballyDetectArtifacts,
 		*iMontageSetDefaults,
 		*iMontageResetAll,
 		*iMontageNotchNone, *iMontageNotch50Hz, *iMontageNotch60Hz,
@@ -251,8 +252,6 @@ struct SExpDesignUIWidgets {
 		*lEdfImportCaption;
 	GtkTextView
 		*lEdfImportFileInfo;
-	// GtkTextBuffer
-	// 	*tEdfImportDetailsReport;
 	GtkButton
 		*bEdfImportAdmit,
 		*bEdfImportEdfhed,
@@ -302,6 +301,12 @@ struct SExpDesignUIWidgets {
 		*eMontageDefaultsShowEMG,
 		*eMontageDefaultsOverride;
 
+	// global artifact dtection
+	GtkDialog
+		*wGlobalArtifactDetection;
+	GtkComboBox
+		*eGlobalADProfiles;
+
       // colours
 	enum TColour {
 		night,		day,
diff --git a/src/ui/expdesign.hh b/src/ui/expdesign.hh
index 96f4dba..50f3f12 100644
--- a/src/ui/expdesign.hh
+++ b/src/ui/expdesign.hh
@@ -220,7 +220,7 @@ class SExpDesignUI
 		double	E, dmin, dmax;
 		size_t	sssu_hist_size,
 			smooth_side;
-		bool	estimate_e,
+		bool	estimate_E,
 			use_range;
 		SDetectArtifactsParamPack ()
 			: scope (4.),
@@ -229,7 +229,7 @@ class SExpDesignUI
 			  mc_gain (10.), iir_backpolate (.5),
 			  E (4.), dmin (-10), dmax (20),
 			  sssu_hist_size (100), smooth_side (0),
-			  estimate_e (true), use_range (false)
+			  estimate_E (true), use_range (false)
 			{}
 	};
 	map<string, SDetectArtifactsParamPack>
diff --git a/src/ui/expdesign_cb.cc b/src/ui/expdesign_cb.cc
index 5bf2faa..55fe7cf 100644
--- a/src/ui/expdesign_cb.cc
+++ b/src/ui/expdesign_cb.cc
@@ -152,6 +152,16 @@ iExpBasicSADetectUltradianCycles_activate_cb( GtkMenuItem*, gpointer userdata)
 	ED.ED->for_all_episodes( F, reporter, filter);
 }
 
+void
+iExpGloballyDetectArtifacts_activate_cb( GtkMenuItem*, gpointer userdata)
+{
+	auto& ED = *(SExpDesignUI*)userdata;
+
+	if ( GTK_RESPONSE_OK ==
+	     gtk_dialog_run( ED.wGlobalArtifactDetection) )
+		FAFA;
+}
+
 
 void
 iExpQuit_activate_cb( GtkMenuItem*, gpointer userdata)
diff --git a/src/ui/expdesign_cb.hh b/src/ui/expdesign_cb.hh
index 20f274b..24caebd 100644
--- a/src/ui/expdesign_cb.hh
+++ b/src/ui/expdesign_cb.hh
@@ -28,6 +28,7 @@ void iExpRefresh_activate_cb( GtkMenuItem*, gpointer);
 void iExpPurgeComputed_activate_cb( GtkMenuItem*, gpointer);
 void iExpAnnotations_activate_cb( GtkMenuItem*, gpointer);
 void iExpBasicSADetectUltradianCycles_activate_cb( GtkMenuItem*, gpointer);
+void iExpGloballyDetectArtifacts_activate_cb( GtkMenuItem*, gpointer);
 void iExpClose_activate_cb( GtkMenuItem*, gpointer);
 void iExpQuit_activate_cb( GtkMenuItem*, gpointer);
 void iMontageSetDefaults_activate_cb( GtkMenuItem*, gpointer);
diff --git a/src/ui/scoring-facility-artifacts.cc b/src/ui/scoring-facility-artifacts.cc
index d9bd18c..1e71771 100644
--- a/src/ui/scoring-facility-artifacts.cc
+++ b/src/ui/scoring-facility-artifacts.cc
@@ -30,7 +30,7 @@ SArtifactDetectionDialog (aghui::SScoringFacility& p_)
 	W_V.reg( _p.eSFADBandwidth,	&P.bandwidth);
 	W_V.reg( _p.eSFADMCGain,	&P.mc_gain);
 	W_V.reg( _p.eSFADBackpolate,	&P.iir_backpolate);
-	W_V.reg( _p.eSFADEstimateE,	&P.estimate_e);
+	W_V.reg( _p.eSFADEstimateE,	&P.estimate_E);
 	W_V.reg( _p.eSFADEValue,	&P.E);
 	W_V.reg( _p.eSFADHistRangeMin,	&P.dmin);
 	W_V.reg( _p.eSFADHistRangeMax,	&P.dmax);
@@ -45,7 +45,7 @@ SArtifactDetectionDialog (aghui::SScoringFacility& p_)
 aghui::SScoringFacility::SArtifactDetectionDialog::
 ~SArtifactDetectionDialog ()
 {
-	gtk_widget_destroy( (GtkWidget*)_p.wSFArtifactDetectionSetup);
+	gtk_widget_destroy( (GtkWidget*)_p.wSFArtifactDetection);
 }
 
 // eof
diff --git a/src/ui/scoring-facility-artifacts_cb.cc b/src/ui/scoring-facility-artifacts_cb.cc
index 2797191..29d770a 100644
--- a/src/ui/scoring-facility-artifacts_cb.cc
+++ b/src/ui/scoring-facility-artifacts_cb.cc
@@ -86,7 +86,7 @@ bSFADApply_clicked_cb( GtkButton*, gpointer userdata)
 	auto& SF = *(SScoringFacility*)userdata;
 	auto& AD = SF.artifact_detection_dialog;
 
-	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetectionSetup);
+	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetection);
 
 	for ( auto& H : AD.channels_visible_backup )
 		H.first->hidden = H.second;
@@ -101,7 +101,7 @@ bSFADCancel_clicked_cb( GtkButton*, gpointer userdata)
 	auto& SF = *(SScoringFacility*)userdata;
 	auto& AD = SF.artifact_detection_dialog;
 
-	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetectionSetup);
+	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetection);
 
 	if ( gtk_toggle_button_get_active(SF.bSFADPreview) ) {
 		SF.using_channel -> artifacts = AD.artifacts_backup;
@@ -128,7 +128,7 @@ bSFADPreview_toggled_cb( GtkToggleButton *b, gpointer userdata)
 		return;
 
 	if ( gtk_toggle_button_get_active(b) ) {
-		aghui::SBusyBlock bb (SF.wSFArtifactDetectionSetup);
+		aghui::SBusyBlock bb (SF.wSFArtifactDetection);
 		AD.artifacts_backup = SF.using_channel->artifacts;
 		SF.using_channel -> detect_artifacts( (AD.W_V.down(), AD.P));
 		gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, TRUE);
diff --git a/src/ui/scoring-facility-channel.cc b/src/ui/scoring-facility-channel.cc
index 4a9e1c6..7eb17e7 100644
--- a/src/ui/scoring-facility-channel.cc
+++ b/src/ui/scoring-facility-channel.cc
@@ -354,8 +354,9 @@ detect_artifacts( const aghui::SExpDesignUI::SDetectArtifactsParamPack& P)
 
 	sigproc::smooth( sssu_diff, P.smooth_side);
 
-	if ( !isfinite(P.E) )
-		P.E = P.use_range
+	double E;
+	if ( P.estimate_E )
+		E = P.use_range
 			? sigfile::CBinnedMC::estimate_E(
 				sssu_diff,
 				P.sssu_hist_size,
@@ -363,12 +364,14 @@ detect_artifacts( const aghui::SExpDesignUI::SDetectArtifactsParamPack& P)
 			: sigfile::CBinnedMC::estimate_E(
 				sssu_diff,
 				P.sssu_hist_size);
+	else
+		E = P.E;
 
 	auto marked =
 		sigfile::CBinnedMC::detect_artifacts(
 			sssu_diff,
 			P.upper_thr, P.lower_thr,
-			P.E);
+			E);
 	for ( size_t p = 0; p < marked.size(); ++p )
 		crecording.F().artifacts(_h).mark_artifact(
 			marked[p] * P.scope * samplerate(), (marked[p]+1) * P.scope * samplerate());
diff --git a/src/ui/scoring-facility-construct.cc b/src/ui/scoring-facility-construct.cc
index b3ce7e5..b6ca35d 100644
--- a/src/ui/scoring-facility-construct.cc
+++ b/src/ui/scoring-facility-construct.cc
@@ -33,6 +33,7 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 
 	GtkCellRenderer *renderer;
 
+	// general & montage page navigation
 	if ( !(AGH_GBGETOBJ (GtkWindow,		wScoringFacility)) ||
 	     !(AGH_GBGETOBJ (GtkLabel,		lSFHint)) ||
 	     !(AGH_GBGETOBJ (GtkListStore,	mScoringPageSize) ) ||
@@ -49,9 +50,77 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 
 	     !(AGH_GBGETOBJ (GtkButton,		bSFBack)) ||
 	     !(AGH_GBGETOBJ (GtkButton,		bSFForward)) ||
+	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoPrevUnscored)) ||
+	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoNextUnscored)) ||
+	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoPrevArtifact)) ||
+	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoNextArtifact)) ||
+
+	     !(AGH_GBGETOBJ (GtkToggleButton,	bSFShowFindDialog)) ||
+	     !(AGH_GBGETOBJ (GtkToggleButton,	bSFShowPhaseDiffDialog)) ||
+	     !(AGH_GBGETOBJ (GtkToggleButton,	bSFDrawCrosshair)) ||
+	     !(AGH_GBGETOBJ (GtkButton,		bSFRunICA)) )
+		throw runtime_error ("Failed to contruct SF widgets");
+
+	g_signal_connect( wScoringFacility, "delete-event",
+			  (GCallback)wScoringFacility_delete_event_cb,
+			  this);
+
+	gtk_combo_box_set_model( eSFPageSize,
+				 (GtkTreeModel*)mScoringPageSize);
+	gtk_combo_box_set_id_column( eSFPageSize, 0);
+
+	renderer = gtk_cell_renderer_text_new();
+	gtk_cell_layout_pack_start( (GtkCellLayout*)eSFPageSize, renderer, FALSE);
+	gtk_cell_layout_set_attributes( (GtkCellLayout*)eSFPageSize, renderer,
+					"text", 0,
+					NULL);
+
+	g_signal_connect( eSFPageSize, "changed",
+			  (GCallback)eSFPageSize_changed_cb,
+			  this);
+	g_signal_connect( eSFCurrentPage, "value-changed",
+			  (GCallback)eSFCurrentPage_value_changed_cb,
+			  this);
+
+	g_signal_connect( eSFCurrentPos, "clicked",
+			  (GCallback)eSFCurrentPos_clicked_cb,
+			  this);
+
+	g_signal_connect( bSFForward, "clicked",
+			  (GCallback)bSFForward_clicked_cb,
+			  this);
+	g_signal_connect( bSFBack, "clicked",
+			  (GCallback)bSFBack_clicked_cb,
+			  this);
+
+	g_signal_connect( bScoreGotoNextUnscored, "clicked",
+			  (GCallback)bScoreGotoNextUnscored_clicked_cb,
+			  this);
+	g_signal_connect( bScoreGotoPrevUnscored, "clicked",
+			  (GCallback)bScoreGotoPrevUnscored_clicked_cb,
+			  this);
 
-	     // 1. scoring
-	     !(AGH_GBGETOBJ (GtkButton,		bScoreClear)) ||
+	g_signal_connect( bScoreGotoNextArtifact, "clicked",
+			  (GCallback)bScoreGotoNextArtifact_clicked_cb,
+			  this);
+	g_signal_connect( bScoreGotoPrevArtifact, "clicked",
+			  (GCallback)bScoreGotoPrevArtifact_clicked_cb,
+			  this);
+
+	g_signal_connect( bSFDrawCrosshair, "toggled",
+			  (GCallback)bSFDrawCrosshair_toggled_cb,
+			  this);
+	g_signal_connect( bSFShowFindDialog, "toggled",
+			  (GCallback)bSFShowFindDialog_toggled_cb,
+			  this);
+	g_signal_connect( bSFShowPhaseDiffDialog, "toggled",
+			  (GCallback)bSFShowPhaseDiffDialog_toggled_cb,
+			  this);
+	g_signal_connect( bSFRunICA, "clicked",
+			  (GCallback)bSFRunICA_clicked_cb,
+			  this);
+
+	if ( !(AGH_GBGETOBJ (GtkButton,		bScoreClear)) ||
 	     !(AGH_GBGETOBJ (GtkButton,		bScoreNREM1)) ||
 	     !(AGH_GBGETOBJ (GtkButton,		bScoreNREM2)) ||
 	     !(AGH_GBGETOBJ (GtkButton,		bScoreNREM3)) ||
@@ -62,20 +131,87 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 	     !(AGH_GBGETOBJ (GtkLabel,		lSFPercentScored)) ||
 	     !(AGH_GBGETOBJ (GtkLabel,		lScoreStatsNREMPercent)) ||
 	     !(AGH_GBGETOBJ (GtkLabel,		lScoreStatsREMPercent)) ||
-	     !(AGH_GBGETOBJ (GtkLabel,		lScoreStatsWakePercent)) ||
+	     !(AGH_GBGETOBJ (GtkLabel,		lScoreStatsWakePercent)) )
+		throw runtime_error ("Failed to contruct SF widgets");
 
-	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoPrevUnscored)) ||
-	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoNextUnscored)) ||
-	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoPrevArtifact)) ||
-	     !(AGH_GBGETOBJ (GtkButton,		bScoreGotoNextArtifact)) ||
+	g_signal_connect( bScoreClear, "clicked",
+			  (GCallback)bScoreClear_clicked_cb,
+			  this);
+	g_signal_connect( bScoreNREM1, "clicked",
+			  (GCallback)bScoreNREM1_clicked_cb,
+			  this);
+	g_signal_connect( bScoreNREM2, "clicked",
+			  (GCallback)bScoreNREM2_clicked_cb,
+			  this);
+	g_signal_connect( bScoreNREM3, "clicked",
+			  (GCallback)bScoreNREM3_clicked_cb,
+			  this);
+	g_signal_connect( bScoreNREM4, "clicked",
+			  (GCallback)bScoreNREM4_clicked_cb,
+			  this);
+	g_signal_connect( bScoreREM, "clicked",
+			  (GCallback)bScoreREM_clicked_cb,
+			  this);
+	g_signal_connect( bScoreWake, "clicked",
+			  (GCallback)bScoreWake_clicked_cb,
+			  this);
 
-	     !(AGH_GBGETOBJ (GtkToggleButton,	bSFShowFindDialog)) ||
-	     !(AGH_GBGETOBJ (GtkToggleButton,	bSFShowPhaseDiffDialog)) ||
-	     !(AGH_GBGETOBJ (GtkToggleButton,	bSFDrawCrosshair)) ||
-	     !(AGH_GBGETOBJ (GtkButton,		bSFRunICA)) ||
+	if ( !(AGH_GBGETOBJ (GtkDrawingArea,	daSFMontage)) ||
+	     !(AGH_GBGETOBJ (GtkDrawingArea,	daSFHypnogram)) ||
+	     !(AGH_GBGETOBJ (GtkMenuToolButton,	bSFAccept)) ||
+	     !(AGH_GBGETOBJ (GtkMenu,		iiSFAccept)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,	iSFAcceptAndTakeNext)) ||
+	     !(AGH_GBGETOBJ (GtkStatusbar,	sbSF)) )
+		throw runtime_error ("Failed to contruct SF widgets");
+
+	sbSFContextIdGeneral = gtk_statusbar_get_context_id( sbSF, "General context");
+
+	g_signal_connect( daSFMontage, "draw",
+			  (GCallback)daSFMontage_draw_cb,
+			  this);
+	g_signal_connect( daSFMontage, "configure-event",
+			  (GCallback)daSFMontage_configure_event_cb,
+			  this);
+	g_signal_connect( daSFMontage, "button-press-event",
+			  (GCallback)daSFMontage_button_press_event_cb,
+			  this);
+	g_signal_connect( daSFMontage, "button-release-event",
+			  (GCallback)daSFMontage_button_release_event_cb,
+			  this);
+	g_signal_connect( daSFMontage, "scroll-event",
+			  (GCallback)daSFMontage_scroll_event_cb,
+			  this);
+	g_signal_connect( daSFMontage, "motion-notify-event",
+			  (GCallback)daSFMontage_motion_notify_event_cb,
+			  this);
+	g_signal_connect( daSFMontage, "leave-notify-event",
+			  (GCallback)daSFMontage_leave_notify_event_cb,
+			  this);
 
-	     // 2. ICA
-	     !(AGH_GBGETOBJ (GtkComboBox,	eSFICARemixMode)) ||
+	g_signal_connect( daSFHypnogram, "draw",
+			  (GCallback)daSFHypnogram_draw_cb,
+			  this);
+	g_signal_connect( daSFHypnogram, "button-press-event",
+			  (GCallback)daSFHypnogram_button_press_event_cb,
+			  this);
+	g_signal_connect( daSFHypnogram, "button-release-event",
+			  (GCallback)daSFHypnogram_button_release_event_cb,
+			  this);
+	g_signal_connect( daSFHypnogram, "motion-notify-event",
+			  (GCallback)daSFHypnogram_motion_notify_event_cb,
+			  this);
+
+	gtk_menu_tool_button_set_menu( bSFAccept, (GtkWidget*)iiSFAccept);
+
+	g_signal_connect( bSFAccept, "clicked",
+			  (GCallback)bSFAccept_clicked_cb,
+			  this);
+	g_signal_connect( iSFAcceptAndTakeNext, "activate",
+			  (GCallback)iSFAcceptAndTakeNext_activate_cb,
+			  this);
+
+	// ICA
+	if ( !(AGH_GBGETOBJ (GtkComboBox,	eSFICARemixMode)) ||
 	     !(AGH_GBGETOBJ (GtkComboBox,	eSFICANonlinearity)) ||
 	     !(AGH_GBGETOBJ (GtkComboBox,	eSFICAApproach)) ||
 	     !(AGH_GBGETOBJ (GtkListStore,	mSFICARemixMode)) ||
@@ -101,26 +237,8 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 	     !(AGH_GBGETOBJ (GtkButton,		bSFICAApply)) ||
 	     !(AGH_GBGETOBJ (GtkButton,		bSFICACancel)) ||
 	     !(AGH_GBGETOBJ (GtkDialog,		wSFICAMatrix)) ||
-	     !(AGH_GBGETOBJ (GtkTextView,	tSFICAMatrix)) ||
-
-	     // rest
-	     !(AGH_GBGETOBJ (GtkDrawingArea,	daSFMontage)) ||
-	     !(AGH_GBGETOBJ (GtkDrawingArea,	daSFHypnogram)) ||
-
-	     !(AGH_GBGETOBJ (GtkMenuToolButton,	bSFAccept)) ||
-	     !(AGH_GBGETOBJ (GtkMenu,		mSFAccept)) ||
-	     !(AGH_GBGETOBJ (GtkStatusbar,	sbSF)) )
-		throw runtime_error ("Failed to contruct SF widgets (1)");
-
-	gtk_combo_box_set_model( eSFPageSize,
-				 (GtkTreeModel*)mScoringPageSize);
-	gtk_combo_box_set_id_column( eSFPageSize, 0);
-
-	renderer = gtk_cell_renderer_text_new();
-	gtk_cell_layout_pack_start( (GtkCellLayout*)eSFPageSize, renderer, FALSE);
-	gtk_cell_layout_set_attributes( (GtkCellLayout*)eSFPageSize, renderer,
-					"text", 0,
-					NULL);
+	     !(AGH_GBGETOBJ (GtkTextView,	tSFICAMatrix)) )
+		throw runtime_error ("Failed to contruct SF widgets");
 
 	gtk_combo_box_set_model( eSFICANonlinearity,
 				 (GtkTreeModel*)mSFICANonlinearity);
@@ -156,205 +274,6 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 		      "tabs", tabarray,
 		      NULL);
 
-	g_signal_connect( eSFCurrentPos, "clicked",
-			  (GCallback)eSFCurrentPos_clicked_cb,
-			  this);
-
-	sbSFContextIdGeneral = gtk_statusbar_get_context_id( sbSF, "General context");
-
-	// ------- menus
-	if ( !(AGH_GBGETOBJ (GtkLabel, 		lSFOverChannel)) ||
-	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPage)) ||
-	     !(AGH_GBGETOBJ (GtkMenu, 		mSFICAPage)) ||
-	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPageSelection)) ||
-	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPageAnnotation)) ||
-	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPageHidden)) ||
-	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPower)) ||
-	     !(AGH_GBGETOBJ (GtkMenu, 		mSFScore)) ||
-
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageShowOriginal)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageShowProcessed)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageUseResample)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageDrawZeroline)) ||
-	     !(AGH_GBGETOBJ (GtkSeparatorMenuItem,	iSFPageProfileItemsSeparator)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawPSDProfile)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawPSDSpectrum)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawMCProfile)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawEMGProfile)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageFilter)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSaveChannelAsSVG)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSaveMontageAsSVG)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageExportSignal)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageUseThisScale)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageDetectArtifacts)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageClearArtifacts)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageHide)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem, 		iSFPageHidden)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem, 		iSFPageSpaceEvenly)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem, 		iSFPageLocateSelection)) ||
-
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageAnnotationSeparator)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageAnnotationDelete)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageAnnotationEdit)) ||
-
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionMarkArtifact)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionClearArtifact)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionFindPattern)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionAnnotate)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageSelectionDrawCourse)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageSelectionDrawEnvelope)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageSelectionDrawDzxdf)) ||
-
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPowerExportRange)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPowerExportAll)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPowerSmooth)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPowerDrawBands)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPowerUseThisScale)) ||
-	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPowerAutoscale)) ||
-
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreAssist)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreImport)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreExport)) ||
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreClear)) ||
-
-	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFAcceptAndTakeNext)) )
-		throw runtime_error ("Failed to contruct SF widgets (2)");
-
-	gtk_menu_tool_button_set_menu( bSFAccept, (GtkWidget*)mSFAccept);
-
-	gtk_menu_item_set_submenu( iSFPageHidden, (GtkWidget*)mSFPageHidden);
-
-	// petty dialogs
-	if ( !(AGH_GBGETOBJ (GtkDialog,			wAnnotationLabel)) ||
-	     !(AGH_GBGETOBJ (GtkEntry,			eAnnotationLabel)) ||
-	     !(AGH_GBGETOBJ (GtkDialog,			wAnnotationSelector)) ||
-	     !(AGH_GBGETOBJ (GtkComboBox,		eAnnotationSelectorWhich)) ||
-
-	     !(AGH_GBGETOBJ (GtkDialog,			wSFArtifactDetectionSetup)) ||
-	     !(AGH_GBGETOBJ (GtkComboBox,		eSFADProfiles)) ||
-	     !(AGH_GBGETOBJ (GtkButton,			bSFADProfileSave)) ||
-	     !(AGH_GBGETOBJ (GtkButton,			bSFADProfileDelete)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADScope)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADUpperThr)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADLowerThr)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADF0)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADFc)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADBandwidth)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADMCGain)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADBackpolate)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADEValue)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADHistRangeMin)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADHistRangeMax)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADHistBins)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADSmoothSide)) ||
-	     !(AGH_GBGETOBJ (GtkCheckButton,		eSFADSingleChannelPreview)) ||
-	     !(AGH_GBGETOBJ (GtkCheckButton,		eSFADEstimateE)) ||
-	     !(AGH_GBGETOBJ (GtkRadioButton,		eSFADUseThisRange)) ||
-	     !(AGH_GBGETOBJ (GtkRadioButton,		eSFADUseComputedRange)) ||
-	     !(AGH_GBGETOBJ (GtkTable,			cSFADWhenEstimateEOn)) ||
-	     !(AGH_GBGETOBJ (GtkTable,			cSFADWhenEstimateEOff)) ||
-	     !(AGH_GBGETOBJ (GtkLabel,			lSFADInfo)) ||
-	     !(AGH_GBGETOBJ (GtkToggleButton,		bSFADPreview)) ||
-	     !(AGH_GBGETOBJ (GtkButton,			bSFADApply)) ||
-	     !(AGH_GBGETOBJ (GtkButton,			bSFADCancel)) )
-		throw runtime_error ("Failed to contruct SF widgets (3)");
-
-	mAnnotationsAtCursor = gtk_list_store_new(1, G_TYPE_STRING);
-	gtk_combo_box_set_model( eAnnotationSelectorWhich,
-				 (GtkTreeModel*)mAnnotationsAtCursor);
-	gtk_combo_box_set_id_column( eAnnotationSelectorWhich, 0);
-
-	renderer = gtk_cell_renderer_text_new();
-	gtk_cell_layout_pack_start( (GtkCellLayout*)eAnnotationSelectorWhich, renderer, FALSE);
-	gtk_cell_layout_set_attributes( (GtkCellLayout*)eAnnotationSelectorWhich, renderer,
-					"text", 0,
-					NULL);
-
-	mSFADProfiles = gtk_list_store_new(1, G_TYPE_STRING);
-	gtk_combo_box_set_model( eSFADProfiles,
-				 (GtkTreeModel*)mSFADProfiles);
-	gtk_combo_box_set_id_column( eSFADProfiles, 0);
-
-	renderer = gtk_cell_renderer_text_new();
-	gtk_cell_layout_pack_start( (GtkCellLayout*)eSFADProfiles, renderer, FALSE);
-	gtk_cell_layout_set_attributes( (GtkCellLayout*)eSFADProfiles, renderer,
-					"text", 0,
-					NULL);
-
-      // orient control widget callbacks
-	// g_signal_connect( wScoringFacility, "configure-event",
-	// 		  (GCallback)wScoringFacility_configure_event_cb,
-	// 		  this);
-
-	g_signal_connect( eSFPageSize, "changed",
-			  (GCallback)eSFPageSize_changed_cb,
-			  this);
-	g_signal_connect( eSFCurrentPage, "value-changed",
-			  (GCallback)eSFCurrentPage_value_changed_cb,
-			  this);
-
-	g_signal_connect( bScoreClear, "clicked",
-			  (GCallback)bScoreClear_clicked_cb,
-			  this);
-	g_signal_connect( bScoreNREM1, "clicked",
-			  (GCallback)bScoreNREM1_clicked_cb,
-			  this);
-	g_signal_connect( bScoreNREM2, "clicked",
-			  (GCallback)bScoreNREM2_clicked_cb,
-			  this);
-	g_signal_connect( bScoreNREM3, "clicked",
-			  (GCallback)bScoreNREM3_clicked_cb,
-			  this);
-	g_signal_connect( bScoreNREM4, "clicked",
-			  (GCallback)bScoreNREM4_clicked_cb,
-			  this);
-	g_signal_connect( bScoreREM, "clicked",
-			  (GCallback)bScoreREM_clicked_cb,
-			  this);
-	g_signal_connect( bScoreWake, "clicked",
-			  (GCallback)bScoreWake_clicked_cb,
-			  this);
-
-	g_signal_connect( bSFForward, "clicked",
-			  (GCallback)bSFForward_clicked_cb,
-			  this);
-	g_signal_connect( bSFBack, "clicked",
-			  (GCallback)bSFBack_clicked_cb,
-			  this);
-
-	g_signal_connect( bScoreGotoNextUnscored, "clicked",
-			  (GCallback)bScoreGotoNextUnscored_clicked_cb,
-			  this);
-	g_signal_connect( bScoreGotoPrevUnscored, "clicked",
-			  (GCallback)bScoreGotoPrevUnscored_clicked_cb,
-			  this);
-
-	g_signal_connect( bScoreGotoNextArtifact, "clicked",
-			  (GCallback)bScoreGotoNextArtifact_clicked_cb,
-			  this);
-	g_signal_connect( bScoreGotoPrevArtifact, "clicked",
-			  (GCallback)bScoreGotoPrevArtifact_clicked_cb,
-			  this);
-
-	g_signal_connect( bSFRunICA, "clicked",
-			  (GCallback)bSFRunICA_clicked_cb,
-			  this);
-	// g_signal_connect( bSFResetMontage, "clicked",
-	// 		  (GCallback)bSFResetMontage_clicked_cb,
-	// 		  this);
-
-
-	g_signal_connect( bSFDrawCrosshair, "toggled",
-			  (GCallback)bSFDrawCrosshair_toggled_cb,
-			  this);
-
-	g_signal_connect( bSFShowFindDialog, "toggled",
-			  (GCallback)bSFShowFindDialog_toggled_cb,
-			  this);
-	g_signal_connect( bSFShowPhaseDiffDialog, "toggled",
-			  (GCallback)bSFShowPhaseDiffDialog_toggled_cb,
-			  this);
-
 	g_signal_connect( eSFICARemixMode, "changed",
 			  (GCallback)eSFICARemixMode_changed_cb,
 			  this);
@@ -418,17 +337,63 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 			  (GCallback)bSFICACancel_clicked_cb,
 			  this);
 
+	// ------- menus
+	if ( !(AGH_GBGETOBJ (GtkLabel, 		lSFOverChannel)) ||
+	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPage)) ||
+	     !(AGH_GBGETOBJ (GtkMenu, 		mSFICAPage)) ||
+	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPageSelection)) ||
+	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPageAnnotation)) ||
+	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPageHidden)) ||
+	     !(AGH_GBGETOBJ (GtkMenu, 		mSFPower)) ||
+	     !(AGH_GBGETOBJ (GtkMenu, 		mSFScore)) ||
 
-	g_signal_connect( bSFAccept, "clicked",
-			  (GCallback)bSFAccept_clicked_cb,
-			  this);
-	g_signal_connect( iSFAcceptAndTakeNext, "activate",
-			  (GCallback)iSFAcceptAndTakeNext_activate_cb,
-			  this);
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageShowOriginal)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageShowProcessed)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageUseResample)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageDrawZeroline)) ||
+	     !(AGH_GBGETOBJ (GtkSeparatorMenuItem,	iSFPageProfileItemsSeparator)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawPSDProfile)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawPSDSpectrum)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawMCProfile)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem, 		iSFPageDrawEMGProfile)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageFilter)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSaveChannelAsSVG)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSaveMontageAsSVG)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageExportSignal)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageUseThisScale)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageDetectArtifacts)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageClearArtifacts)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageHide)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem, 		iSFPageHidden)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem, 		iSFPageSpaceEvenly)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem, 		iSFPageLocateSelection)) ||
 
-	g_signal_connect( wScoringFacility, "delete-event",
-			  (GCallback)wScoringFacility_delete_event_cb,
-			  this);
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageAnnotationSeparator)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageAnnotationDelete)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageAnnotationEdit)) ||
+
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionMarkArtifact)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionClearArtifact)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionFindPattern)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPageSelectionAnnotate)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageSelectionDrawCourse)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageSelectionDrawEnvelope)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPageSelectionDrawDzxdf)) ||
+
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPowerExportRange)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPowerExportAll)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPowerSmooth)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPowerDrawBands)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFPowerUseThisScale)) ||
+	     !(AGH_GBGETOBJ (GtkCheckMenuItem,		iSFPowerAutoscale)) ||
+
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreAssist)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreImport)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreExport)) ||
+	     !(AGH_GBGETOBJ (GtkMenuItem,		iSFScoreClear)) )
+		throw runtime_error ("Failed to contruct SF widgets");
+
+	gtk_menu_item_set_submenu( iSFPageHidden, (GtkWidget*)mSFPageHidden);
 
 	g_signal_connect( iSFPageShowOriginal, "toggled",
 			  (GCallback)iSFPageShowOriginal_toggled_cb,
@@ -519,7 +484,6 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 			  (GCallback)iSFPageDrawEMGProfile_toggled_cb,
 			  this);
 
-
 	g_signal_connect( iSFPowerExportRange, "activate",
 			  (GCallback)iSFPowerExportRange_activate_cb,
 			  this);
@@ -539,7 +503,6 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 			  (GCallback)iSFPowerAutoscale_toggled_cb,
 			  this);
 
-
 	g_signal_connect( iSFScoreAssist, "activate",
 			  (GCallback)iSFScoreAssist_activate_cb,
 			  this);
@@ -552,41 +515,66 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 	g_signal_connect( iSFScoreClear, "activate",
 			  (GCallback)iSFScoreClear_activate_cb,
 			  this);
+      // petty dialogs
+	// annotations
+	if ( !(AGH_GBGETOBJ (GtkDialog,			wAnnotationLabel)) ||
+	     !(AGH_GBGETOBJ (GtkEntry,			eAnnotationLabel)) ||
+	     !(AGH_GBGETOBJ (GtkDialog,			wAnnotationSelector)) ||
+	     !(AGH_GBGETOBJ (GtkComboBox,		eAnnotationSelectorWhich)) )
+		throw runtime_error ("Failed to construct widgets");
 
-	g_signal_connect( daSFMontage, "draw",
-			  (GCallback)daSFMontage_draw_cb,
-			  this);
-	g_signal_connect( daSFMontage, "configure-event",
-			  (GCallback)daSFMontage_configure_event_cb,
-			  this);
-	g_signal_connect( daSFMontage, "button-press-event",
-			  (GCallback)daSFMontage_button_press_event_cb,
-			  this);
-	g_signal_connect( daSFMontage, "button-release-event",
-			  (GCallback)daSFMontage_button_release_event_cb,
-			  this);
-	g_signal_connect( daSFMontage, "scroll-event",
-			  (GCallback)daSFMontage_scroll_event_cb,
-			  this);
-	g_signal_connect( daSFMontage, "motion-notify-event",
-			  (GCallback)daSFMontage_motion_notify_event_cb,
-			  this);
-	g_signal_connect( daSFMontage, "leave-notify-event",
-			  (GCallback)daSFMontage_leave_notify_event_cb,
-			  this);
+	mAnnotationsAtCursor = gtk_list_store_new(1, G_TYPE_STRING);
+	gtk_combo_box_set_model( eAnnotationSelectorWhich,
+				 (GtkTreeModel*)mAnnotationsAtCursor);
+	gtk_combo_box_set_id_column( eAnnotationSelectorWhich, 0);
 
-	g_signal_connect( daSFHypnogram, "draw",
-			  (GCallback)daSFHypnogram_draw_cb,
-			  this);
-	g_signal_connect( daSFHypnogram, "button-press-event",
-			  (GCallback)daSFHypnogram_button_press_event_cb,
-			  this);
-	g_signal_connect( daSFHypnogram, "button-release-event",
-			  (GCallback)daSFHypnogram_button_release_event_cb,
-			  this);
-	g_signal_connect( daSFHypnogram, "motion-notify-event",
-			  (GCallback)daSFHypnogram_motion_notify_event_cb,
-			  this);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_cell_layout_pack_start( (GtkCellLayout*)eAnnotationSelectorWhich, renderer, FALSE);
+	gtk_cell_layout_set_attributes( (GtkCellLayout*)eAnnotationSelectorWhich, renderer,
+					"text", 0,
+					NULL);
+	// artifact detection
+	if ( !(AGH_GBGETOBJ (GtkDialog,			wSFArtifactDetection)) ||
+	     !(AGH_GBGETOBJ (GtkComboBox,		eSFADProfiles)) ||
+	     !(AGH_GBGETOBJ (GtkButton,			bSFADProfileSave)) ||
+	     !(AGH_GBGETOBJ (GtkButton,			bSFADProfileDelete)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADScope)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADUpperThr)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADLowerThr)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADF0)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADFc)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADBandwidth)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADMCGain)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADBackpolate)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADEValue)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADHistRangeMin)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADHistRangeMax)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADHistBins)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,		eSFADSmoothSide)) ||
+	     !(AGH_GBGETOBJ (GtkCheckButton,		eSFADSingleChannelPreview)) ||
+	     !(AGH_GBGETOBJ (GtkCheckButton,		eSFADEstimateE)) ||
+	     !(AGH_GBGETOBJ (GtkRadioButton,		eSFADUseThisRange)) ||
+	     !(AGH_GBGETOBJ (GtkRadioButton,		eSFADUseComputedRange)) ||
+	     !(AGH_GBGETOBJ (GtkTable,			cSFADWhenEstimateEOn)) ||
+	     !(AGH_GBGETOBJ (GtkTable,			cSFADWhenEstimateEOff)) ||
+	     !(AGH_GBGETOBJ (GtkLabel,			lSFADInfo)) ||
+	     !(AGH_GBGETOBJ (GtkToggleButton,		bSFADPreview)) ||
+	     !(AGH_GBGETOBJ (GtkButton,			bSFADApply)) ||
+	     !(AGH_GBGETOBJ (GtkButton,			bSFADCancel)) )
+		throw runtime_error ("Failed to contruct SF widgets");
+
+	mSFADProfiles = gtk_list_store_new( 1, G_TYPE_STRING);
+	// this GtkListStore is populated from the same source, but something
+	// haunting GTK+ forbids reuse of _p.mGlobalArtifactDetectionProfiles
+	gtk_combo_box_set_model( eSFADProfiles,
+				 (GtkTreeModel*)mSFADProfiles);
+	gtk_combo_box_set_id_column( eSFADProfiles, 0);
+
+	renderer = gtk_cell_renderer_text_new();
+	gtk_cell_layout_pack_start( (GtkCellLayout*)eSFADProfiles, renderer, FALSE);
+	gtk_cell_layout_set_attributes( (GtkCellLayout*)eSFADProfiles, renderer,
+					"text", 0,
+					NULL);
 
 	g_signal_connect( eSFADProfiles, "changed",
 			  (GCallback)eSFADProfiles_changed_cb,
@@ -613,7 +601,9 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 			  (GCallback)bSFADCancel_clicked_cb,
 			  this);
 
-      // aghui::SScoringFacility::SFindDialog::
+
+
+      // find/manage patterns
 	mPatterns =
 		gtk_list_store_new( 1, G_TYPE_STRING);
 
@@ -641,7 +631,7 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 	     !AGH_GBGETOBJ (GtkDialog,		wPatternName) ||
 	     !AGH_GBGETOBJ (GtkEntry,		ePatternNameName) ||
 	     !AGH_GBGETOBJ (GtkCheckButton,	ePatternNameSaveGlobally) )
-		throw runtime_error ("Failed to contruct SF widgets (4)");
+		throw runtime_error ("Failed to contruct SF widgets");
 
 	gtk_combo_box_set_model( ePatternList,
 				 (GtkTreeModel*)mPatterns);
@@ -737,7 +727,7 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 	     !(AGH_GBGETOBJ (GtkComboBox,	eFilterNotchFilter)) ||
 	     !(AGH_GBGETOBJ (GtkListStore,	mFilterNotchFilter)) ||
 	     !(AGH_GBGETOBJ (GtkButton,		bFilterOK)) )
-		throw runtime_error ("Failed to contruct SF widgets (5)");
+		throw runtime_error ("Failed to contruct SF widgets");
 
 	gtk_combo_box_set_model( eFilterNotchFilter,
 				 (GtkTreeModel*)mFilterNotchFilter);
@@ -755,18 +745,15 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 			  (GCallback)eFilterLowPassCutoff_value_changed_cb,
 			  this);
 
-
-	// aghui::SScoringFacility::SPhasediffDialog::
-
       // ------- wPhaseDiff
-	if ( !(AGH_GBGETOBJ (GtkDialog, wSFPD)) ||
-	     !(AGH_GBGETOBJ (GtkDrawingArea, daSFPD)) ||
-	     !(AGH_GBGETOBJ (GtkComboBox, eSFPDChannelA)) ||
-	     !(AGH_GBGETOBJ (GtkComboBox, eSFPDChannelB)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton, eSFPDFreqFrom)) ||
-	     !(AGH_GBGETOBJ (GtkSpinButton, eSFPDBandwidth)) ||
-	     !(AGH_GBGETOBJ (GtkScaleButton, eSFPDSmooth)) )
-		throw runtime_error ("Failed to contruct SF widgets (6)");
+	if ( !(AGH_GBGETOBJ (GtkDialog,		wSFPD)) ||
+	     !(AGH_GBGETOBJ (GtkDrawingArea,	daSFPD)) ||
+	     !(AGH_GBGETOBJ (GtkComboBox,	eSFPDChannelA)) ||
+	     !(AGH_GBGETOBJ (GtkComboBox,	eSFPDChannelB)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,	eSFPDFreqFrom)) ||
+	     !(AGH_GBGETOBJ (GtkSpinButton,	eSFPDBandwidth)) ||
+	     !(AGH_GBGETOBJ (GtkScaleButton,	eSFPDSmooth)) )
+		throw runtime_error ("Failed to contruct SF widgets");
 
 	gtk_combo_box_set_model( eSFPDChannelA,
 				 (GtkTreeModel*)_p.mEEGChannels);
diff --git a/src/ui/scoring-facility-montage_cb.cc b/src/ui/scoring-facility-montage_cb.cc
index a81729e..a0fdca1 100644
--- a/src/ui/scoring-facility-montage_cb.cc
+++ b/src/ui/scoring-facility-montage_cb.cc
@@ -649,7 +649,7 @@ iSFPageDetectArtifacts_activate_cb( GtkMenuItem*, gpointer userdata)
 
 	snprintf_buf( "Artifact detection in channel %s", SF.using_channel->name);
 	gtk_label_set_text( SF.lSFADInfo, __buf__);
-	gtk_widget_show_all( (GtkWidget*)SF.wSFArtifactDetectionSetup);
+	gtk_widget_show_all( (GtkWidget*)SF.wSFArtifactDetection);
 }
 
 
diff --git a/src/ui/scoring-facility-widgets.hh b/src/ui/scoring-facility-widgets.hh
index 9c97a2c..64993b3 100644
--- a/src/ui/scoring-facility-widgets.hh
+++ b/src/ui/scoring-facility-widgets.hh
@@ -117,7 +117,7 @@ struct SScoringFacilityWidgets {
 	GtkMenuToolButton
 		*bSFAccept;
 	GtkMenu
-		*mSFAccept;
+		*iiSFAccept;
 
 	// montage area
 	GtkDrawingArea
@@ -236,21 +236,13 @@ struct SScoringFacilityWidgets {
 		eSFPDChannelA_changed_cb_handler_id,
 		eSFPDChannelB_changed_cb_handler_id;
 
-	// less important dialogs
+	// artifact detection dialog
 	GtkDialog
-		*wAnnotationLabel,
-		*wAnnotationSelector;
-	GtkEntry
-		*eAnnotationLabel;
-	GtkComboBox
-		*eAnnotationSelectorWhich;
-
-	GtkDialog
-		*wSFArtifactDetectionSetup;
-	GtkComboBox
-		*eSFADProfiles;
+		*wSFArtifactDetection;
 	GtkListStore
 		*mSFADProfiles;
+	GtkComboBox
+		*eSFADProfiles;
 	GtkButton
 		*bSFADProfileSave,
 		*bSFADProfileDelete;
@@ -285,6 +277,15 @@ struct SScoringFacilityWidgets {
 		*bSFADApply,
 		*bSFADCancel;
 
+	// less important dialogs
+	GtkDialog
+		*wAnnotationLabel,
+		*wAnnotationSelector;
+	GtkEntry
+		*eAnnotationLabel;
+	GtkComboBox
+		*eAnnotationSelectorWhich;
+
 };
 
 } // namespace aghui
diff --git a/src/ui/scoring-facility.hh b/src/ui/scoring-facility.hh
index adc5549..1393e7c 100644
--- a/src/ui/scoring-facility.hh
+++ b/src/ui/scoring-facility.hh
@@ -621,7 +621,7 @@ class SScoringFacility
 		SArtifactDetectionDialog (SScoringFacility&);
 	       ~SArtifactDetectionDialog ();
 
-		SChannel::SDetectArtifactsParamPack
+		SExpDesignUI::SDetectArtifactsParamPack
 			P;
 		sigfile::SArtifacts
 			artifacts_backup;

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list