mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 10:50:23 +08:00
[fix] Fixed a vmess import error and redesigned ImportWindow #121
Former-commit-id: 381075cbbb
This commit is contained in:
parent
7a43973ff2
commit
86f4321565
@ -1 +1 @@
|
||||
997
|
||||
1006
|
||||
|
@ -33,11 +33,6 @@ QMap<QString, CONFIGROOT> ImportConfigWindow::OpenImport(bool outboundsOnly)
|
||||
return this->result() == QDialog::Accepted ? connections : QMap<QString, CONFIGROOT>();
|
||||
}
|
||||
|
||||
void ImportConfigWindow::on_importSourceCombo_currentIndexChanged(int index)
|
||||
{
|
||||
stackedWidget->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
void ImportConfigWindow::on_selectFileBtn_clicked()
|
||||
{
|
||||
QString dir = QFileDialog::getOpenFileName(this, tr("Select file to import"));
|
||||
@ -68,7 +63,7 @@ void ImportConfigWindow::on_beginImportBtn_clicked()
|
||||
CONFIGROOT config;
|
||||
//auto conf = GetGlobalConfig();
|
||||
|
||||
switch (importSourceCombo->currentIndex()) {
|
||||
switch (tabWidget->currentIndex()) {
|
||||
case 0: {
|
||||
// From File...
|
||||
bool keepInBound = keepImportedInboundCheckBox->isChecked();
|
||||
@ -96,7 +91,7 @@ void ImportConfigWindow::on_beginImportBtn_clicked()
|
||||
vmessConnectionStringTxt->clear();
|
||||
errorsList->clear();
|
||||
//
|
||||
LOG(MODULE_IMPORT, to_string(vmessList.count()) + " vmess connection found.")
|
||||
LOG(MODULE_IMPORT, to_string(vmessList.count()) + " string found.")
|
||||
|
||||
while (!vmessList.isEmpty()) {
|
||||
aliasPrefix = nameTxt->text();
|
||||
@ -120,6 +115,10 @@ void ImportConfigWindow::on_beginImportBtn_clicked()
|
||||
vmessConnectionStringTxt->appendPlainText(vmessErrors.key(item));
|
||||
errorsList->addItem(item);
|
||||
}
|
||||
|
||||
vmessConnectionStringTxt->setLineWidth(errorsList->lineWidth());
|
||||
errorsList->sortItems();
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -16,7 +16,6 @@ class ImportConfigWindow : public QDialog, private Ui::ImportConfigWindow
|
||||
~ImportConfigWindow() { }
|
||||
QMap<QString, CONFIGROOT> OpenImport(bool outboundsOnly = false);
|
||||
private slots:
|
||||
void on_importSourceCombo_currentIndexChanged(int index);
|
||||
|
||||
void on_selectFileBtn_clicked();
|
||||
|
||||
|
@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>675</width>
|
||||
<height>485</height>
|
||||
<width>470</width>
|
||||
<height>460</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>370</width>
|
||||
<height>420</height>
|
||||
<width>470</width>
|
||||
<height>460</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -38,57 +38,24 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="nameTxt"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Import Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="importSourceCombo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Existing File</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>VMess and QRCode</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Subscription Link</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Manually Input</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Import</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="filePage">
|
||||
<widget class="QWidget" name="tabWidgetPage1">
|
||||
<attribute name="title">
|
||||
<string>Existing File</string>
|
||||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="fileLabel">
|
||||
@ -145,7 +112,10 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="vmessPage">
|
||||
<widget class="QWidget" name="tabWidgetPage2">
|
||||
<attribute name="title">
|
||||
<string>VMess / QRCode</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
@ -298,7 +268,10 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page">
|
||||
<widget class="QWidget" name="tabWidgetPage3">
|
||||
<attribute name="title">
|
||||
<string>Subscription</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
@ -330,7 +303,10 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<widget class="QWidget" name="tabWidgetPage4">
|
||||
<attribute name="title">
|
||||
<string>Manually Input</string>
|
||||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout_4">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
@ -357,9 +333,6 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
@ -394,8 +367,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>nameTxt</tabstop>
|
||||
<tabstop>importSourceCombo</tabstop>
|
||||
<tabstop>fileLineTxt</tabstop>
|
||||
<tabstop>keepImportedInboundCheckBox</tabstop>
|
||||
<tabstop>editFileBtn</tabstop>
|
||||
|
Loading…
Reference in New Issue
Block a user