13
13
using Microsoft . Win32 ;
14
14
using System . Runtime . InteropServices ;
15
15
using System . IO ;
16
-
16
+ using System . Net ;
17
17
18
18
namespace Shadowsocks . View
19
19
{
20
20
21
21
public partial class ConfigForm : Form
22
22
{
23
- const string Version = "1.0" ;
24
-
25
23
26
24
private ShadowsocksController controller ;
27
- private UpdateChecker updateChecker ;
28
25
29
26
private List < string > m_list_ads = new List < string > ( ) ;
30
27
28
+ private VersionChecker mUpdater = new VersionChecker ( ) ;
29
+
31
30
// this is a copy of configuration that we are working on
32
31
private Configuration _modifiedConfiguration ;
33
32
private int _oldSelectedIndex = - 1 ;
@@ -38,6 +37,7 @@ public partial class ConfigForm : Form
38
37
public ConfigForm ( ShadowsocksController controller )
39
38
{
40
39
InitializeComponent ( ) ;
40
+
41
41
LoadTrayIcon ( ) ;
42
42
43
43
m_settings = Properties . Settings . Default ;
@@ -50,8 +50,6 @@ public ConfigForm(ShadowsocksController controller)
50
50
controller . PACFileReadyToOpen += controller_PACFileReadyToOpen ;
51
51
controller . ShareOverLANStatusChanged += controller_ShareOverLANStatusChanged ;
52
52
53
- this . updateChecker = new UpdateChecker ( ) ;
54
- //updateChecker.NewVersionFound += updateChecker_NewVersionFound;
55
53
56
54
LoadCurrentConfiguration ( ) ;
57
55
@@ -73,8 +71,12 @@ public ConfigForm(ShadowsocksController controller)
73
71
}
74
72
75
73
76
- if ( tempAutoCheckUpdate )
77
- CheckUpdate ( ) ;
74
+ //if (tempAutoCheckUpdate)
75
+ //CheckUpdate();
76
+
77
+ //mUpdater.VersionCheck();
78
+
79
+
78
80
79
81
}
80
82
@@ -127,20 +129,6 @@ void controller_PACFileReadyToOpen(object sender, ShadowsocksController.PathEven
127
129
System . Diagnostics . Process . Start ( "explorer.exe" , argument ) ;
128
130
}
129
131
130
- void updateChecker_NewVersionFound ( object sender , EventArgs e )
131
- {
132
- notifyIcon1 . BalloonTipTitle = "Shadowsocks " + updateChecker . LatestVersionNumber + " Update Found" ;
133
- notifyIcon1 . BalloonTipText = "Click here to download" ;
134
- notifyIcon1 . BalloonTipIcon = ToolTipIcon . Info ;
135
- notifyIcon1 . BalloonTipClicked += notifyIcon1_BalloonTipClicked ;
136
- notifyIcon1 . ShowBalloonTip ( 5000 ) ;
137
- _isFirstRun = false ;
138
- }
139
-
140
- void notifyIcon1_BalloonTipClicked ( object sender , EventArgs e )
141
- {
142
- Process . Start ( updateChecker . LatestVersionURL ) ;
143
- }
144
132
145
133
146
134
private void ShowWindow ( )
@@ -258,14 +246,17 @@ private void UpdateServersMenu()
258
246
}
259
247
}
260
248
string Startuplnkname ;
249
+
261
250
private void ConfigForm_Load ( object sender , EventArgs e )
262
251
{
263
252
Startuplnkname = Shadowsocks . _3rd . CreateDesktopShort . StartupPath + "\\ " + System . IO . Path . GetFileName ( Application . ExecutablePath ) . Replace ( ".exe" , ".lnk" ) . Replace ( ".EXE" , ".lnk" ) ;
264
253
265
254
checkBoxAutoRun . Checked = File . Exists ( Startuplnkname ) ;
266
255
267
256
GetPassWord . m_mainform = this ;
257
+
268
258
CheckForIllegalCrossThreadCalls = false ;
259
+
269
260
if ( ! controller . GetConfiguration ( ) . isDefault )
270
261
{
271
262
//this.Opacity = 0;
@@ -796,25 +787,16 @@ private void buttonDel_Click(object sender, EventArgs e)
796
787
}
797
788
798
789
799
- void CheckUpdate ( )
800
- {
801
- Task . Factory . StartNew ( ( ) =>
802
- {
803
-
804
-
805
790
806
791
807
- } ) ;
808
- }
809
-
810
792
/// <summary>
811
793
/// 手动更新
812
794
/// </summary>
813
795
/// <param name="sender"></param>
814
796
/// <param name="e"></param>
815
797
private void menuItemStartCheckUpdate_Click ( object sender , EventArgs e )
816
798
{
817
- CheckUpdate ( ) ;
799
+ // CheckUpdate();
818
800
}
819
801
820
802
public bool tempAutoCheckUpdate = true ;
@@ -834,7 +816,7 @@ private void menuItem7_Click(object sender, EventArgs e)
834
816
835
817
FileInfo file = new FileInfo ( path ) ;
836
818
837
- System . Diagnostics . Process . Start ( "explorer.exe" , file . DirectoryName ) ;
819
+ Process . Start ( "explorer.exe" , file . DirectoryName ) ;
838
820
839
821
}
840
822
0 commit comments