Package: nut / 2.7.4-5

0002-nut-monitor-paths.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--- a/scripts/python/app/NUT-Monitor
+++ b/scripts/python/app/NUT-Monitor
@@ -76,7 +76,7 @@ class interface :
         ( cmd_opts, args ) = opt_parser.parse_args()
 
 
-        self.__glade_file = os.path.join( os.path.dirname( sys.argv[0] ), "gui-1.3.glade" )
+        self.__glade_file = '/usr/share/nut-monitor/gui-1.3.glade'
 
         self.__widgets["interface"]                   = gtk.glade.XML( self.__glade_file, "window1", APP )
         self.__widgets["main_window"]                 = self.__widgets["interface"].get_widget("window1")
@@ -109,11 +109,11 @@ class interface :
 
         # Create the tray icon and connect it to the show/hide method...
         self.__widgets["status_icon"] = gtk.StatusIcon()
-        self.__widgets["status_icon"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "on_line.png" ) )
+        self.__widgets["status_icon"].set_from_file( "/usr/share/nut-monitor/pixmaps/on_line.png" )
         self.__widgets["status_icon"].set_visible( True )
         self.__widgets["status_icon"].connect( "activate", self.tray_activated )
 
-        self.__widgets["ups_status_image"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "on_line.png" ) )
+        self.__widgets["ups_status_image"].set_from_file( "/usr/share/nut-monitor/pixmaps/on_line.png" )
 
         # Define interface callbacks actions
         self.__callbacks = { "on_window1_destroy"              : self.quit,
@@ -271,8 +271,8 @@ class interface :
     #-------------------------------------------------------------------
     # Change the status icon and tray icon
     def change_status_icon( self, icon="on_line", blink=False ) :
-        self.__widgets["status_icon"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "%s.png" % icon ) )
-        self.__widgets["ups_status_image"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "%s.png" % icon ) )
+        self.__widgets["status_icon"].set_from_file( "/usr/share/nut-monitor/pixmaps/%s.png" % icon )
+        self.__widgets["ups_status_image"].set_from_file( "/usr/share/nut-monitor/pixmaps/%s.png" % icon )
         self.__widgets["status_icon"].set_blinking( blink )
 
     #-------------------------------------------------------------------
@@ -728,9 +728,9 @@ class interface :
 
             for k,v in vars.iteritems() :
                 if ( rwvars.has_key( k ) ) :
-                    icon_file = os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "var-rw.png" )
+                    icon_file = "/usr/share/nut-monitor/pixmaps/var-rw.png"
                 else :
-                    icon_file = os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "var-ro.png" )
+                    icon_file = "/usr/share/nut-monitor/pixmaps/var-ro.png"
 
                 icon = gtk.gdk.pixbuf_new_from_file( icon_file )
                 self.__widgets["ups_vars_tree_store"].append( [ icon, k, v ] )