@ -1,5 +1,5 @@
using System ;
using System.Diagnostics ;
using System.Diagnostics ;
using System.IO ;
using System.Windows.Forms ;
@ -58,54 +58,54 @@ namespace network.loki.lokinet.win32.ui
VisualSettings v = new VisualSettings ( ) ;
v . ShowDialog ( ) ;
v . Dispose ( ) ;
}
private void BtnEditCfg_Click ( object sender , EventArgs e )
{
try {
Process . Start ( string . Format ( "{0}/lokinet.ini" , config_path ) ) ; }
catch
{
MessageBox . Show ( "No existing config found" ) ;
BtnNewCfg_Click ( sender , e ) ;
}
}
private void BtnNewCfg_Click ( object sender , EventArgs e )
{
if ( File . Exists ( string . Format ( "{0}/lokinet.ini" , config_path ) ) )
{
DialogResult resp = MessageBox . Show ( "WARNING: This will overwrite your existing config file, Continue?" , "Lokinet" , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ;
switch ( resp )
{
case DialogResult . Yes :
File . Delete ( string . Format ( "{0}/lokinet.ini" , config_path ) ) ;
break ;
case DialogResult . No :
return ;
}
}
string lokinetExeString ;
if ( Program . platform = = PlatformID . Win32NT )
lokinetExeString = String . Format ( "{0}\\lokinet.exe" , Directory . GetCurrentDirectory ( ) ) ;
else
lokinetExeString = String . Format ( "{0}/lokinet" , Directory . GetCurrentDirectory ( ) ) ;
Process p = new Process ( ) ;
p . StartInfo . FileName = lokinetExeString ;
p . StartInfo . Arguments = "-g" ;
p . StartInfo . CreateNoWindow = true ;
p . StartInfo . UseShellExecute = false ;
p . EnableRaisingEvents = true ;
p . Exited + = new EventHandler ( msg ) ;
p . Start ( ) ;
}
private void msg ( object sender , EventArgs e )
{
MessageBox . Show ( string . Format ( "Created new config file at {0}/lokinet.ini" , config_path ) , "Success" , MessageBoxButtons . OK , MessageBoxIcon . Asterisk ) ;
}
}
private void BtnEditCfg_Click ( object sender , EventArgs e )
{
try {
Process . Start ( string . Format ( "{0}/lokinet.ini" , config_path ) ) ; }
catch
{
MessageBox . Show ( "No existing config found" ) ;
BtnNewCfg_Click ( sender , e ) ;
}
}
private void BtnNewCfg_Click ( object sender , EventArgs e )
{
if ( File . Exists ( string . Format ( "{0}/lokinet.ini" , config_path ) ) )
{
DialogResult resp = MessageBox . Show ( "WARNING: This will overwrite your existing config file, Continue?" , "Lokinet" , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ;
switch ( resp )
{
case DialogResult . Yes :
File . Delete ( string . Format ( "{0}/lokinet.ini" , config_path ) ) ;
break ;
case DialogResult . No :
return ;
}
}
string lokinetExeString ;
if ( Program . platform = = PlatformID . Win32NT )
lokinetExeString = String . Format ( "{0}\\lokinet.exe" , Directory . GetCurrentDirectory ( ) ) ;
else
lokinetExeString = String . Format ( "{0}/lokinet" , Directory . GetCurrentDirectory ( ) ) ;
Process p = new Process ( ) ;
p . StartInfo . FileName = lokinetExeString ;
p . StartInfo . Arguments = "-g" ;
p . StartInfo . CreateNoWindow = true ;
p . StartInfo . UseShellExecute = false ;
p . EnableRaisingEvents = true ;
p . Exited + = new EventHandler ( msg ) ;
p . Start ( ) ;
}
private void msg ( object sender , EventArgs e )
{
MessageBox . Show ( string . Format ( "Created new config file at {0}/lokinet.ini" , config_path ) , "Success" , MessageBoxButtons . OK , MessageBoxIcon . Asterisk ) ;
}
}
}