@@ -95,16 +95,6 @@ def getProcInfos():
9595 return result
9696
9797
98- def getSystemIcon ():
99- schema = Gio .Settings (schema = "org.cinnamon" )
100-
101- iconPath = schema .get_string ("system-icon-path" )
102- if iconPath == "" : # left empty, so its disabled
103- return None
104-
105- return iconPath
106-
107-
10898def createSystemInfos ():
10999 procInfos = getProcInfos ()
110100 infos = []
@@ -176,13 +166,27 @@ def on_module_selected(self):
176166 if not self .loaded :
177167 print ("Loading Info module" )
178168
179- infos = createSystemInfos ()
180-
181169 page = SettingsPage ()
182- page .set_spacing (10 )
170+ page .set_spacing (24 )
183171 self .sidePage .add_widget (page )
184172
185- settings = page .add_section (_ ("System info" ))
173+ schema = Gio .Settings (schema = "org.cinnamon" )
174+ systemIcon = schema .get_string ("system-icon" )
175+ if systemIcon != "" :
176+ try :
177+ if "/" in systemIcon :
178+ pixbuf = GdkPixbuf .Pixbuf .new_from_file_at_scale (systemIconPath , - 1 , 100 , True )
179+ systemIcon = Gtk .Image .new_from_pixbuf (pixbuf )
180+ else :
181+ systemIcon = Gtk .Image .new_from_icon_name (systemIcon , Gtk .IconSize .DIALOG )
182+ systemIcon .set_pixel_size (100 )
183+ page .add (systemIcon )
184+ except GLib .GError :
185+ pass
186+
187+ infos = createSystemInfos ()
188+
189+ settings = page .add_section ()
186190
187191 for (key , value ) in infos :
188192 widget = SettingsWidget ()
@@ -209,24 +213,13 @@ def on_module_selected(self):
209213 settings .add_row (widget )
210214
211215 if shutil .which ("inxi" ):
212-
213216 widget = SettingsWidget ()
214217
215218 button = Gtk .Button (label = _ ("Copy to clipboard" ))
216219 button .connect ("clicked" , self .on_copy_clipboard_button_clicked )
217220 widget .pack_start (button , True , True , 0 )
218221 settings .add_row (widget )
219222
220- systemIconPath = getSystemIcon ()
221- if systemIconPath is not None :
222- try :
223- pixbuf = GdkPixbuf .Pixbuf .new_from_file_at_scale (systemIconPath , - 1 , 160 , True )
224- systemIcon = Gtk .Image .new_from_pixbuf (pixbuf )
225- page .add (systemIcon )
226- except GLib .GError :
227- pass
228-
229-
230223 def on_copy_clipboard_button_clicked (self , button ):
231224 try :
232225 # taken from https://github.com/linuxmint/xapp/blob/master/scripts/upload-system-info
0 commit comments