Set last_played as the default sort mode
This commit is contained in:
@@ -161,13 +161,13 @@ class CartridgesApplication(Adw.Application):
|
|||||||
)
|
)
|
||||||
|
|
||||||
sort_action = Gio.SimpleAction.new_stateful(
|
sort_action = Gio.SimpleAction.new_stateful(
|
||||||
"sort_by", GLib.VariantType.new("s"), GLib.Variant("s", "a-z")
|
"sort_by",
|
||||||
|
GLib.VariantType.new("s"),
|
||||||
|
sort_mode := GLib.Variant("s", shared.state_schema.get_string("sort-mode")),
|
||||||
)
|
)
|
||||||
sort_action.connect("activate", shared.win.on_sort_action)
|
sort_action.connect("activate", shared.win.on_sort_action)
|
||||||
shared.win.add_action(sort_action)
|
shared.win.add_action(sort_action)
|
||||||
shared.win.on_sort_action(
|
shared.win.on_sort_action(sort_action, sort_mode)
|
||||||
sort_action, shared.state_schema.get_value("sort-mode")
|
|
||||||
)
|
|
||||||
|
|
||||||
if self.init_search_term: # For command line activation
|
if self.init_search_term: # For command line activation
|
||||||
shared.win.search_bar.set_search_mode(True)
|
shared.win.search_bar.set_search_mode(True)
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
|||||||
toasts: dict = {}
|
toasts: dict = {}
|
||||||
active_game: Game
|
active_game: Game
|
||||||
details_view_game_cover: Optional[GameCover] = None
|
details_view_game_cover: Optional[GameCover] = None
|
||||||
sort_state: str = "a-z"
|
sort_state: str = "last_played"
|
||||||
filter_state: str = "all"
|
filter_state: str = "all"
|
||||||
source_rows: dict = {}
|
source_rows: dict = {}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
<choice value="oldest" />
|
<choice value="oldest" />
|
||||||
<choice value="last_played" />
|
<choice value="last_played" />
|
||||||
</choices>
|
</choices>
|
||||||
<default>"a-z"</default>
|
<default>"last_played"</default>
|
||||||
</key>
|
</key>
|
||||||
<key name="show-sidebar" type="b">
|
<key name="show-sidebar" type="b">
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
|
|||||||
Reference in New Issue
Block a user