Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
2a450fc7
Commit
2a450fc7
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Add transfer progress information to menu and tooltips.
Refers to
#2
parent
e8d188c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATXTray/AutoTxTray.cs
+32
-2
32 additions, 2 deletions
ATXTray/AutoTxTray.cs
with
32 additions
and
2 deletions
ATXTray/AutoTxTray.cs
+
32
−
2
View file @
2a450fc7
...
...
@@ -24,6 +24,9 @@ namespace ATXTray
private
static
bool
_svcRunning
=
false
;
private
static
bool
_svcSuspended
=
true
;
private
static
string
_svcSuspendReason
;
private
static
bool
_txInProgress
=
false
;
private
static
long
_txSize
;
private
readonly
NotifyIcon
_notifyIcon
=
new
NotifyIcon
();
private
readonly
ContextMenuStrip
_cmStrip
=
new
ContextMenuStrip
();
...
...
@@ -31,6 +34,7 @@ namespace ATXTray
private
readonly
ToolStripMenuItem
_miTitle
=
new
ToolStripMenuItem
();
private
readonly
ToolStripMenuItem
_miSvcRunning
=
new
ToolStripMenuItem
();
private
readonly
ToolStripMenuItem
_miSvcSuspended
=
new
ToolStripMenuItem
();
private
readonly
ToolStripMenuItem
_miTxProgress
=
new
ToolStripMenuItem
();
public
AutoTxTray
()
{
_notifyIcon
.
Visible
=
true
;
...
...
@@ -66,10 +70,14 @@ namespace ATXTray
_miSvcSuspended
.
Text
=
@"No limits apply, service active."
;
_miSvcSuspended
.
Click
+=
ShowContextMenu
;
_miTxProgress
.
Text
=
"No transfer running."
;
_miTxProgress
.
Click
+=
ShowContextMenu
;
_cmStrip
.
Items
.
AddRange
(
new
ToolStripItem
[]
{
_miTitle
,
_miSvcRunning
,
_miSvcSuspended
,
_miTxProgress
,
_miExit
});
...
...
@@ -101,10 +109,11 @@ namespace ATXTray
serviceRunning
=
"OK"
;
ReadStatus
();
UpdateSvcSuspended
();
UpdateTxInProgress
();
if
((
DateTime
.
Now
-
_status
.
LastStatusUpdate
).
TotalSeconds
<
60
)
heartBeat
=
"OK"
;
if
(
_
status
.
Transfer
InProgress
)
tx
In
Progress
=
"Yes"
;
if
(
_
tx
InProgress
)
txProgress
=
_txSize
.
ToString
()
;
}
if
(!
_statusChanged
)
...
...
@@ -196,5 +205,26 @@ namespace ATXTray
*/
}
}
private
void
UpdateTxInProgress
()
{
if
(
_txInProgress
==
_status
.
TransferInProgress
&&
_txSize
==
_status
.
CurrentTransferSize
)
return
;
_statusChanged
=
true
;
_txInProgress
=
_status
.
TransferInProgress
;
_txSize
=
_status
.
CurrentTransferSize
;
if
(
_txInProgress
)
{
_miTxProgress
.
Text
=
@"Transfer in progress (size: "
+
_txSize
+
")"
;
_miTxProgress
.
BackColor
=
Color
.
LightGreen
;
_notifyIcon
.
ShowBalloonTip
(
500
,
AppTitle
,
"New transfer started (size: "
+
_txSize
+
")."
,
ToolTipIcon
.
Info
);
}
else
{
_miTxProgress
.
Text
=
@"No transfer running."
;
_miTxProgress
.
ResetBackColor
();
_notifyIcon
.
ShowBalloonTip
(
500
,
AppTitle
,
"Transfer completed."
,
ToolTipIcon
.
Info
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment