diff --git a/data/com.github.tkashkin.gamehub.appdata.xml.in b/data/com.github.tkashkin.gamehub.appdata.xml.in index e00c3a5e..a9d86184 100644 --- a/data/com.github.tkashkin.gamehub.appdata.xml.in +++ b/data/com.github.tkashkin.gamehub.appdata.xml.in @@ -35,7 +35,7 @@ - +

GOG games installation and running

Various improvements

diff --git a/debian/changelog b/debian/changelog index dcfc822b..7b975e42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -com.github.tkashkin.gamehub (0.2.2) xenial; urgency=low +com.github.tkashkin.gamehub (0.2.3) xenial; urgency=low * GOG games installation and running * Various improvements - -- tkashkin Fri, 01 Jun 2018 04:12:18 +0300 + -- tkashkin Fri, 01 Jun 2018 14:36:24 +0300 com.github.tkashkin.gamehub (0.1.3) xenial; urgency=low diff --git a/meson.build b/meson.build index 248a20f5..e42c10f3 100644 --- a/meson.build +++ b/meson.build @@ -3,9 +3,9 @@ project('com.github.tkashkin.gamehub', 'vala', 'c', version: '0.2.2') i18n = import('i18n') gnome = import('gnome') -add_global_arguments('-g', language: 'vala') -add_global_arguments('-X', language: 'vala') -add_global_arguments('-rdynamic', language: 'vala') +#add_global_arguments('-g', language: 'vala') +#add_global_arguments('-X', language: 'vala') +#add_global_arguments('-rdynamic', language: 'vala') add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), language: 'c') subdir('data') diff --git a/src/data/GamesDB.vala b/src/data/GamesDB.vala index 95f7080f..549a54af 100644 --- a/src/data/GamesDB.vala +++ b/src/data/GamesDB.vala @@ -20,7 +20,7 @@ namespace GameHub.Data if(Database.open(path, out db) != Sqlite.OK) { - error("Can't open games database: " + db.errmsg()); + warning("Can't open games database: " + db.errmsg()); db = null; return; } diff --git a/src/data/sources/gog/GOGGame.vala b/src/data/sources/gog/GOGGame.vala index 1d27ff0e..5bfa836a 100644 --- a/src/data/sources/gog/GOGGame.vala +++ b/src/data/sources/gog/GOGGame.vala @@ -73,14 +73,19 @@ namespace GameHub.Data.Sources.GOG var local = FSUtils.expand(FSUtils.Paths.GOG.Installers, "gog_" + id + "_" + installer.id + ".sh"); Downloader.get_instance().download.begin(File.new_for_uri(link), { local }, progress, null, (obj, res) => { - var file = Downloader.get_instance().download.end(res).get_path(); - FSUtils.mkdir(FSUtils.Paths.GOG.Games); - var install_dir = FSUtils.expand(FSUtils.Paths.GOG.Games, name.escape().replace(" ", "_").replace("'", "\\'")); - Utils.run(@"chmod +x '$(file)'"); - Utils.run_async.begin(@"'$(file)' -- --i-agree-to-all-licenses --noreadme --nooptions --noprompt --destination \"$(install_dir)\"", (obj, res) => { - Utils.run_async.end(res); + try + { + var file = Downloader.get_instance().download.end(res).get_path(); + FSUtils.mkdir(FSUtils.Paths.GOG.Games); + var install_dir = FSUtils.expand(FSUtils.Paths.GOG.Games, name.escape().replace(" ", "_").replace("'", "\\'")); + Utils.run(@"chmod +x '$(file)'"); + Utils.run_async(@"'$(file)' -- --i-agree-to-all-licenses --noreadme --nooptions --noprompt --destination \"$(install_dir)\""); Idle.add(install.callback); - }); + } + catch(Error e) + { + warning(e.message); + } }); }); diff --git a/src/data/sources/steam/SteamGame.vala b/src/data/sources/steam/SteamGame.vala index 666c17be..f894b50b 100644 --- a/src/data/sources/steam/SteamGame.vala +++ b/src/data/sources/steam/SteamGame.vala @@ -14,7 +14,6 @@ namespace GameHub.Data.Sources.Steam id = json.get_int_member("appid").to_string(); name = json.get_string_member("name"); var icon_hash = json.get_string_member("img_icon_url"); - var image_hash = json.get_string_member("img_logo_url"); icon = @"https://media.steampowered.com/steamcommunity/public/images/apps/$(id)/$(icon_hash).jpg"; image = @"https://cdn.akamai.steamstatic.com/steam/apps/$(id)/header.jpg"; int64 minutes = json.get_int_member("playtime_forever"); diff --git a/src/meson.build b/src/meson.build index e9fd6495..3b281d0f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -59,7 +59,6 @@ executable( dependency('libsoup-2.4'), dependency('sqlite3'), #dependency('ivy'), - meson.get_compiler('vala').find_library('posix'), ], install: true ) diff --git a/src/ui/views/GamesGridView/GameCard.vala b/src/ui/views/GamesGridView/GameCard.vala index 2522fe79..770f82b1 100644 --- a/src/ui/views/GamesGridView/GameCard.vala +++ b/src/ui/views/GamesGridView/GameCard.vala @@ -18,7 +18,6 @@ namespace GameHub.UI.Views private Label label; private Box actions; - private Button run; private const int CARD_WIDTH_MIN = 320; private const int CARD_WIDTH_MAX = 680; @@ -138,7 +137,7 @@ namespace GameHub.UI.Views } catch(Error e) { - error(e.message); + warning(e.message); } } } diff --git a/src/ui/widgets/AutoSizeImage.vala b/src/ui/widgets/AutoSizeImage.vala index b609a913..c7b37783 100644 --- a/src/ui/widgets/AutoSizeImage.vala +++ b/src/ui/widgets/AutoSizeImage.vala @@ -22,11 +22,11 @@ namespace GameHub.UI.Widgets switch(constraint) { case Orientation.HORIZONTAL: - set_size_request(cmin, -1); + set_size_request(cmin, (int) (cmin * ratio)); break; case Orientation.VERTICAL: - set_size_request(-1, cmin); + set_size_request((int) (cmin / ratio), cmin); break; } } @@ -55,7 +55,7 @@ namespace GameHub.UI.Widgets case Orientation.VERTICAL: new_height = int.max(cmin, int.min(cmax, rect.height)); - new_width = (int) (new_height * ratio); + new_width = (int) (new_height / ratio); break; } diff --git a/src/ui/windows/MainWindow.vala b/src/ui/windows/MainWindow.vala index f59c77df..0e526394 100644 --- a/src/ui/windows/MainWindow.vala +++ b/src/ui/windows/MainWindow.vala @@ -48,9 +48,6 @@ namespace GameHub.UI.Windows saved_state = SavedState.get_instance(); - Unix.signal_add(Posix.Signal.INT, quit_source_func, Priority.HIGH); - Unix.signal_add(Posix.Signal.TERM, quit_source_func, Priority.HIGH); - delete_event.connect(() => { quit(); return false; }); restore_saved_state(); @@ -117,12 +114,6 @@ namespace GameHub.UI.Windows saved_state.window_x = x; saved_state.window_y = y; } - - public bool quit_source_func() - { - quit(); - return false; - } private void quit() { diff --git a/src/utils/Downloader.vala b/src/utils/Downloader.vala index 1d9b802e..72944cd8 100644 --- a/src/utils/Downloader.vala +++ b/src/utils/Downloader.vala @@ -12,12 +12,12 @@ namespace GameHub.Utils public File cached_file; public DownloadProgress progress; - public Download(File remote_file, File cached_file, DownloadProgress progress) + public Download(File remote_file, File cached_file, owned DownloadProgress progress) { this.remote_file = remote_file; this.uri = remote_file.get_uri(); this.cached_file = cached_file; - this.progress = progress; + this.progress = (owned) progress; } } @@ -57,7 +57,7 @@ namespace GameHub.Utils var cached_path = cached_paths[0]; if(download != null) - return yield await_download(download, cached_path, progress); + return yield await_download(download, cached_path, (d, t) => progress(d, t)); var cached_file = get_cached_file(remote_file, cached_paths); if(cached_file != null) @@ -66,7 +66,7 @@ namespace GameHub.Utils var tmp_path = cached_path + "~"; var tmp_file = GLib.File.new_for_path(tmp_path); debug("Downloading '%s'...", uri); - download = new Download(remote_file, tmp_file, progress); + download = new Download(remote_file, tmp_file, (d, t) => progress(d, t)); downloads.set(uri, download); try @@ -162,7 +162,7 @@ namespace GameHub.Utils } } - private async File? await_download(Download download, string cached_path, DownloadProgress progress) throws GLib.Error + private async File? await_download(Download download, string cached_path, owned DownloadProgress progress) throws GLib.Error { File downloaded_file = null; GLib.Error download_error = null; @@ -173,7 +173,7 @@ namespace GameHub.Utils return; downloaded_file = downloaded.cached_file; - callback (); + callback(); }); var downloaded_failed_id = download_failed.connect((downloader, failed_download, error) => { if (failed_download.uri != download.uri) diff --git a/src/utils/FSUtils.vala b/src/utils/FSUtils.vala index a9d85905..5a1b948c 100644 --- a/src/utils/FSUtils.vala +++ b/src/utils/FSUtils.vala @@ -76,7 +76,7 @@ namespace GameHub.Utils } catch(Error e) { - error(e.message); + warning(e.message); } return null; } @@ -96,7 +96,7 @@ namespace GameHub.Utils } catch(Error e) { - error(e.message); + warning(e.message); } return null; } diff --git a/src/utils/Parser.vala b/src/utils/Parser.vala index 3d44da64..108caaf3 100644 --- a/src/utils/Parser.vala +++ b/src/utils/Parser.vala @@ -17,7 +17,7 @@ namespace GameHub.Utils } catch(Error e) { - error(e.message); + warning(e.message); } return data; } @@ -67,7 +67,7 @@ namespace GameHub.Utils } catch(GLib.Error e) { - error(e.message); + warning(e.message); } return new Json.Object(); } @@ -136,7 +136,7 @@ namespace GameHub.Utils } catch(Error e) { - error(e.message); + warning(e.message); } return "{" + json + "}"; diff --git a/src/utils/Utils.vala b/src/utils/Utils.vala index 06e86be3..a72e3284 100644 --- a/src/utils/Utils.vala +++ b/src/utils/Utils.vala @@ -15,7 +15,7 @@ namespace GameHub.Utils } catch(Error e) { - error(e.message); + warning(e.message); } } @@ -28,12 +28,12 @@ namespace GameHub.Utils } catch (Error e) { - error(e.message); + warning(e.message); } return stdout; } - public static async void run_async(string cmd) + public static void run_async(string cmd) { try { @@ -41,7 +41,7 @@ namespace GameHub.Utils } catch (Error e) { - error(e.message); + warning(e.message); } }