From 1eb4bde631772579c4cc72cc830f974054278baf Mon Sep 17 00:00:00 2001 From: tkashkin Date: Fri, 20 Jul 2018 17:15:57 +0300 Subject: [PATCH] Bugfixes Design changes Compatibility Former-commit-id: 268bdfe664464a85ca3a4d3681690aa6c555188e --- README.md | 2 +- data/GameHub.css | 43 +++++++ ...com.github.tkashkin.gamehub.appdata.xml.in | 7 ++ debian/changelog | 8 ++ meson.build | 6 + meson_options.txt | 2 + po/com.github.tkashkin.gamehub.pot | 92 ++++++++------- po/de.po | 105 +++++++++-------- po/id.po | 106 ++++++++++-------- po/pl.po | 103 +++++++++-------- po/pt_BR.po | 102 +++++++++-------- po/ru.po | 102 +++++++++-------- po/uk.po | 102 +++++++++-------- src/app.vala | 10 +- src/data/Game.vala | 1 + src/data/sources/gog/GOGGame.vala | 17 ++- src/data/sources/humble/HumbleGame.vala | 33 +++++- src/data/sources/steam/Steam.vala | 17 ++- src/data/sources/steam/SteamGame.vala | 8 ++ src/ui/dialogs/GameDetailsDialog.vala | 3 +- src/ui/dialogs/GameInstallDialog.vala | 69 ++++++++---- src/ui/dialogs/SettingsDialog.vala | 2 +- .../GameDetailsView/GameDetailsView.vala | 51 ++++++--- src/ui/views/GamesView/GameListRow.vala | 1 + src/ui/views/GamesView/GamesView.vala | 45 +++++--- src/ui/widgets/ActionButton.vala | 35 ++++-- src/utils/FSUtils.vala | 11 +- src/utils/Utils.vala | 36 ++++-- 28 files changed, 719 insertions(+), 400 deletions(-) diff --git a/README.md b/README.md index 996738d0..cfb03410 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ debuild ```bash git clone https://github.com/tkashkin/GameHub.git cd GameHub -meson build --prefix=/usr +meson build --prefix=/usr -Ddistro=generic cd build ninja sudo ninja install diff --git a/data/GameHub.css b/data/GameHub.css index abd171c4..9710b40c 100644 --- a/data/GameHub.css +++ b/data/GameHub.css @@ -91,4 +91,47 @@ { margin-bottom: 0; opacity: 1; +} + +/* Some granite styles */ +.h1 +{ + font-size: 24pt; +} +.h2 +{ + font-weight: 300; + font-size: 18pt; +} +.h3 +{ + font-size: 11pt; +} +.h4, .category-label +{ + font-weight: bold; +} +.h4, .gameinfo-singleline-value +{ + padding-bottom: 6px; + padding-top: 6px; +} +list .h4 +{ + padding-left: 6px; +} +button label +{ + padding: 0 6px; +} +.card +{ + border: none; + border-color: transparent; + box-shadow: 0 0 0 1px alpha (#000, 0.05), 0 3px 3px alpha (#000, 0.22); + border-radius: 4px; +} +list:not(:backdrop) row:selected:focus label.category-label +{ + color: alpha(#ffffff, 0.8); } \ No newline at end of file diff --git a/data/com.github.tkashkin.gamehub.appdata.xml.in b/data/com.github.tkashkin.gamehub.appdata.xml.in index ca94e072..a85c9c1e 100644 --- a/data/com.github.tkashkin.gamehub.appdata.xml.in +++ b/data/com.github.tkashkin.gamehub.appdata.xml.in @@ -41,6 +41,13 @@ + + +

Bugfixes

+

Design changes

+

Compatibility

+
+

Icon fixes

diff --git a/debian/changelog b/debian/changelog index a36612ea..2d420901 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +com.github.tkashkin.gamehub (0.5.5) xenial; urgency=low + + * Bugfixes + * Design changes + * Compatibility + + -- tkashkin Mon, 16 Jul 2018 05:52:48 +0300 + com.github.tkashkin.gamehub (0.5.4) xenial; urgency=low * Icon fixes diff --git a/meson.build b/meson.build index 07cebe0b..64148d50 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,12 @@ if get_option('flatpak') add_global_arguments('-D', 'FLATPAK', language: 'vala') endif +if get_option('distro') == 'debian' + add_global_arguments('-D', 'DISTRO_DEBIAN', '-D', 'PM_APT', language: 'vala') +elif get_option('distro') == 'arch' + add_global_arguments('-D', 'DISTRO_ARCH', '-D', 'PM_PACMAN', language: 'vala') +endif + subdir('data') subdir('src') subdir('po') diff --git a/meson_options.txt b/meson_options.txt index 9246c3da..c292e6d8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,5 @@ +option('distro', type: 'combo', choices: ['generic', 'debian', 'arch'], value: 'debian') + option('flatpak', type: 'boolean', value: false) option('runtime', type: 'string', value: '') diff --git a/po/com.github.tkashkin.gamehub.pot b/po/com.github.tkashkin.gamehub.pot index 56a54916..0726eae6 100644 --- a/po/com.github.tkashkin.gamehub.pot +++ b/po/com.github.tkashkin.gamehub.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: com.github.tkashkin.gamehub\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-14 01:42+0300\n" +"POT-Creation-Date: 2018-07-20 17:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -34,28 +34,28 @@ msgstr "" msgid "Manage your Steam, GOG and Humble Bundle games in one place." msgstr "" -#: src/data/Game.vala:73 +#: src/data/Game.vala:74 msgid "Installed" msgstr "" -#: src/data/Game.vala:74 +#: src/data/Game.vala:75 msgid "Installing" msgstr "" -#: src/data/Game.vala:75 +#: src/data/Game.vala:76 msgid "Download started" msgstr "" -#: src/data/Game.vala:76 +#: src/data/Game.vala:77 msgid "Download finished" msgstr "" -#: src/data/Game.vala:79 +#: src/data/Game.vala:80 #, c-format msgid "Downloading: %d%% (%s / %s)" msgstr "" -#: src/data/Game.vala:81 +#: src/data/Game.vala:82 msgid "Not installed" msgstr "" @@ -69,17 +69,9 @@ msgid "" "Login into your account in Steam client and return to GameHub" msgstr "" -#: src/data/sources/humble/HumbleGame.vala:203 -msgid "Select main executable of the game" -msgstr "" - -#: src/data/sources/humble/HumbleGame.vala:212 -#: src/ui/dialogs/GameInstallDialog.vala:90 -msgid "Cancel" -msgstr "" - -#: src/data/sources/humble/HumbleGame.vala:213 -msgid "Select" +#: src/ui/dialogs/SettingsDialog.vala:13 src/ui/views/WelcomeView.vala:34 +#: src/ui/views/WelcomeView.vala:59 src/ui/views/GamesView/GamesView.vala:141 +msgid "Settings" msgstr "" #: src/ui/dialogs/SettingsDialog.vala:30 @@ -111,21 +103,26 @@ msgid "Humble Bundle games directory" msgstr "" #: src/ui/dialogs/SettingsDialog.vala:61 -#: src/ui/dialogs/GameDetailsDialog.vala:30 +#: src/ui/dialogs/GameDetailsDialog.vala:31 msgid "Close" msgstr "" -#: src/ui/dialogs/GameInstallDialog.vala:56 +#: src/ui/dialogs/GameInstallDialog.vala:33 +#: src/ui/dialogs/GameInstallDialog.vala:128 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:158 +msgid "Install" +msgstr "" + +#: src/ui/dialogs/GameInstallDialog.vala:87 msgid "Select game installer" msgstr "" -#: src/ui/dialogs/GameInstallDialog.vala:94 -msgid "Import" +#: src/ui/dialogs/GameInstallDialog.vala:121 +msgid "Cancel" msgstr "" -#: src/ui/dialogs/GameInstallDialog.vala:97 -#: src/ui/views/GameDetailsView/GameDetailsView.vala:141 -msgid "Install" +#: src/ui/dialogs/GameInstallDialog.vala:125 +msgid "Import" msgstr "" #: src/ui/views/WelcomeView.vala:33 @@ -136,11 +133,6 @@ msgstr "" msgid "Enable some game sources in settings" msgstr "" -#: src/ui/views/WelcomeView.vala:34 src/ui/views/WelcomeView.vala:59 -#: src/ui/views/GamesView/GamesView.vala:147 -msgid "Settings" -msgstr "" - #: src/ui/views/WelcomeView.vala:38 msgid "Let's get started" msgstr "" @@ -149,24 +141,24 @@ msgstr "" msgid "Skip" msgstr "" -#: src/ui/views/WelcomeView.vala:121 +#: src/ui/views/WelcomeView.vala:115 msgid "Ready" msgstr "" -#: src/ui/views/WelcomeView.vala:127 +#: src/ui/views/WelcomeView.vala:121 msgid "Authentication required" msgstr "" -#: src/ui/views/WelcomeView.vala:132 +#: src/ui/views/WelcomeView.vala:126 msgid "Authenticating..." msgstr "" -#: src/ui/views/WelcomeView.vala:143 +#: src/ui/views/WelcomeView.vala:137 #, c-format msgid "Install %s" msgstr "" -#: src/ui/views/WelcomeView.vala:144 +#: src/ui/views/WelcomeView.vala:138 msgid "Return to GameHub after installing" msgstr "" @@ -182,34 +174,50 @@ msgstr "" msgid "All games" msgstr "" -#: src/ui/views/GamesView/GamesView.vala:117 +#: src/ui/views/GamesView/GamesView.vala:111 #, c-format msgid "%s games" msgstr "" -#: src/ui/views/GamesView/GamesView.vala:123 +#: src/ui/views/GamesView/GamesView.vala:117 msgid "Downloads" msgstr "" -#: src/ui/views/GamesView/GamesView.vala:142 +#: src/ui/views/GamesView/GamesView.vala:136 msgid "Search" msgstr "" -#: src/ui/views/GamesView/GamesView.vala:183 +#: src/ui/views/GamesView/GamesView.vala:192 #, c-format msgid "%u game" msgid_plural "%u games" msgstr[0] "" msgstr[1] "" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:142 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:120 +msgid "Description" +msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:159 msgid "Run" msgstr "" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:143 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:160 msgid "Open installation directory" msgstr "" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:144 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:161 msgid "Open store page" msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:162 +msgid "Uninstall" +msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:229 +msgid "Language" +msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:232 +msgid "Languages" +msgstr "" diff --git a/po/de.po b/po/de.po index d4116265..0c0f9c02 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: com.github.tkashkin.gamehub\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-14 01:42+0300\n" +"POT-Creation-Date: 2018-07-20 17:06+0300\n" "PO-Revision-Date: 2018-07-14 00:51+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -33,28 +33,28 @@ msgstr "Alle Spiele an einem Ort" msgid "Manage your Steam, GOG and Humble Bundle games in one place." msgstr "Verwalten Sie Ihre Steam, GOG und Humble Bundle Spiele an einem Ort." -#: src/data/Game.vala:73 +#: src/data/Game.vala:74 msgid "Installed" msgstr "Installiert" -#: src/data/Game.vala:74 +#: src/data/Game.vala:75 msgid "Installing" msgstr "Wird installiert" -#: src/data/Game.vala:75 +#: src/data/Game.vala:76 msgid "Download started" msgstr "Download ist gestartet" -#: src/data/Game.vala:76 +#: src/data/Game.vala:77 msgid "Download finished" msgstr "Download ist beendet" -#: src/data/Game.vala:79 +#: src/data/Game.vala:80 #, c-format msgid "Downloading: %d%% (%s / %s)" msgstr "Herunterladen: %d%% (%s / %s)" -#: src/data/Game.vala:81 +#: src/data/Game.vala:82 msgid "Not installed" msgstr "Nicht installiert" @@ -70,18 +70,10 @@ msgstr "" "Die Steam-Konfigurationsdatei wurde nicht gefunden\n" "Logge dich in dein Konto im Steam-Client ein und kehre zu GameHub zurück" -#: src/data/sources/humble/HumbleGame.vala:203 -msgid "Select main executable of the game" -msgstr "Wählen Sie die Hauptdatei des Spiels" - -#: src/data/sources/humble/HumbleGame.vala:212 -#: src/ui/dialogs/GameInstallDialog.vala:90 -msgid "Cancel" -msgstr "Abbrechen" - -#: src/data/sources/humble/HumbleGame.vala:213 -msgid "Select" -msgstr "Wählen" +#: src/ui/dialogs/SettingsDialog.vala:13 src/ui/views/WelcomeView.vala:34 +#: src/ui/views/WelcomeView.vala:59 src/ui/views/GamesView/GamesView.vala:141 +msgid "Settings" +msgstr "Einstellungen" #: src/ui/dialogs/SettingsDialog.vala:30 msgid "Use dark theme" @@ -89,7 +81,8 @@ msgstr "Dunkles Theme benutzen" #: src/ui/dialogs/SettingsDialog.vala:34 msgid "Steam API keys have limited number of uses per day" -msgstr "Steam-API-Schlüssel haben eine begrenzte Anzahl von Verwendungen pro Tag" +msgstr "" +"Steam-API-Schlüssel haben eine begrenzte Anzahl von Verwendungen pro Tag" #: src/ui/dialogs/SettingsDialog.vala:34 msgid "Generate key" @@ -112,23 +105,28 @@ msgid "Humble Bundle games directory" msgstr "Humble Bundle Spieleordner" #: src/ui/dialogs/SettingsDialog.vala:61 -#: src/ui/dialogs/GameDetailsDialog.vala:30 +#: src/ui/dialogs/GameDetailsDialog.vala:31 msgid "Close" msgstr "Schließen" -#: src/ui/dialogs/GameInstallDialog.vala:56 +#: src/ui/dialogs/GameInstallDialog.vala:33 +#: src/ui/dialogs/GameInstallDialog.vala:128 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:158 +msgid "Install" +msgstr "Installieren" + +#: src/ui/dialogs/GameInstallDialog.vala:87 msgid "Select game installer" msgstr "Wähle das Spiel-Installationsprogramm aus" -#: src/ui/dialogs/GameInstallDialog.vala:94 +#: src/ui/dialogs/GameInstallDialog.vala:121 +msgid "Cancel" +msgstr "Abbrechen" + +#: src/ui/dialogs/GameInstallDialog.vala:125 msgid "Import" msgstr "Einführen" -#: src/ui/dialogs/GameInstallDialog.vala:97 -#: src/ui/views/GameDetailsView/GameDetailsView.vala:141 -msgid "Install" -msgstr "Installieren" - #: src/ui/views/WelcomeView.vala:33 msgid "No enabled game sources" msgstr "Keine aktivierten Spielquellen" @@ -137,11 +135,6 @@ msgstr "Keine aktivierten Spielquellen" msgid "Enable some game sources in settings" msgstr "Aktivieren Sie einige Spielquellen in den Einstellungen" -#: src/ui/views/WelcomeView.vala:34 src/ui/views/WelcomeView.vala:59 -#: src/ui/views/GamesView/GamesView.vala:147 -msgid "Settings" -msgstr "Einstellungen" - #: src/ui/views/WelcomeView.vala:38 msgid "Let's get started" msgstr "Lass uns anfangen" @@ -150,24 +143,24 @@ msgstr "Lass uns anfangen" msgid "Skip" msgstr "Überspringen" -#: src/ui/views/WelcomeView.vala:121 +#: src/ui/views/WelcomeView.vala:115 msgid "Ready" msgstr "Bereit" -#: src/ui/views/WelcomeView.vala:127 +#: src/ui/views/WelcomeView.vala:121 msgid "Authentication required" msgstr "Authentifizierung erforderlich" -#: src/ui/views/WelcomeView.vala:132 +#: src/ui/views/WelcomeView.vala:126 msgid "Authenticating..." msgstr "Authentifizieren..." -#: src/ui/views/WelcomeView.vala:143 +#: src/ui/views/WelcomeView.vala:137 #, c-format msgid "Install %s" msgstr "%s installieren" -#: src/ui/views/WelcomeView.vala:144 +#: src/ui/views/WelcomeView.vala:138 msgid "Return to GameHub after installing" msgstr "Zurück zu GameHub nach der Installation" @@ -183,34 +176,56 @@ msgstr "Listenansicht" msgid "All games" msgstr "Alle Spiele" -#: src/ui/views/GamesView/GamesView.vala:117 +#: src/ui/views/GamesView/GamesView.vala:111 #, c-format msgid "%s games" msgstr "Spiele von %s" -#: src/ui/views/GamesView/GamesView.vala:123 +#: src/ui/views/GamesView/GamesView.vala:117 msgid "Downloads" msgstr "Downloads" -#: src/ui/views/GamesView/GamesView.vala:142 +#: src/ui/views/GamesView/GamesView.vala:136 msgid "Search" msgstr "Suche" -#: src/ui/views/GamesView/GamesView.vala:183 +#: src/ui/views/GamesView/GamesView.vala:192 #, c-format msgid "%u game" msgid_plural "%u games" msgstr[0] "%u Spiel" msgstr[1] "%u Spiele" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:142 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:120 +msgid "Description" +msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:159 msgid "Run" msgstr "Ausführen" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:143 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:160 msgid "Open installation directory" msgstr "Installationsordner öffnen" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:144 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:161 msgid "Open store page" msgstr "Shopseite öffnen" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:162 +msgid "Uninstall" +msgstr "Deinstallieren" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:229 +msgid "Language" +msgstr "Sprache" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:232 +msgid "Languages" +msgstr "Sprachen" + +#~ msgid "Select main executable of the game" +#~ msgstr "Wählen Sie die Hauptdatei des Spiels" + +#~ msgid "Select" +#~ msgstr "Wählen" diff --git a/po/id.po b/po/id.po index 84f9d482..32dfdaf3 100644 --- a/po/id.po +++ b/po/id.po @@ -7,16 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: com.github.tkashkin.gamehub\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-14 01:42+0300\n" +"POT-Creation-Date: 2018-07-20 17:06+0300\n" "PO-Revision-Date: 2018-07-14 22:01+0700\n" +"Last-Translator: Kukuh Syafaat \n" "Language-Team: \n" +"Language: id\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 2.0.6\n" -"Last-Translator: Kukuh Syafaat \n" -"Language: id\n" #: data/com.github.tkashkin.gamehub.appdata.xml.in:8 #: data/com.github.tkashkin.gamehub.desktop.in:3 @@ -34,28 +34,28 @@ msgstr "Semua permainan Anda di satu tempat" msgid "Manage your Steam, GOG and Humble Bundle games in one place." msgstr "Kelola permainan Steam, GOG, dan Humble Bundle Anda di satu tempat." -#: src/data/Game.vala:73 +#: src/data/Game.vala:74 msgid "Installed" msgstr "Terpasang" -#: src/data/Game.vala:74 +#: src/data/Game.vala:75 msgid "Installing" msgstr "Memasang" -#: src/data/Game.vala:75 +#: src/data/Game.vala:76 msgid "Download started" msgstr "Unduhan dimulai" -#: src/data/Game.vala:76 +#: src/data/Game.vala:77 msgid "Download finished" msgstr "Unduhan selesai" -#: src/data/Game.vala:79 +#: src/data/Game.vala:80 #, c-format msgid "Downloading: %d%% (%s / %s)" msgstr "Mengunduh: %d%% (%s / %s)" -#: src/data/Game.vala:81 +#: src/data/Game.vala:82 msgid "Not installed" msgstr "Tidak terpasang" @@ -71,18 +71,10 @@ msgstr "" "Berkas konfigurasi Steam tidak ditemukan.\n" "Masuk ke akun Anda di klien Steam dan kembali ke GameHub" -#: src/data/sources/humble/HumbleGame.vala:203 -msgid "Select main executable of the game" -msgstr "Pilih main executable dari permainan" - -#: src/data/sources/humble/HumbleGame.vala:212 -#: src/ui/dialogs/GameInstallDialog.vala:90 -msgid "Cancel" -msgstr "Batal" - -#: src/data/sources/humble/HumbleGame.vala:213 -msgid "Select" -msgstr "Pilih" +#: src/ui/dialogs/SettingsDialog.vala:13 src/ui/views/WelcomeView.vala:34 +#: src/ui/views/WelcomeView.vala:59 src/ui/views/GamesView/GamesView.vala:141 +msgid "Settings" +msgstr "Pengaturan" #: src/ui/dialogs/SettingsDialog.vala:30 msgid "Use dark theme" @@ -113,23 +105,28 @@ msgid "Humble Bundle games directory" msgstr "Direktori permainan Humble Bundle" #: src/ui/dialogs/SettingsDialog.vala:61 -#: src/ui/dialogs/GameDetailsDialog.vala:30 +#: src/ui/dialogs/GameDetailsDialog.vala:31 msgid "Close" msgstr "Tutup" -#: src/ui/dialogs/GameInstallDialog.vala:56 +#: src/ui/dialogs/GameInstallDialog.vala:33 +#: src/ui/dialogs/GameInstallDialog.vala:128 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:158 +msgid "Install" +msgstr "Pasang" + +#: src/ui/dialogs/GameInstallDialog.vala:87 msgid "Select game installer" msgstr "Pilih pemasang permainan" -#: src/ui/dialogs/GameInstallDialog.vala:94 +#: src/ui/dialogs/GameInstallDialog.vala:121 +msgid "Cancel" +msgstr "Batal" + +#: src/ui/dialogs/GameInstallDialog.vala:125 msgid "Import" msgstr "Impor" -#: src/ui/dialogs/GameInstallDialog.vala:97 -#: src/ui/views/GameDetailsView/GameDetailsView.vala:141 -msgid "Install" -msgstr "Pasang" - #: src/ui/views/WelcomeView.vala:33 msgid "No enabled game sources" msgstr "Tidak ada sumber permainan yang diaktifkan" @@ -138,11 +135,6 @@ msgstr "Tidak ada sumber permainan yang diaktifkan" msgid "Enable some game sources in settings" msgstr "Aktifkan beberapa sumber permainan di pengaturan" -#: src/ui/views/WelcomeView.vala:34 src/ui/views/WelcomeView.vala:59 -#: src/ui/views/GamesView/GamesView.vala:147 -msgid "Settings" -msgstr "Pengaturan" - #: src/ui/views/WelcomeView.vala:38 msgid "Let's get started" msgstr "Mari kita mulai" @@ -151,24 +143,24 @@ msgstr "Mari kita mulai" msgid "Skip" msgstr "Lewati" -#: src/ui/views/WelcomeView.vala:121 +#: src/ui/views/WelcomeView.vala:115 msgid "Ready" msgstr "Siap" -#: src/ui/views/WelcomeView.vala:127 +#: src/ui/views/WelcomeView.vala:121 msgid "Authentication required" msgstr "Diperlukan autentikasi" -#: src/ui/views/WelcomeView.vala:132 +#: src/ui/views/WelcomeView.vala:126 msgid "Authenticating..." msgstr "Mengautentikasi..." -#: src/ui/views/WelcomeView.vala:143 +#: src/ui/views/WelcomeView.vala:137 #, c-format msgid "Install %s" msgstr "Pasang %s" -#: src/ui/views/WelcomeView.vala:144 +#: src/ui/views/WelcomeView.vala:138 msgid "Return to GameHub after installing" msgstr "Kembali ke GameHub setelah memasang" @@ -184,33 +176,55 @@ msgstr "Tilikan daftar" msgid "All games" msgstr "Semua permainan" -#: src/ui/views/GamesView/GamesView.vala:117 +#: src/ui/views/GamesView/GamesView.vala:111 #, c-format msgid "%s games" msgstr "%s permainan" -#: src/ui/views/GamesView/GamesView.vala:123 +#: src/ui/views/GamesView/GamesView.vala:117 msgid "Downloads" msgstr "Unduh" -#: src/ui/views/GamesView/GamesView.vala:142 +#: src/ui/views/GamesView/GamesView.vala:136 msgid "Search" msgstr "Cari" -#: src/ui/views/GamesView/GamesView.vala:183 +#: src/ui/views/GamesView/GamesView.vala:192 #, c-format msgid "%u game" msgid_plural "%u games" msgstr[0] "%u permainan" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:142 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:120 +msgid "Description" +msgstr "Deskripsi" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:159 msgid "Run" msgstr "Jalankan" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:143 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:160 msgid "Open installation directory" msgstr "Buka direktori pemasangan" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:144 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:161 msgid "Open store page" msgstr "Buka halaman toko" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:162 +msgid "Uninstall" +msgstr "Copot pemasangan" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:229 +msgid "Language" +msgstr "Bahasa" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:232 +msgid "Languages" +msgstr "Bahasa" + +#~ msgid "Select main executable of the game" +#~ msgstr "Pilih main executable dari permainan" + +#~ msgid "Select" +#~ msgstr "Pilih" diff --git a/po/pl.po b/po/pl.po index d184b346..5ae893c7 100644 --- a/po/pl.po +++ b/po/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: com.github.tkashkin.gamehub\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-14 01:42+0300\n" +"POT-Creation-Date: 2018-07-20 17:06+0300\n" "PO-Revision-Date: 2018-07-14 00:51+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -34,28 +34,28 @@ msgstr "Wszystkie gry w jednym miejscu" msgid "Manage your Steam, GOG and Humble Bundle games in one place." msgstr "Zarządzaj grami Steam, GOG i Humble Bundle w jednym miejscu" -#: src/data/Game.vala:73 +#: src/data/Game.vala:74 msgid "Installed" msgstr "Zainstalowana" -#: src/data/Game.vala:74 +#: src/data/Game.vala:75 msgid "Installing" msgstr "Instalacja" -#: src/data/Game.vala:75 +#: src/data/Game.vala:76 msgid "Download started" msgstr "Pobieranie rozpoczęte" -#: src/data/Game.vala:76 +#: src/data/Game.vala:77 msgid "Download finished" msgstr "Pobieranie zakończone" -#: src/data/Game.vala:79 +#: src/data/Game.vala:80 #, c-format msgid "Downloading: %d%% (%s / %s)" msgstr "Ściąganie: %d%% (%s / %s)" -#: src/data/Game.vala:81 +#: src/data/Game.vala:82 msgid "Not installed" msgstr "Nie zainstalowana" @@ -71,18 +71,10 @@ msgstr "" "Nie znaleziono pliku konfiguracyjnego Steam.\n" "Zaloguj się do swojego konta w kliencie Steam i wróć do GameHub" -#: src/data/sources/humble/HumbleGame.vala:203 -msgid "Select main executable of the game" -msgstr "Wybierz główny plik wykonywalny gry" - -#: src/data/sources/humble/HumbleGame.vala:212 -#: src/ui/dialogs/GameInstallDialog.vala:90 -msgid "Cancel" -msgstr "Anuluj" - -#: src/data/sources/humble/HumbleGame.vala:213 -msgid "Select" -msgstr "Wybierz" +#: src/ui/dialogs/SettingsDialog.vala:13 src/ui/views/WelcomeView.vala:34 +#: src/ui/views/WelcomeView.vala:59 src/ui/views/GamesView/GamesView.vala:141 +msgid "Settings" +msgstr "Ustawienia" #: src/ui/dialogs/SettingsDialog.vala:30 msgid "Use dark theme" @@ -113,23 +105,28 @@ msgid "Humble Bundle games directory" msgstr "Katalog gier Humble Bundle" #: src/ui/dialogs/SettingsDialog.vala:61 -#: src/ui/dialogs/GameDetailsDialog.vala:30 +#: src/ui/dialogs/GameDetailsDialog.vala:31 msgid "Close" msgstr "Zamknij" -#: src/ui/dialogs/GameInstallDialog.vala:56 +#: src/ui/dialogs/GameInstallDialog.vala:33 +#: src/ui/dialogs/GameInstallDialog.vala:128 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:158 +msgid "Install" +msgstr "Instaluj" + +#: src/ui/dialogs/GameInstallDialog.vala:87 msgid "Select game installer" msgstr "Wybierz instalator gry" -#: src/ui/dialogs/GameInstallDialog.vala:94 +#: src/ui/dialogs/GameInstallDialog.vala:121 +msgid "Cancel" +msgstr "Anuluj" + +#: src/ui/dialogs/GameInstallDialog.vala:125 msgid "Import" msgstr "Importuj" -#: src/ui/dialogs/GameInstallDialog.vala:97 -#: src/ui/views/GameDetailsView/GameDetailsView.vala:141 -msgid "Install" -msgstr "Instaluj" - #: src/ui/views/WelcomeView.vala:33 msgid "No enabled game sources" msgstr "Brak włączonych źródeł gier" @@ -138,11 +135,6 @@ msgstr "Brak włączonych źródeł gier" msgid "Enable some game sources in settings" msgstr "Włącz niektóre źródła gier w ustawieniach" -#: src/ui/views/WelcomeView.vala:34 src/ui/views/WelcomeView.vala:59 -#: src/ui/views/GamesView/GamesView.vala:147 -msgid "Settings" -msgstr "Ustawienia" - #: src/ui/views/WelcomeView.vala:38 msgid "Let's get started" msgstr "Zacznijmy" @@ -151,24 +143,24 @@ msgstr "Zacznijmy" msgid "Skip" msgstr "Pominąć" -#: src/ui/views/WelcomeView.vala:121 +#: src/ui/views/WelcomeView.vala:115 msgid "Ready" msgstr "Gotowe" -#: src/ui/views/WelcomeView.vala:127 +#: src/ui/views/WelcomeView.vala:121 msgid "Authentication required" msgstr "Wymagane uwierzytelnienie" -#: src/ui/views/WelcomeView.vala:132 +#: src/ui/views/WelcomeView.vala:126 msgid "Authenticating..." msgstr "Uwierzytelnianie..." -#: src/ui/views/WelcomeView.vala:143 +#: src/ui/views/WelcomeView.vala:137 #, c-format msgid "Install %s" msgstr "Instaluj %s" -#: src/ui/views/WelcomeView.vala:144 +#: src/ui/views/WelcomeView.vala:138 msgid "Return to GameHub after installing" msgstr "Wróć do GameHub po instalacji" @@ -184,20 +176,20 @@ msgstr "Widok listy" msgid "All games" msgstr "Wszystkie gry" -#: src/ui/views/GamesView/GamesView.vala:117 +#: src/ui/views/GamesView/GamesView.vala:111 #, c-format msgid "%s games" msgstr "Gry z %s" -#: src/ui/views/GamesView/GamesView.vala:123 +#: src/ui/views/GamesView/GamesView.vala:117 msgid "Downloads" msgstr "Pliki do pobrania" -#: src/ui/views/GamesView/GamesView.vala:142 +#: src/ui/views/GamesView/GamesView.vala:136 msgid "Search" msgstr "Szukaj" -#: src/ui/views/GamesView/GamesView.vala:183 +#: src/ui/views/GamesView/GamesView.vala:192 #, c-format msgid "%u game" msgid_plural "%u games" @@ -205,14 +197,37 @@ msgstr[0] "%u gra" msgstr[1] "%u gry" msgstr[2] "%u gier" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:142 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:120 +msgid "Description" +msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:159 msgid "Run" msgstr "Uruchom" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:143 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:160 msgid "Open installation directory" msgstr "Otwórz katalog instalacyjny" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:144 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:161 msgid "Open store page" msgstr "Otwórz stronę sklepu" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:162 +#, fuzzy +msgid "Uninstall" +msgstr "Odinstaluj" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:229 +msgid "Language" +msgstr "Język" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:232 +msgid "Languages" +msgstr "Języki" + +#~ msgid "Select main executable of the game" +#~ msgstr "Wybierz główny plik wykonywalny gry" + +#~ msgid "Select" +#~ msgstr "Wybierz" diff --git a/po/pt_BR.po b/po/pt_BR.po index 19c5a88f..ae0d4288 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: com.github.tkashkin.gamehub\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-14 01:42+0300\n" +"POT-Creation-Date: 2018-07-20 17:06+0300\n" "PO-Revision-Date: 2018-07-13 16:18+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -33,28 +33,28 @@ msgstr "Todos os seus jogos em um só lugar" msgid "Manage your Steam, GOG and Humble Bundle games in one place." msgstr "Gerencie seus jogos Steam, GOG e Humble Bundle em um só lugar." -#: src/data/Game.vala:73 +#: src/data/Game.vala:74 msgid "Installed" msgstr "Instalado" -#: src/data/Game.vala:74 +#: src/data/Game.vala:75 msgid "Installing" msgstr "Instalando" -#: src/data/Game.vala:75 +#: src/data/Game.vala:76 msgid "Download started" msgstr "Começou a baixar" -#: src/data/Game.vala:76 +#: src/data/Game.vala:77 msgid "Download finished" msgstr "Jogo baixado com sucesso" -#: src/data/Game.vala:79 +#: src/data/Game.vala:80 #, c-format msgid "Downloading: %d%% (%s / %s)" msgstr "Baixando: %d%% (%s / %s)" -#: src/data/Game.vala:81 +#: src/data/Game.vala:82 msgid "Not installed" msgstr "Não instalado" @@ -70,18 +70,10 @@ msgstr "" "Arquivo de configuração do Steam não encontrado.\n" "Entre na sua conta no cliente Steam e retorne ao GameHub" -#: src/data/sources/humble/HumbleGame.vala:203 -msgid "Select main executable of the game" -msgstr "Selecione o executável principal do jogo" - -#: src/data/sources/humble/HumbleGame.vala:212 -#: src/ui/dialogs/GameInstallDialog.vala:90 -msgid "Cancel" -msgstr "Cancelar" - -#: src/data/sources/humble/HumbleGame.vala:213 -msgid "Select" -msgstr "Selecione" +#: src/ui/dialogs/SettingsDialog.vala:13 src/ui/views/WelcomeView.vala:34 +#: src/ui/views/WelcomeView.vala:59 src/ui/views/GamesView/GamesView.vala:141 +msgid "Settings" +msgstr "Configurações" #: src/ui/dialogs/SettingsDialog.vala:30 msgid "Use dark theme" @@ -112,23 +104,28 @@ msgid "Humble Bundle games directory" msgstr "Diretório de jogos Humble Bundle" #: src/ui/dialogs/SettingsDialog.vala:61 -#: src/ui/dialogs/GameDetailsDialog.vala:30 +#: src/ui/dialogs/GameDetailsDialog.vala:31 msgid "Close" msgstr "Fechar" -#: src/ui/dialogs/GameInstallDialog.vala:56 +#: src/ui/dialogs/GameInstallDialog.vala:33 +#: src/ui/dialogs/GameInstallDialog.vala:128 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:158 +msgid "Install" +msgstr "Instalar" + +#: src/ui/dialogs/GameInstallDialog.vala:87 msgid "Select game installer" msgstr "Selecione o instalador do jogo" -#: src/ui/dialogs/GameInstallDialog.vala:94 +#: src/ui/dialogs/GameInstallDialog.vala:121 +msgid "Cancel" +msgstr "Cancelar" + +#: src/ui/dialogs/GameInstallDialog.vala:125 msgid "Import" msgstr "Importar" -#: src/ui/dialogs/GameInstallDialog.vala:97 -#: src/ui/views/GameDetailsView/GameDetailsView.vala:141 -msgid "Install" -msgstr "Instalar" - #: src/ui/views/WelcomeView.vala:33 msgid "No enabled game sources" msgstr "Nenhuma fonte de jogo ativada" @@ -137,11 +134,6 @@ msgstr "Nenhuma fonte de jogo ativada" msgid "Enable some game sources in settings" msgstr "Ative algumas fontes de jogos nas configurações" -#: src/ui/views/WelcomeView.vala:34 src/ui/views/WelcomeView.vala:59 -#: src/ui/views/GamesView/GamesView.vala:147 -msgid "Settings" -msgstr "Configurações" - #: src/ui/views/WelcomeView.vala:38 msgid "Let's get started" msgstr "Vamos começar" @@ -150,24 +142,24 @@ msgstr "Vamos começar" msgid "Skip" msgstr "Pular" -#: src/ui/views/WelcomeView.vala:121 +#: src/ui/views/WelcomeView.vala:115 msgid "Ready" msgstr "Pronto" -#: src/ui/views/WelcomeView.vala:127 +#: src/ui/views/WelcomeView.vala:121 msgid "Authentication required" msgstr "Autentificação requerida" -#: src/ui/views/WelcomeView.vala:132 +#: src/ui/views/WelcomeView.vala:126 msgid "Authenticating..." msgstr "Autenticando..." -#: src/ui/views/WelcomeView.vala:143 +#: src/ui/views/WelcomeView.vala:137 #, c-format msgid "Install %s" msgstr "Instalar %s" -#: src/ui/views/WelcomeView.vala:144 +#: src/ui/views/WelcomeView.vala:138 msgid "Return to GameHub after installing" msgstr "Retornar ao GameHub depois de instalar" @@ -183,34 +175,56 @@ msgstr "Visualizar lista" msgid "All games" msgstr "Todos os jogos" -#: src/ui/views/GamesView/GamesView.vala:117 +#: src/ui/views/GamesView/GamesView.vala:111 #, c-format msgid "%s games" msgstr "%s jogos" -#: src/ui/views/GamesView/GamesView.vala:123 +#: src/ui/views/GamesView/GamesView.vala:117 msgid "Downloads" msgstr "Baixado" -#: src/ui/views/GamesView/GamesView.vala:142 +#: src/ui/views/GamesView/GamesView.vala:136 msgid "Search" msgstr "Pesquisar" -#: src/ui/views/GamesView/GamesView.vala:183 +#: src/ui/views/GamesView/GamesView.vala:192 #, c-format msgid "%u game" msgid_plural "%u games" msgstr[0] "%u jogo" msgstr[1] "%u jogos" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:142 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:120 +msgid "Description" +msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:159 msgid "Run" msgstr "Correr" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:143 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:160 msgid "Open installation directory" msgstr "Abra o diretório de instalação" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:144 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:161 msgid "Open store page" msgstr "Abra a página da loja" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:162 +msgid "Uninstall" +msgstr "Desinstalar" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:229 +msgid "Language" +msgstr "Língua" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:232 +msgid "Languages" +msgstr "Línguas" + +#~ msgid "Select main executable of the game" +#~ msgstr "Selecione o executável principal do jogo" + +#~ msgid "Select" +#~ msgstr "Selecione" diff --git a/po/ru.po b/po/ru.po index 210b1bbe..c0a244c2 100644 --- a/po/ru.po +++ b/po/ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: com.github.tkashkin.gamehub\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-14 01:42+0300\n" +"POT-Creation-Date: 2018-07-20 17:06+0300\n" "PO-Revision-Date: 2018-05-27 03:39+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -34,28 +34,28 @@ msgstr "Все игры в одном месте" msgid "Manage your Steam, GOG and Humble Bundle games in one place." msgstr "Управляйте играми из Steam, GOG и Humble Bundle в одном месте" -#: src/data/Game.vala:73 +#: src/data/Game.vala:74 msgid "Installed" msgstr "Установлена" -#: src/data/Game.vala:74 +#: src/data/Game.vala:75 msgid "Installing" msgstr "Установка" -#: src/data/Game.vala:75 +#: src/data/Game.vala:76 msgid "Download started" msgstr "Загрузка начата" -#: src/data/Game.vala:76 +#: src/data/Game.vala:77 msgid "Download finished" msgstr "Загрузка завершена" -#: src/data/Game.vala:79 +#: src/data/Game.vala:80 #, c-format msgid "Downloading: %d%% (%s / %s)" msgstr "Загрузка: %d%% (%s / %s)" -#: src/data/Game.vala:81 +#: src/data/Game.vala:82 msgid "Not installed" msgstr "Не установлена" @@ -71,18 +71,10 @@ msgstr "" "Файл конфигурации Steam не найден.\n" "Войдите в ваш аккаунт в клиенте Steam и вернитесь в GameHub" -#: src/data/sources/humble/HumbleGame.vala:203 -msgid "Select main executable of the game" -msgstr "Выберите исполняемый файл игры" - -#: src/data/sources/humble/HumbleGame.vala:212 -#: src/ui/dialogs/GameInstallDialog.vala:90 -msgid "Cancel" -msgstr "Отмена" - -#: src/data/sources/humble/HumbleGame.vala:213 -msgid "Select" -msgstr "Выбрать" +#: src/ui/dialogs/SettingsDialog.vala:13 src/ui/views/WelcomeView.vala:34 +#: src/ui/views/WelcomeView.vala:59 src/ui/views/GamesView/GamesView.vala:141 +msgid "Settings" +msgstr "Настройки" #: src/ui/dialogs/SettingsDialog.vala:30 msgid "Use dark theme" @@ -113,23 +105,28 @@ msgid "Humble Bundle games directory" msgstr "Папка игр Humble Bundle" #: src/ui/dialogs/SettingsDialog.vala:61 -#: src/ui/dialogs/GameDetailsDialog.vala:30 +#: src/ui/dialogs/GameDetailsDialog.vala:31 msgid "Close" msgstr "Закрыть" -#: src/ui/dialogs/GameInstallDialog.vala:56 +#: src/ui/dialogs/GameInstallDialog.vala:33 +#: src/ui/dialogs/GameInstallDialog.vala:128 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:158 +msgid "Install" +msgstr "Установить" + +#: src/ui/dialogs/GameInstallDialog.vala:87 msgid "Select game installer" msgstr "Выберите установочный файл игры" -#: src/ui/dialogs/GameInstallDialog.vala:94 +#: src/ui/dialogs/GameInstallDialog.vala:121 +msgid "Cancel" +msgstr "Отмена" + +#: src/ui/dialogs/GameInstallDialog.vala:125 msgid "Import" msgstr "Импортировать" -#: src/ui/dialogs/GameInstallDialog.vala:97 -#: src/ui/views/GameDetailsView/GameDetailsView.vala:141 -msgid "Install" -msgstr "Установить" - #: src/ui/views/WelcomeView.vala:33 msgid "No enabled game sources" msgstr "Нет активных источников игр" @@ -138,11 +135,6 @@ msgstr "Нет активных источников игр" msgid "Enable some game sources in settings" msgstr "Включите источники в настройках" -#: src/ui/views/WelcomeView.vala:34 src/ui/views/WelcomeView.vala:59 -#: src/ui/views/GamesView/GamesView.vala:147 -msgid "Settings" -msgstr "Настройки" - #: src/ui/views/WelcomeView.vala:38 msgid "Let's get started" msgstr "Давайте начнём" @@ -151,24 +143,24 @@ msgstr "Давайте начнём" msgid "Skip" msgstr "Пропустить" -#: src/ui/views/WelcomeView.vala:121 +#: src/ui/views/WelcomeView.vala:115 msgid "Ready" msgstr "Готово" -#: src/ui/views/WelcomeView.vala:127 +#: src/ui/views/WelcomeView.vala:121 msgid "Authentication required" msgstr "Требуется авторизация" -#: src/ui/views/WelcomeView.vala:132 +#: src/ui/views/WelcomeView.vala:126 msgid "Authenticating..." msgstr "Авторизация..." -#: src/ui/views/WelcomeView.vala:143 +#: src/ui/views/WelcomeView.vala:137 #, c-format msgid "Install %s" msgstr "Установить %s" -#: src/ui/views/WelcomeView.vala:144 +#: src/ui/views/WelcomeView.vala:138 msgid "Return to GameHub after installing" msgstr "Вернитесь в GameHub после установки" @@ -184,20 +176,20 @@ msgstr "Список" msgid "All games" msgstr "Все игры" -#: src/ui/views/GamesView/GamesView.vala:117 +#: src/ui/views/GamesView/GamesView.vala:111 #, c-format msgid "%s games" msgstr "Игры из %s" -#: src/ui/views/GamesView/GamesView.vala:123 +#: src/ui/views/GamesView/GamesView.vala:117 msgid "Downloads" msgstr "Загрузки" -#: src/ui/views/GamesView/GamesView.vala:142 +#: src/ui/views/GamesView/GamesView.vala:136 msgid "Search" msgstr "Поиск" -#: src/ui/views/GamesView/GamesView.vala:183 +#: src/ui/views/GamesView/GamesView.vala:192 #, c-format msgid "%u game" msgid_plural "%u games" @@ -205,14 +197,36 @@ msgstr[0] "%u игра" msgstr[1] "%u игры" msgstr[2] "%u игр" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:142 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:120 +msgid "Description" +msgstr "Описание" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:159 msgid "Run" msgstr "Запустить" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:143 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:160 msgid "Open installation directory" msgstr "Открыть папку установки" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:144 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:161 msgid "Open store page" msgstr "Открыть страницу в магазине" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:162 +msgid "Uninstall" +msgstr "Удалить" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:229 +msgid "Language" +msgstr "Язык" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:232 +msgid "Languages" +msgstr "Языки" + +#~ msgid "Select main executable of the game" +#~ msgstr "Выберите исполняемый файл игры" + +#~ msgid "Select" +#~ msgstr "Выбрать" diff --git a/po/uk.po b/po/uk.po index b7c3884c..0b5f3bfd 100644 --- a/po/uk.po +++ b/po/uk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: com.github.tkashkin.gamehub\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-14 01:42+0300\n" +"POT-Creation-Date: 2018-07-20 17:06+0300\n" "PO-Revision-Date: 2018-07-14 00:51+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -34,28 +34,28 @@ msgstr "Всі ігри в одному місці" msgid "Manage your Steam, GOG and Humble Bundle games in one place." msgstr "Керуйте іграми з Steam, GOG і Humble Bundle в одному місці." -#: src/data/Game.vala:73 +#: src/data/Game.vala:74 msgid "Installed" msgstr "Встановлено" -#: src/data/Game.vala:74 +#: src/data/Game.vala:75 msgid "Installing" msgstr "Встановлення" -#: src/data/Game.vala:75 +#: src/data/Game.vala:76 msgid "Download started" msgstr "Завантаження розпочато" -#: src/data/Game.vala:76 +#: src/data/Game.vala:77 msgid "Download finished" msgstr "Завантаження завершено" -#: src/data/Game.vala:79 +#: src/data/Game.vala:80 #, c-format msgid "Downloading: %d%% (%s / %s)" msgstr "Завантаження: %d%% (%s / %s)" -#: src/data/Game.vala:81 +#: src/data/Game.vala:82 msgid "Not installed" msgstr "Не встановлено" @@ -71,18 +71,10 @@ msgstr "" "Файл конфігурації Steam не знайдено.\n" "Увійдіть у свій обліковий запис у клієнті Steam і поверніться до GameHub" -#: src/data/sources/humble/HumbleGame.vala:203 -msgid "Select main executable of the game" -msgstr "Виберіть основний виконуваний файл гри" - -#: src/data/sources/humble/HumbleGame.vala:212 -#: src/ui/dialogs/GameInstallDialog.vala:90 -msgid "Cancel" -msgstr "Скасувати" - -#: src/data/sources/humble/HumbleGame.vala:213 -msgid "Select" -msgstr "Вибрати" +#: src/ui/dialogs/SettingsDialog.vala:13 src/ui/views/WelcomeView.vala:34 +#: src/ui/views/WelcomeView.vala:59 src/ui/views/GamesView/GamesView.vala:141 +msgid "Settings" +msgstr "Налаштування" #: src/ui/dialogs/SettingsDialog.vala:30 msgid "Use dark theme" @@ -113,23 +105,28 @@ msgid "Humble Bundle games directory" msgstr "Каталог ігор Humble Bundle" #: src/ui/dialogs/SettingsDialog.vala:61 -#: src/ui/dialogs/GameDetailsDialog.vala:30 +#: src/ui/dialogs/GameDetailsDialog.vala:31 msgid "Close" msgstr "Закрити" -#: src/ui/dialogs/GameInstallDialog.vala:56 +#: src/ui/dialogs/GameInstallDialog.vala:33 +#: src/ui/dialogs/GameInstallDialog.vala:128 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:158 +msgid "Install" +msgstr "Встановити" + +#: src/ui/dialogs/GameInstallDialog.vala:87 msgid "Select game installer" msgstr "Виберіть інсталятора гри" -#: src/ui/dialogs/GameInstallDialog.vala:94 +#: src/ui/dialogs/GameInstallDialog.vala:121 +msgid "Cancel" +msgstr "Скасувати" + +#: src/ui/dialogs/GameInstallDialog.vala:125 msgid "Import" msgstr "Імпортувати" -#: src/ui/dialogs/GameInstallDialog.vala:97 -#: src/ui/views/GameDetailsView/GameDetailsView.vala:141 -msgid "Install" -msgstr "Встановити" - #: src/ui/views/WelcomeView.vala:33 msgid "No enabled game sources" msgstr "Немає активних джерел ігор" @@ -138,11 +135,6 @@ msgstr "Немає активних джерел ігор" msgid "Enable some game sources in settings" msgstr "Увімкніть джерела ігор у налаштуваннях" -#: src/ui/views/WelcomeView.vala:34 src/ui/views/WelcomeView.vala:59 -#: src/ui/views/GamesView/GamesView.vala:147 -msgid "Settings" -msgstr "Налаштування" - #: src/ui/views/WelcomeView.vala:38 msgid "Let's get started" msgstr "Давайте розпочнемо" @@ -151,24 +143,24 @@ msgstr "Давайте розпочнемо" msgid "Skip" msgstr "Пропустити" -#: src/ui/views/WelcomeView.vala:121 +#: src/ui/views/WelcomeView.vala:115 msgid "Ready" msgstr "Готово" -#: src/ui/views/WelcomeView.vala:127 +#: src/ui/views/WelcomeView.vala:121 msgid "Authentication required" msgstr "Необхідна аутентифікація" -#: src/ui/views/WelcomeView.vala:132 +#: src/ui/views/WelcomeView.vala:126 msgid "Authenticating..." msgstr "Аутентифікація..." -#: src/ui/views/WelcomeView.vala:143 +#: src/ui/views/WelcomeView.vala:137 #, c-format msgid "Install %s" msgstr "Встановити %s" -#: src/ui/views/WelcomeView.vala:144 +#: src/ui/views/WelcomeView.vala:138 msgid "Return to GameHub after installing" msgstr "Поверніться до GameHub після встановлення" @@ -184,20 +176,20 @@ msgstr "Список" msgid "All games" msgstr "Всі ігри" -#: src/ui/views/GamesView/GamesView.vala:117 +#: src/ui/views/GamesView/GamesView.vala:111 #, c-format msgid "%s games" msgstr "Ігри з %s" -#: src/ui/views/GamesView/GamesView.vala:123 +#: src/ui/views/GamesView/GamesView.vala:117 msgid "Downloads" msgstr "Завантаження" -#: src/ui/views/GamesView/GamesView.vala:142 +#: src/ui/views/GamesView/GamesView.vala:136 msgid "Search" msgstr "Пошук" -#: src/ui/views/GamesView/GamesView.vala:183 +#: src/ui/views/GamesView/GamesView.vala:192 #, c-format msgid "%u game" msgid_plural "%u games" @@ -205,14 +197,36 @@ msgstr[0] "%u гра" msgstr[1] "%u гри" msgstr[2] "%u ігор" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:142 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:120 +msgid "Description" +msgstr "" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:159 msgid "Run" msgstr "Запустити" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:143 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:160 msgid "Open installation directory" msgstr "Відкрити каталог встановлення" -#: src/ui/views/GameDetailsView/GameDetailsView.vala:144 +#: src/ui/views/GameDetailsView/GameDetailsView.vala:161 msgid "Open store page" msgstr "Відкрити сторінку магазину" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:162 +msgid "Uninstall" +msgstr "Видалити" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:229 +msgid "Language" +msgstr "Мова" + +#: src/ui/views/GameDetailsView/GameDetailsView.vala:232 +msgid "Languages" +msgstr "Мови" + +#~ msgid "Select main executable of the game" +#~ msgstr "Виберіть основний виконуваний файл гри" + +#~ msgid "Select" +#~ msgstr "Вибрати" diff --git a/src/app.vala b/src/app.vala index 9251b2f1..6f4cd72c 100644 --- a/src/app.vala +++ b/src/app.vala @@ -24,11 +24,13 @@ namespace GameHub { weak IconTheme default_theme = IconTheme.get_default(); default_theme.add_resource_path("/com/github/tkashkin/gamehub/icons"); - + var provider = new CssProvider(); provider.load_from_resource("/com/github/tkashkin/gamehub/GameHub.css"); StyleContext.add_provider_for_screen(Screen.get_default(), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - + + info("Distro: %s", Utils.get_distro()); + new GameHub.UI.Windows.MainWindow(this).show_all(); } @@ -42,13 +44,13 @@ namespace GameHub Intl.bindtextdomain(ProjectConfig.GETTEXT_PACKAGE, ProjectConfig.DATADIR + "/locale"); Intl.bind_textdomain_codeset(ProjectConfig.GETTEXT_PACKAGE, "UTF-8"); Intl.textdomain(ProjectConfig.GETTEXT_PACKAGE); - + FSUtils.make_dirs(); GamesDB.init(); GameSources = { new Steam(), new GOG(), new Humble() }; - + var app = new Application(); return app.run(args); } diff --git a/src/data/Game.vala b/src/data/Game.vala index 98c9403b..9d97263b 100644 --- a/src/data/Game.vala +++ b/src/data/Game.vala @@ -24,6 +24,7 @@ namespace GameHub.Data public abstract async void install(Utils.DownloadProgress progress = (d, t) => {}); public abstract async void run(); + public abstract async void uninstall(); public virtual async void update_game_info(){} diff --git a/src/data/sources/gog/GOGGame.vala b/src/data/sources/gog/GOGGame.vala index 3f4af3b7..9f287bfb 100644 --- a/src/data/sources/gog/GOGGame.vala +++ b/src/data/sources/gog/GOGGame.vala @@ -80,6 +80,12 @@ namespace GameHub.Data.Sources.GOG description = root.get_object_member("description").get_string_member("full"); store_page = root.get_object_member("links").get_string_member("product_card"); + var cool = root.get_object_member("description").get_string_member("whats_cool_about_it"); + if(cool != null && cool.length > 0) + { + description += "
  • " + cool.replace("\n", "
  • ") + "
"; + } + GamesDB.get_instance().add_game(this); status = new Game.Status(executable.query_exists() ? Game.State.INSTALLED : Game.State.UNINSTALLED); @@ -152,7 +158,16 @@ namespace GameHub.Data.Sources.GOG if(is_installed()) { var path = executable.get_path(); - yield Utils.run_async({path}, null, true, false); + yield Utils.run_thread({path}, null, true); + } + } + + public override async void uninstall() + { + if(is_installed()) + { + yield Utils.run_async({"sh", "-c", FSUtils.expand(install_dir.get_path(), "uninstall-*.sh")}, null, true); + status = new Game.Status(executable.query_exists() ? Game.State.INSTALLED : Game.State.UNINSTALLED); } } diff --git a/src/data/sources/humble/HumbleGame.vala b/src/data/sources/humble/HumbleGame.vala index e85cffcb..a882438d 100644 --- a/src/data/sources/humble/HumbleGame.vala +++ b/src/data/sources/humble/HumbleGame.vala @@ -178,6 +178,28 @@ namespace GameHub.Data.Sources.Humble Utils.run_async.begin(cmd, null, false, true, (obj, res) => { Utils.run_async.end(res); Utils.run({"chmod", "-R", "+x", install_dir.get_path()}); + + string? dirname = null; + FileInfo? finfo = null; + var enumerator = install_dir.enumerate_children("standard::*", FileQueryInfoFlags.NOFOLLOW_SYMLINKS); + while((finfo = enumerator.next_file()) != null) + { + if(dirname == null) + { + dirname = finfo.get_name(); + } + else + { + dirname = null; + } + } + + if(dirname != null) + { + Utils.run({"bash", "-c", "mv " + dirname + "/* " + dirname + "/.* ."}, install_dir.get_path()); + FSUtils.rm(install_dir.get_path(), dirname, "-rf"); + } + choose_executable(); Idle.add(install.callback); }); @@ -241,7 +263,16 @@ namespace GameHub.Data.Sources.Humble if(is_installed()) { var path = executable.get_path(); - yield Utils.run_async({path}, null, true, false); + yield Utils.run_thread({path}, null, true); + } + } + + public override async void uninstall() + { + if(is_installed()) + { + FSUtils.rm(install_dir.get_path(), "", "-rf"); + status = new Game.Status(executable.query_exists() ? Game.State.INSTALLED : Game.State.UNINSTALLED); } } diff --git a/src/data/sources/steam/Steam.vala b/src/data/sources/steam/Steam.vala index 1448aebb..bf3ab1d6 100644 --- a/src/data/sources/steam/Steam.vala +++ b/src/data/sources/steam/Steam.vala @@ -42,14 +42,25 @@ namespace GameHub.Data.Sources.Steam { return (!) installed; } - - installed = Utils.is_package_installed("steam"); + + if("elementary" in Utils.get_distro()) + { + installed = Utils.is_package_installed("steam"); + } + else + { + installed = FSUtils.file(FSUtils.Paths.Steam.Home).query_exists(); + } + return (!) installed; } public override async bool install() { - Utils.open_uri("appstream://steam.desktop"); + if("elementary" in Utils.get_distro()) + { + Utils.open_uri("appstream://steam.desktop"); + } return true; } diff --git a/src/data/sources/steam/SteamGame.vala b/src/data/sources/steam/SteamGame.vala index 9d944817..413401ac 100644 --- a/src/data/sources/steam/SteamGame.vala +++ b/src/data/sources/steam/SteamGame.vala @@ -117,5 +117,13 @@ namespace GameHub.Data.Sources.Steam { Utils.open_uri(@"steam://rungameid/$(id)"); } + + public override async void uninstall() + { + if(is_installed()) + { + + } + } } } diff --git a/src/ui/dialogs/GameDetailsDialog.vala b/src/ui/dialogs/GameDetailsDialog.vala index 2d884b26..0b2b4fd0 100644 --- a/src/ui/dialogs/GameDetailsDialog.vala +++ b/src/ui/dialogs/GameDetailsDialog.vala @@ -11,7 +11,8 @@ namespace GameHub.UI.Dialogs { Object(transient_for: Windows.MainWindow.instance, deletable: false, resizable: false, title: game.name); - set_modal(true); + gravity = Gdk.Gravity.CENTER; + modal = true; var content = get_content_area(); content.set_size_request(560, -1); diff --git a/src/ui/dialogs/GameInstallDialog.vala b/src/ui/dialogs/GameInstallDialog.vala index 7ac76c61..a1ffef33 100644 --- a/src/ui/dialogs/GameInstallDialog.vala +++ b/src/ui/dialogs/GameInstallDialog.vala @@ -2,6 +2,7 @@ using Gtk; using GLib; using Gee; using GameHub.Utils; +using GameHub.UI.Widgets; using GameHub.Data; using GameHub.Data.Sources.GOG; @@ -9,7 +10,7 @@ using GameHub.Data.Sources.Humble; namespace GameHub.UI.Dialogs { - public class GameInstallDialog: Granite.MessageDialog + public class GameInstallDialog: Dialog { private const int RESPONSE_IMPORT = 123; @@ -17,6 +18,12 @@ namespace GameHub.UI.Dialogs public signal void install(Game.Installer installer); public signal void canceled(); + private Box content; + private Box actions; + private Label title_label; + private Label subtitle_label; + private AutoSizeImage icon; + private ListBox installers_list; private bool is_finished = false; @@ -25,28 +32,42 @@ namespace GameHub.UI.Dialogs { Object(transient_for: Windows.MainWindow.instance, deletable: false, resizable: false, title: _("Install")); - set_modal(true); - - try - { - image_icon = Icon.new_for_string("go-down"); + modal = true; - if(game.icon != null && game.icon.length > 0) - { - Utils.cache_image.begin(game.icon, "icon", (obj, res) => { - var cached = Utils.cache_image.end(res); - if(cached != null) image_icon = new FileIcon(File.new_for_uri(cached)); - }); - } - } - catch(Error e) - { - warning(e.message); - } + content = new Box(Orientation.VERTICAL, 0); + content.margin_start = content.margin_end = 8; + + var title_hbox = new Box(Orientation.HORIZONTAL, 16); - primary_text = game.name; + var icon = new AutoSizeImage(); + icon.set_constraint(48, 48, 1); + icon.set_size_request(48, 48); + + title_label = new Label(null); + title_label.halign = Align.START; + title_label.hexpand = true; + title_label.get_style_context().add_class(Granite.STYLE_CLASS_H2_LABEL); + + subtitle_label = new Label(null); + subtitle_label.halign = Align.START; + subtitle_label.hexpand = true; + + var title_vbox = new Box(Orientation.VERTICAL, 0); + + title_vbox.add(title_label); + + title_hbox.add(icon); + title_hbox.add(title_vbox); + + content.add(title_hbox); + + title_label.label = game.name; + Utils.load_image.begin(icon, game.icon, "icon"); installers_list = new ListBox(); + installers_list.margin_start = 64; + installers_list.margin_top = 8; + installers_list.margin_bottom = 8; var sys_langs = Intl.get_language_names(); @@ -63,9 +84,9 @@ namespace GameHub.UI.Dialogs if(installers.size > 1) { - secondary_text = _("Select game installer"); - custom_bin.hexpand = true; - custom_bin.child = installers_list; + subtitle_label.label = _("Select game installer"); + title_vbox.add(subtitle_label); + content.add(installers_list); } destroy.connect(() => { if(!is_finished) canceled(); }); @@ -107,7 +128,9 @@ namespace GameHub.UI.Dialogs var install_btn = add_button(_("Install"), ResponseType.ACCEPT); install_btn.get_style_context().add_class(STYLE_CLASS_SUGGESTED_ACTION); install_btn.grab_default(); - + + get_content_area().add(content); + get_content_area().set_size_request(340, 96); show_all(); } diff --git a/src/ui/dialogs/SettingsDialog.vala b/src/ui/dialogs/SettingsDialog.vala index 4c111ff5..0553e40f 100644 --- a/src/ui/dialogs/SettingsDialog.vala +++ b/src/ui/dialogs/SettingsDialog.vala @@ -12,7 +12,7 @@ namespace GameHub.UI.Dialogs { Object(transient_for: Windows.MainWindow.instance, deletable: false, resizable: false, title: _("Settings")); - set_modal(true); + modal = true; var content = get_content_area(); content.set_size_request(480, -1); diff --git a/src/ui/views/GameDetailsView/GameDetailsView.vala b/src/ui/views/GameDetailsView/GameDetailsView.vala index 59c2a73e..a688b6d4 100644 --- a/src/ui/views/GameDetailsView/GameDetailsView.vala +++ b/src/ui/views/GameDetailsView/GameDetailsView.vala @@ -52,6 +52,7 @@ namespace GameHub.UI.Views private ActionButton action_run; private ActionButton action_open_directory; private ActionButton action_open_store_page; + private ActionButton action_uninstall; private Granite.HeaderLabel description_header; private WebView description; @@ -63,10 +64,8 @@ namespace GameHub.UI.Views construct { - is_dialog = !(get_toplevel() is GameHub.UI.Windows.MainWindow); - stack = new Stack(); - stack.transition_type = StackTransitionType.CROSSFADE; + stack.transition_type = StackTransitionType.NONE; stack.vexpand = true; spinner = new Spinner(); @@ -134,11 +133,11 @@ namespace GameHub.UI.Views ui_settings.notify["dark-theme"].connect(() => { description.user_content_manager.remove_all_style_sheets(); var style = ui_settings.dark_theme ? CSS_DARK : CSS_LIGHT; - description.user_content_manager.add_style_sheet(new UserStyleSheet(@"body{overflow: hidden; font-size: 0.8em; $(style)}", UserContentInjectedFrames.TOP_FRAME, UserStyleLevel.USER, null, null)); + description.user_content_manager.add_style_sheet(new UserStyleSheet(@"body{overflow: hidden; font-size: 0.8em; line-height: 1.4; $(style)} h1,h2,h3{line-height: 1.2;} ul{padding: 4px 0 4px 16px;}", UserContentInjectedFrames.TOP_FRAME, UserStyleLevel.USER, null, null)); }); ui_settings.notify_property("dark-theme"); - actions = new Box(Orientation.VERTICAL, 0); + actions = new Box(Orientation.HORIZONTAL, 0); actions.margin_top = actions.margin_bottom = 16; content.add(title_hbox); @@ -156,16 +155,19 @@ namespace GameHub.UI.Views add(stack); - action_install = add_action("go-down", _("Install"), install_game); - action_run = add_action("media-playback-start", _("Run"), run_game); + action_install = add_action("go-down", _("Install"), install_game, true); + action_run = add_action("media-playback-start", _("Run"), run_game, true); action_open_directory = add_action("folder", _("Open installation directory"), open_game_directory); action_open_store_page = add_action("web-browser", _("Open store page"), open_game_store_page); + action_uninstall = add_action("edit-delete", _("Uninstall"), uninstall_game); } private async void update_game() { is_dialog = !(get_toplevel() is GameHub.UI.Windows.MainWindow); + content_scrolled.max_content_height = is_dialog ? 640 : -1; + stack.set_visible_child(spinner); if(_game == null) return; @@ -199,10 +201,12 @@ namespace GameHub.UI.Views download_progress.show(); download_progress.fraction = (double) s.dl_bytes / s.dl_bytes_total; } - action_install.visible = s.state == Game.State.UNINSTALLED; + action_install.visible = s.state != Game.State.INSTALLED; + action_install.sensitive = s.state == Game.State.UNINSTALLED; action_run.visible = s.state == Game.State.INSTALLED; action_open_directory.visible = s.state == Game.State.INSTALLED; action_open_store_page.visible = _game.store_page != null; + action_uninstall.visible = s.state == Game.State.INSTALLED; }); _game.status_change(_game.status); @@ -211,26 +215,25 @@ namespace GameHub.UI.Views { var root = Parser.parse_json(_game.custom_info).get_object(); - var sys_langs = Intl.get_language_names(); var langs = root.get_object_member("languages"); if(langs != null) { var langs_string = ""; - foreach(var l in langs.get_members()) { var lang = langs.get_string_member(l); if(l in sys_langs) lang = @"$(lang)"; langs_string += (langs_string.length > 0 ? ", " : "") + lang; } - - add_custom_info_label(_("Languages"), langs_string, false, true); + var langs_label = _("Language"); + if(langs_string.contains(",")) + { + langs_label = _("Languages"); + } + add_custom_info_label(langs_label, langs_string, false, true); } - var cool = "• " + root.get_object_member("description").get_string_member("whats_cool_about_it").replace("\n", "\n• "); - add_custom_info_label(_("What's cool about it?"), cool); - custom_info.show_all(); } custom_info.margin_bottom = custom_info.get_children().length() > 0 ? 16 : 0; @@ -272,10 +275,19 @@ namespace GameHub.UI.Views } } + private void uninstall_game() + { + if(_game != null && _game.status.state == Game.State.INSTALLED) + { + _game.uninstall.begin(); + } + } + private delegate void Action(); - private ActionButton add_action(string icon, string title, Action action) + private ActionButton add_action(string icon, string title, Action action, bool primary=false) { - var button = new ActionButton(new Image.from_icon_name(icon, IconSize.DIALOG), title); + var button = new ActionButton(new Image.from_icon_name(icon, IconSize.DIALOG), title, primary); + button.hexpand = primary; actions.add(button); button.clicked.connect(() => action()); return button; @@ -297,6 +309,11 @@ namespace GameHub.UI.Views text_label.max_width_chars = is_dialog ? 80 : -1; text_label.use_markup = markup; + if(!multiline) + { + text_label.get_style_context().add_class("gameinfo-singleline-value"); + } + var box = new Box(multiline ? Orientation.VERTICAL : Orientation.HORIZONTAL, 0); box.add(title_label); box.add(text_label); diff --git a/src/ui/views/GamesView/GameListRow.vala b/src/ui/views/GamesView/GameListRow.vala index e994d6cd..09a7ca91 100644 --- a/src/ui/views/GamesView/GameListRow.vala +++ b/src/ui/views/GamesView/GameListRow.vala @@ -22,6 +22,7 @@ namespace GameHub.UI.Views var hbox = new Box(Orientation.HORIZONTAL, 8); hbox.margin = 4; var vbox = new Box(Orientation.VERTICAL, 0); + vbox.valign = Align.CENTER; image = new AutoSizeImage(); image.set_constraint(36, 36, 1); diff --git a/src/ui/views/GamesView/GamesView.vala b/src/ui/views/GamesView/GamesView.vala index 8f71d542..e17b743f 100644 --- a/src/ui/views/GamesView/GamesView.vala +++ b/src/ui/views/GamesView/GamesView.vala @@ -167,26 +167,12 @@ namespace GameHub.UI.Views games_grid.set_filter_func(child => { var item = child as GameCard; - var f = filter.selected; - - GameSource? src = null; - if(f > 0) src = sources[f - 1]; - - var games = src == null ? games_grid.get_children().length() : src.games_count; - titlebar.title = "GameHub" + (src == null ? "" : "/" + src.name); - titlebar.subtitle = ngettext("%u game", "%u games", games).printf(games); - - return (src == null || item == null || src == item.game.source) && (item == null || search.text.casefold() in item.game.name.casefold()); + return games_filter(item.game); }); games_list.set_filter_func(row => { var item = row as GameListRow; - var f = filter.selected; - - GameSource? src = null; - if(f > 0) src = sources[f - 1]; - - return (src == null || item == null || src == item.game.source) && (item == null || search.text.casefold() in item.game.name.casefold()); + return games_filter(item.game); }); games_list.row_selected.connect(row => { @@ -197,10 +183,20 @@ namespace GameHub.UI.Views filter.mode_changed.connect(() => { games_grid.invalidate_filter(); games_list.invalidate_filter(); + + var f = filter.selected; + GameSource? src = null; + if(f > 0) src = sources[f - 1]; + var games = src == null ? games_grid.get_children().length() : src.games_count; + titlebar.title = "GameHub" + (src == null ? "" : "/" + src.name); + titlebar.subtitle = ngettext("%u game", "%u games", games).printf(games); + + Timeout.add(100, () => { games_list_select_first_visible_row(); return false; }); }); search.search_changed.connect(() => { games_grid.invalidate_filter(); games_list.invalidate_filter(); + Timeout.add(100, () => { games_list_select_first_visible_row(); return false; }); }); spinner = new Spinner(); @@ -263,5 +259,22 @@ namespace GameHub.UI.Views image.tooltip_text = tooltip; filter.append(image); } + + private bool games_filter(Game game) + { + var f = filter.selected; + GameSource? src = null; + if(f > 0) src = sources[f - 1]; + return (src == null || game == null || src == game.source) && search.text.casefold() in game.name.casefold(); + } + + private void games_list_select_first_visible_row() + { + var row = games_list.get_selected_row() as GameListRow?; + if(row == null || games_filter(row.game)) return; + + row = games_list.get_row_at_y(1) as GameListRow?; + games_list.select_row(row); + } } } diff --git a/src/ui/widgets/ActionButton.vala b/src/ui/widgets/ActionButton.vala index 3dd0a220..a9c9c6b5 100644 --- a/src/ui/widgets/ActionButton.vala +++ b/src/ui/widgets/ActionButton.vala @@ -4,14 +4,27 @@ namespace GameHub.UI.Widgets { class ActionButton: Gtk.Button { - Label button_title; + Label button_text; Image? _icon; Grid button_grid; - public string title + public string text { - get { return button_title.get_text(); } - set { button_title.set_text(value); } + get { return button_text.label; } + set { button_text.label = value; } + } + + public bool show_text + { + get { return button_text.visible; } + set + { + button_text.visible = value; + + tooltip_text = value ? null : text; + button_grid.remove(button_text); + if(value) button_grid.attach(button_text, 1, 0, 1, 1); + } } public Gtk.Image? icon @@ -34,24 +47,24 @@ namespace GameHub.UI.Widgets } } - public ActionButton(Gtk.Image? image, string text) + public ActionButton(Gtk.Image? image, string text, bool show_text=true) { - Object(title: text, icon: image); + Object(text: text, icon: image, show_text: show_text); } construct { - button_title = new Label(null); - button_title.get_style_context().add_class(Granite.STYLE_CLASS_H3_LABEL); - button_title.halign = Align.START; - button_title.valign = Align.CENTER; + button_text = new Label(null); + button_text.get_style_context().add_class(Granite.STYLE_CLASS_H3_LABEL); + button_text.halign = Align.START; + button_text.valign = Align.CENTER; get_style_context().add_class(Gtk.STYLE_CLASS_FLAT); button_grid = new Grid(); button_grid.column_spacing = 8; - button_grid.attach(button_title, 1, 0, 1, 1); + button_grid.attach(button_text, 1, 0, 1, 1); this.add(button_grid); } } diff --git a/src/utils/FSUtils.vala b/src/utils/FSUtils.vala index 60c1ba8a..c0c6b696 100644 --- a/src/utils/FSUtils.vala +++ b/src/utils/FSUtils.vala @@ -108,15 +108,18 @@ namespace GameHub.Utils return null; } + public static void rm(string path, string file="", string flags="-f") + { + Utils.run({"bash", "-c", "rm " + flags + " " + FSUtils.expand(path, file)}); + } + public static void make_dirs() { mkdir(FSUtils.Paths.Cache.Home); mkdir(FSUtils.Paths.Cache.Images); - var cache = FSUtils.expand(FSUtils.Paths.GOG.Installers, "{*~,.goutputstream-*}"); - Utils.run({"bash", "-c", @"'rm $(cache)'"}); - cache = FSUtils.expand(FSUtils.Paths.Humble.Installers, "{*~,.goutputstream-*}"); - Utils.run({"bash", "-c", @"'rm $(cache)'"}); + FSUtils.rm(FSUtils.Paths.GOG.Installers, "{*~,.goutputstream-*}"); + FSUtils.rm(FSUtils.Paths.Humble.Installers, "{*~,.goutputstream-*}"); } } } diff --git a/src/utils/Utils.vala b/src/utils/Utils.vala index 5630fe88..f6e59610 100644 --- a/src/utils/Utils.vala +++ b/src/utils/Utils.vala @@ -45,10 +45,9 @@ namespace GameHub.Utils return stdout; } - public static async int run_async(string[] cmd, string? dir=null, bool override_runtime=false, bool wait=true) + public static async void run_async(string[] cmd, string? dir=null, bool override_runtime=false, bool wait=true) { Pid pid; - int result = -1; var cdir = dir ?? Environment.get_home_dir(); var cenv = Environ.get(); @@ -64,14 +63,12 @@ namespace GameHub.Utils try { - Process.spawn_async(cdir, ccmd, cenv, SpawnFlags.SEARCH_PATH | SpawnFlags.STDERR_TO_DEV_NULL, null, out pid); + Process.spawn_async(cdir, ccmd, cenv, SpawnFlags.SEARCH_PATH | SpawnFlags.STDERR_TO_DEV_NULL | SpawnFlags.DO_NOT_REAP_CHILD, null, out pid); - #if !FLATPAK ChildWatch.add(pid, (pid, status) => { Process.close_pid(pid); - run_async.callback(); + Idle.add(run_async.callback); }); - #endif } catch (Error e) { @@ -79,17 +76,40 @@ namespace GameHub.Utils } if(cwait) yield; + } + + public static async string run_thread(string[] cmd, string? dir=null, bool override_runtime=false) + { + string stdout = ""; + + new Thread("utils-run_thread", () => { + stdout = Utils.run(cmd, dir, override_runtime); + Idle.add(run_thread.callback); + return null; + }); - return result; + yield; + return stdout; + } + + public static string get_distro() + { + #if FLATPAK + return "flatpak"; + #else + return Utils.run({"bash", "-c", "lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | head -n1 || uname -om"}); + #endif } public static bool is_package_installed(string package) { #if FLATPAK return false; - #else + #elif PM_APT var output = Utils.run({"dpkg-query", "-W", "-f=${Status}", package}); return "install ok installed" in output; + #else + return false; #endif }