commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 04/16: grc: Add check for GTK initializatio


From: git
Subject: [Commit-gnuradio] [gnuradio] 04/16: grc: Add check for GTK initialization
Date: Sun, 26 Apr 2015 23:18:03 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 839b933dd40f876a3a85351462575bac46ffd441
Author: Doug Geiger <address@hidden>
Date:   Tue Apr 21 21:36:34 2015 -0400

    grc: Add check for GTK initialization
    
    Ensure GTK can be initialized before application start-up (e.g. if X11 
forwarding is not enabled on an SSH connection) to avoid a fatal error (e.g. 
segfault)
---
 grc/scripts/gnuradio-companion | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion
index 7a407ea..b8b960a 100755
--- a/grc/scripts/gnuradio-companion
+++ b/grc/scripts/gnuradio-companion
@@ -55,6 +55,14 @@ def show_gtk_error_dialog(title, message):
     d.run()
 
 
+def check_gtk_init():
+    try:
+        gtk.init_check()
+    except RuntimeError:
+        print 'GTK initialization failed - bailing'
+        exit(-1)
+
+
 def check_gnuradio_import():
     try:
         from gnuradio import gr
@@ -108,6 +116,7 @@ def main():
 
 
 if __name__ == '__main__':
+    check_gtk_init()
     check_gnuradio_import()
     ensure_blocks_path()
     main()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]