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

Andrei Zavada johnhommer at gmail.com
Sun Feb 3 12:53:05 UTC 2013


The following commit has been merged in the master branch:
commit c2e11da8ee655089fe83d61d70f7f28ba0e75652
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Sun Feb 3 11:11:02 2013 +0200

    fix args in pop_ok_message calls

diff --git a/src/ui/libcommon.cc b/src/ui/libcommon.cc
index 2a6500c..566fdac 100644
--- a/src/ui/libcommon.cc
+++ b/src/ui/libcommon.cc
@@ -271,7 +271,9 @@ gtk_cell_layout_set_renderer( GtkComboBox *cb)
 
 void
 aghui::
-pop_ok_message( GtkWindow *parent, const char* primary_text, const char *fmt, ...)
+pop_ok_message( GtkWindow *parent,
+		const char* primary_text,
+		const char *fmt, ...)
 {
 	GtkWidget *msg =
 		gtk_message_dialog_new_with_markup(
diff --git a/src/ui/mw/admit-one.cc b/src/ui/mw/admit-one.cc
index 902d7cc..95c0ef4 100644
--- a/src/ui/mw/admit-one.cc
+++ b/src/ui/mw/admit-one.cc
@@ -28,7 +28,7 @@ dnd_maybe_admit_one( const char* fname)
 	try {
 		F = new CSource (fname, ED->fft_params.pagesize);
 		if ( F->type() == CSource::TType::edf && F->status() & CEDFFile::TStatus::inoperable ) {
-			pop_ok_message( wMainWindow, "File <i>%s</i> doesn't appear to be a valid EDF file", fname);
+			pop_ok_message( wMainWindow, "Bad EDF file", "The file <i>%s</i> doesn't appear to be a valid EDF file", fname);
 			return 0;
 		}
 		info = F->details();
@@ -39,7 +39,7 @@ dnd_maybe_admit_one( const char* fname)
 		gtk_label_set_markup( lEdfImportSubject, __buf__);
 
 	} catch ( exception& ex) {
-		pop_ok_message( wMainWindow, "File <i>%s</i> doesn't appear to be a valid EDF file", fname);
+		pop_ok_message( wMainWindow, "Bad EDF ", "File <i>%s</i> doesn't appear to be a valid EDF file", fname);
 		return 0;
 	}
 	gtk_text_buffer_set_text( tEDFFileDetailsReport, info.c_str(), -1);
diff --git a/src/ui/mw/mainmenu_cb.cc b/src/ui/mw/mainmenu_cb.cc
index bc0d28b..a38abe5 100644
--- a/src/ui/mw/mainmenu_cb.cc
+++ b/src/ui/mw/mainmenu_cb.cc
@@ -303,7 +303,7 @@ bGlobalMontageResetAll_clicked_cb( GtkButton*, gpointer userdata)
 	snprintf_buf( "find '%s' -name '.*.montage' -delete",
 		      ED.ED->session_dir().c_str());
 	if ( system( __buf__) )
-		pop_ok_message( ED.wMainWindow, "Command '%s' returned a non-zero status. This is weird.", __buf__);
+		pop_ok_message( ED.wMainWindow, "How strange!", "Command '%s' returned a non-zero status. This is weird.", __buf__);
 }
 
 
@@ -312,13 +312,15 @@ void
 iHelpAbout_activate_cb( GtkMenuItem*, gpointer userdata)
 {
 	auto& ED = *(SExpDesignUI*)userdata;
+	// auto w = gtk_widget_get_window( (GtkWidget*)ED.lAboutVersion);
+	// gdk_window_set_composited( w, TRUE);
+	// gdk_window_set_opacity( w, .7);
 	gtk_widget_show_all( (GtkWidget*)ED.wAbout);
 }
 
 void
 iHelpUsage_activate_cb( GtkMenuItem*, gpointer)
 {
-//	auto& ED = *(SExpDesignUI*)userdata;
 	gtk_show_uri( NULL,
 		      "http://johnhommer.com/academic/code/aghermann/usage/",
 		      GDK_CURRENT_TIME, NULL);
diff --git a/src/ui/mw/measurements_cb.cc b/src/ui/mw/measurements_cb.cc
index 367926e..1bb54f6 100644
--- a/src/ui/mw/measurements_cb.cc
+++ b/src/ui/mw/measurements_cb.cc
@@ -220,7 +220,7 @@ iSubjectTimelineResetMontage_activate_cb( GtkMenuItem *checkmenuitem, gpointer u
 			      ED.ED->session_dir().c_str(), ED.ED->group_of( J->csubject), J->csubject.short_name.c_str(), ED.AghD(), ED.AghE());
 
 	if ( system( __buf__) )
-		pop_ok_message( ED.wMainWindow, "Command '%s' returned a non-zero status. This is weird.", __buf__);
+		pop_ok_message( ED.wMainWindow, "Wow", "Command '%s' returned a non-zero status. This is weird.", __buf__);
 }
 
 
diff --git a/src/ui/sm/sm.cc b/src/ui/sm/sm.cc
index 2071bde..4ffa3ea 100644
--- a/src/ui/sm/sm.cc
+++ b/src/ui/sm/sm.cc
@@ -73,7 +73,7 @@ SSessionChooser (const char* explicit_session)
 			set_unique_app_window( ed->wMainWindow);
 		}
 	} catch (runtime_error ex) {
-		aghui::pop_ok_message( nullptr, "%s", ex.what());
+		aghui::pop_ok_message( nullptr, "Huh", "%s", ex.what());
 
 		string new_experiment_dir = string (getenv("HOME")) + "/NewExperiment";
 		if ( agh::fs::mkdir_with_parents( new_experiment_dir.c_str()) ) {
@@ -120,8 +120,8 @@ open_selected_session()
 		//set_unique_app_window( (GtkWindow*)wSessionChooser);
 
 		pop_ok_message( nullptr,
-				"%s\n\n"
-				"Please choose another directory", ex.what());
+				ex.what(),
+				"Please choose another directory");
 		return -1;
 	}
 }
@@ -297,7 +297,7 @@ write_sessionrc() const
 
 		conf.writeFile( filename.c_str());
 	} catch (...) {
-		pop_ok_message( (GtkWindow*)wSessionChooser, "Couldn't write %s", filename.c_str());
+		pop_ok_message( (GtkWindow*)wSessionChooser, "Error saving your sessionrc file", "(%s)", filename.c_str());
 	}
 }
 
diff --git a/src/ui/ui.hh b/src/ui/ui.hh
index 752a29e..eafa9a8 100644
--- a/src/ui/ui.hh
+++ b/src/ui/ui.hh
@@ -167,8 +167,8 @@ cairo_put_banner( cairo_t *cr,
 
 
 
-void pop_ok_message( GtkWindow *parent, const char* primary, const gchar*, ...);
-gint pop_question( GtkWindow *parent, const gchar*, ...);
+void pop_ok_message( GtkWindow *parent, const char* primary, const gchar*, ...) __attribute__ ((format (printf, 3, 4)));
+gint pop_question( GtkWindow *parent, const gchar*, ...) __attribute__ ((format (printf, 2, 3)));
 void set_cursor_busy( bool busy, GtkWidget *wid);
 
 

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list