Main.cpp (ssr-0.3.10) | : | Main.cpp (ssr-0.3.11) | ||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
bool g_option_systray = true; | bool g_option_systray = true; | |||
bool g_option_start_hidden = false; | bool g_option_start_hidden = false; | |||
bool g_option_benchmark = false; | bool g_option_benchmark = false; | |||
void PrintOptionHelp() { | void PrintOptionHelp() { | |||
Logger::LogInfo( | Logger::LogInfo( | |||
"Usage: simplescreenrecorder [OPTIONS]\n" | "Usage: simplescreenrecorder [OPTIONS]\n" | |||
"\n" | "\n" | |||
"Options:\n" | "Options:\n" | |||
" --help Show this help message.\n" | " --help Show this help message.\n" | |||
" --version Show version information.\ n" | ||||
" --logfile Write log to ~/.ssr/log-DA TE_TIME.txt instead of stdout.\n" | " --logfile Write log to ~/.ssr/log-DA TE_TIME.txt instead of stdout.\n" | |||
" --statsfile[=FILE] Write recording statistics to FILE. If FILE is omitted,\n" | " --statsfile[=FILE] Write recording statistics to FILE. If FILE is omitted,\n" | |||
" /dev/shm/simplescreenrecor der-stats-PID is used. It will\n" | " /dev/shm/simplescreenrecor der-stats-PID is used. It will\n" | |||
" be updated continuously an d deleted when the recording\n" | " be updated continuously an d deleted when the recording\n" | |||
" page is closed.\n" | " page is closed.\n" | |||
" --syncdiagram Show synchronization diagr am (for debugging).\n" | " --syncdiagram Show synchronization diagr am (for debugging).\n" | |||
" --no-systray Don't show the system tray icon.\n" | " --no-systray Don't show the system tray icon.\n" | |||
" --start-hidden Start the application in h idden form.\n" | " --start-hidden Start the application in h idden form.\n" | |||
); | ); | |||
} | } | |||
skipping to change at line 128 | skipping to change at line 129 | |||
if(!value.isNull()) { \ | if(!value.isNull()) { \ | |||
Logger::LogError("[main] " + Logger::tr("Error: C ommand-line option '%1' does not take a value!").arg(option)); \ | Logger::LogError("[main] " + Logger::tr("Error: C ommand-line option '%1' does not take a value!").arg(option)); \ | |||
PrintOptionHelp(); \ | PrintOptionHelp(); \ | |||
return 1; \ | return 1; \ | |||
} | } | |||
// handle options | // handle options | |||
if(option == "--help") { | if(option == "--help") { | |||
PrintOptionHelp(); | PrintOptionHelp(); | |||
return 0; | return 0; | |||
} else if(option == "--version") { | ||||
Logger::LogInfo(GetVersionInfo()); | ||||
return 0; | ||||
} else if(option == "--logfile") { | } else if(option == "--logfile") { | |||
NOVALUE | NOVALUE | |||
g_option_logfile = true; | g_option_logfile = true; | |||
} else if(option == "--statsfile") { | } else if(option == "--statsfile") { | |||
if(value.isNull()) { | if(value.isNull()) { | |||
g_option_statsfile = "/dev/shm/simplescre enrecorder-stats-" + QString::number(QCoreApplication::applicationPid()); | g_option_statsfile = "/dev/shm/simplescre enrecorder-stats-" + QString::number(QCoreApplication::applicationPid()); | |||
} else { | } else { | |||
g_option_statsfile = value; | g_option_statsfile = value; | |||
} | } | |||
} else if(option == "--syncdiagram") { | } else if(option == "--syncdiagram") { | |||
skipping to change at line 208 | skipping to change at line 212 | |||
// start logging | // start logging | |||
Logger::LogInfo("==================== " + Logger::tr("SSR started") + " = ==================="); | Logger::LogInfo("==================== " + Logger::tr("SSR started") + " = ==================="); | |||
Logger::LogInfo(GetVersionInfo()); | Logger::LogInfo(GetVersionInfo()); | |||
#if SSR_USE_X86_ASM | #if SSR_USE_X86_ASM | |||
// detect CPU features | // detect CPU features | |||
CPUFeatures::Detect(); | CPUFeatures::Detect(); | |||
#endif | #endif | |||
// start the GUI | // start the program | |||
int ret; | int ret; | |||
if(g_option_benchmark) { | if(g_option_benchmark) { | |||
// run benchmark | ||||
Benchmark(); | Benchmark(); | |||
ret = 0; | ret = 0; | |||
} else { | } else { | |||
// create hotkey listener | // create hotkey listener | |||
HotkeyListener hotkey_listener; | HotkeyListener hotkey_listener; | |||
Q_UNUSED(hotkey_listener); | Q_UNUSED(hotkey_listener); | |||
// create main window | // create main window | |||
MainWindow mainwindow; | MainWindow mainwindow; | |||
// run application | // run application | |||
End of changes. 5 change blocks. | ||||
1 lines changed or deleted | 8 lines changed or added |