22#include " ui_firstlaunchwizard.h"
33#include " misc/common.h"
44#include " misc/autostartmanager.h"
5+ #include " misc/GstRegistryHelper.h"
56#include " mainwindow.h"
67
78#include < QTimer>
1112#include < QFileInfo>
1213#include < QDir>
1314#include < QProcess>
15+ #include < QMessageBox>
1416
1517FirstLaunchWizard::FirstLaunchWizard (AppConfigWrapper* _appconf, MainWindow* mainwin, QWidget *parent) :
1618 QWidget(parent),
@@ -25,43 +27,62 @@ FirstLaunchWizard::FirstLaunchWizard(AppConfigWrapper* _appconf, MainWindow* mai
2527 QTimer::singleShot (1000 , [&]{
2628 ui->p1_icon ->startAnimation ();
2729 });
28- ui->p1dot5_icon ->startAnimation ();
2930 ui->p2_icon ->startAnimation ();
31+ ui->pm_icon ->startAnimation ();
32+ ui->pl_icon ->startAnimation ();
3033 ui->p3_icon ->startAnimation ();
3134 ui->p4_icon ->startAnimation ();
3235
3336 ui->stackedWidget ->setAnimation (QEasingCurve::Type::OutCirc);
37+
3438 connect (ui->p1_next ,&QPushButton::clicked,[&]{
35- ui->stackedWidget ->slideInIdx (1 );
36- });
37- connect (ui->p1dot5_next ,&QPushButton::clicked,[&]{
38- ui->stackedWidget ->slideInIdx (2 );
39+ if (!GstRegistryHelper::IsPluginInstalled ()){
40+ ui->stackedWidget ->slideInIdx (1 );
41+ }
42+ else if (!GstRegistryHelper::HasDBusSupport ()){
43+ ui->stackedWidget ->slideInIdx (2 );
44+ }
45+ else {
46+ ui->stackedWidget ->slideInIdx (3 );
47+ }
3948 });
4049 connect (ui->p2_next ,&QPushButton::clicked,[&]{
41- ui->stackedWidget ->slideInIdx (3 );
50+ ui->stackedWidget ->slideInIdx (4 );
4251 });
4352 connect (ui->p3_next ,&QPushButton::clicked,[&]{
44- ui->stackedWidget ->slideInIdx (4 );
53+ ui->stackedWidget ->slideInIdx (5 );
4554 });
4655 connect (ui->p4_next ,&QPushButton::clicked,[&]{
4756 emit wizardFinished ();
4857 });
49- connect (ui->p4_telegram ,&QPushButton::clicked,[&]{
50- QDesktopServices::openUrl (QUrl (" https://t.me/joinchat/FTKC2A2bolHkFAyO-fuPjw" ));
51- });
52-
53- ui->p1dot5_mode_legacy ->setChecked (appconf->getLegacyMode ());
5458
55- auto legacy_radio = [this ]{
56- if (lockslot)return ;
57- int mode = 0 ;
58- if (ui->p1dot5_mode_a4l ->isChecked ())mode=0 ;
59- else if (ui->p1dot5_mode_legacy ->isChecked ())mode=1 ;
60- appconf->setLegacyMode (mode);
59+ auto openTelegram = []{
60+ QDesktopServices::openUrl (QUrl (" https://t.me/joinchat/FTKC2A2bolHkFAyO-fuPjw" ));
6161 };
62+ connect (ui->p4_telegram ,&QPushButton::clicked, openTelegram);
6263
63- connect (ui->p1dot5_mode_a4l ,&QRadioButton::clicked,this ,legacy_radio);
64- connect (ui->p1dot5_mode_legacy ,&QRadioButton::clicked,this ,legacy_radio);
64+ connect (ui->pm_telegram ,&QPushButton::clicked, openTelegram);
65+ connect (ui->pm_readme ,&QPushButton::clicked, []{
66+ QDesktopServices::openUrl (QUrl (" https://github.com/Audio4Linux/Viper4Linux" ));
67+ });
68+ connect (ui->pm_next ,&QPushButton::clicked, [this ]{
69+ gst_update_registry ();
70+ if (GstRegistryHelper::IsPluginInstalled ()){
71+ if (!GstRegistryHelper::HasDBusSupport ())
72+ ui->stackedWidget ->slideInIdx (2 );
73+ else
74+ ui->stackedWidget ->slideInIdx (3 );
75+ }
76+ else {
77+ QMessageBox::warning (this , " Error" , " Still no luck. No GStreamer plugin named 'viperfx' has been found!" );
78+ }
79+ });
80+ connect (ui->pl_next ,&QPushButton::clicked, [this ]{
81+ ui->stackedWidget ->slideInIdx (3 );
82+ });
83+ connect (ui->pl_help ,&QPushButton::clicked, []{
84+ QDesktopServices::openUrl (QUrl (" https://gist.github.com/ThePBone/93da516635cdbc01759c10d2e5abb7ea" ));
85+ });
6586
6687 auto deviceUpdated = [this ](){
6788 if (lockslot) return ;
0 commit comments