mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-27 17:13:54 -07:00
Fix settings dialog tr (#5292)
This commit is contained in:
parent
5339be318e
commit
1d9e64ec73
3 changed files with 31 additions and 20 deletions
|
|
@ -61,12 +61,6 @@ GeneralSettingsPage::GeneralSettingsPage()
|
||||||
|
|
||||||
// updates
|
// updates
|
||||||
SettingsCache &settings = SettingsCache::instance();
|
SettingsCache &settings = SettingsCache::instance();
|
||||||
QList<ReleaseChannel *> channels = settings.getUpdateReleaseChannels();
|
|
||||||
foreach (ReleaseChannel *chan, channels) {
|
|
||||||
updateReleaseChannelBox.insertItem(chan->getIndex(), tr(chan->getName().toUtf8()));
|
|
||||||
}
|
|
||||||
updateReleaseChannelBox.setCurrentIndex(settings.getUpdateReleaseChannel()->getIndex());
|
|
||||||
|
|
||||||
updateNotificationCheckBox.setChecked(settings.getNotifyAboutUpdates());
|
updateNotificationCheckBox.setChecked(settings.getNotifyAboutUpdates());
|
||||||
newVersionOracleCheckBox.setChecked(settings.getNotifyAboutNewVersion());
|
newVersionOracleCheckBox.setChecked(settings.getNotifyAboutNewVersion());
|
||||||
|
|
||||||
|
|
@ -137,7 +131,7 @@ GeneralSettingsPage::GeneralSettingsPage()
|
||||||
customCardDatabasePathButton->setVisible(false);
|
customCardDatabasePathButton->setVisible(false);
|
||||||
tokenDatabasePathButton->setVisible(false);
|
tokenDatabasePathButton->setVisible(false);
|
||||||
} else {
|
} else {
|
||||||
resetAllPathsButton = new QPushButton(tr("Reset all paths"));
|
resetAllPathsButton = new QPushButton;
|
||||||
connect(resetAllPathsButton, SIGNAL(clicked()), this, SLOT(resetAllPathsClicked()));
|
connect(resetAllPathsButton, SIGNAL(clicked()), this, SLOT(resetAllPathsClicked()));
|
||||||
allPathsResetLabel = new QLabel(tr("All paths have been reset"));
|
allPathsResetLabel = new QLabel(tr("All paths have been reset"));
|
||||||
allPathsResetLabel->setVisible(false);
|
allPathsResetLabel->setVisible(false);
|
||||||
|
|
@ -297,6 +291,15 @@ void GeneralSettingsPage::retranslateUi()
|
||||||
updateNotificationCheckBox.setText(tr("Notify if a feature supported by the server is missing in my client"));
|
updateNotificationCheckBox.setText(tr("Notify if a feature supported by the server is missing in my client"));
|
||||||
newVersionOracleCheckBox.setText(tr("Automatically run Oracle when running a new version of Cockatrice"));
|
newVersionOracleCheckBox.setText(tr("Automatically run Oracle when running a new version of Cockatrice"));
|
||||||
showTipsOnStartup.setText(tr("Show tips on startup"));
|
showTipsOnStartup.setText(tr("Show tips on startup"));
|
||||||
|
resetAllPathsButton->setText(tr("Reset all paths"));
|
||||||
|
|
||||||
|
const auto &settings = SettingsCache::instance();
|
||||||
|
QList<ReleaseChannel *> channels = settings.getUpdateReleaseChannels();
|
||||||
|
updateReleaseChannelBox.clear();
|
||||||
|
for (ReleaseChannel *chan : channels) {
|
||||||
|
updateReleaseChannelBox.insertItem(chan->getIndex(), tr(chan->getName().toUtf8()));
|
||||||
|
}
|
||||||
|
updateReleaseChannelBox.setCurrentIndex(settings.getUpdateReleaseChannel()->getIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
AppearanceSettingsPage::AppearanceSettingsPage()
|
AppearanceSettingsPage::AppearanceSettingsPage()
|
||||||
|
|
@ -647,7 +650,7 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
|
||||||
mpSpoilerPathButton = new QPushButton("...");
|
mpSpoilerPathButton = new QPushButton("...");
|
||||||
connect(mpSpoilerPathButton, SIGNAL(clicked()), this, SLOT(spoilerPathButtonClicked()));
|
connect(mpSpoilerPathButton, SIGNAL(clicked()), this, SLOT(spoilerPathButtonClicked()));
|
||||||
|
|
||||||
updateNowButton = new QPushButton(tr("Update Spoilers"));
|
updateNowButton = new QPushButton;
|
||||||
updateNowButton->setFixedWidth(150);
|
updateNowButton->setFixedWidth(150);
|
||||||
connect(updateNowButton, SIGNAL(clicked()), this, SLOT(updateSpoilers()));
|
connect(updateNowButton, SIGNAL(clicked()), this, SLOT(updateSpoilers()));
|
||||||
|
|
||||||
|
|
@ -664,17 +667,16 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
|
||||||
|
|
||||||
urlList->addItems(SettingsCache::instance().downloads().getAllURLs());
|
urlList->addItems(SettingsCache::instance().downloads().getAllURLs());
|
||||||
|
|
||||||
auto aAdd = new QAction(this);
|
aAdd = new QAction(this);
|
||||||
aAdd->setIcon(QPixmap("theme:icons/increment"));
|
aAdd->setIcon(QPixmap("theme:icons/increment"));
|
||||||
aAdd->setToolTip(tr("Add New URL"));
|
|
||||||
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAddURL()));
|
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAddURL()));
|
||||||
auto aEdit = new QAction(this);
|
|
||||||
|
aEdit = new QAction(this);
|
||||||
aEdit->setIcon(QPixmap("theme:icons/pencil"));
|
aEdit->setIcon(QPixmap("theme:icons/pencil"));
|
||||||
aEdit->setToolTip(tr("Edit URL"));
|
|
||||||
connect(aEdit, SIGNAL(triggered()), this, SLOT(actEditURL()));
|
connect(aEdit, SIGNAL(triggered()), this, SLOT(actEditURL()));
|
||||||
auto aRemove = new QAction(this);
|
|
||||||
|
aRemove = new QAction(this);
|
||||||
aRemove->setIcon(QPixmap("theme:icons/decrement"));
|
aRemove->setIcon(QPixmap("theme:icons/decrement"));
|
||||||
aRemove->setToolTip(tr("Remove URL"));
|
|
||||||
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemoveURL()));
|
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemoveURL()));
|
||||||
|
|
||||||
auto *urlToolBar = new QToolBar;
|
auto *urlToolBar = new QToolBar;
|
||||||
|
|
@ -706,7 +708,6 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
|
||||||
networkRedirectCacheTtlEdit.setMaximum(NETWORK_REDIRECT_CACHE_TTL_MAX);
|
networkRedirectCacheTtlEdit.setMaximum(NETWORK_REDIRECT_CACHE_TTL_MAX);
|
||||||
networkRedirectCacheTtlEdit.setSingleStep(1);
|
networkRedirectCacheTtlEdit.setSingleStep(1);
|
||||||
networkRedirectCacheTtlEdit.setValue(SettingsCache::instance().getRedirectCacheTtl());
|
networkRedirectCacheTtlEdit.setValue(SettingsCache::instance().getRedirectCacheTtl());
|
||||||
networkRedirectCacheTtlEdit.setSuffix(" " + tr("Day(s)"));
|
|
||||||
|
|
||||||
auto networkCacheLayout = new QHBoxLayout;
|
auto networkCacheLayout = new QHBoxLayout;
|
||||||
networkCacheLayout->addStretch();
|
networkCacheLayout->addStretch();
|
||||||
|
|
@ -939,6 +940,11 @@ void DeckEditorSettingsPage::retranslateUi()
|
||||||
networkRedirectCacheTtlEdit.setToolTip(tr("How long cached redirects for urls are valid for."));
|
networkRedirectCacheTtlEdit.setToolTip(tr("How long cached redirects for urls are valid for."));
|
||||||
pixmapCacheLabel.setText(tr("Picture Cache Size:"));
|
pixmapCacheLabel.setText(tr("Picture Cache Size:"));
|
||||||
pixmapCacheEdit.setToolTip(tr("In-memory cache for pictures not currently on screen"));
|
pixmapCacheEdit.setToolTip(tr("In-memory cache for pictures not currently on screen"));
|
||||||
|
updateNowButton->setText(tr("Update Spoilers"));
|
||||||
|
aAdd->setToolTip(tr("Add New URL"));
|
||||||
|
aEdit->setToolTip(tr("Edit URL"));
|
||||||
|
aRemove->setToolTip(tr("Remove URL"));
|
||||||
|
networkRedirectCacheTtlEdit.setSuffix(" " + tr("Day(s)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagesSettingsPage::MessagesSettingsPage()
|
MessagesSettingsPage::MessagesSettingsPage()
|
||||||
|
|
@ -985,7 +991,6 @@ MessagesSettingsPage::MessagesSettingsPage()
|
||||||
connect(&roomHistory, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(), &SettingsCache::setRoomHistory);
|
connect(&roomHistory, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(), &SettingsCache::setRoomHistory);
|
||||||
|
|
||||||
customAlertString = new QLineEdit();
|
customAlertString = new QLineEdit();
|
||||||
customAlertString->setPlaceholderText(tr("Word1 Word2 Word3"));
|
|
||||||
customAlertString->setText(SettingsCache::instance().getHighlightWords());
|
customAlertString->setText(SettingsCache::instance().getHighlightWords());
|
||||||
connect(customAlertString, SIGNAL(textChanged(QString)), &SettingsCache::instance(),
|
connect(customAlertString, SIGNAL(textChanged(QString)), &SettingsCache::instance(),
|
||||||
SLOT(setHighlightWords(QString)));
|
SLOT(setHighlightWords(QString)));
|
||||||
|
|
@ -1026,15 +1031,14 @@ MessagesSettingsPage::MessagesSettingsPage()
|
||||||
|
|
||||||
aAdd = new QAction(this);
|
aAdd = new QAction(this);
|
||||||
aAdd->setIcon(QPixmap("theme:icons/increment"));
|
aAdd->setIcon(QPixmap("theme:icons/increment"));
|
||||||
aAdd->setToolTip(tr("Add New Message"));
|
|
||||||
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAdd()));
|
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAdd()));
|
||||||
|
|
||||||
aEdit = new QAction(this);
|
aEdit = new QAction(this);
|
||||||
aEdit->setIcon(QPixmap("theme:icons/pencil"));
|
aEdit->setIcon(QPixmap("theme:icons/pencil"));
|
||||||
aEdit->setToolTip(tr("Edit Message"));
|
|
||||||
connect(aEdit, SIGNAL(triggered()), this, SLOT(actEdit()));
|
connect(aEdit, SIGNAL(triggered()), this, SLOT(actEdit()));
|
||||||
|
|
||||||
aRemove = new QAction(this);
|
aRemove = new QAction(this);
|
||||||
aRemove->setIcon(QPixmap("theme:icons/decrement"));
|
aRemove->setIcon(QPixmap("theme:icons/decrement"));
|
||||||
aRemove->setToolTip(tr("Remove Message"));
|
|
||||||
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemove()));
|
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemove()));
|
||||||
|
|
||||||
auto *messageToolBar = new QToolBar;
|
auto *messageToolBar = new QToolBar;
|
||||||
|
|
@ -1179,6 +1183,10 @@ void MessagesSettingsPage::retranslateUi()
|
||||||
hexLabel.setText(tr("(Color is hexadecimal)"));
|
hexLabel.setText(tr("(Color is hexadecimal)"));
|
||||||
hexHighlightLabel.setText(tr("(Color is hexadecimal)"));
|
hexHighlightLabel.setText(tr("(Color is hexadecimal)"));
|
||||||
customAlertStringLabel.setText(tr("Separate words with a space, alphanumeric characters only"));
|
customAlertStringLabel.setText(tr("Separate words with a space, alphanumeric characters only"));
|
||||||
|
customAlertString->setPlaceholderText(tr("Word1 Word2 Word3"));
|
||||||
|
aAdd->setToolTip(tr("Add New Message"));
|
||||||
|
aEdit->setToolTip(tr("Edit Message"));
|
||||||
|
aRemove->setToolTip(tr("Remove Message"));
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundSettingsPage::SoundSettingsPage()
|
SoundSettingsPage::SoundSettingsPage()
|
||||||
|
|
@ -1260,7 +1268,6 @@ ShortcutSettingsPage::ShortcutSettingsPage()
|
||||||
// search bar
|
// search bar
|
||||||
searchEdit = new SearchLineEdit;
|
searchEdit = new SearchLineEdit;
|
||||||
searchEdit->setObjectName("searchEdit");
|
searchEdit->setObjectName("searchEdit");
|
||||||
searchEdit->setPlaceholderText(tr("Search by shortcut name"));
|
|
||||||
searchEdit->setClearButtonEnabled(true);
|
searchEdit->setClearButtonEnabled(true);
|
||||||
|
|
||||||
setFocusProxy(searchEdit);
|
setFocusProxy(searchEdit);
|
||||||
|
|
@ -1369,6 +1376,7 @@ void ShortcutSettingsPage::retranslateUi()
|
||||||
faqLabel->setText(QString("<a href='%1'>%2</a>").arg(WIKI_CUSTOM_SHORTCUTS).arg(tr("How to set custom shortcuts")));
|
faqLabel->setText(QString("<a href='%1'>%2</a>").arg(WIKI_CUSTOM_SHORTCUTS).arg(tr("How to set custom shortcuts")));
|
||||||
btnResetAll->setText(tr("Restore all default shortcuts"));
|
btnResetAll->setText(tr("Restore all default shortcuts"));
|
||||||
btnClearAll->setText(tr("Clear all shortcuts"));
|
btnClearAll->setText(tr("Clear all shortcuts"));
|
||||||
|
searchEdit->setPlaceholderText(tr("Search by shortcut name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
DlgSettings::DlgSettings(QWidget *parent) : QDialog(parent)
|
DlgSettings::DlgSettings(QWidget *parent) : QDialog(parent)
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ private:
|
||||||
QLabel urlLinkLabel;
|
QLabel urlLinkLabel;
|
||||||
QCheckBox picDownloadCheckBox;
|
QCheckBox picDownloadCheckBox;
|
||||||
QListWidget *urlList;
|
QListWidget *urlList;
|
||||||
|
QAction *aAdd, *aEdit, *aRemove;
|
||||||
QCheckBox mcDownloadSpoilersCheckBox;
|
QCheckBox mcDownloadSpoilersCheckBox;
|
||||||
QLabel msDownloadSpoilersLabel;
|
QLabel msDownloadSpoilersLabel;
|
||||||
QGroupBox *mpGeneralGroupBox;
|
QGroupBox *mpGeneralGroupBox;
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,14 @@ void SequenceEdit::setShortcutName(const QString &_shortcutName)
|
||||||
defaultButton->setEnabled(false);
|
defaultButton->setEnabled(false);
|
||||||
lineEdit->setEnabled(false);
|
lineEdit->setEnabled(false);
|
||||||
lineEdit->setText("");
|
lineEdit->setText("");
|
||||||
|
// Correct as in-line translation
|
||||||
lineEdit->setPlaceholderText(tr("Choose an action from the table"));
|
lineEdit->setPlaceholderText(tr("Choose an action from the table"));
|
||||||
} else {
|
} else {
|
||||||
clearButton->setEnabled(true);
|
clearButton->setEnabled(true);
|
||||||
defaultButton->setEnabled(true);
|
defaultButton->setEnabled(true);
|
||||||
lineEdit->setEnabled(true);
|
lineEdit->setEnabled(true);
|
||||||
lineEdit->setText(SettingsCache::instance().shortcuts().getShortcutString(shortcutName));
|
lineEdit->setText(SettingsCache::instance().shortcuts().getShortcutString(shortcutName));
|
||||||
|
// Correct as in-line translation
|
||||||
lineEdit->setPlaceholderText(tr("Hit the key/combination of keys you want to set for this action"));
|
lineEdit->setPlaceholderText(tr("Hit the key/combination of keys you want to set for this action"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue