The following commit has been merged in the master branch:
commit 62336348a77aac350b3a6c024ac1801ba19fda34
Author: Andrei Zavada <[email protected]>
Date:   Mon Oct 29 01:36:52 2012 +0200

    provide a hint for when no AD profiles exist (part 1/2)

diff --git a/src/ui/mw/mw-construct.cc b/src/ui/mw/mw-construct.cc
index dd11be2..0034fc4 100644
--- a/src/ui/mw/mw-construct.cc
+++ b/src/ui/mw/mw-construct.cc
@@ -730,7 +730,8 @@ SExpDesignUIWidgets ()
        if ( !AGH_GBGETOBJ (GtkDialog,          wGlobalArtifactDetection) ||
             !AGH_GBGETOBJ (GtkComboBox,        eGlobalADProfiles) ||
             !AGH_GBGETOBJ (GtkCheckButton,     eGlobalADKeepExisting) ||
-            !AGH_GBGETOBJ (GtkButton,          bGlobalADOK) )
+            !AGH_GBGETOBJ (GtkButton,          bGlobalADOK) ||
+            !AGH_GBGETOBJ (GtkLabel,           lGlobalADHint) )
                throw runtime_error ("Failed to construct widgets");
 
        gtk_combo_box_set_model_properly(
diff --git a/src/ui/mw/mw-widgets.hh b/src/ui/mw/mw-widgets.hh
index 4801c81..bd2b922 100644
--- a/src/ui/mw/mw-widgets.hh
+++ b/src/ui/mw/mw-widgets.hh
@@ -307,6 +307,8 @@ struct SExpDesignUIWidgets {
                *eGlobalADProfiles;
        GtkCheckButton
                *eGlobalADKeepExisting;
+       GtkLabel
+               *lGlobalADHint;
        GtkButton
                *bGlobalADOK;
 
diff --git a/src/ui/mw/mw_cb.cc b/src/ui/mw/mw_cb.cc
index 26d73e0..b0dbe0f 100644
--- a/src/ui/mw/mw_cb.cc
+++ b/src/ui/mw/mw_cb.cc
@@ -141,6 +141,23 @@ iExpGloballyDetectArtifacts_activate_cb( GtkMenuItem*, 
gpointer userdata)
 {
        auto& ED = *(SExpDesignUI*)userdata;
 
+       if ( ED.global_artifact_detection_profiles.size() < 1 ) {
+               pop_ok_message( ED.wMainWindow,
+                               "Create some profiles first",
+                               "You can do it by opening a recording in 
Scoring Facility and"
+                               " tweaking default parameters in Artifact 
Detect dialog."
+                               " After saving them as a profile, it will 
appear here.");
+               return;
+       }
+
+       gtk_label_set_markup(
+               ED.lGlobalADHint,
+               (ED.global_artifact_detection_profiles.size() < 2)
+               ? "<small>You can create a custom profile in Scoring Facility,"
+                 " after tuning parameters on a real recording.</small>"
+               : ""); // good boy
+
+
        auto response = gtk_dialog_run( ED.wGlobalArtifactDetection);
        if ( response == GTK_RESPONSE_CANCEL ||
             response == GTK_RESPONSE_DELETE_EVENT )
@@ -242,7 +259,6 @@ eGlobalADProfiles_changed_cb( GtkComboBox *b, gpointer 
userdata)
 
 
 
-// 
 // iMontageSetDefaults_activate_cb( GtkMenuItem*, gpointer userdata)
 // {
 //     auto& ED = *(SExpDesignUI*)userdata;

-- 
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