Skip to content

Commit 1798663

Browse files
committed
feat: advanced import
1 parent 389e4b1 commit 1798663

File tree

9 files changed

+576
-64
lines changed

9 files changed

+576
-64
lines changed

MainWindow.ui

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,15 @@
4444
</widget>
4545
</item>
4646
<item>
47-
<widget class="QPushButton" name="btnWait_Load">
47+
<widget class="QPushButton" name="btnWait_Import">
4848
<property name="toolTip">
49-
<string>从文件导入IP列表。</string>
49+
<string>从指定来源导入IP列表。</string>
5050
</property>
5151
<property name="text">
5252
<string>导入</string>
5353
</property>
5454
</widget>
5555
</item>
56-
<item>
57-
<widget class="QPushButton" name="btnWait_Sync">
58-
<property name="toolTip">
59-
<string>从远程服务器上获取IP列表。</string>
60-
</property>
61-
<property name="text">
62-
<string>同步</string>
63-
</property>
64-
</widget>
65-
</item>
6656
<item>
6757
<widget class="QPushButton" name="btnWait_Test">
6858
<property name="toolTip">

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,29 @@ python main.py
6262

6363
...(若有其他需求欢迎在[issues](https://github.com/GoodCoder666/GoogleTranslate_IPFinder/issues)中提出)
6464

65+
## 关于在线同步功能
66+
67+
本项目作者提供的 IP 库在打开软件时会自动导入。程序还提供了在线导入其他 IP 库的功能,地址如下:
68+
69+
- 精简 IPv4:
70+
- 官方:https://unpkg.com/@hcfy/google-translate-ip/ips.txt
71+
- 备用1(ghproxy 镜像):https://ghproxy.com/https://raw.githubusercontent.com/hcfyapp/google-translate-cn-ip/master/packages/google-translate-ip/ips.txt
72+
- 备用2(jsDelivr CDN):https://cdn.jsdelivr.net/npm/@hcfy/google-translate-ip/ips.txt
73+
- 扩展 IPv4:
74+
- 官方1:https://raw.githubusercontent.com/Ponderfly/GoogleTranslateIpCheck/master/src/GoogleTranslateIpCheck/GoogleTranslateIpCheck/ip.txt
75+
- 官方2:https://ghproxy.com/https://raw.githubusercontent.com/Ponderfly/GoogleTranslateIpCheck/master/src/GoogleTranslateIpCheck/GoogleTranslateIpCheck/ip.txt
76+
- 备用(GitCode 镜像):https://gitcode.net/mirrors/Ponderfly/GoogleTranslateIpCheck/-/raw/master/src/GoogleTranslateIpCheck/GoogleTranslateIpCheck/ip.txt
77+
- 标准 IPv6:
78+
- 官方1:https://raw.githubusercontent.com/Ponderfly/GoogleTranslateIpCheck/master/src/GoogleTranslateIpCheck/GoogleTranslateIpCheck/IPv6.txt
79+
- 官方2:https://ghproxy.com/https://raw.githubusercontent.com/Ponderfly/GoogleTranslateIpCheck/master/src/GoogleTranslateIpCheck/GoogleTranslateIpCheck/IPv6.txt
80+
- 备用(GitCode 镜像):https://gitcode.net/mirrors/Ponderfly/GoogleTranslateIpCheck/-/raw/master/src/GoogleTranslateIpCheck/GoogleTranslateIpCheck/IPv6.txt
81+
82+
程序会自动找到可用的网址并导入 IP 库(设置备用网址是因为 raw.githubusercontent.com 访问不稳定)。导入一般需要 5-10 秒,请耐心等待。
83+
84+
感谢 @hcfyapp@Ponderfly 提供的 IP 库。
85+
6586
## 版权说明
6687

6788
本项目使用[GPLv3](https://github.com/GoodCoder666/GoogleTranslate_IPFinder/blob/main/LICENSE)版权许可。IP 扫描逻辑参考 [https://repo.or.cz/gscan_quic](https://repo.or.cz/gscan_quic)
6889

69-
类似的项目:[hcfyapp/google-translate-cn-ip](https://github.com/hcfyapp/google-translate-cn-ip) [Ponderfly/GoogleTranslateIpCheck](https://github.com/Ponderfly/GoogleTranslateIpCheck)
70-
71-
特别感谢 [hcfyapp/google-translate-cn-ip](https://github.com/hcfyapp/google-translate-cn-ip) 中提供的 IP 地址列表。自动同步功能的 IP 列表地址:[https://unpkg.com/@hcfy/google-translate-ip/ips.txt](https://unpkg.com/@hcfy/google-translate-ip/ips.txt)
90+
类似的项目:[hcfyapp/google-translate-cn-ip](https://github.com/hcfyapp/google-translate-cn-ip) [Ponderfly/GoogleTranslateIpCheck](https://github.com/Ponderfly/GoogleTranslateIpCheck)

dlgImport.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
from PySide6.QtWidgets import QDialog, QDialogButtonBox
3+
from PySide6.QtCore import Slot
4+
from ui_dlgImport import Ui_Dialog
5+
6+
__all__ = ['dlgImport']
7+
8+
class dlgImport(QDialog):
9+
def __init__(self, parent=None):
10+
super().__init__(parent)
11+
12+
self.ui = Ui_Dialog()
13+
self.ui.setupUi(self)
14+
15+
self.ui.buttonBox.button(QDialogButtonBox.Ok).setText('导入')
16+
self.ui.buttonBox.button(QDialogButtonBox.Cancel).setText('取消')

dlgImport.ui

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Dialog</class>
4+
<widget class="QDialog" name="Dialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>266</width>
10+
<height>326</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>导入选项</string>
15+
</property>
16+
<layout class="QVBoxLayout" name="verticalLayout">
17+
<item>
18+
<widget class="QGroupBox" name="groupBox_Mode">
19+
<property name="title">
20+
<string>导入模式</string>
21+
</property>
22+
<layout class="QHBoxLayout" name="horizontalLayout">
23+
<item>
24+
<widget class="QRadioButton" name="radioAppend">
25+
<property name="text">
26+
<string>添加并去重</string>
27+
</property>
28+
<property name="checked">
29+
<bool>true</bool>
30+
</property>
31+
</widget>
32+
</item>
33+
<item>
34+
<widget class="QRadioButton" name="radioReplace">
35+
<property name="text">
36+
<string>替换全部</string>
37+
</property>
38+
</widget>
39+
</item>
40+
</layout>
41+
</widget>
42+
</item>
43+
<item>
44+
<widget class="QGroupBox" name="groupBox_Source">
45+
<property name="sizePolicy">
46+
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
47+
<horstretch>0</horstretch>
48+
<verstretch>0</verstretch>
49+
</sizepolicy>
50+
</property>
51+
<property name="title">
52+
<string>导入来源</string>
53+
</property>
54+
<layout class="QVBoxLayout" name="verticalLayout_3">
55+
<item>
56+
<widget class="QRadioButton" name="radioLocalFile">
57+
<property name="text">
58+
<string>本地文件</string>
59+
</property>
60+
</widget>
61+
</item>
62+
<item>
63+
<layout class="QHBoxLayout" name="horizontalLayout_2">
64+
<item>
65+
<widget class="QRadioButton" name="radioSingleIP">
66+
<property name="text">
67+
<string>单个 IP:</string>
68+
</property>
69+
</widget>
70+
</item>
71+
<item>
72+
<widget class="QLineEdit" name="singleIPEdit">
73+
<property name="enabled">
74+
<bool>false</bool>
75+
</property>
76+
</widget>
77+
</item>
78+
</layout>
79+
</item>
80+
<item>
81+
<widget class="QRadioButton" name="radioOnline">
82+
<property name="text">
83+
<string>在线服务:</string>
84+
</property>
85+
<property name="checked">
86+
<bool>true</bool>
87+
</property>
88+
</widget>
89+
</item>
90+
<item>
91+
<layout class="QVBoxLayout" name="verticalLayout_2">
92+
<property name="leftMargin">
93+
<number>30</number>
94+
</property>
95+
<item>
96+
<widget class="QCheckBox" name="chkBox_std4">
97+
<property name="text">
98+
<string>精简 IPv4</string>
99+
</property>
100+
<property name="checked">
101+
<bool>true</bool>
102+
</property>
103+
</widget>
104+
</item>
105+
<item>
106+
<widget class="QCheckBox" name="chkBox_ext4">
107+
<property name="text">
108+
<string>扩展 IPv4</string>
109+
</property>
110+
</widget>
111+
</item>
112+
<item>
113+
<widget class="QCheckBox" name="chkBox_std6">
114+
<property name="text">
115+
<string>标准 IPv6</string>
116+
</property>
117+
</widget>
118+
</item>
119+
</layout>
120+
</item>
121+
<item>
122+
<layout class="QHBoxLayout" name="horizontalLayout_3">
123+
<item>
124+
<widget class="QRadioButton" name="radioCustomURL">
125+
<property name="text">
126+
<string>自定义 URL:</string>
127+
</property>
128+
</widget>
129+
</item>
130+
<item>
131+
<widget class="QLineEdit" name="customURLEdit">
132+
<property name="enabled">
133+
<bool>false</bool>
134+
</property>
135+
</widget>
136+
</item>
137+
</layout>
138+
</item>
139+
</layout>
140+
</widget>
141+
</item>
142+
<item>
143+
<widget class="QDialogButtonBox" name="buttonBox">
144+
<property name="orientation">
145+
<enum>Qt::Horizontal</enum>
146+
</property>
147+
<property name="standardButtons">
148+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
149+
</property>
150+
</widget>
151+
</item>
152+
</layout>
153+
</widget>
154+
<resources/>
155+
<connections>
156+
<connection>
157+
<sender>buttonBox</sender>
158+
<signal>accepted()</signal>
159+
<receiver>Dialog</receiver>
160+
<slot>accept()</slot>
161+
<hints>
162+
<hint type="sourcelabel">
163+
<x>248</x>
164+
<y>254</y>
165+
</hint>
166+
<hint type="destinationlabel">
167+
<x>157</x>
168+
<y>274</y>
169+
</hint>
170+
</hints>
171+
</connection>
172+
<connection>
173+
<sender>buttonBox</sender>
174+
<signal>rejected()</signal>
175+
<receiver>Dialog</receiver>
176+
<slot>reject()</slot>
177+
<hints>
178+
<hint type="sourcelabel">
179+
<x>316</x>
180+
<y>260</y>
181+
</hint>
182+
<hint type="destinationlabel">
183+
<x>286</x>
184+
<y>274</y>
185+
</hint>
186+
</hints>
187+
</connection>
188+
<connection>
189+
<sender>radioOnline</sender>
190+
<signal>toggled(bool)</signal>
191+
<receiver>chkBox_std4</receiver>
192+
<slot>setEnabled(bool)</slot>
193+
<hints>
194+
<hint type="sourcelabel">
195+
<x>126</x>
196+
<y>158</y>
197+
</hint>
198+
<hint type="destinationlabel">
199+
<x>141</x>
200+
<y>185</y>
201+
</hint>
202+
</hints>
203+
</connection>
204+
<connection>
205+
<sender>radioOnline</sender>
206+
<signal>toggled(bool)</signal>
207+
<receiver>chkBox_ext4</receiver>
208+
<slot>setEnabled(bool)</slot>
209+
<hints>
210+
<hint type="sourcelabel">
211+
<x>126</x>
212+
<y>158</y>
213+
</hint>
214+
<hint type="destinationlabel">
215+
<x>141</x>
216+
<y>211</y>
217+
</hint>
218+
</hints>
219+
</connection>
220+
<connection>
221+
<sender>radioOnline</sender>
222+
<signal>toggled(bool)</signal>
223+
<receiver>chkBox_std6</receiver>
224+
<slot>setEnabled(bool)</slot>
225+
<hints>
226+
<hint type="sourcelabel">
227+
<x>126</x>
228+
<y>158</y>
229+
</hint>
230+
<hint type="destinationlabel">
231+
<x>141</x>
232+
<y>237</y>
233+
</hint>
234+
</hints>
235+
</connection>
236+
<connection>
237+
<sender>radioSingleIP</sender>
238+
<signal>toggled(bool)</signal>
239+
<receiver>singleIPEdit</receiver>
240+
<slot>setEnabled(bool)</slot>
241+
<hints>
242+
<hint type="sourcelabel">
243+
<x>56</x>
244+
<y>131</y>
245+
</hint>
246+
<hint type="destinationlabel">
247+
<x>172</x>
248+
<y>131</y>
249+
</hint>
250+
</hints>
251+
</connection>
252+
<connection>
253+
<sender>radioCustomURL</sender>
254+
<signal>toggled(bool)</signal>
255+
<receiver>customURLEdit</receiver>
256+
<slot>setEnabled(bool)</slot>
257+
<hints>
258+
<hint type="sourcelabel">
259+
<x>68</x>
260+
<y>265</y>
261+
</hint>
262+
<hint type="destinationlabel">
263+
<x>184</x>
264+
<y>265</y>
265+
</hint>
266+
</hints>
267+
</connection>
268+
</connections>
269+
</ui>

0 commit comments

Comments
 (0)