GUI: Setup new dialog for Download Games

This commit is contained in:
Ankush Dutt
2023-06-13 23:35:31 +05:30
committed by Eugene Sandulenko
parent ec3fe97b14
commit 4af698b7cd
5 changed files with 90 additions and 3 deletions
+35
View File
@@ -0,0 +1,35 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "gui/download-games-dialog.h"
#include "gui/widget.h"
#include "common/translation.h"
namespace GUI {
DownloadGamesDialog::DownloadGamesDialog()
: Dialog("DownloadGames") {
new StaticTextWidget(this, "DownloadGames.Headline", _("Download Freeware Games"));
}
} // End of namespace GUI
+36
View File
@@ -0,0 +1,36 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DOWNLOAD_GAMES_DIALOG_H
#define DOWNLOAD_GAMES_DIALOG_H
#include "gui/dialog.h"
namespace GUI {
class DownloadGamesDialog : public Dialog {
public:
DownloadGamesDialog();
};
} // End of namespace GUI
#endif
+3 -2
View File
@@ -32,6 +32,7 @@
#include "gui/about.h"
#include "gui/browser.h"
#include "gui/chooser.h"
#include "gui/download-games-dialog.h"
#include "gui/editgamedialog.h"
#include "gui/launcher.h"
#include "gui/massadd.h"
@@ -256,7 +257,7 @@ void LauncherDialog::build() {
// I18N: Button caption. O is the shortcut, Ctrl+O, put it in parens for non-latin (~O~)
new ButtonWidget(this, _title + ".OptionsButton", _("Global ~O~ptions..."), _("Change global ScummVM options"), kOptionsCmd, 0, _c("Global ~O~pts...", "lowres"));
// I18N: Button download games button.
new ButtonWidget(this, _title + ".DownloadGameButton", _("Download Games"), _("Download freeware games for ScummVM"), kDownloadGameCmd);
new ButtonWidget(this, _title + ".DownloadGamesButton", _("Download Games"), _("Download freeware games for ScummVM"), kDownloadGameCmd);
// Above the lowest button rows: two more buttons (directly below the list box)
DropdownButtonWidget *addButton =
@@ -731,7 +732,7 @@ void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
massAddGame();
break;
case kDownloadGameCmd: {
MessageDialog downloader("Download Freeware Games");
DownloadGamesDialog downloader;
downloader.runModal();
}
break;
+1
View File
@@ -7,6 +7,7 @@ MODULE_OBJS := \
console.o \
debugger.o \
dialog.o \
download-games-dialog.o \
dump-all-dialogs.o \
editgamedialog.o \
error.o \
+15 -1
View File
@@ -204,7 +204,7 @@
<widget name = 'AddGameButton'
type = 'Button'
/>
<widget name = 'DownloadGameButton'
<widget name = 'DownloadGamesButton'
type = 'Button'
/>
<widget name = 'EditGameButton'
@@ -291,6 +291,9 @@
<widget name = 'AddGameButton'
height = 'Globals.Button.Height'
/>
<widget name = 'DownloadGamesButton'
height = 'Globals.Button.Height'
/>
<widget name = 'EditGameButton'
height = 'Globals.Button.Height'
/>
@@ -371,6 +374,9 @@
<widget name = 'AddGameButton'
height = 'Globals.Button.Height'
/>
<widget name = 'DownloadGamesButton'
height = 'Globals.Button.Height'
/>
<widget name = 'RemoveGameButton'
height = 'Globals.Button.Height'
/>
@@ -507,6 +513,14 @@
</layout>
</dialog>
<dialog name = 'DownloadGames' overlays = 'screen' inset = '32' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 8'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
</layout>
</dialog>
<dialog name = 'GlobalOptions' overlays = 'screen' inset = '32' shading = 'dim' resolution='x<800'>
<layout type = 'vertical' padding = '0, 0, 0, 0'>
<widget name = 'TabWidget' type = 'TabWidget'/>