Skip to content

Commit

Permalink
Hide label and Radio button (windows/linux) if the game has only Wind…
Browse files Browse the repository at this point in the history
…ows as platform.
  • Loading branch information
Kzimir committed Apr 11, 2022
1 parent 0100bdd commit 3816d9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/ui/properties.ui
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="label_properties_platform">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
Expand Down
7 changes: 4 additions & 3 deletions minigalaxy/ui/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Properties(Gtk.Dialog):
button_properties_ok = Gtk.Template.Child()
radiobutton_linux_type = Gtk.Template.Child()
radiobutton_windows_type = Gtk.Template.Child()
label_properties_platform = Gtk.Template.Child()

def __init__(self, parent, game, api):
Gtk.Dialog.__init__(self, title=_("Properties of {}").format(game.name), parent=parent.parent.parent,
Expand Down Expand Up @@ -133,6 +134,6 @@ def button_sensitive(self, game):
self.radiobutton_windows_type.set_active(True)

if "linux" not in self.game.supported_platforms:
self.radiobutton_linux_type.set_sensitive(False)
if "windows" not in self.game.supported_platforms or not shutil.which("wine"):
self.radiobutton_windows_type.set_sensitive(False)
self.radiobutton_linux_type.hide()
self.radiobutton_windows_type.hide()
self.label_properties_platform.hide()

0 comments on commit 3816d9f

Please sign in to comment.