now attaches to parent console on windows
This commit is contained in:
@@ -232,6 +232,7 @@ SOURCES += \
|
|||||||
src/singletons/TooltipPreviewImage.cpp \
|
src/singletons/TooltipPreviewImage.cpp \
|
||||||
src/singletons/Updates.cpp \
|
src/singletons/Updates.cpp \
|
||||||
src/singletons/WindowManager.cpp \
|
src/singletons/WindowManager.cpp \
|
||||||
|
src/util/AttachToConsole.cpp \
|
||||||
src/util/Clipboard.cpp \
|
src/util/Clipboard.cpp \
|
||||||
src/util/DebugCount.cpp \
|
src/util/DebugCount.cpp \
|
||||||
src/util/FormatTime.cpp \
|
src/util/FormatTime.cpp \
|
||||||
@@ -464,6 +465,7 @@ HEADERS += \
|
|||||||
src/singletons/TooltipPreviewImage.hpp \
|
src/singletons/TooltipPreviewImage.hpp \
|
||||||
src/singletons/Updates.hpp \
|
src/singletons/Updates.hpp \
|
||||||
src/singletons/WindowManager.hpp \
|
src/singletons/WindowManager.hpp \
|
||||||
|
src/util/AttachToConsole.hpp \
|
||||||
src/util/Clamp.hpp \
|
src/util/Clamp.hpp \
|
||||||
src/util/Clipboard.hpp \
|
src/util/Clipboard.hpp \
|
||||||
src/util/CombinePath.hpp \
|
src/util/CombinePath.hpp \
|
||||||
|
|||||||
+12
-1
@@ -7,6 +7,7 @@
|
|||||||
#include "common/QLogging.hpp"
|
#include "common/QLogging.hpp"
|
||||||
#include "singletons/Paths.hpp"
|
#include "singletons/Paths.hpp"
|
||||||
#include "singletons/WindowManager.hpp"
|
#include "singletons/WindowManager.hpp"
|
||||||
|
#include "util/AttachToConsole.hpp"
|
||||||
#include "util/CombinePath.hpp"
|
#include "util/CombinePath.hpp"
|
||||||
#include "widgets/Window.hpp"
|
#include "widgets/Window.hpp"
|
||||||
|
|
||||||
@@ -26,10 +27,17 @@ Args::Args(const QApplication &app)
|
|||||||
QCommandLineOption parentWindowOption("parent-window");
|
QCommandLineOption parentWindowOption("parent-window");
|
||||||
parentWindowOption.setFlags(QCommandLineOption::HiddenFromHelp);
|
parentWindowOption.setFlags(QCommandLineOption::HiddenFromHelp);
|
||||||
|
|
||||||
|
// Verbose
|
||||||
|
QCommandLineOption verboseOption({{"v", "verbose"},
|
||||||
|
"Attaches to the Console on windows, "
|
||||||
|
"allowing you to see debug output."});
|
||||||
|
crashRecoveryOption.setFlags(QCommandLineOption::HiddenFromHelp);
|
||||||
|
|
||||||
parser.addOptions({
|
parser.addOptions({
|
||||||
{{"V", "version"}, "Displays version information."},
|
{{"V", "version"}, "Displays version information."},
|
||||||
crashRecoveryOption,
|
crashRecoveryOption,
|
||||||
parentWindowOption,
|
parentWindowOption,
|
||||||
|
verboseOption,
|
||||||
});
|
});
|
||||||
parser.addOption(QCommandLineOption(
|
parser.addOption(QCommandLineOption(
|
||||||
{"c", "channels"},
|
{"c", "channels"},
|
||||||
@@ -46,6 +54,7 @@ Args::Args(const QApplication &app)
|
|||||||
|
|
||||||
if (parser.isSet("help"))
|
if (parser.isSet("help"))
|
||||||
{
|
{
|
||||||
|
attachToConsole();
|
||||||
qInfo().noquote() << parser.helpText();
|
qInfo().noquote() << parser.helpText();
|
||||||
::exit(EXIT_SUCCESS);
|
::exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
@@ -60,7 +69,9 @@ Args::Args(const QApplication &app)
|
|||||||
this->applyCustomChannelLayout(parser.value("c"));
|
this->applyCustomChannelLayout(parser.value("c"));
|
||||||
}
|
}
|
||||||
|
|
||||||
this->printVersion = parser.isSet("v");
|
this->verbose = parser.isSet(verboseOption);
|
||||||
|
|
||||||
|
this->printVersion = parser.isSet("V");
|
||||||
this->crashRecovery = parser.isSet("crash-recovery");
|
this->crashRecovery = parser.isSet("crash-recovery");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public:
|
|||||||
bool shouldRunBrowserExtensionHost{};
|
bool shouldRunBrowserExtensionHost{};
|
||||||
bool dontSaveSettings{};
|
bool dontSaveSettings{};
|
||||||
boost::optional<WindowLayout> customChannelLayout;
|
boost::optional<WindowLayout> customChannelLayout;
|
||||||
|
bool verbose{};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void applyCustomChannelLayout(const QString &argValue);
|
void applyCustomChannelLayout(const QString &argValue);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "providers/twitch/api/Kraken.hpp"
|
#include "providers/twitch/api/Kraken.hpp"
|
||||||
#include "singletons/Paths.hpp"
|
#include "singletons/Paths.hpp"
|
||||||
#include "singletons/Settings.hpp"
|
#include "singletons/Settings.hpp"
|
||||||
|
#include "util/AttachToConsole.hpp"
|
||||||
#include "util/IncognitoBrowser.hpp"
|
#include "util/IncognitoBrowser.hpp"
|
||||||
|
|
||||||
using namespace chatterino;
|
using namespace chatterino;
|
||||||
@@ -63,6 +64,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (getArgs().printVersion)
|
else if (getArgs().printVersion)
|
||||||
{
|
{
|
||||||
|
attachToConsole();
|
||||||
|
|
||||||
auto version = Version::instance();
|
auto version = Version::instance();
|
||||||
qInfo().noquote() << QString("%1 (commit %2%3)")
|
qInfo().noquote() << QString("%1 (commit %2%3)")
|
||||||
.arg(version.fullVersion())
|
.arg(version.fullVersion())
|
||||||
@@ -73,6 +76,11 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (getArgs().verbose)
|
||||||
|
{
|
||||||
|
attachToConsole();
|
||||||
|
}
|
||||||
|
|
||||||
IvrApi::initialize();
|
IvrApi::initialize();
|
||||||
Helix::initialize();
|
Helix::initialize();
|
||||||
Kraken::initialize();
|
Kraken::initialize();
|
||||||
|
|||||||
Reference in New Issue
Block a user