forked from Qv2ray/QvPlugin-SS
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a config option to choose default find path of SIP003 plugins.
- Loading branch information
1 parent
b8a497e
commit 2f5acbd
Showing
11 changed files
with
163 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
*.user | ||
build/ | ||
/cmake-build-debug | ||
/cmake-build-* | ||
/.idea | ||
/compile_commands.json | ||
|
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
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,25 @@ | ||
#include "SSSettingsWidget.hpp" | ||
#include <QFileDialog> | ||
|
||
void SSSettingsWidget::SetSettings(const QJsonObject &content) { | ||
setting.loadJson(content); | ||
|
||
pfxPathEdit->setText(setting.default_plugin_prefix); | ||
} | ||
|
||
QJsonObject SSSettingsWidget::GetSettings() { | ||
return setting.toJson(); | ||
} | ||
|
||
void SSSettingsWidget::on_pfxPathPushButton_clicked() { | ||
auto filename = QFileDialog::getExistingDirectory(this, tr("Default Plugin Path"), {}); | ||
|
||
if (!filename.isEmpty()) { | ||
setting.default_plugin_prefix = filename; | ||
pfxPathEdit->setText(filename); | ||
} | ||
} | ||
|
||
void SSSettingsWidget::on_pfxPathEdit_textEdited(const QString &arg1) { | ||
setting.default_plugin_prefix = arg1; | ||
} |
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,31 @@ | ||
#ifndef SSSETTINGSWIDGET_HPP | ||
#define SSSETTINGSWIDGET_HPP | ||
|
||
#include "QvGUIPluginInterface.hpp" | ||
#include "common/CommonHelpers.hpp" | ||
#include "ui_SSSettingsWidget.h" | ||
|
||
class SSSettingsWidget | ||
: public Qv2rayPlugin::QvPluginSettingsWidget, private Ui::SSSettingsWidget { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit SSSettingsWidget(QWidget *parent = nullptr) : QvPluginSettingsWidget(parent) { | ||
setupUi(this); | ||
} | ||
|
||
void SetSettings(const QJsonObject &content) override; | ||
|
||
QJsonObject GetSettings() override; | ||
|
||
private slots: | ||
|
||
void on_pfxPathPushButton_clicked(); | ||
|
||
void on_pfxPathEdit_textEdited(const QString &arg1); | ||
|
||
private: | ||
SSPluginSettingObject setting; | ||
}; | ||
|
||
#endif // SSSETTINGSWIDGET_HPP |
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>SSSettingsWidget</class> | ||
<widget class="QWidget" name="SSSettingsWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<widget class="QWidget" name=""> | ||
<property name="geometry"> | ||
<rect> | ||
<x>20</x> | ||
<y>30</y> | ||
<width>361</width> | ||
<height>82</height> | ||
</rect> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>Default Prefix for Plugins</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLineEdit" name="pfxPathEdit"/> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pfxPathPushButton"> | ||
<property name="text"> | ||
<string>选择Plugin默认路径</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |