-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
243 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "dialog_first_setup.h" | ||
#include "ui_dialog_first_setup.h" | ||
|
||
#include "main/NekoRay.hpp" | ||
|
||
DialogFirstSetup::DialogFirstSetup(QWidget *parent) : QDialog(parent), ui(new Ui::DialogFirstSetup) { | ||
ui->setupUi(this); | ||
} | ||
|
||
DialogFirstSetup::~DialogFirstSetup() { | ||
delete ui; | ||
} | ||
|
||
void DialogFirstSetup::onButtonClicked() { | ||
auto s = sender(); | ||
if (s == ui->v2ray) { | ||
done(NekoRay::CoreType::V2RAY); | ||
} else if (s == ui->singbox) { | ||
done(NekoRay::CoreType::SING_BOX); | ||
} else { | ||
done(-1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#include <QDialog> | ||
|
||
QT_BEGIN_NAMESPACE | ||
namespace Ui { | ||
class DialogFirstSetup; | ||
} | ||
QT_END_NAMESPACE | ||
|
||
class DialogFirstSetup : public QDialog { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit DialogFirstSetup(QWidget *parent = nullptr); | ||
~DialogFirstSetup() override; | ||
|
||
private: | ||
Ui::DialogFirstSetup *ui; | ||
|
||
private slots: | ||
void onButtonClicked(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>DialogFirstSetup</class> | ||
<widget class="QDialog" name="DialogFirstSetup"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>First time setup</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>It looks like you are using this software for the first time, please select a core. | ||
|
||
These settings can be changed later.</string> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="v2ray"> | ||
<property name="text"> | ||
<string notr="true">V2Ray</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="singbox"> | ||
<property name="text"> | ||
<string notr="true">sing-box</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="quit"> | ||
<property name="text"> | ||
<string>Quit</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>v2ray</sender> | ||
<signal>clicked()</signal> | ||
<receiver>DialogFirstSetup</receiver> | ||
<slot>onButtonClicked()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>199</x> | ||
<y>196</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>199</x> | ||
<y>149</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>singbox</sender> | ||
<signal>clicked()</signal> | ||
<receiver>DialogFirstSetup</receiver> | ||
<slot>onButtonClicked()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>199</x> | ||
<y>236</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>199</x> | ||
<y>149</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>quit</sender> | ||
<signal>clicked()</signal> | ||
<receiver>DialogFirstSetup</receiver> | ||
<slot>onButtonClicked()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>199</x> | ||
<y>276</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>199</x> | ||
<y>149</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
<slots> | ||
<slot>onButtonClicked()</slot> | ||
</slots> | ||
</ui> |