Commit Graph
41 Commits
Author SHA1 Message Date
Allen Zhu 84b69d3dff Chart Refactor (#1019)
* Rename variable 'traffic' to 'trafficPerSecondQueue' and 'trafficInfoQueue'

* Remove class QueueLast<T> by using linq Queue.Last()

* Slight changes, such as rename, move several variables from function domain to class domain to improve performance.
Logic remains the same.

* Update the logic of copying queue from Controller to View.

* Move the TrafficInfo declaration into LogForm class

Overwise, the VS UI designer does not work.
2017-03-31 22:21:01 +08:00
noisyfox b63bab0d1a Refine LogViewerConfig. Don't store window size in main settings file 2016-11-15 04:23:59 +11:00
Syrone Wong 46d95e7411 Get rid of lock(this)
- Use readonly object as lock

Info from stackoverflow:

If I want to be sure that it will be locked for all threads inside my
application:
The lock object has to be static, if it locks access to static state.
Otherwise it has to be instance, because there's no need to lock state of
one class instance, and prevent other threads to work with another class
instance at the same time.

everyone says that the object has to be "readonly" I didn't found the
reason
Well, it doesn't have to be. This is just a best practice, which helps you
to avoid errors.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-29 16:39:58 +08:00
破娃酱 7586739a52 remove all tuple (#718) 2016-09-15 22:02:55 -05:00
Syrone Wong 33b2ca8c8a Refactor
- Only use one instance of LogForm

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-16 00:47:05 +08:00
破娃酱 836a58775f optimize LogMessageTextBox (#719)
* optimize LogMessageTextBox

* StringBuilder instead
2016-09-14 21:14:33 -05:00
破娃酱 59c315d465 new traffic chart style (#704)
* new traffic chart style
- remove invoke
- force to set AxisY.Maximum not zero
- format LogForm.cs

* avoid data race
2016-09-08 15:24:46 +08:00
破娃酱 d958c5c393 fix bandwidthScale of the LogForm (#701)
- Revert bandwidthScale when throughput gets smaller
- Don't save coordinates when LogForm is minimized. Otherwise, we get negative values
- activate ConfigForm & ProxyForm & LogForm
2016-09-06 18:46:35 +08:00
Syrone Wong f70b177e56 Misc
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-29 21:30:05 +08:00
noisyfox a7b0ce5bcb Use atomic long read.
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-26 12:23:21 +10:00
金黎明 81188103f2 日志清理改为直接清理文件
日志文件越来越大,原有的清空日志只是清理记录窗口中显示的日志,实际并没有真的删除。
2016-08-13 10:50:21 +08:00
金黎明 6116388262 日志窗口支持记录最大化显示状态 2016-08-13 09:52:45 +08:00
Syrone Wong 4795340999 Check whether form handle been created(#650)
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-10 14:15:48 +08:00
Syrone Wong 3b5d38658f Minor bugfixes (#647)
* Drop unused variable to suppress warning in LogForm

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>

* Fix IPv6 displaying

It is a little ugly, send a PR if you can find a better way.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-08 18:49:24 +08:00
Allen Zhu c8f8ff5277 Fix the System.ObjectDisposedException when closing the LogForm. (#641)
This exception is caused by processing Invoke Action while trafficChart is already disposed.

=====
Exception reproduce frequency: RARE. Once triggered, ShadowSocks crashes.
2016-08-06 10:37:20 +08:00
Syrone Wong 382c581365 apply I18N to traffic chart legend (#636)
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-05 16:43:53 +08:00
Allen Zhu b0f71c43f5 Add traffic chart and traffic icon support (#595)
* Implement the line chart on Log View window for inbound/outbound traffic per second

* Implement dynamic tray icon to indicate Inbound and Outbound

* Refine linechart

* Bugfix for dynamic icon

* Refine chart presentation

* Change the data points' type for more accurate calculation

* Tweak inbound/outbound indicator image for tray icon
2016-08-04 17:32:56 +08:00
kimw 6f38bbb1d3 fixed 0 bytes will not show up, and, corrected function name 2016-01-05 04:49:17 +08:00
kimw 2cce646700 featured show bandwidth in log form's title 2016-01-04 23:21:53 +08:00
kimw 0b16ef7445 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
2016-01-04 09:14:55 +08:00
Gang Zhuo d0518e5a11 typo 2015-09-24 00:34:48 -04:00
kimw 969ee15ad6 convert "\r\n" -> Environment.NewLine 2015-09-23 00:32:28 +08:00
Gang Zhuo a070c3c986 small fix 2015-09-22 23:52:12 +08:00
kimw 0eee5cd98f add feature: save LogForm's config into json file. 2015-09-22 23:18:25 +08:00
kimw f1019b4aad fix variables' name: (first letter uppercase -> lowercase)
1. WrapTextTrigger -> wrapTextTrigger
2. WrapTextTriggerLock -> wrapTextTriggerLock
3. TopMostTrigger -> topMostTrigger
4. TopMostTriggerLock -> topMostTriggerLock
5. ShowToolbarTrigger -> toolbarTrigger
2015-09-22 23:15:20 +08:00
kimw b632d4a8a9 improved log viewer:
1. add menu items for `clear logs`, `change fonts`, `wrap text` and `top most` functions.
2. hide toolbar default. but you can trigger it out by menu.
2015-09-22 23:15:20 +08:00
Gang Zhuo 2ec1340261 fix "Only TrueType fonts are supported. This is not a TrueType font." 2015-09-22 02:01:23 -04:00
kimw 0a733c61b8 fixed: standardize Logging usage
1. Add Logging.Info()
2. Console.WriteLine() -> Logging.Info()
3. Console.WriteLine() in exceptions -> Logging.LogUsefulException()
2015-09-14 14:58:46 +08:00
kimw b4f0285307 fixed: typo 2015-09-14 12:58:44 +08:00
kimw bdd29e8384 fixed: Log Form will hidden when restart Windows 2015-08-27 04:38:52 +08:00
kimw 17c75de9c0 convert "\r\n" -> Environment.NewLine 2015-08-21 17:18:57 +08:00
kimw b1f17e02a1 1. limit the windows' minimized size
2. store window's size & position in config file.
3. fix: scroll bar sometimes disappear while sizing the window.
2015-08-21 16:47:56 +08:00
kimw 79e9a23d94 add feature: save LogForm's config into json file. 2015-08-20 21:03:38 +08:00
kimw 9953ae2e68 fix variables' name: (first letter uppercase -> lowercase)
1. WrapTextTrigger -> wrapTextTrigger
2. WrapTextTriggerLock -> wrapTextTriggerLock
3. TopMostTrigger -> topMostTrigger
4. TopMostTriggerLock -> topMostTriggerLock
5. ShowToolbarTrigger -> toolbarTrigger
2015-08-20 21:01:40 +08:00
kimw 6ed32ff709 improved log viewer:
1. add menu items for `clear logs`, `change fonts`, `wrap text` and `top most` functions.
2. hide toolbar default. but you can trigger it out by menu.
2015-08-20 17:17:21 +08:00
kimw 99fe540e53 Merge remote-tracking branch 'upstream/master' 2015-08-19 21:55:40 +08:00
clowwindy 765720dbd9 small fix 2015-08-19 21:51:28 -07:00
kimw cec6f79e7e improved log viewer:
1. add `clean log` feature
2. add `change font` feature
3. add `wrap text` feature
4. add `top most` feature
2015-08-19 21:52:16 +08:00
clowwindy e634b7eca1 remove unused var 2015-08-04 02:14:30 -07:00
clowwindy 7425e09ebc fix log not scrolled to bottom when first shown 2015-08-04 02:08:48 -07:00
clowwindy 6a5432c861 bump 2.5.2 2015-08-04 01:47:21 -07:00