2013-05-17 00:18:09 +03:00
|
|
|
/* 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.
|
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* 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.
|
2014-02-18 02:34:20 +01:00
|
|
|
*
|
2013-05-17 00:18:09 +03:00
|
|
|
* 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.
|
2014-02-18 02:34:20 +01:00
|
|
|
*
|
2013-05-17 00:18:09 +03:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2013-05-17 00:18:09 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-11-10 11:33:24 +01:00
|
|
|
#include "gui/editrecorddialog.h"
|
2013-05-17 00:18:09 +03:00
|
|
|
#include "gui/widgets/edittext.h"
|
|
|
|
#include "common/translation.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace GUI {
|
|
|
|
|
2020-07-21 00:16:39 +05:30
|
|
|
const Common::U32String EditRecordDialog::getAuthor() {
|
2013-05-17 00:18:09 +03:00
|
|
|
return _authorEdit->getEditString();
|
|
|
|
}
|
|
|
|
|
2020-07-21 00:16:39 +05:30
|
|
|
void EditRecordDialog::setAuthor(const Common::U32String &author) {
|
2013-05-17 00:18:09 +03:00
|
|
|
_authorEdit->setEditString(author);
|
|
|
|
}
|
|
|
|
|
|
|
|
const Common::String EditRecordDialog::getNotes() {
|
|
|
|
return _notesEdit->getEditString();
|
2013-07-14 19:01:47 +02:00
|
|
|
}
|
2013-05-17 00:18:09 +03:00
|
|
|
|
|
|
|
void EditRecordDialog::setNotes(const Common::String &desc) {
|
|
|
|
_notesEdit->setEditString(desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
const Common::String EditRecordDialog::getName() {
|
|
|
|
return _nameEdit->getEditString();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditRecordDialog::setName(const Common::String &name) {
|
|
|
|
_nameEdit->setEditString(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
EditRecordDialog::~EditRecordDialog() {
|
|
|
|
}
|
|
|
|
|
2022-09-18 13:20:35 +02:00
|
|
|
EditRecordDialog::EditRecordDialog(const Common::U32String &author, const Common::String &name, const Common::String ¬es) : Dialog("EditRecordDialog") {
|
2020-08-20 01:02:51 +05:30
|
|
|
new StaticTextWidget(this, "EditRecordDialog.AuthorLabel", _("Author:"));
|
2020-07-21 00:16:39 +05:30
|
|
|
new StaticTextWidget(this, "EditRecordDialog.NameLabel", _("Name:"));
|
|
|
|
new StaticTextWidget(this, "EditRecordDialog.NotesLabel", _("Notes:"));
|
2020-11-15 18:15:58 +00:00
|
|
|
_authorEdit = new EditTextWidget(this, "EditRecordDialog.AuthorEdit", Common::U32String());
|
|
|
|
_notesEdit = new EditTextWidget(this, "EditRecordDialog.NotesEdit", Common::U32String());
|
|
|
|
_nameEdit = new EditTextWidget(this, "EditRecordDialog.NameEdit", Common::U32String());
|
2013-05-17 00:18:09 +03:00
|
|
|
_authorEdit->setEditString(author);
|
|
|
|
_notesEdit->setEditString(notes);
|
|
|
|
_nameEdit->setEditString(name);
|
2020-11-15 18:15:58 +00:00
|
|
|
new GUI::ButtonWidget(this, "EditRecordDialog.Cancel", _("Cancel"), Common::U32String(), kCloseCmd);
|
2022-03-18 13:20:37 +01:00
|
|
|
new GUI::ButtonWidget(this, "EditRecordDialog.OK", _("OK"), Common::U32String(), kOKCmd);
|
2013-05-17 00:18:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void EditRecordDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
|
|
|
|
switch(cmd) {
|
|
|
|
case kCloseCmd:
|
|
|
|
setResult(kCloseCmd);
|
|
|
|
close();
|
|
|
|
break;
|
|
|
|
case kOKCmd:
|
|
|
|
setResult(kOKCmd);
|
|
|
|
close();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
Dialog::handleCommand(sender, cmd, data);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|