From e4402ac5ca0966515b00c278bb8c6fa1df07fc66 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 29 Nov 2018 15:44:40 +0100 Subject: Add --session and --pick-session -s,--session replaces --browser.session --pick-session shows the SessionDialog instead of creating a session on startup --- src/main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 34f8a1a..7cc8757 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,6 +9,7 @@ #include "browser.h" #include "configuration.h" #include "session/session.h" +#include "session/sessiondialog.h" #include "util.h" #include #include @@ -205,10 +206,11 @@ int main(int argc, char **argv) } // command line arguments - bool isStandalone = config->exists("no-remote"); - auto arguments = config->value>("args"); - auto session = config->value("browser.session"); - auto profile = config->value("profile.default"); + const bool isStandalone = config->exists("no-remote"); + const auto arguments = config->value>("args"); + const bool pickSession = config->exists("pick-session"); + const auto session = config->value("session"); + const auto profile = config->value("profile.default"); app.setConfiguration(config); app.setup(plugins); @@ -235,7 +237,10 @@ int main(int argc, char **argv) }); } - { + if(pickSession) { + auto *dlg = new SessionDialog(); + dlg->exec(); + } else { QJsonObject sessionData; if(session) { QFile sessionJson(session.value()); -- cgit v1.2.1