Skip to content
Snippets Groups Projects
Commit 94e38530 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add action for tray icon double click, rename method.

Refers to #2
parent d34c8445
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ namespace ATXTray ...@@ -41,6 +41,7 @@ namespace ATXTray
public AutoTxTray() { public AutoTxTray() {
_notifyIcon.Visible = true; _notifyIcon.Visible = true;
_notifyIcon.Icon = new Icon("AutoTx.ico"); _notifyIcon.Icon = new Icon("AutoTx.ico");
_notifyIcon.DoubleClick += StartNewTransfer;
// this doesn't work properly, the menu will not close etc. so we disable it for now: // this doesn't work properly, the menu will not close etc. so we disable it for now:
// _notifyIcon.Click += ShowContextMenu; // _notifyIcon.Click += ShowContextMenu;
...@@ -76,7 +77,7 @@ namespace ATXTray ...@@ -76,7 +77,7 @@ namespace ATXTray
_miTxProgress.Click += ShowContextMenu; _miTxProgress.Click += ShowContextMenu;
_miTxEnqueue.Text = @"+++ Add new directory for transfer. +++"; _miTxEnqueue.Text = @"+++ Add new directory for transfer. +++";
_miTxEnqueue.Click += _miTxEnqueue_Click; _miTxEnqueue.Click += StartNewTransfer;
_cmStrip.Items.AddRange(new ToolStripItem[] { _cmStrip.Items.AddRange(new ToolStripItem[] {
_miTitle, _miTitle,
...@@ -142,7 +143,7 @@ namespace ATXTray ...@@ -142,7 +143,7 @@ namespace ATXTray
_notifyIcon.ContextMenuStrip.Show(); _notifyIcon.ContextMenuStrip.Show();
} }
private void _miTxEnqueue_Click(object sender, EventArgs e) { private static void StartNewTransfer(object sender, EventArgs e) {
var dirDialog = new CommonOpenFileDialog { var dirDialog = new CommonOpenFileDialog {
Title = @"Select directory to be transferred", Title = @"Select directory to be transferred",
IsFolderPicker = true, IsFolderPicker = true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment