Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/KisApplicationArguments.cpp
Show All 37 Lines | 36 | { | |||
---|---|---|---|---|---|
38 | { | 38 | { | ||
39 | } | 39 | } | ||
40 | 40 | | |||
41 | QStringList filenames; | 41 | QStringList filenames; | ||
42 | int dpiX {72}; | 42 | int dpiX {72}; | ||
43 | int dpiY {72}; | 43 | int dpiY {72}; | ||
44 | bool doTemplate {false}; | 44 | bool doTemplate {false}; | ||
45 | bool exportAs {false}; | 45 | bool exportAs {false}; | ||
46 | bool exportSequence {false}; | ||||
46 | QString exportFileName; | 47 | QString exportFileName; | ||
47 | QString workspace; | 48 | QString workspace; | ||
48 | QString windowLayout; | 49 | QString windowLayout; | ||
49 | QString session; | 50 | QString session; | ||
50 | bool canvasOnly {false}; | 51 | bool canvasOnly {false}; | ||
51 | bool noSplash {false}; | 52 | bool noSplash {false}; | ||
52 | bool fullScreen {false}; | 53 | bool fullScreen {false}; | ||
53 | 54 | | |||
Show All 39 Lines | 75 | { | |||
93 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("workspace"), i18n("The name of the workspace to open Krita with"), QLatin1String("workspace"))); | 94 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("workspace"), i18n("The name of the workspace to open Krita with"), QLatin1String("workspace"))); | ||
94 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("windowlayout"), i18n("The name of the window layout to open Krita with"), QLatin1String("windowlayout"))); | 95 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("windowlayout"), i18n("The name of the window layout to open Krita with"), QLatin1String("windowlayout"))); | ||
95 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("load-session"), i18n("The name of the session to open Krita with"), QLatin1String("load-session"))); // NB: the argument "session" is already used by QGuiApplication | 96 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("load-session"), i18n("The name of the session to open Krita with"), QLatin1String("load-session"))); // NB: the argument "session" is already used by QGuiApplication | ||
96 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("canvasonly"), i18n("Start Krita in canvas-only mode"))); | 97 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("canvasonly"), i18n("Start Krita in canvas-only mode"))); | ||
97 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("nosplash"), i18n("Do not show the splash screen"))); | 98 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("nosplash"), i18n("Do not show the splash screen"))); | ||
98 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("fullscreen"), i18n("Start Krita in full-screen mode"))); | 99 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("fullscreen"), i18n("Start Krita in full-screen mode"))); | ||
99 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("dpi"), i18n("Override display DPI"), QLatin1String("dpiX,dpiY"))); | 100 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("dpi"), i18n("Override display DPI"), QLatin1String("dpiX,dpiY"))); | ||
100 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("export"), i18n("Export to the given filename and exit"))); | 101 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("export"), i18n("Export to the given filename and exit"))); | ||
102 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("export-sequence"), i18n("Export animation to the given filename and exit"))); | ||||
101 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("export-filename"), i18n("Filename for export"), QLatin1String("filename"))); | 103 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("export-filename"), i18n("Filename for export"), QLatin1String("filename"))); | ||
102 | parser.addPositionalArgument(QLatin1String("[file(s)]"), i18n("File(s) or URL(s) to open")); | 104 | parser.addPositionalArgument(QLatin1String("[file(s)]"), i18n("File(s) or URL(s) to open")); | ||
103 | parser.process(app); | 105 | parser.process(app); | ||
104 | 106 | | |||
105 | QString dpiValues = parser.value("dpi"); | 107 | QString dpiValues = parser.value("dpi"); | ||
106 | if (!dpiValues.isEmpty()) { | 108 | if (!dpiValues.isEmpty()) { | ||
107 | int sep = dpiValues.indexOf(QRegExp("[x, ]")); | 109 | int sep = dpiValues.indexOf(QRegExp("[x, ]")); | ||
108 | bool ok = true; | 110 | bool ok = true; | ||
Show All 26 Lines | |||||
135 | 137 | | |||
136 | 138 | | |||
137 | d->exportFileName = parser.value("export-filename"); | 139 | d->exportFileName = parser.value("export-filename"); | ||
138 | d->workspace = parser.value("workspace"); | 140 | d->workspace = parser.value("workspace"); | ||
139 | d->windowLayout = parser.value("windowlayout"); | 141 | d->windowLayout = parser.value("windowlayout"); | ||
140 | d->session = parser.value("load-session"); | 142 | d->session = parser.value("load-session"); | ||
141 | d->doTemplate = parser.isSet("template"); | 143 | d->doTemplate = parser.isSet("template"); | ||
142 | d->exportAs = parser.isSet("export"); | 144 | d->exportAs = parser.isSet("export"); | ||
145 | d->exportSequence = parser.isSet("export-sequence"); | ||||
143 | d->canvasOnly = parser.isSet("canvasonly"); | 146 | d->canvasOnly = parser.isSet("canvasonly"); | ||
144 | d->noSplash = parser.isSet("nosplash"); | 147 | d->noSplash = parser.isSet("nosplash"); | ||
145 | d->fullScreen = parser.isSet("fullscreen"); | 148 | d->fullScreen = parser.isSet("fullscreen"); | ||
146 | 149 | | |||
147 | const QDir currentDir = QDir::current(); | 150 | const QDir currentDir = QDir::current(); | ||
148 | Q_FOREACH (const QString &filename, parser.positionalArguments()) { | 151 | Q_FOREACH (const QString &filename, parser.positionalArguments()) { | ||
149 | d->filenames << currentDir.absoluteFilePath(filename); | 152 | d->filenames << currentDir.absoluteFilePath(filename); | ||
150 | } | 153 | } | ||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 279 | { | |||
277 | return d->doTemplate; | 280 | return d->doTemplate; | ||
278 | } | 281 | } | ||
279 | 282 | | |||
280 | bool KisApplicationArguments::exportAs() const | 283 | bool KisApplicationArguments::exportAs() const | ||
281 | { | 284 | { | ||
282 | return d->exportAs; | 285 | return d->exportAs; | ||
283 | } | 286 | } | ||
284 | 287 | | |||
288 | bool KisApplicationArguments::exportSequence() const | ||||
289 | { | ||||
290 | return d->exportSequence; | ||||
291 | } | ||||
292 | | ||||
285 | QString KisApplicationArguments::exportFileName() const | 293 | QString KisApplicationArguments::exportFileName() const | ||
286 | { | 294 | { | ||
287 | return d->exportFileName; | 295 | return d->exportFileName; | ||
288 | } | 296 | } | ||
289 | 297 | | |||
290 | QString KisApplicationArguments::workspace() const | 298 | QString KisApplicationArguments::workspace() const | ||
291 | { | 299 | { | ||
292 | return d->workspace; | 300 | return d->workspace; | ||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |