Commit Graph

71 Commits

Author SHA1 Message Date
Bastien Bouclet
4182c50a92 GUI: Fix the SaveLoadDialog with the lowres layouts
The thumbnail layout element is not available in the lowres layouts.
Issue introduced by c0d8b6d9fc.

Fixes #11304.
2020-01-05 08:34:24 +01:00
Bastien Bouclet
c0d8b6d9fc GUI: Introduce dynamic layouts
Prior to this change, a GUI layout was only affected by the screen size.
Now, a layout can additionally be influenced by the GUI dialog and widgets
that uses it. This capability is leveraged to implement the following
features:

* Layout elements that are not bound to a GUI widget do not take space.
   This means that dialogs where the widgets shown depend on for example
   a feature being enabled at configure time no longer have blank spaces.
* Widgets can define a minimal required size for their contents not to be
   cut. For now this is only used for buttons so their width is always
   sufficient for their caption not to be cut. This mechanism could be
   applied to other widget types in the future.
2020-01-04 10:56:25 +01:00
D G Turner
30c366ee5d GUI: Add Missing Switch Default Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-03 06:03:46 +01:00
D G Turner
9831f6ddd2 GUI: Disable Current View Selection Button in Save/Load Chooser.
Switching between List and Grid views causes a nasty redraw flicker.
This also occurs if you press the button for the current view type.

This patch does not fix the underlying refresh issue, but it does
disable the button for the current view type as pressing this is not
useful in any case.

This is a partial fix for bug Trac #10441.
2018-10-10 08:20:17 +01:00
David Fioramonti
81e0fa37ff GUI: Show saveload date/time, or playtime even if thumbnail not enabled
Previously, if playtime or date/time support was added it would not be displayed
unless thumbnail support was also valid.

Now they will be shown even if the thumbnail is not valid.

No container is shown if only metainfo support is enabled.
2018-07-09 21:31:23 +01:00
Bastien Bouclet
5878c618c9 GUI: Remove Dialog::markAsDirty to expose full GUI redraws 2018-01-27 18:12:34 +01:00
Bastien Bouclet
0496ede62f GUI: Implement dirty-checking for widget redraws 2018-01-27 18:12:34 +01:00
D G Turner
afdcde4b54 GUI: Fix Signed vs. Unsigned Comparison GCC Compiler Warning. 2017-11-27 11:39:58 +00:00
Thierry Crozat
469e75cb64 GUI: Fix incorrect SaveLoad dialog state after updating the save list
Updating the list reset the selection in the list widget, however if
a save had previously been selected and the Choose button was enabled,
it remained enabled despite no save being selected. Trying to load
the game resulted in a crash. This was particularly an issue with
cloud enabled as if you are unlucky you could have tried to load a
save just as the cloud sync finished, which updated the list and
unselected the save. This change fixes bug #9766: Assert in
SaveLoadChooser dialog.

In addition to adding a sanity check on the selected index for the
Choose command, this commit also preserves the selection when
updating the list as I think this would be the expected behaviour
in this dialog.
2017-11-24 22:44:41 +00:00
Tarek Soliman
2977ae546e GUI: Improve calculation for savegame thumbnail labels
Instead of shrinking the rect based on how many labels aren't there,
expand the rect based on how many labels are there.

Closes gh-958
2017-06-09 13:17:09 -05:00
Tarek Soliman
7de8be411d GUI: Fix savegame thumbnail label layout
The Save/Load screen has a preview area with labels for date and time.
The bottom label was drawing past the bottom of the rect.
2017-06-09 13:17:09 -05:00
Ben Castricum
6f38c1e55d ALL: game state => saved game 2016-11-29 20:15:20 +01:00
Eugene Sandulenko
e8b70a4686 ALL: Fix compilation with disabled cloud but enabled libcurl 2016-10-17 18:55:22 +02:00
Bastien Bouclet
1a1a5b5f69 CLOUD: Change the cloud icon to be updated by the main thread
The cloud manager registers itself as an event source as a mean to be polled
periodically by the GUI or engine code. The periodical polling is used to
update the OSD icon indicating background sync activity.

Also move the cloud icon from ConnectionManager to CloudManager,
allowing to decouple icon handling from network connections updates.
2016-09-18 17:54:12 +02:00
Thierry Crozat
a87a702eb2 ALL: Homogeneize use of 'saved game' in messages 2016-09-18 16:40:34 +01:00
Alexander Tkachev
b665fc933d ALL: Make simpleSaveNames() a MetaEngineFeature
Added it into hasFeature() of all engines which returned `true` in
simpleSaveNames() before.

As mentioned in #788, SCI is not always using simple names, so it
doesn't have such feature now.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
53aa0c46f1 GUI: JANITORIAL: Fix code formatting 2016-08-24 16:07:55 +06:00
Alexander Tkachev
438ba985a4 JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
3da38ca60b CLOUD: Replace USE_CLOUD with USE_LIBCURL
In most cases that's the right one to check. USE_CLOUD is defined when
either USE_LIBCURL or USE_SDL_NET are, which means if there is no curl,
USE_CLOUD still could be defined and linking errors would appear.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
81c85b6651 CLOUD: Fix SaveLoadDialogs to check USE_CLOUD
Linking was failing when disabling curl support.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
659dcd9702 GUI: Fix SaveLoadDialog
It was SavesSyncRequest's target even when closed.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
62a640ff44 GUI: Disable "Run in background" for "difficult" engines
During saves sync slots of MetaEngines with simpleSaveNames() == false
would not be available at all. User would have to wait for sync to
complete.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ab1d160ec8 ALL: Add MetaEngine::simpleSaveNames()
Engines with "simple" savenames would support "Run in background" in
save/load dialog and gradual save slots unlocking. Other engines
save/load feature would be locked until save sync is over.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f24a89e080 GUI: Fix SaveLoadCloudSyncProgressDialog
* disabled progress bar;
* removed syncTarget segfault;
* fixed grid slots disabling for "locked" slots.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f5cb5be393 GUI: Add SaveLoadCloudSyncProgress in ScummModern theme
ScummVM would probably crash when using a theme without
SaveLoadCloudSyncProgress dialog described.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
67789c3c16 GUI: Update SaveLoadCloudSyncProgressDialog
So now it's centered, includes a progress bar and two labels instead of
one. Works fine in 320x200.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f1a56eaf36 GUI: Show "locked" saves during sync 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6c5a8f34ea CLOUD: Add SaveLoadCloudSyncProgress enum
It's common for Save/Load dialogs and SavesSyncRequest.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9eb4aad7fd CLOUD: Make DefaultSaveFileManager ignore syncing files
MetaEngines don't get "locked" files in the list, so won't try to open
these.

Save/Load dialog updates save list every time SavesSyncRequest tells it
to.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0ce7be17d3 CLOUD: Make ProgressDialog display downloading progress 2016-08-24 16:07:55 +06:00
Alexander Tkachev
3db80154d6 CLOUD: Fix SaveLoadCloudSyncProgressDialog crash
It's closing itself a bit later now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e9721976aa GUI: Add SaveLoadCloudSyncProgressDialog
It's shown by SaveLoadChooserDialog when files are downloaded and some
save slots are locked. One can hide that dialog to interact with
non-locked slots or cancel saves sync completely. Dialog's label shows
current sync progress.

Dialog automatically hides itself when all files are downloaded.
WARNING: right now that results in a crash!
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e7763700e2 CLOUD: Make Save/Load dialog start saves sync
It also shows a "sync disabled" icon in case it has a savepath override.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
b590cc2d8f GUI: Cleanup class initialization 2016-06-01 13:16:12 +02:00
Johannes Schickel
bbfff93c64 GUI: Do not overwrite write protected saves in grid based save dialog.
This fixes overwriting of, for example, autosaves in the grid based save load
dialog when using "New Save".
2014-12-29 14:59:13 +01:00
Ben Castricum
9d885bce22 GUI: s/savegame/saved game/
Makes it consistant throughout the GUI
2014-08-22 07:11:03 +02:00
Johannes Schickel
f5dfe6725a GUI: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Johannes Schickel
6a1112f98f GUI: Mark some intentional fall throughs in switches.
All of these are for handling kCloseCmd.
2013-07-15 13:44:24 +02:00
Johannes Schickel
0052ef2802 GUI: Check for screen changes in the saveload chooser selection code. 2012-10-28 21:44:05 +01:00
Johannes Schickel
9942b5ab60 GUI: Support for page restoring for non-continuous save lists in the grid chooser. 2012-09-26 16:14:18 +02:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Johannes Schickel
40fb004509 GUI: Fix maximum page number calculation in grid chooser.
This avoids a off by one error in some cases.
2012-09-26 02:59:32 +02:00
Johannes Schickel
bc1743b225 GUI: Save/restore last scroll position in the list save/load dialog.
This should give a better user experience, since the user will not have to
scroll back to where he was when he used the dialog last.

Thanks to wjp for suggesting this.
2012-09-26 02:59:32 +02:00
Johannes Schickel
66fb399227 GUI: Save/restore the last used page in the grid save/load dialog.
This allows opening the dialog on (nearly) the same page again as when it was
closed. Sadly due to the different number of entries in the save and load
version this is not always exactly the same page as before. Same goes for
resolution changes.

Thanks to wjp for suggesting this.
2012-09-26 02:59:31 +02:00
Alyssa Milburn
c9f3d83c9e GUI: Fix out-of-bounds in new chooser. 2012-08-14 23:48:24 +02:00
Johannes Schickel
9ba145419f GUI: Mark parts of the grid based chooser layout code as HACK. 2012-08-12 15:16:27 +02:00
Johannes Schickel
e7cd238809 GUI: Remove left-over code from theme based fill color in thumbnail display. 2012-08-12 14:56:20 +02:00
Johannes Schickel
4f7c65af0e Merge pull request #260 from lordhoto/new-chooser.
New save/load chooser

Conflicts:
	gui/saveload.cpp
2012-08-12 14:49:28 +02:00
Johannes Schickel
71daae7bbc GUI: Use "OK" instead of "Ok" in SavenameDialog. 2012-07-25 17:21:36 +02:00
Johannes Schickel
7d51907405 GUI: Add possibility to disable the grid based chooser via DISABLE_SAVELOADCHOOSER_GRID. 2012-07-24 23:49:50 +02:00