зеркало из https://github.com/microsoft/2LCS.git
Merge pull request #43 from aariste/master
Added minimize to notification area option in parameters and context menu to notification icon
This commit is contained in:
Коммит
f4ce2b61c1
|
@ -11,16 +11,16 @@
|
|||
<userSettings>
|
||||
<LCS.Properties.Settings>
|
||||
<setting name="cookie" serializeAs="String">
|
||||
<value/>
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="links" serializeAs="String">
|
||||
<value/>
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="instances" serializeAs="String">
|
||||
<value/>
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="projects" serializeAs="String">
|
||||
<value/>
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="update" serializeAs="String">
|
||||
<value>True</value>
|
||||
|
@ -31,6 +31,9 @@
|
|||
<setting name="projOrgExcl" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="minimizeToNotificationArea" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</LCS.Properties.Settings>
|
||||
</userSettings>
|
||||
<runtime>
|
||||
|
|
|
@ -168,6 +168,8 @@
|
|||
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.cheEnvironmentChangesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.notifyIconContextMenu = new System.Windows.Forms.ContextMenu();
|
||||
this.notifyIconMenuClose = new System.Windows.Forms.MenuItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cheDataGridView)).BeginInit();
|
||||
this.cheInstanceContextMenu.SuspendLayout();
|
||||
this.mainMenuStrip.SuspendLayout();
|
||||
|
@ -1392,9 +1394,23 @@
|
|||
this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
|
||||
this.notifyIcon.Icon = global::LCS.Properties.Resources.favicon_white;
|
||||
this.notifyIcon.Text = "2LCS - Lightweight LCS";
|
||||
this.notifyIcon.ContextMenu = this.notifyIconContextMenu;
|
||||
this.notifyIcon.Visible = true;
|
||||
this.notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon_MouseClick);
|
||||
//
|
||||
// notifyIconContextMenu
|
||||
//
|
||||
this.notifyIconContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
||||
this.notifyIconMenuClose});
|
||||
this.notifyIconContextMenu.Name = "notifyIconContextMenu";
|
||||
//
|
||||
// notifyIconMenuCloseMenuItem
|
||||
//
|
||||
this.notifyIconMenuClose.Index = 0;
|
||||
this.notifyIconMenuClose.Name = "notifyIconMenuClose";
|
||||
this.notifyIconMenuClose.Text = "Close 2LCS";
|
||||
this.notifyIconMenuClose.Click += new System.EventHandler(this.notifyIconMenuClose_Click);
|
||||
//
|
||||
// cheEnvironmentChangesToolStripMenuItem
|
||||
//
|
||||
this.cheEnvironmentChangesToolStripMenuItem.Name = "cheEnvironmentChangesToolStripMenuItem";
|
||||
|
@ -1417,6 +1433,7 @@
|
|||
this.Name = "MainForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "2LCS - Lifecycle Services companion app";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_Closing);
|
||||
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.cheDataGridView)).EndInit();
|
||||
this.cheInstanceContextMenu.ResumeLayout(false);
|
||||
|
@ -1431,7 +1448,6 @@
|
|||
this.statusStrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1500,6 +1516,8 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem saasSystemDiagnosticsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem cheOpenRDPConnectionToolStripMenuItem;
|
||||
private System.Windows.Forms.NotifyIcon notifyIcon;
|
||||
private System.Windows.Forms.ContextMenu notifyIconContextMenu;
|
||||
private System.Windows.Forms.MenuItem notifyIconMenuClose;
|
||||
private System.Windows.Forms.ToolStripMenuItem cheShowRDPDetailsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saasShowRDPDetailsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem cheAvailableHotfixesToolStripMenuItem;
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace LCS.Forms
|
|||
private List<ProjectInstance> Instances;
|
||||
private List<CustomLink> Links;
|
||||
private List<LcsProject> Projects;
|
||||
private bool closeFromNotificationArea = false;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT
|
||||
|
@ -1275,6 +1276,12 @@ namespace LCS.Forms
|
|||
Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
private void notifyIconMenuClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
closeFromNotificationArea = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void LoginToLCSMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
WebBrowserHelper.FixBrowserVersion();
|
||||
|
@ -1386,6 +1393,19 @@ namespace LCS.Forms
|
|||
EnableDisableMenuItems();
|
||||
}
|
||||
|
||||
private void MainForm_Closing(object sender, EventArgs e)
|
||||
{
|
||||
if (Properties.Settings.Default.minimizeToNotificationArea && !closeFromNotificationArea)
|
||||
{
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
this.ShowInTaskbar = false;
|
||||
|
||||
FormClosingEventArgs ev = e as FormClosingEventArgs;
|
||||
|
||||
ev.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void EnableDisableMenuItems()
|
||||
{
|
||||
if (_selectedProject != null)
|
||||
|
@ -1397,22 +1417,35 @@ namespace LCS.Forms
|
|||
|
||||
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (WindowState == FormWindowState.Normal || WindowState == FormWindowState.Maximized)
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
if (IsOverlapped(this))
|
||||
if (WindowState == FormWindowState.Normal || WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
Activate();
|
||||
if (IsOverlapped(this))
|
||||
{
|
||||
Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
_previousState = WindowState;
|
||||
WindowState = FormWindowState.Minimized;
|
||||
|
||||
if (Properties.Settings.Default.minimizeToNotificationArea == true)
|
||||
{
|
||||
this.ShowInTaskbar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
_previousState = WindowState;
|
||||
WindowState = FormWindowState.Minimized;
|
||||
WindowState = _previousState;
|
||||
|
||||
if (Properties.Settings.Default.minimizeToNotificationArea == true)
|
||||
{
|
||||
this.ShowInTaskbar = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
WindowState = _previousState;
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenRDPConnectionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Parameters));
|
||||
this.AutoRefreshCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.closeButton = new System.Windows.Forms.Button();
|
||||
this.groupBoxExportConfig = new System.Windows.Forms.GroupBox();
|
||||
this.labelOrgNameExcl = new System.Windows.Forms.Label();
|
||||
this.textBoxProjectExcl = new System.Windows.Forms.TextBox();
|
||||
this.groupBoxUIConfig = new System.Windows.Forms.GroupBox();
|
||||
this.minimizeToNotificationArea = new System.Windows.Forms.CheckBox();
|
||||
this.groupBoxExportConfig.SuspendLayout();
|
||||
this.groupBoxUIConfig.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
|
@ -42,10 +42,9 @@
|
|||
// AutoRefreshCheckBox
|
||||
//
|
||||
this.AutoRefreshCheckBox.AutoSize = true;
|
||||
this.AutoRefreshCheckBox.Location = new System.Drawing.Point(7, 29);
|
||||
this.AutoRefreshCheckBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.AutoRefreshCheckBox.Location = new System.Drawing.Point(5, 19);
|
||||
this.AutoRefreshCheckBox.Name = "AutoRefreshCheckBox";
|
||||
this.AutoRefreshCheckBox.Size = new System.Drawing.Size(474, 29);
|
||||
this.AutoRefreshCheckBox.Size = new System.Drawing.Size(351, 21);
|
||||
this.AutoRefreshCheckBox.TabIndex = 0;
|
||||
this.AutoRefreshCheckBox.Text = "Auto-refresh list of instances after switching project";
|
||||
this.AutoRefreshCheckBox.UseVisualStyleBackColor = true;
|
||||
|
@ -53,10 +52,10 @@
|
|||
// closeButton
|
||||
//
|
||||
this.closeButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.closeButton.Location = new System.Drawing.Point(424, 224);
|
||||
this.closeButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.closeButton.Location = new System.Drawing.Point(308, 172);
|
||||
this.closeButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.closeButton.Name = "closeButton";
|
||||
this.closeButton.Size = new System.Drawing.Size(223, 39);
|
||||
this.closeButton.Size = new System.Drawing.Size(162, 26);
|
||||
this.closeButton.TabIndex = 4;
|
||||
this.closeButton.Text = "Close";
|
||||
this.closeButton.UseVisualStyleBackColor = true;
|
||||
|
@ -66,48 +65,64 @@
|
|||
//
|
||||
this.groupBoxExportConfig.Controls.Add(this.labelOrgNameExcl);
|
||||
this.groupBoxExportConfig.Controls.Add(this.textBoxProjectExcl);
|
||||
this.groupBoxExportConfig.Location = new System.Drawing.Point(16, 110);
|
||||
this.groupBoxExportConfig.Location = new System.Drawing.Point(12, 91);
|
||||
this.groupBoxExportConfig.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.groupBoxExportConfig.Name = "groupBoxExportConfig";
|
||||
this.groupBoxExportConfig.Size = new System.Drawing.Size(637, 108);
|
||||
this.groupBoxExportConfig.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.groupBoxExportConfig.Size = new System.Drawing.Size(463, 72);
|
||||
this.groupBoxExportConfig.TabIndex = 5;
|
||||
this.groupBoxExportConfig.TabStop = false;
|
||||
this.groupBoxExportConfig.Text = "Export instances/updates";
|
||||
//
|
||||
// labelOrgNameExcl
|
||||
//
|
||||
this.labelOrgNameExcl.Location = new System.Drawing.Point(6, 36);
|
||||
this.labelOrgNameExcl.Location = new System.Drawing.Point(4, 24);
|
||||
this.labelOrgNameExcl.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.labelOrgNameExcl.Name = "labelOrgNameExcl";
|
||||
this.labelOrgNameExcl.Size = new System.Drawing.Size(332, 52);
|
||||
this.labelOrgNameExcl.Size = new System.Drawing.Size(241, 35);
|
||||
this.labelOrgNameExcl.TabIndex = 1;
|
||||
this.labelOrgNameExcl.Text = "Exclude projects for all organizations containing the following string\r\n\r\n";
|
||||
//
|
||||
// textBoxProjectExcl
|
||||
//
|
||||
this.textBoxProjectExcl.Location = new System.Drawing.Point(344, 59);
|
||||
this.textBoxProjectExcl.Location = new System.Drawing.Point(250, 39);
|
||||
this.textBoxProjectExcl.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.textBoxProjectExcl.Name = "textBoxProjectExcl";
|
||||
this.textBoxProjectExcl.Size = new System.Drawing.Size(287, 29);
|
||||
this.textBoxProjectExcl.Size = new System.Drawing.Size(210, 22);
|
||||
this.textBoxProjectExcl.TabIndex = 0;
|
||||
//
|
||||
// groupBoxUIConfig
|
||||
//
|
||||
this.groupBoxUIConfig.Controls.Add(this.minimizeToNotificationArea);
|
||||
this.groupBoxUIConfig.Controls.Add(this.AutoRefreshCheckBox);
|
||||
this.groupBoxUIConfig.Location = new System.Drawing.Point(16, 12);
|
||||
this.groupBoxUIConfig.Location = new System.Drawing.Point(12, 8);
|
||||
this.groupBoxUIConfig.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.groupBoxUIConfig.Name = "groupBoxUIConfig";
|
||||
this.groupBoxUIConfig.Size = new System.Drawing.Size(637, 72);
|
||||
this.groupBoxUIConfig.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.groupBoxUIConfig.Size = new System.Drawing.Size(463, 79);
|
||||
this.groupBoxUIConfig.TabIndex = 6;
|
||||
this.groupBoxUIConfig.TabStop = false;
|
||||
this.groupBoxUIConfig.Text = "UI";
|
||||
//
|
||||
// minimizeToNotificationArea
|
||||
//
|
||||
this.minimizeToNotificationArea.AutoSize = true;
|
||||
this.minimizeToNotificationArea.Location = new System.Drawing.Point(5, 46);
|
||||
this.minimizeToNotificationArea.Name = "minimizeToNotificationArea";
|
||||
this.minimizeToNotificationArea.Size = new System.Drawing.Size(335, 21);
|
||||
this.minimizeToNotificationArea.TabIndex = 2;
|
||||
this.minimizeToNotificationArea.Text = "Closing the window minimizes to notification area";
|
||||
this.minimizeToNotificationArea.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// Parameters
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(669, 275);
|
||||
this.ClientSize = new System.Drawing.Size(487, 206);
|
||||
this.Controls.Add(this.groupBoxUIConfig);
|
||||
this.Controls.Add(this.groupBoxExportConfig);
|
||||
this.Controls.Add(this.closeButton);
|
||||
this.Icon = global::LCS.Properties.Resources.favicon_blue;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "Parameters";
|
||||
|
@ -132,5 +147,6 @@
|
|||
private System.Windows.Forms.Label labelOrgNameExcl;
|
||||
private System.Windows.Forms.TextBox textBoxProjectExcl;
|
||||
private System.Windows.Forms.GroupBox groupBoxUIConfig;
|
||||
private System.Windows.Forms.CheckBox minimizeToNotificationArea;
|
||||
}
|
||||
}
|
|
@ -27,12 +27,14 @@ namespace LCS.Forms
|
|||
private void Parameters_Load(object sender, EventArgs e)
|
||||
{
|
||||
AutoRefreshCheckBox.Checked = Properties.Settings.Default.autorefresh;
|
||||
minimizeToNotificationArea.Checked = Properties.Settings.Default.minimizeToNotificationArea;
|
||||
textBoxProjectExcl.Text = Properties.Settings.Default.projOrgExcl;
|
||||
}
|
||||
|
||||
private void setParameters()
|
||||
{
|
||||
Properties.Settings.Default.autorefresh = AutoRefreshCheckBox.Checked;
|
||||
Properties.Settings.Default.minimizeToNotificationArea = minimizeToNotificationArea.Checked;
|
||||
Properties.Settings.Default.projOrgExcl = textBoxProjectExcl.Text;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -106,5 +106,17 @@ namespace LCS.Properties {
|
|||
this["projOrgExcl"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool minimizeToNotificationArea {
|
||||
get {
|
||||
return ((bool)(this["minimizeToNotificationArea"]));
|
||||
}
|
||||
set {
|
||||
this["minimizeToNotificationArea"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,5 +23,8 @@
|
|||
<Setting Name="projOrgExcl" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="minimizeToNotificationArea" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
Загрузка…
Ссылка в новой задаче