1
0

i18n: zh_CN locale support

`CONFIG += embed_translations` is used.
This commit is contained in:
Gary Wang
2019-10-06 17:31:27 +08:00
committed by GitHub
parent 011e46b70b
commit b1260c0b41
9 changed files with 212 additions and 9 deletions

View File

@@ -238,8 +238,22 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
});
protectedMode->setCheckable(true);
protectedMode->setChecked(m_protectedMode);
QAction * helpAction = new QAction(tr("Help"));
connect(helpAction, &QAction::triggered, this, [ = ](){
QStringList sl {
tr("Launch application with image file path as argument to load the file."),
tr("Drag and drop image file onto the window is also supported."),
"",
tr("Context menu option explanation:"),
(tr("Stay on top") + " : " + tr("Make window stay on top of all other windows.")),
(tr("Protected mode") + " : " + tr("Avoid close window accidentally. (eg. by double clicking the window)"))
};
m_graphicsView->showText(sl.join('\n'));
});
menu->addAction(stayOnTopMode);
menu->addAction(protectedMode);
menu->addSeparator();
menu->addAction(helpAction);
menu->exec(mapToGlobal(event->pos()));
menu->deleteLater();
@@ -372,6 +386,7 @@ void MainWindow::toggleProtectedMode()
void MainWindow::toggleStayOnTop()
{
setWindowFlag(Qt::WindowStaysOnTopHint, !stayOnTop());
show();
}
bool MainWindow::stayOnTop()