Guest User

allow-non-flatpak.patch

a guest
Mar 26th, 2025
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.25 KB | None | 0 0
  1. diff --color -Naru Bottles-51.21-orig/bottles/frontend/meson.build Bottles-51.21/bottles/frontend/meson.build
  2. --- Bottles-51.21-orig/bottles/frontend/meson.build 2025-03-24 00:34:04.273862142 +0800
  3. +++ Bottles-51.21/bottles/frontend/meson.build 2025-03-24 01:43:55.290633603 +0800
  4. @@ -25,9 +25,9 @@
  5.  
  6. fs = import('fs')
  7.  
  8. -if not fs.is_file('/' + '.flatpak-info')
  9. - error('file does not exist')
  10. -endif
  11. +# if not fs.is_file('/' + '.flatpak-info')
  12. +# error('file does not exist')
  13. +# endif
  14.  
  15. bottles_sources = [
  16. '__init__.py',
  17. diff --color -Naru Bottles-51.21-orig/bottles/frontend/views/bottle_dependencies.py Bottles-51.21/bottles/frontend/views/bottle_dependencies.py
  18. --- Bottles-51.21-orig/bottles/frontend/views/bottle_dependencies.py 2025-03-24 00:34:04.280820281 +0800
  19. +++ Bottles-51.21/bottles/frontend/views/bottle_dependencies.py 2025-03-24 01:44:42.015363727 +0800
  20. @@ -138,6 +138,6 @@
  21. for dep in self.config.Installed_Dependencies:
  22. if dep in dependencies:
  23. dep = (dep, dependencies[dep])
  24. - GLib.idle_add(new_dependency, dep, plain=True)
  25. + GLib.idle_add(new_dependency, dep)
  26.  
  27. RunAsync(process_dependencies, callback=callback)
  28. diff --color -Naru Bottles-51.21-orig/bottles/frontend/views/bottle_details.py Bottles-51.21/bottles/frontend/views/bottle_details.py
  29. --- Bottles-51.21-orig/bottles/frontend/views/bottle_details.py 2025-03-24 00:34:04.280861203 +0800
  30. +++ Bottles-51.21/bottles/frontend/views/bottle_details.py 2025-03-24 01:43:55.290877248 +0800
  31. @@ -436,20 +436,20 @@
  32. dialog.connect("response", execute)
  33. dialog.show()
  34.  
  35. - if Xdp.Portal.running_under_sandbox():
  36. - if self.window.settings.get_boolean("show-sandbox-warning"):
  37. - dialog = Adw.MessageDialog.new(
  38. - self.window,
  39. - _("Be Aware of Sandbox"),
  40. - _(
  41. - "Bottles is running in a sandbox, a restricted permission environment needed to keep you safe. If the program won't run, consider moving inside the bottle (3 dots icon on the top), then launch from there."
  42. - ),
  43. - )
  44. - dialog.add_response("dismiss", _("_Dismiss"))
  45. - dialog.connect("response", show_chooser)
  46. - dialog.present()
  47. - else:
  48. - show_chooser()
  49. + # if Xdp.Portal.running_under_sandbox():
  50. + if self.window.settings.get_boolean("show-sandbox-warning"):
  51. + dialog = Adw.MessageDialog.new(
  52. + self.window,
  53. + _("Be Aware of Sandbox"),
  54. + _(
  55. + "Bottles is running in a sandbox, a restricted permission environment needed to keep you safe. If the program won't run, consider moving inside the bottle (3 dots icon on the top), then launch from there."
  56. + ),
  57. + )
  58. + dialog.add_response("dismiss", _("_Dismiss"))
  59. + dialog.connect("response", show_chooser)
  60. + dialog.present()
  61. + else:
  62. + show_chooser()
  63.  
  64. def __backup(self, widget, backup_type):
  65. """
  66. diff --color -Naru Bottles-51.21-orig/bottles/frontend/views/bottle_preferences.py Bottles-51.21/bottles/frontend/views/bottle_preferences.py
  67. --- Bottles-51.21-orig/bottles/frontend/views/bottle_preferences.py 2025-03-24 00:34:04.280861203 +0800
  68. +++ Bottles-51.21/bottles/frontend/views/bottle_preferences.py 2025-03-24 01:43:55.291390026 +0800
  69. @@ -139,8 +139,8 @@
  70. self.queue = details.queue
  71. self.details = details
  72.  
  73. - if not gamemode_available or not Xdp.Portal.running_under_sandbox():
  74. - return
  75. + # if not gamemode_available or not Xdp.Portal.running_under_sandbox():
  76. + # return
  77.  
  78. _not_available = _("This feature is unavailable on your system.")
  79. _flatpak_not_available = _(
  80. diff --color -Naru Bottles-51.21-orig/bottles/frontend/views/list.py Bottles-51.21/bottles/frontend/views/list.py
  81. --- Bottles-51.21-orig/bottles/frontend/views/list.py 2025-03-24 00:34:04.281861069 +0800
  82. +++ Bottles-51.21/bottles/frontend/views/list.py 2025-03-24 01:43:55.291916352 +0800
  83. @@ -82,8 +82,8 @@
  84.  
  85. def run_executable(self, *_args):
  86. """Display file dialog for executable"""
  87. - if not Xdp.Portal.running_under_sandbox():
  88. - return
  89. + # if not Xdp.Portal.running_under_sandbox():
  90. + # return
  91.  
  92. def set_path(_dialog, response):
  93. if response != Gtk.ResponseType.ACCEPT:
  94. diff --color -Naru Bottles-51.21-orig/bottles/frontend/views/new_bottle_dialog.py Bottles-51.21/bottles/frontend/views/new_bottle_dialog.py
  95. --- Bottles-51.21-orig/bottles/frontend/views/new_bottle_dialog.py 2025-03-24 00:34:04.281861069 +0800
  96. +++ Bottles-51.21/bottles/frontend/views/new_bottle_dialog.py 2025-03-24 01:43:55.292209648 +0800
  97. @@ -80,7 +80,8 @@
  98. super().__init__(**kwargs)
  99. # common variables and references
  100. self.window = GtkUtils.get_parent_window()
  101. - if not self.window or not Xdp.Portal.running_under_sandbox():
  102. + # if not self.window or not Xdp.Portal.running_under_sandbox():
  103. + if not self.window:
  104. return
  105.  
  106. self.app = self.window.get_application()
  107. diff --color -Naru Bottles-51.21-orig/bottles/frontend/windows/window.py Bottles-51.21/bottles/frontend/windows/window.py
  108. --- Bottles-51.21-orig/bottles/frontend/windows/window.py 2025-03-24 00:34:04.286860397 +0800
  109. +++ Bottles-51.21/bottles/frontend/windows/window.py 2025-03-24 01:43:55.292499312 +0800
  110. @@ -97,34 +97,34 @@
  111. manager = Adw.StyleManager.get_default()
  112. manager.set_color_scheme(Adw.ColorScheme.FORCE_DARK)
  113.  
  114. - # Be VERY explicit that non-sandboxed environments are unsupported
  115. - if not Xdp.Portal.running_under_sandbox():
  116. + # # Be VERY explicit that non-sandboxed environments are unsupported
  117. + # if not Xdp.Portal.running_under_sandbox():
  118.  
  119. - def response(dialog, response, *args):
  120. - if response == "close":
  121. - quit(1)
  122. -
  123. - body = _(
  124. - "Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at"
  125. - )
  126. - download_url = "usebottles.com/download"
  127. -
  128. - error_dialog = Adw.AlertDialog.new(
  129. - _("Unsupported Environment"),
  130. - f"{body} <a href='https://{download_url}' title='https://{download_url}'>{download_url}.</a>",
  131. - )
  132. -
  133. - error_dialog.add_response("close", _("Close"))
  134. - error_dialog.set_body_use_markup(True)
  135. - error_dialog.connect("response", response)
  136. - error_dialog.present(self)
  137. - logging.error(
  138. - _(
  139. - "Bottles is only supported within a sandboxed format. Official sources of Bottles are available at:"
  140. - )
  141. - )
  142. - logging.error("https://usebottles.com/download/")
  143. - return
  144. + # def response(dialog, response, *args):
  145. + # if response == "close":
  146. + # quit(1)
  147. +
  148. + # body = _(
  149. + # "Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at"
  150. + # )
  151. + # download_url = "usebottles.com/download"
  152. +
  153. + # error_dialog = Adw.AlertDialog.new(
  154. + # _("Unsupported Environment"),
  155. + # f"{body} <a href='https://{download_url}' title='https://{download_url}'>{download_url}.</a>",
  156. + # )
  157. +
  158. + # error_dialog.add_response("close", _("Close"))
  159. + # error_dialog.set_body_use_markup(True)
  160. + # error_dialog.connect("response", response)
  161. + # error_dialog.present(self)
  162. + # logging.error(
  163. + # _(
  164. + # "Bottles is only supported within a sandboxed format. Official sources of Bottles are available at:"
  165. + # )
  166. + # )
  167. + # logging.error("https://usebottles.com/download/")
  168. + # return
  169.  
  170. # Loading view
  171. self.page_loading = LoadingView()
  172.  
Advertisement
Add Comment
Please, Sign In to add comment