set the icon in both executables
authorjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Tue, 20 Jan 2009 07:14:39 +0000 (07:14 +0000)
committerjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Tue, 20 Jan 2009 07:14:39 +0000 (07:14 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10266 221aa14e-8319-0410-a670-987f0aec2ac5

grc/scripts/grc
grc/scripts/usrp_probe
grc/src/gui/ActionHandler.py

index 11f9c60d365d68a5a8036f2f3406569a8aa29f6f..94fb4294c99a3fad800ae37e3789395a55e44653 100755 (executable)
@@ -18,6 +18,10 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
+import pygtk
+pygtk.require('2.0')
+import gtk
+
 from gnuradio.grc.platforms.base.Constants import VERSION
 from optparse import OptionParser
 
@@ -35,5 +39,8 @@ and you are welcome to redistribute it.
        (options, args) = parser.parse_args()
        from gnuradio.grc.platforms.python.Platform import Platform
        from gnuradio.grc.gui.ActionHandler import ActionHandler
+       #setup icon using icon theme
+       try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
+       except: pass
        ActionHandler(args, Platform())
 
index eab57677d89494619d585133dcc17022ce753c68..c926034823a0595a9c663b5b9209bd391847b682 100755 (executable)
@@ -109,9 +109,13 @@ If the USRP cannot be found, make sure that the USRP is plugged-in and restart t
 If the problem persists, there may be a problem with you gnuradio installation or USB 2.0.
 '''%str(e))
 
-#enter the mainloop
-gtk.gdk.threads_init()
-gtk.gdk.threads_enter()
-USRPProbeWindow()
-gtk.main()
-gtk.gdk.threads_leave()
+if __name__ == '__main__':
+       #setup icon using icon theme
+       try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
+       except: pass
+       #enter the mainloop
+       gtk.gdk.threads_init()
+       gtk.gdk.threads_enter()
+       USRPProbeWindow()
+       gtk.main()
+       gtk.gdk.threads_leave()
index 4c5516311ffdb376ba76bec4fd37d59bbf5ea53a..91dd0fb454e89fb038ef53bd245bf5e34bf4f2b7 100644 (file)
@@ -53,9 +53,6 @@ class ActionHandler:
                """
                self.clipboard = None
                platform = Platform(platform)
-               #setup icon using icon theme
-               try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
-               except: pass
                for action in Actions.get_all_actions(): action.connect('activate', self._handle_actions)
                #setup the main window
                self.main_window = MainWindow(self.handle_states, platform)