This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
int main(int argc, char *argv[])
for(int i = 1; i < argc-1; i++)
if (std::strcmp(argv[i], "--ffmpeg") == 0)
QString new_ffmpeg_path = argv[i+1];
MainWindow::ffmpeg_path(new_ffmpeg_path);
if (std::strcmp(argv[i], "--stat") == 0)
QString new_stat_path = argv[i+1];
MainWindow::stat_path(new_stat_path);
QApplication a(argc, argv);
if (!QFile::exists(MainWindow::ffmpeg_path()))
InfoView iv(InfoView::window_type::ok,
"Please set FFMPEG with the commandline parameter \"--ffmpeg <path to ffmpeg>\".");
if (!QFile::exists(MainWindow::stat_path()))
InfoView iv(InfoView::window_type::ok,
"Please set STAT with the commandline parameter \"--stat <path to stat>\".");
/*
Copyright (C) 2022 Lari Varjonen <
[email protected]>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "main_window.h"
#include <QApplication>
int main(int argc, char *argv[])
{
for(int i = 1; i < argc-1; i++)
{
if (std::strcmp(argv[i], "--ffmpeg") == 0)
{
QString new_ffmpeg_path = argv[i+1];
MainWindow::ffmpeg_path(new_ffmpeg_path);
i++;
continue;
}
if (std::strcmp(argv[i], "--stat") == 0)
{
QString new_stat_path = argv[i+1];
MainWindow::stat_path(new_stat_path);
i++;
continue;
}
}
QApplication a(argc, argv);
if (!QFile::exists(MainWindow::ffmpeg_path()))
{
InfoView iv(InfoView::window_type::ok,
"FFMPEG not found.",
"Please set FFMPEG with the commandline parameter \"--ffmpeg <path to ffmpeg>\".");
iv.exec();
a.quit();
return 0;
}
if (!QFile::exists(MainWindow::stat_path()))
{
InfoView iv(InfoView::window_type::ok,
"STAT not found.",
"Please set STAT with the commandline parameter \"--stat <path to stat>\".");
iv.exec();
a.quit();
return 0;
}
MainWindow w;
w.show();
return a.exec();
}