Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #27 from Vysp3r/21-vimms-lair-parser-rework
Browse files Browse the repository at this point in the history
Vimm's Lair parser rework
  • Loading branch information
Vysp3r authored Feb 17, 2024
2 parents 291fb9c + 15cd217 commit e94fd35
Show file tree
Hide file tree
Showing 10 changed files with 480 additions and 890 deletions.
44 changes: 26 additions & 18 deletions po/com.vysp3r.RetroPlus.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.vysp3r.RetroPlus\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-12 04:02+0300\n"
"POT-Creation-Date: 2024-02-16 21:04-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -58,15 +58,14 @@ msgstr ""
msgid "translator-credits"
msgstr ""

#: src/main-window.vala:33
#: src/main-window.vala:34
msgid "Preferences"
msgstr ""

#: src/main-window.vala:34
#: src/main-window.vala:35
msgid "Keyboard Shortcuts"
msgstr ""

#. Translators: Do not translate the application name
#: src/main-window.vala:36
msgid "About RetroPlus"
msgstr ""
Expand Down Expand Up @@ -96,54 +95,59 @@ msgstr ""
msgid "Version"
msgstr ""

#: src/main-window.vala:111
#: src/main-window.vala:119
msgid ""
"Feels empty in here.\n"
"Why not search for a game?"
msgstr ""

#: src/main-window.vala:187
#: src/main-window.vala:215
msgid ""
"Can't reach the servers.\n"
"Please report this on our GitHub if you think this is a bug."
msgstr ""

#: src/main-window.vala:192
#: src/main-window.vala:220
msgid ""
"An unknown error occurred.\n"
"Please report this on our GitHub."
msgstr ""

#: src/main-window.vala:197
#: src/main-window.vala:225
msgid "Nothing found, try searching again."
msgstr ""

#: src/main-window.vala:270
#: src/main-window.vala:291
#, c-format
msgid "An error occured while opening %s"
msgstr ""

#: src/main-window.vala:296
#: src/main-window.vala:309
#, c-format
msgid "%s is currently missing/unavailable"
msgstr ""

#: src/main-window.vala:324
#, c-format
msgid "%s download queued"
msgstr ""

#: src/main-window.vala:302
#: src/main-window.vala:329
#, c-format
msgid "%s finished downloading"
msgstr ""

#: src/main-window.vala:308
#: src/main-window.vala:334
#, c-format
msgid "%s download cancelled"
msgstr ""

#: src/main-window.vala:314
#: src/main-window.vala:339
#, c-format
msgid "%s could not download due to an error"
msgstr ""

#: src/main-window.vala:320
#: src/main-window.vala:344
#, c-format
msgid "%s is already downloaded"
msgstr ""
Expand Down Expand Up @@ -230,17 +234,17 @@ msgid "See manual"
msgstr ""

#: src/widgets/game-detail-dialog.vala:198
#: src/widgets/game-detail-dialog.vala:228
#: src/widgets/game-detail-dialog.vala:231
msgid "CRC"
msgstr ""

#: src/widgets/game-detail-dialog.vala:199
#: src/widgets/game-detail-dialog.vala:231
#: src/widgets/game-detail-dialog.vala:234
msgid "MD5"
msgstr ""

#: src/widgets/game-detail-dialog.vala:200
#: src/widgets/game-detail-dialog.vala:235
#: src/widgets/game-detail-dialog.vala:238
msgid "SHA1"
msgstr ""

Expand Down Expand Up @@ -268,10 +272,14 @@ msgstr ""
msgid "vote"
msgstr ""

#: src/widgets/game-detail-dialog.vala:228
msgid "Verified"
msgstr ""

#: src/widgets/search-filter-box.vala:31
msgid "Source"
msgstr ""

#: src/widgets/search-row.vala:40
#: src/widgets/search-row.vala:27
msgid "Manual available"
msgstr ""
44 changes: 26 additions & 18 deletions po/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.vysp3r.RetroPlus\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-12 04:02+0300\n"
"POT-Creation-Date: 2024-02-16 21:04-0500\n"
"PO-Revision-Date: 2024-02-12 04:02+0300\n"
"Last-Translator: Sabri Ünal <libreajans@gmail.com>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -62,15 +62,14 @@ msgstr "Özel teşekkürler"
msgid "translator-credits"
msgstr "Sabri Ünal <libreajans@gmail.com>"

#: src/main-window.vala:33
#: src/main-window.vala:34
msgid "Preferences"
msgstr "Tercihler"

#: src/main-window.vala:34
#: src/main-window.vala:35
msgid "Keyboard Shortcuts"
msgstr "Klavye Kısayolları"

#. Translators: Do not translate the application name
#: src/main-window.vala:36
msgid "About RetroPlus"
msgstr "RetroPlus Hakkında"
Expand Down Expand Up @@ -100,60 +99,65 @@ msgstr "Bölge"
msgid "Version"
msgstr "Sürüm"

#: src/main-window.vala:111
#: src/main-window.vala:119
msgid ""
"Feels empty in here.\n"
"Why not search for a game?"
msgstr ""
"Burası boş gibi.\n"
"Neden bir oyun aramıyorsunuz?"

#: src/main-window.vala:187
#: src/main-window.vala:215
msgid ""
"Can't reach the servers.\n"
"Please report this on our GitHub if you think this is a bug."
msgstr ""
"Sunuculara ulaşılamıyor.\n"
"Bunun bir hata olduğunu düşünüyorsanız lütfen GitHub üstünden bildirin."

#: src/main-window.vala:192
#: src/main-window.vala:220
msgid ""
"An unknown error occurred.\n"
"Please report this on our GitHub."
msgstr ""
"Bilinmeyen bir hata oluştu.\n"
"Lütfen bunu GitHub üstünden bildirin."

#: src/main-window.vala:197
#: src/main-window.vala:225
msgid "Nothing found, try searching again."
msgstr "Hiçbir şey bulunamadı, tekrar aramayı deneyin."

#: src/main-window.vala:270
#: src/main-window.vala:291
#, c-format
msgid "An error occured while opening %s"
msgstr "%s açılırken hata oluştu"

#: src/main-window.vala:296
#: src/main-window.vala:309
#, c-format
msgid "%s is currently missing/unavailable"
msgstr ""

#: src/main-window.vala:324
#, c-format
msgid "%s download queued"
msgstr "%s indirme sırasına eklendi"

#: src/main-window.vala:302
#: src/main-window.vala:329
#, c-format
msgid "%s finished downloading"
msgstr "%s indirildi"

#: src/main-window.vala:308
#: src/main-window.vala:334
#, c-format
msgid "%s download cancelled"
msgstr "%s indirmesi iptal edildi"

#: src/main-window.vala:314
#: src/main-window.vala:339
#, c-format
msgid "%s could not download due to an error"
msgstr "%s hata nedeniyle indirilemedi"

#: src/main-window.vala:320
#: src/main-window.vala:344
#, c-format
msgid "%s is already downloaded"
msgstr "%s zaten indirilmiş"
Expand Down Expand Up @@ -240,17 +244,17 @@ msgid "See manual"
msgstr "Kılavuza bak"

#: src/widgets/game-detail-dialog.vala:198
#: src/widgets/game-detail-dialog.vala:228
#: src/widgets/game-detail-dialog.vala:231
msgid "CRC"
msgstr "CRC"

#: src/widgets/game-detail-dialog.vala:199
#: src/widgets/game-detail-dialog.vala:231
#: src/widgets/game-detail-dialog.vala:234
msgid "MD5"
msgstr "MD5"

#: src/widgets/game-detail-dialog.vala:200
#: src/widgets/game-detail-dialog.vala:235
#: src/widgets/game-detail-dialog.vala:238
msgid "SHA1"
msgstr "SHA1"

Expand Down Expand Up @@ -278,11 +282,15 @@ msgstr "oy"
msgid "vote"
msgstr "oy"

#: src/widgets/game-detail-dialog.vala:228
msgid "Verified"
msgstr ""

#: src/widgets/search-filter-box.vala:31
msgid "Source"
msgstr "Kaynak"

#: src/widgets/search-row.vala:40
#: src/widgets/search-row.vala:27
msgid "Manual available"
msgstr "Kılavuz var"

Expand Down
12 changes: 7 additions & 5 deletions src/main-window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ namespace RetroPlus {
}

void on_download_started (Models.Game game, Models.Media media) {
if (game.missing || game.removed) {
var toast = new Adw.Toast (_("%s is currently missing/unavailable").printf (game.title));
toast_overlay.add_toast (toast);

return;
}

var system = Application.systems.get (game.system);

if (system == null) {
Expand All @@ -315,31 +322,26 @@ namespace RetroPlus {
download_popover.add_download (game, media, system);

var toast = new Adw.Toast (_("%s download queued").printf (game.title));

toast_overlay.add_toast (toast);
}

void on_download_finished (Models.Game game) {
var toast = new Adw.Toast (_("%s finished downloading").printf (game.title));

toast_overlay.add_toast (toast);
}

void on_download_cancelled (Models.Game game) {
var toast = new Adw.Toast (_("%s download cancelled").printf (game.title));

toast_overlay.add_toast (toast);
}

void on_download_error (Models.Game game) {
var toast = new Adw.Toast (_("%s could not download due to an error").printf (game.title));

toast_overlay.add_toast (toast);
}

void on_download_file_exists (Models.Game game) {
var toast = new Adw.Toast (_("%s is already downloaded").printf (game.title));

toast_overlay.add_toast (toast);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ sources = [

'utils/web.vala',
'utils/filesystem.vala',
'utils/parser.vala',

'utils/parsers/vimms-lair-parser.vala',

'models/game.vala',
'models/system.vala',
Expand All @@ -46,6 +47,7 @@ deps = [
dependency('libsoup-3.0'),
dependency('json-glib-1.0'),
dependency('gee-0.8'),
dependency('libxml-2.0')
]

executable(
Expand Down
3 changes: 2 additions & 1 deletion src/models/game.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace RetroPlus.Models {
public string system { get; set; }
public List<Region> regions;
public int max_players { get; set; }
public bool removed { get; set; }
public bool has_max_players {
get {
return max_players > 0;
Expand Down Expand Up @@ -119,7 +120,7 @@ namespace RetroPlus.Models {

var game = this;

if (!Utils.Parser.parse_game_request (res, ref game)) {
if (!Utils.VimmsLairParser.parse_game_request (res, ref game)) {
return output = false;
}

Expand Down
Loading

0 comments on commit e94fd35

Please sign in to comment.