Browse Source

fix broken message button texts

pull/2/head
Skycoder42 7 years ago
parent
commit
ba3d9c0a57
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 6
      examples/mvvmcore/SampleCore/sampleviewmodel.cpp
  2. 3
      src/imports/mvvmquick/MsgBoxBase.qml
  3. 4
      src/imports/mvvmquick/settingsuibuilder.cpp

6
examples/mvvmcore/SampleCore/sampleviewmodel.cpp

@ -43,7 +43,7 @@ void SampleViewModel::setName(QString name)
if (_name == name) if (_name == name)
return; return;
_name = name; _name = std::move(name);
emit nameChanged(_name); emit nameChanged(_name);
if(_active && _eventService) { if(_active && _eventService) {
_eventService->removeEvent(_eventId); _eventService->removeEvent(_eventId);
@ -88,8 +88,8 @@ void SampleViewModel::getInput()
void SampleViewModel::getFiles() void SampleViewModel::getFiles()
{ {
QtMvvm::getOpenFiles(this, [this](QList<QUrl> urls) { QtMvvm::getOpenFiles(this, [this](const QList<QUrl> &urls) {
for(auto url : urls) for(const auto &url : urls)
addEvent(url.toString()); addEvent(url.toString());
}, tr("Open Files:"), {QStringLiteral("text/plain"), QStringLiteral("application/pdf")}); }, tr("Open Files:"), {QStringLiteral("text/plain"), QStringLiteral("application/pdf")});
} }

3
src/imports/mvvmquick/MsgBoxBase.qml

@ -69,8 +69,9 @@ AlertDialog {
standardButtons: msgConfig.buttons standardButtons: msgConfig.buttons
onStandardButtonsChanged: { onStandardButtonsChanged: {
for(var key in msgConfig.buttonTexts) Object.keys(msgConfig.buttonTexts).forEach(function(key) {
standardButton(key).text = msgConfig.buttonTexts[key] standardButton(key).text = msgConfig.buttonTexts[key]
});
} }
onClicked: { onClicked: {

4
src/imports/mvvmquick/settingsuibuilder.cpp

@ -39,7 +39,9 @@ void SettingsUiBuilder::loadSection(const SettingsElements::Section &section)
{ {
auto inputFactory = QuickPresenterPrivate::currentPresenter()->inputViewFactory(); auto inputFactory = QuickPresenterPrivate::currentPresenter()->inputViewFactory();
_entryModel->setup(section, _viewModel, inputFactory); _entryModel->setup(section, _viewModel, inputFactory);
#ifndef QT_NO_DEBUG
qmlDebug(this) << "Loaded section " << section.title; qmlDebug(this) << "Loaded section " << section.title;
#endif
emit presentSection(_entryFilterModel); emit presentSection(_entryFilterModel);
} }
@ -48,7 +50,9 @@ void SettingsUiBuilder::showDialog(const QString &key, const QString &title, con
if(type == QStringLiteral("action")) if(type == QStringLiteral("action"))
_viewModel->callAction(key, properties.value(QStringLiteral("args")).toMap()); _viewModel->callAction(key, properties.value(QStringLiteral("args")).toMap());
else { else {
#ifndef QT_NO_DEBUG
qmlDebug(this) << "Creating input dialog for settings entry " << key; qmlDebug(this) << "Creating input dialog for settings entry " << key;
#endif
getInput(title + tr(":"), QString(), qUtf8Printable(type), this, [this, key](const QVariant &value) { getInput(title + tr(":"), QString(), qUtf8Printable(type), this, [this, key](const QVariant &value) {
if(value.isValid()) if(value.isValid())
_viewModel->saveValue(key, value); _viewModel->saveValue(key, value);

Loading…
Cancel
Save