[med-svn] [SCM] aghermann branch, master, updated. 4f7a3b774136ffffbaf9b05d90bd568347bc5461
Andrei Zavada
johnhommer at gmail.com
Fri Nov 16 00:50:47 UTC 2012
The following commit has been merged in the master branch:
commit 9a57c9e14019d6c099a1f43a76f4dba71f7aa2f7
Author: Andrei Zavada <johnhommer at gmail.com>
Date: Wed Nov 7 01:41:28 2012 +0200
be more particular about what controls to hide when visiting an empty experiment
diff --git a/data/main.glade b/data/main.glade
index 55fc2f4..6d1b93d 100644
--- a/data/main.glade
+++ b/data/main.glade
@@ -613,11 +613,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkMenuBar" id="iiMainMenu">
+ <object class="GtkMenuBar" id="cMainMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkMenuItem" id="iMainMenu">
+ <object class="GtkMenuItem" id="iiMainMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Experiment</property>
@@ -661,7 +661,7 @@ rm */*/*/.*.{psd,mc}</property>
</object>
</child>
<child>
- <object class="GtkMenuItem" id="menuitem9">
+ <object class="GtkMenuItem" id="iiExpGlobalOperations">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Global operations</property>
diff --git a/src/ui/mw/mw-construct.cc b/src/ui/mw/mw-construct.cc
index 0034fc4..db88ce7 100644
--- a/src/ui/mw/mw-construct.cc
+++ b/src/ui/mw/mw-construct.cc
@@ -82,11 +82,12 @@ SExpDesignUIWidgets ()
// =========== 1. Measurements
// ------------- cMeasurements
- if ( !AGH_GBGETOBJ (GtkMenu, iiMainMenu) ||
+ if ( !AGH_GBGETOBJ (GtkMenuItem, iiMainMenu) ||
!AGH_GBGETOBJ (GtkMenuItem, iExpRefresh) ||
!AGH_GBGETOBJ (GtkMenuItem, iExpPurgeComputed) ||
!AGH_GBGETOBJ (GtkMenuItem, iExpAnnotations) ||
!AGH_GBGETOBJ (GtkMenuItem, iExpBasicSADetectUltradianCycles) ||
+ !AGH_GBGETOBJ (GtkMenuItem, iiExpGlobalOperations) ||
!AGH_GBGETOBJ (GtkMenuItem, iExpGloballyDetectArtifacts) ||
!AGH_GBGETOBJ (GtkMenuItem, iExpGloballySetFilters) ||
!AGH_GBGETOBJ (GtkMenuItem, iMontageSetDefaults) ||
@@ -792,13 +793,13 @@ set_wMainWindow_interactive( bool indeed, bool flush)
set_cursor_busy( not indeed, (GtkWidget*)wMainWindow);
//gtk_widget_set_sensitive( (GtkWidget*)wMainWindow, indeed);
- gtk_widget_set_sensitive( (GtkWidget*)cMsmtProfileParamsContainer, indeed);
+ gtk_widget_set_sensitive( (GtkWidget*)cMsmtMainToolbar, indeed);
gtk_widget_set_sensitive( (GtkWidget*)cMeasurements, indeed);
gtk_widget_set_visible( (GtkWidget*)lTaskSelector2, indeed);
gtk_widget_set_visible( gtk_notebook_get_nth_page( tTaskSelector, 1), indeed);
gtk_widget_set_visible( (GtkWidget*)lSettings, indeed);
- gtk_widget_set_sensitive( gtk_notebook_get_nth_page( tDesign, 1), indeed);
+ gtk_widget_set_visible( gtk_notebook_get_nth_page( tDesign, 1), indeed);
gtk_widget_set_sensitive( (GtkWidget*)iiMainMenu, indeed);
gtk_widget_set_sensitive( (GtkWidget*)eMsmtSession, indeed);
@@ -808,5 +809,25 @@ set_wMainWindow_interactive( bool indeed, bool flush)
gtk_flush();
}
+void
+aghui::SExpDesignUIWidgets::
+set_controls_for_empty_experiment( bool indeed, bool flush)
+{
+ indeed = not indeed;
+ gtk_widget_set_visible( (GtkWidget*)cMsmtMainToolbar, indeed);
+
+ gtk_widget_set_visible( (GtkWidget*)lTaskSelector2, indeed);
+ gtk_widget_set_visible( gtk_notebook_get_nth_page( tTaskSelector, 1), indeed);
+
+ gtk_widget_set_visible( (GtkWidget*)iExpAnnotations, indeed);
+ gtk_widget_set_visible( (GtkWidget*)iiExpGlobalOperations, indeed);
+
+ gtk_widget_set_visible( (GtkWidget*)eMsmtSession, indeed);
+ gtk_widget_set_visible( (GtkWidget*)eMsmtChannel, indeed);
+
+ if ( flush )
+ gtk_flush();
+}
+
// eof
diff --git a/src/ui/mw/mw-populate.cc b/src/ui/mw/mw-populate.cc
index eace913..c10897e 100644
--- a/src/ui/mw/mw-populate.cc
+++ b/src/ui/mw/mw-populate.cc
@@ -87,9 +87,7 @@ populate( bool do_load)
"There are no EEG channels found in any recordings in the tree.");
if ( AghTT.empty() or AghGG.empty() ) {
show_empty_experiment_blurb();
- gtk_widget_set_visible( (GtkWidget*)lTaskSelector2, FALSE);
- gtk_widget_set_visible( (GtkWidget*)cMsmtMainToolbar, FALSE);
- gtk_widget_set_visible( gtk_notebook_get_nth_page( tTaskSelector, 1), FALSE);
+ set_controls_for_empty_experiment( true);
} else {
populate_mChannels();
populate_mSessions();
@@ -110,9 +108,7 @@ populate( bool do_load)
gtk_widget_set_visible( (GtkWidget*)cMsmtProfileParams2, TRUE);
}
- gtk_widget_set_visible( (GtkWidget*)lTaskSelector2, TRUE);
- gtk_widget_set_visible( (GtkWidget*)cMsmtMainToolbar, TRUE);
- gtk_widget_set_visible( gtk_notebook_get_nth_page( tTaskSelector, 1), TRUE);
+ set_controls_for_empty_experiment( false);
}
if ( not ED->error_log().empty() ) {
diff --git a/src/ui/mw/mw-widgets.hh b/src/ui/mw/mw-widgets.hh
index bd2b922..cf67239 100644
--- a/src/ui/mw/mw-widgets.hh
+++ b/src/ui/mw/mw-widgets.hh
@@ -80,6 +80,8 @@ struct SExpDesignUIWidgets {
*wMainWindow;
void
set_wMainWindow_interactive( bool indeed, bool flush = true);
+ void
+ set_controls_for_empty_experiment( bool indeed, bool flush = true);
// tabs
GtkNotebook
@@ -90,11 +92,11 @@ struct SExpDesignUIWidgets {
*lTaskSelector1, *lTaskSelector2,
*lSettings;
// 1. Measurements
- GtkMenu
- *iiMainMenu;
GtkMenuItem
+ *iiMainMenu,
*iExpRefresh, *iExpPurgeComputed, *iExpAnnotations, *iExpClose, *iExpQuit,
*iExpBasicSADetectUltradianCycles,
+ *iiExpGlobalOperations,
*iExpGloballyDetectArtifacts,
*iExpGloballySetFilters,
*iMontageSetDefaults,
--
Sleep experiment manager
More information about the debian-med-commit
mailing list