The following commit has been merged in the master branch:
commit 1f1d1919870ffcf6ad6f64c7a8fc76003250aa8f
Author: andrei zavada <[email protected]>
Date:   Fri Jan 25 10:08:08 2013 +0000

    WIP

diff --git a/configure.ac b/configure.ac
index 17dc7bd..bce85b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,7 +206,7 @@ AC_OUTPUT([
        src/ui/sm/Makefile
        src/ui/mw/Makefile
        src/ui/sf/Makefile
-       src/ui/sf/dialogs/Makefile
+       src/ui/sf/d/Makefile
        src/ui/mf/Makefile
        src/tools/Makefile
        data/Makefile
diff --git a/src/ui/sf/d/artifacts-construct.cc 
b/src/ui/sf/d/artifacts-construct.cc
index cfa28ef..2170f25 100644
--- a/src/ui/sf/d/artifacts-construct.cc
+++ b/src/ui/sf/d/artifacts-construct.cc
@@ -62,6 +62,7 @@ SArtifactsDialogWidgets (SScoringFacility& _p)
        // haunting GTK+ forbids reuse of _p.mGlobalArtifactDetectionProfiles
        gtk_combo_box_set_model_properly( eSFADProfiles, mSFADProfiles);
 
+       G_CONNECT_1 (wSFAD, show);
        G_CONNECT_1 (wSFAD, close);
        G_CONNECT_2 (wSFAD, delete, event);
        eSFADProfiles_changed_cb_handler_id =
diff --git a/src/ui/sf/d/artifacts.cc b/src/ui/sf/d/artifacts.cc
index 60112bd..71de3a4 100644
--- a/src/ui/sf/d/artifacts.cc
+++ b/src/ui/sf/d/artifacts.cc
@@ -13,6 +13,15 @@
 
 using namespace std;
 
+aghui::SScoringFacility::SArtifactsDialog&
+aghui::SScoringFacility::
+artifacts_d()
+{
+       if ( not _artifacts_d )
+               _artifacts_d = new SArtifactsDialog(*this);
+       return *_artifacts_d;
+}
+
 
 aghui::SScoringFacility::SArtifactsDialog::
 SArtifactsDialog (aghui::SScoringFacility& p_)
diff --git a/src/ui/sf/d/artifacts.hh b/src/ui/sf/d/artifacts.hh
index b236b5f..3a695c6 100644
--- a/src/ui/sf/d/artifacts.hh
+++ b/src/ui/sf/d/artifacts.hh
@@ -114,6 +114,7 @@ struct SArtifactsDialogWidgets {
 extern "C" {
 gboolean wSFAD_delete_event_cb(GtkWidget*, GdkEvent*, gpointer);
 void wSFAD_close_cb(GtkWidget*, gpointer);
+void wSFAD_show_cb(GtkWidget*, gpointer);
 void eSFADProfiles_changed_cb( GtkComboBox*, gpointer);
 void bSFADProfileSave_clicked_cb( GtkButton*, gpointer);
 void bSFADProfileDelete_clicked_cb( GtkButton*, gpointer);
diff --git a/src/ui/sf/d/artifacts_cb.cc b/src/ui/sf/d/artifacts_cb.cc
index caba558..4229cc9 100644
--- a/src/ui/sf/d/artifacts_cb.cc
+++ b/src/ui/sf/d/artifacts_cb.cc
@@ -187,6 +187,34 @@ bSFADPreview_toggled_cb( GtkToggleButton *b, gpointer 
userdata)
 }
 
 
+
+void
+wSFAD_show_cb( GtkWidget*, gpointer userdata)
+{
+       auto& AD = *(SScoringFacility::SArtifactsDialog*)userdata;
+       auto& SF = AD._p;
+
+       AD.W_V.up();
+       SF.populate_mSFADProfiles();
+       g_signal_emit_by_name( AD.eSFADProfiles, "changed");
+
+       g_signal_emit_by_name( AD.eSFADEstimateE, "toggled");
+       g_signal_emit_by_name( AD.eSFADEstimateE, "toggled");
+       g_signal_emit_by_name( AD.eSFADUseThisRange, "toggled");
+       g_signal_emit_by_name( AD.eSFADUseThisRange, "toggled");
+
+       gtk_widget_set_sensitive( (GtkWidget*)AD.bSFADApply, FALSE);
+       AD.suppress_preview_handler = true;
+       gtk_toggle_button_set_active( AD.bSFADPreview, FALSE);
+       AD.suppress_preview_handler = false;
+
+       snprintf_buf( "Artifact detection in channel %s", 
SF.using_channel->name);
+       gtk_label_set_text( AD.lSFADInfo, __buf__);
+       snprintf_buf( "%4.2f%% marked", 
SF.using_channel->calculate_dirty_percent() * 100);
+       gtk_label_set_text( AD.lSFADDirtyPercent, __buf__);
+}
+
+
 gboolean
 wSFAD_delete_event_cb( GtkWidget*, GdkEvent*, gpointer userdata)
 {
diff --git a/src/ui/sf/d/filters.cc b/src/ui/sf/d/filters.cc
index 69e3fdf..e6b0b60 100644
--- a/src/ui/sf/d/filters.cc
+++ b/src/ui/sf/d/filters.cc
@@ -14,16 +14,25 @@
 
 using namespace std;
 
+
+aghui::SScoringFacility::SFiltersDialog&
+aghui::SScoringFacility::
+filters_d()
+{
+       if ( not _filters_d )
+               _filters_d = new SFiltersDialog(*this);
+       return *_filters_d;
+}
+
 aghui::SScoringFacility::SFiltersDialog::
-SFiltersDialog(SScoringFacility& p_)
-      : _p (p_)
+SFiltersDialog (SScoringFacility& p_)
+      : _p (parent)
 {
-       auto& H = *_p.using_channel;
-       W_V.reg( eSFFilterLowPassCutoff,  &H.filters.low_pass_cutoff);
-       W_V.reg( eSFFilterLowPassOrder,  (int*)&H.filters.low_pass_order);
-       W_V.reg( eSFFilterHighPassCutoff, &H.filters.high_pass_cutoff);
-       W_V.reg( eSFFilterHighPassOrder, (int*)&H.filters.high_pass_order);
-       W_V.reg( eSFFilterNotchFilter,   (int*)&H.filters.notch_filter);
+       W_V.reg( eSFFilterLowPassCutoff,  P.low_pass_cutoff);
+       W_V.reg( eSFFilterLowPassOrder,   P.low_pass_order);
+       W_V.reg( eSFFilterHighPassCutoff, P.high_pass_cutoff);
+       W_V.reg( eSFFilterHighPassOrder,  P.high_pass_order);
+       W_V.reg( eSFFilterNotchFilter,    (int*)&P.notch_filter);
 }
 
 aghui::SScoringFacility::SFiltersDialogWidgets::
diff --git a/src/ui/sf/d/filters.hh b/src/ui/sf/d/filters.hh
index 97b7c4a..ea18945 100644
--- a/src/ui/sf/d/filters.hh
+++ b/src/ui/sf/d/filters.hh
@@ -32,10 +32,11 @@ struct SScoringFacility::SFiltersDialog
 
        DELETE_DEFAULT_METHODS (SFiltersDialog);
 
-       SFiltersDialog (SScoringFacility& parent)
-               : _p (parent)
-               {}
-       ~SFiltersDialog ();
+       SFiltersDialog (SScoringFacility&);
+       ~SFiltersDialog ();
+
+       sigfile::SFilterPack&
+               P;
 
        SUIVarCollection
                W_V;
diff --git a/src/ui/sf/d/filters_cb.cc b/src/ui/sf/d/filters_cb.cc
index 6930f2c..b8f7c8e 100644
--- a/src/ui/sf/d/filters_cb.cc
+++ b/src/ui/sf/d/filters_cb.cc
@@ -1,6 +1,5 @@
-// ;-*-C++-*-
 /*
- *       File name:  ui/sf/sf-filter_cb.cc
+ *       File name:  ui/sf/d/filters_cb.cc
  *         Project:  Aghermann
  *          Author:  Andrei Zavada <[email protected]>
  * Initial version:  2012-06-25
@@ -12,8 +11,7 @@
 
 
 #include "ui/misc.hh"
-#include "sf.hh"
-#include "sf_cb.hh"
+#include "filters.hh"
 
 using namespace std;
 using namespace aghui;
@@ -21,7 +19,6 @@ using namespace aghui;
 
 extern "C" {
 
-
 void
 eSFFilterHighPassCutoff_value_changed_cb( GtkSpinButton *spinbutton, gpointer 
userdata)
 {
@@ -44,4 +41,6 @@ eSFFilterLowPassCutoff_value_changed_cb( GtkSpinButton 
*spinbutton, gpointer use
 } // extern "C"
 
 
-// eof
+// Local Variables:
+// indent-tabs-mode: 8
+// End:
diff --git a/src/ui/sf/d/patterns.cc b/src/ui/sf/d/patterns.cc
index 495d38a..a96ce5e 100644
--- a/src/ui/sf/d/patterns.cc
+++ b/src/ui/sf/d/patterns.cc
@@ -15,6 +15,14 @@
 
 using namespace std;
 
+aghui::SScoringFacility::SPatternsDialog&
+aghui::SScoringFacility::
+patterns_d()
+{
+       if ( not _patterns_d )
+               _patterns_d = new SPatternsDialog(*this);
+       return *_patterns_d;
+}
 
 aghui::SScoringFacility::SFindDialog::
 SFindDialog (SScoringFacility& parent)
diff --git a/src/ui/sf/d/phasediff.cc b/src/ui/sf/d/phasediff.cc
index 7a3b2bc..4eec6d5 100644
--- a/src/ui/sf/d/phasediff.cc
+++ b/src/ui/sf/d/phasediff.cc
@@ -16,6 +16,15 @@
 
 using namespace std;
 
+aghui::SScoringFacility::SPhasediffDialog&
+aghui::SScoringFacility::phasediff_d()
+{
+       if ( not _phasediff_d )
+               _phasediff_d = new SPhasediffDialog(*this);
+       return *_phasediff_d;
+}
+
+
 aghui::SScoringFacility::SPhasediffDialog::
 SPhasediffDialog (aghui::SScoringFacility& parent)
       : channel1 (nullptr),
diff --git a/src/ui/sf/montage_cb.cc b/src/ui/sf/montage_cb.cc
index 087ea2c..a7d6cc8 100644
--- a/src/ui/sf/montage_cb.cc
+++ b/src/ui/sf/montage_cb.cc
@@ -624,14 +624,16 @@ iSFPageFilter_activate_cb( GtkMenuItem *menuitem, 
gpointer userdata)
        auto& SF = *(SScoringFacility*)userdata;
        auto& FD =  SF.filters_d();
        auto& H  = *SF.using_channel;
+       FD.P = H.filters;
        FD.W_V.up();
 
-       snprintf_buf( "<big>Filters for channel <b>%s</b></big>", 
SF.using_channel->name);
-       gtk_label_set_markup( SF.lSFFilterCaption,
+       snprintf_buf( "<big>Filters for channel <b>%s</b></big>", 
FDusing_channel->name);
+       gtk_label_set_markup( FD.lSFFilterCaption,
                              __buf__);
 
-       if ( gtk_dialog_run( SF.wSFFilters) == GTK_RESPONSE_OK ) {
+       if ( gtk_dialog_run( FD.wSFFilters) == GTK_RESPONSE_OK ) {
                FD.W_V.down();
+               H.filters = FD.P;
                H.get_signal_filtered();
 
                if ( H.type == sigfile::SChannel::TType::eeg ) {
@@ -652,28 +654,9 @@ void
 iSFPageArtifactsDetect_activate_cb( GtkMenuItem*, gpointer userdata)
 {
        auto& SF = *(SScoringFacility*)userdata;
-       auto& AD = SF.artifact_detection_dialog;
+       auto& AD = SF.artifacts_d();
 
-       AD.W_V.up();
-       SF.populate_mSFADProfiles();
-       g_signal_emit_by_name( SF.eSFADProfiles, "changed");
-
-       g_signal_emit_by_name( SF.eSFADEstimateE, "toggled");
-       g_signal_emit_by_name( SF.eSFADEstimateE, "toggled");
-       g_signal_emit_by_name( SF.eSFADUseThisRange, "toggled");
-       g_signal_emit_by_name( SF.eSFADUseThisRange, "toggled");
-
-       gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, FALSE);
-       AD.suppress_preview_handler = true;
-       gtk_toggle_button_set_active( SF.bSFADPreview, FALSE);
-       AD.suppress_preview_handler = false;
-
-       snprintf_buf( "Artifact detection in channel %s", 
SF.using_channel->name);
-       gtk_label_set_text( SF.lSFADInfo, __buf__);
-       snprintf_buf( "%4.2f%% marked", 
SF.using_channel->calculate_dirty_percent() * 100);
-       gtk_label_set_text( SF.lSFADDirtyPercent, __buf__);
-
-       gtk_widget_show_all( (GtkWidget*)SF.wSFAD);
+       gtk_widget_show( (GtkWidget*)AD.wSFAD);
 }
 
 void
diff --git a/src/ui/sf/sf.hh b/src/ui/sf/sf.hh
index a200b96..6d6a712 100644
--- a/src/ui/sf/sf.hh
+++ b/src/ui/sf/sf.hh
@@ -498,36 +498,20 @@ class SScoringFacility
     public:
        struct SPatternsDialog;
        SPatternsDialog&
-       patterns_d()
-               {
-                       if ( not _patterns_d )
-                               _patterns_d = new SPatternsDialog(*this);
-                       return *_patterns_d;
-               }
+       patterns_d();
+
        struct SFiltersDialog;
        SFiltersDialog&
-       filters_d()
-               {
-                       if ( not _filters_d )
-                               _filters_d = new SFiltersDialog(*this);
-                       return *_filters_d;
-               }
+       filters_d();
+
        struct SPhasediffDialog;
        SPhasediffDialog&
-       phasediff_d()
-               {
-                       if ( not _phasediff_d )
-                               _phasediff_d = new SPhasediffDialog(*this);
-                       return *_phasediff_d;
-               }
+       phasediff_d();
+
        struct SArtifactsDialog;
-       SArtifactsDialog
-       artifacts_d()
-               {
-                       if ( not _artifacts_d )
-                               _artifacts_d = new SArtifactsDialog(*this);
-                       return *_artifacts_d;
-               }
+       SArtifactsDialog&
+       artifacts_d();
+
     private:
        SPatternsDialog
                *_patterns_d;
@@ -535,7 +519,7 @@ class SScoringFacility
                *_filters_d;
        SPhasediffDialog
                *_phasediff_d;
-       SArtifactDetectionDialog
+       SArtifactsDialog
                *_artifact_d;
        void populate_mSFADProfiles();
 
diff --git a/src/ui/sf/sf_cb.cc b/src/ui/sf/sf_cb.cc
index 95dc487..908314b 100644
--- a/src/ui/sf/sf_cb.cc
+++ b/src/ui/sf/sf_cb.cc
@@ -193,13 +193,10 @@ bSFShowFindDialog_toggled_cb( GtkToggleButton 
*togglebutton, gpointer userdata)
 {
        auto& SF = *(SScoringFacility*)userdata;
        if ( gtk_toggle_button_get_active( togglebutton) ) {
-               if ( not SF.find_dialog )
-                       SF.find_dialog =
-                               new aghui::SScoringFacility::SFindDialog (SF);
-               SF.find_dialog->setup_controls_for_find();
-               gtk_widget_show( (GtkWidget*)SF.find_dialog->wSFFD);
+               SF.patterns_d().setup_controls_for_find();
+               gtk_widget_show( (GtkWidget*)SF.patterns_d().wSFFD);
        } else
-               gtk_widget_hide( (GtkWidget*)SF.find_dialog->wSFFD);
+               gtk_widget_hide( (GtkWidget*)SF.patterns_d().wSFFD);
 }
 
 
@@ -209,13 +206,10 @@ bSFShowPhaseDiffDialog_toggled_cb( GtkToggleButton 
*togglebutton, gpointer userd
 {
        auto& SF = *(SScoringFacility*)userdata;
        if ( gtk_toggle_button_get_active( togglebutton) ) {
-               if ( not SF.phasediff_dialog )
-                       SF.phasediff_dialog =
-                               new aghui::SScoringFacility::SPhasediffDialog 
(SF);
-               SF.phasediff_dialog->setup_controls_for_find();
-               gtk_widget_show( (GtkWidget*)SF.phasediff_dialog->wSFPD);
+               SF.phasediff_d().setup_controls_for_find();
+               gtk_widget_show( (GtkWidget*)SF.phasediff_d().wSFPD);
        } else
-               gtk_widget_hide( (GtkWidget*)SF.phasediff_dialog->wSFPD);
+               gtk_widget_hide( (GtkWidget*)SF.phasediff_d().wSFPD);
 }
 
 

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to