diff --git a/main.cpp b/main.cpp index ed46de5..cd828b9 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,6 @@ #include "pylonrecorder.h" +#include +#include #include #include #include @@ -15,12 +17,26 @@ int main(int argc, char *argv[]) commandLineParser.addHelpOption(); commandLineParser.addPositionalArgument(PylonRecorder::tr("[file]"), PylonRecorder::tr("Image file to open.")); commandLineParser.process(QCoreApplication::arguments()); + QSettings settings; + int width = settings.value("app/width", 1024).toInt(); + int height = settings.value("app/height", 768).toInt(); + int x = settings.value("app/pos_x", 100).toInt(); + int y = settings.value("app/pos_y", 100).toInt(); + PylonRecorder recorder; if (!commandLineParser.positionalArguments().isEmpty() && !recorder.loadFile(commandLineParser.positionalArguments().front())) { return -1; } + recorder.resize(width, height); + recorder.move(x, y); recorder.show(); int ret = app.exec(); + + QPoint pos = recorder.pos(); + settings.setValue("app/width", recorder.width()); + settings.setValue("app/height", recorder.height()); + settings.setValue("app/pos_x", pos.x()); + settings.setValue("app/pos_y", pos.y()); return ret; }