/// <summary> /// User clicks on "update". /// </summary> /// <param name="sender">ignored</param> /// <param name="e">ignored</param> private void btnUpdateCheck_Click(object sender, EventArgs e) { // check if an error is possible Update u = new Update(false, this); if (u.hadErrors) { return; } // update available? if (u.checkUpdate()) { // open url, if the user wants if (RTLMessageBox.Show(this, Program.res.GetString("BOX_UpdateInformation") .Replace("%s", u.getVersion()), MessageBoxButtons.YesNoCancel, MessageBoxDefaultButton.Button1, MessageBoxIcon.Information) == DialogResult.Yes) { openUrl(u.getUpdateUrl()); } } // no update found else { RTLMessageBox.Show(this, Program.res.GetString("BOX_UpdateNone"), MessageBoxIcon.Information); } }
/// <summary> /// Generate the form, load configs, show initial settings if needed. /// </summary> /// <param name="configs">Strings passed on the commandline</param> public FrmGlobalStatus(string[] commands) { InitializeComponent(); this.niIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.niIcon_MouseClick); Helper.UpdateSettings(); // if this is the first start: show settings if (Properties.Settings.Default.firstStart) { Properties.Settings.Default.firstStart = false; Properties.Settings.Default.Save(); ShowSettings(true); } InitializeTrayIcon(ref trayDisconnectedIcon, "Disconnected.ico", Properties.Resources.TRAY_Disconnected); InitializeTrayIcon(ref trayConnectingIcon, "Connecting.ico", Properties.Resources.TRAY_Connecting); InitializeTrayIcon(ref trayConnectedIcon, "Connected.ico", Properties.Resources.TRAY_Connected); InitializeTrayIcon(ref trayMultipleIcon, "Multiple.ico", Properties.Resources.TRAY_Multiple); ReadConfigs(); SetTrayIconAndPopupText(); bool checkupdate = false; TimeSpan ts = Properties.Settings.Default.lastUpdateCheck - DateTime.Now; if (Properties.Settings.Default.searchUpdate == 0 || (ts.Days > 7 && Properties.Settings.Default.searchUpdate == 1) || (ts.Days > 30 && Properties.Settings.Default.searchUpdate == 2)) { checkupdate = true; Properties.Settings.Default.lastUpdateCheck = DateTime.Now; Properties.Settings.Default.Save(); } if (checkupdate) { Update u = new Update(true, this); if (u.checkUpdate()) { niIcon.ShowBalloonTip(5000, Program.res.GetString("QUICKINFO_Update"), Program.res.GetString("QUICKINFO_Update_More"), ToolTipIcon.Info); } } m_simpleComm.ReceivedLines += new EventHandler <SimpleComm.ReceivedLinesEventArgs>( m_simpleComm_ReceivedLines); parseCommandLine(commands); if (Properties.Settings.Default.allowRemoteControl) { m_simpleComm.startServer(); } }
/// <summary> /// Generate the form, load configs, show initial settings if needed. /// </summary> /// <param name="configs">Strings passed on the commandline</param> public FrmGlobalStatus(string[] commands) { InitializeComponent(); helper.UpdateSettings(); // if this is the first start: show settings if (Properties.Settings.Default.firstStart) { Properties.Settings.Default.firstStart = false; Properties.Settings.Default.Save(); ShowSettings(true); } ReadConfigs(); niIcon.Icon = Properties.Resources.TRAY_Disconnected; bool checkupdate = false; TimeSpan ts = Properties.Settings.Default.lastUpdateCheck - DateTime.Now; if (Properties.Settings.Default.searchUpdate == 0 || (ts.Days > 7 && Properties.Settings.Default.searchUpdate == 1) || (ts.Days > 30 && Properties.Settings.Default.searchUpdate == 2)) { checkupdate = true; Properties.Settings.Default.lastUpdateCheck = DateTime.Now; Properties.Settings.Default.Save(); } if (checkupdate) { Update u = new Update(true, this); if (u.checkUpdate()) { niIcon.ShowBalloonTip(5000, Program.res.GetString("QUICKINFO_Update"), Program.res.GetString("QUICKINFO_Update_More"), ToolTipIcon.Info); } } m_simpleComm.ReceivedLines += new EventHandler<SimpleComm.ReceivedLinesEventArgs>( m_simpleComm_ReceivedLines); parseCommandLine(commands); if(Properties.Settings.Default.allowRemoteControl) m_simpleComm.startServer(); }
/// <summary> /// User clicks on "update". /// </summary> /// <param name="sender">ignored</param> /// <param name="e">ignored</param> private void btnUpdateCheck_Click(object sender, EventArgs e) { // check if an error is possible Update u = new Update(false, this); if (u.hadErrors) return; // update available? if (u.checkUpdate()) { // open url, if the user wants if (RTLMessageBox.Show(this, Program.res.GetString("BOX_UpdateInformation") .Replace("%s", u.getVersion()), MessageBoxButtons.YesNoCancel, MessageBoxDefaultButton.Button1, MessageBoxIcon.Information) == DialogResult.Yes) openUrl(u.getUpdateUrl()); } // no update found else RTLMessageBox.Show(this, Program.res.GetString("BOX_UpdateNone"), MessageBoxIcon.Information); }