Merge upstream
# Conflicts: # README.md # shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs # shadowsocks-csharp/Controller/Service/PACServer.cs # shadowsocks-csharp/Controller/Strategy/SimplyChooseByStatisticsStrategy.cs # shadowsocks-csharp/Data/cn.txt # shadowsocks-csharp/Model/Configuration.cs # shadowsocks-csharp/Model/LogViewerConfig.cs # shadowsocks-csharp/View/LogForm.Designer.cs # shadowsocks-csharp/View/LogForm.cs # shadowsocks-csharp/View/MenuViewController.cs
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Shadowsocks.Model
|
||||
{
|
||||
if (!(e is FileNotFoundException))
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
Logging.LogUsefulException(e);
|
||||
}
|
||||
return new Configuration
|
||||
{
|
||||
@@ -167,6 +167,7 @@ namespace Shadowsocks.Model
|
||||
}
|
||||
}
|
||||
|
||||
// internal class
|
||||
private class JsonSerializerStrategy : SimpleJson.PocoJsonSerializerStrategy
|
||||
{
|
||||
// convert string to int
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Shadowsocks.View;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Shadowsocks.Model
|
||||
{
|
||||
@@ -13,16 +15,37 @@ namespace Shadowsocks.Model
|
||||
public bool topMost;
|
||||
public bool wrapText;
|
||||
public bool toolbarShown;
|
||||
public int width;
|
||||
public int height;
|
||||
public int top;
|
||||
public int left;
|
||||
|
||||
public LogViewerConfig()
|
||||
{
|
||||
this.fontName = "Consolas";
|
||||
this.fontSize = 8;
|
||||
this.bgColor = "black";
|
||||
this.textColor = "white";
|
||||
this.topMost = false;
|
||||
this.wrapText = false;
|
||||
this.toolbarShown = false;
|
||||
fontName = "Consolas";
|
||||
fontSize = 8;
|
||||
bgColor = "black";
|
||||
textColor = "white";
|
||||
topMost = false;
|
||||
wrapText = false;
|
||||
toolbarShown = false;
|
||||
width = 600;
|
||||
height = 400;
|
||||
left = GetBestLeft();
|
||||
top = GetBestTop();
|
||||
}
|
||||
|
||||
// Use GetBestTop() and GetBestLeft() to ensure the log viwer form can be always display IN screen.
|
||||
public int GetBestLeft()
|
||||
{
|
||||
width = (width >= 400) ? width : 400; // set up the minimum size
|
||||
return Screen.PrimaryScreen.WorkingArea.Width - width;
|
||||
}
|
||||
|
||||
public int GetBestTop()
|
||||
{
|
||||
height = (height >= 200) ? height : 200; // set up the minimum size
|
||||
return Screen.PrimaryScreen.WorkingArea.Height - height;
|
||||
}
|
||||
|
||||
public Font GetFont()
|
||||
|
||||
Reference in New Issue
Block a user