Add option description about gui reset
This commit is contained in:
parent
a84013cb5c
commit
644278890b
@ -66,7 +66,7 @@ Ctrl - продолжить выделять</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../src/main.cpp" line="27"/>
|
||||
<location filename="../../src/main.cpp" line="28"/>
|
||||
<source>OCR and translation tool</source>
|
||||
<translation>Инструмент распознавания и перевода</translation>
|
||||
</message>
|
||||
@ -697,6 +697,11 @@ in %1</source>
|
||||
<source>No target language set</source>
|
||||
<translation>Не задан язык результата</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/service/widgetstate.cpp" line="110"/>
|
||||
<source>Do not restore user interface (window size and position, etc)</source>
|
||||
<translation>Не восстанавливать интерфейс пользователя (размер и положения окна и т.д.)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RecognizeWorker</name>
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "apptranslator.h"
|
||||
#include "manager.h"
|
||||
#include "singleapplication.h"
|
||||
#include "widgetstate.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
@ -27,6 +28,7 @@ int main(int argc, char *argv[])
|
||||
parser.setApplicationDescription(QObject::tr("OCR and translation tool"));
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
service::WidgetState::addHelp(parser);
|
||||
|
||||
parser.process(a);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "widgetstate.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <QCommandLineParser>
|
||||
#include <QCoreApplication>
|
||||
#include <QHeaderView>
|
||||
#include <QMainWindow>
|
||||
@ -103,6 +104,13 @@ bool WidgetState::eventFilter(QObject *watched, QEvent *event)
|
||||
return QObject::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void WidgetState::addHelp(QCommandLineParser &parser)
|
||||
{
|
||||
parser.addOption(
|
||||
{"reset-gui", QObject::tr("Do not restore user interface "
|
||||
"(window size and position, etc)")});
|
||||
}
|
||||
|
||||
void WidgetState::save(QWidget *widget)
|
||||
{
|
||||
SOFT_ASSERT(widget, return );
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QCommandLineParser;
|
||||
|
||||
namespace service
|
||||
{
|
||||
class WidgetState : public QObject
|
||||
@ -11,6 +13,8 @@ public:
|
||||
void add(QWidget *watched);
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
|
||||
static void addHelp(QCommandLineParser &parser);
|
||||
|
||||
static void save(QWidget *widget);
|
||||
static void restore(QWidget *widget);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user