Beispiel #1
0
 def on_entry_changed(self, widget):
     """Entry changed callback"""
     self.clear_warnings()
     path = widget.get_text()
     if not path:
         return
     path = os.path.expanduser(path)
     self.update_completion(path)
     if self.warn_if_ntfs and LINUX_SYSTEM.get_fs_type_for_path(
             path) == "ntfs":
         ntfs_box = Gtk.Box(spacing=6, visible=True)
         warning_image = Gtk.Image(visible=True)
         warning_image.set_from_pixbuf(get_stock_icon("dialog-warning", 32))
         ntfs_box.add(warning_image)
         ntfs_label = Gtk.Label(visible=True)
         ntfs_label.set_markup(
             "<b>Warning!</b> The selected path is located on a drive formatted by Windows.\n"
             "Games and programs installed on Windows drives usually <b>don't work</b>."
         )
         ntfs_box.add(ntfs_label)
         self.pack_end(ntfs_box, False, False, 10)
     if self.warn_if_non_empty and os.path.exists(path) and os.listdir(
             path):
         non_empty_label = Gtk.Label(visible=True)
         non_empty_label.set_markup(
             "<b>Warning!</b> The selected path "
             "contains files. Installation might not work properly.")
         self.pack_end(non_empty_label, False, False, 10)
Beispiel #2
0
 def on_entry_changed(self, widget):
     """Entry changed callback"""
     self.clear_warnings()
     path = widget.get_text()
     if not path:
         return
     path = os.path.expanduser(path)
     self.update_completion(path)
     if self.warn_if_ntfs and LINUX_SYSTEM.get_fs_type_for_path(path) == "ntfs":
         ntfs_box = Gtk.Box(spacing=6, visible=True)
         warning_image = Gtk.Image(visible=True)
         warning_image.set_from_pixbuf(get_stock_icon("dialog-warning", 32))
         ntfs_box.add(warning_image)
         ntfs_label = Gtk.Label(visible=True)
         ntfs_label.set_markup(
             "<b>Warning!</b> The selected path is located on a NTFS drive.\n"
             "Installing games on NTFS partitions is known to cause issues."
         )
         ntfs_box.add(ntfs_label)
         self.pack_end(ntfs_box, False, False, 10)
     if self.warn_if_non_empty and os.path.exists(path) and os.listdir(path):
         non_empty_label = Gtk.Label(visible=True)
         non_empty_label.set_markup(
             "<b>Warning!</b> The selected path "
             "contains files. Installation might not work properly."
         )
         self.pack_end(non_empty_label, False, False, 10)