merge with new options

This commit is contained in:
Dimitrij
2021-09-14 12:03:01 +01:00
parent 17e70d11f5
commit d2349bd713
25 changed files with 731 additions and 102 deletions

View File

@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
### Added
- #1476: Configurable backups. Can now edit/set backup frequency, backup path, and max number of backup files.
- #1427: Fix RDP local desktop scale not taking effect on remote
- #1770: Added missing RDP performance settings
- #1332: Added option to hide menu strip container

View File

@@ -102,6 +102,10 @@ namespace mRemoteNG.App
if (Settings.Default.UseSQLServer)
{
ConnectionsService.LastSqlUpdate = DateTime.Now;
}
else
{
ConnectionsService.LastFileUpdate = System.IO.File.GetLastWriteTime(connectionFileName);
}
// re-enable sql update checking after updates are loaded

View File

@@ -2,6 +2,7 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;
using mRemoteNG.Config.Connections;
using mRemoteNG.Config.Putty;
using mRemoteNG.Properties;
using mRemoteNG.Resources.Language;
@@ -60,8 +61,34 @@ namespace mRemoteNG.App
private static void SaveConnections()
{
if (Settings.Default.SaveConsOnExit)
DateTime lastUpdate;
DateTime updateDate;
DateTime currentDate = DateTime.Now;
//OBSOLETE: Settings.Default.SaveConsOnExit is obsolete and should be removed in a future release
if (Settings.Default.SaveConsOnExit || (Settings.Default.SaveConnectionsFrequency == (int)ConnectionsBackupFrequencyEnum.OnExit))
{
Runtime.ConnectionsService.SaveConnections();
return;
}
lastUpdate = Runtime.ConnectionsService.UsingDatabase ? Runtime.ConnectionsService.LastSqlUpdate : Runtime.ConnectionsService.LastFileUpdate;
switch (Settings.Default.SaveConnectionsFrequency)
{
case (int)ConnectionsBackupFrequencyEnum.Daily:
updateDate = lastUpdate.AddDays(1);
break;
case (int)ConnectionsBackupFrequencyEnum.Weekly:
updateDate = lastUpdate.AddDays(7);
break;
default:
return;
}
if (currentDate >= updateDate)
{
Runtime.ConnectionsService.SaveConnections();
}
}
private static void SaveSettings(Control quickConnectToolStrip,

View File

@@ -0,0 +1,13 @@
namespace mRemoteNG.Config.Connections
{
public enum ConnectionsBackupFrequencyEnum
{
Unassigned = 0,
Never = 1,
OnEdit = 2,
OnExit = 3,
Daily = 4,
Weekly = 5,
Custom = 6
}
}

View File

@@ -3,6 +3,7 @@ using System.Collections.Specialized;
using System.ComponentModel;
using mRemoteNG.Connection;
using mRemoteNG.UI.Forms;
using mRemoteNG.Properties;
namespace mRemoteNG.Config.Connections
{
@@ -48,12 +49,14 @@ namespace mRemoteNG.Config.Connections
private void SaveConnectionOnEdit(string propertyName = "")
{
if (!Properties.Settings.Default.SaveConnectionsAfterEveryEdit)
return;
if (FrmMain.Default.IsClosing)
return;
//OBSOLETE: mRemoteNG.Settings.Default.SaveConnectionsAfterEveryEdit is obsolete and should be removed in a future release
if (mRemoteNG.Properties.Settings.Default.SaveConnectionsAfterEveryEdit || (mRemoteNG.Properties.Settings.Default.SaveConnectionsFrequency == (int)ConnectionsBackupFrequencyEnum.OnEdit))
{
if (FrmMain.Default.IsClosing)
return;
_connectionsService.SaveConnectionsAsync(propertyName);
_connectionsService.SaveConnectionsAsync(propertyName);
}
}
}
}

View File

@@ -37,6 +37,7 @@ namespace mRemoteNG.Connection
public string ConnectionFileName { get; private set; }
public RemoteConnectionsSyncronizer RemoteConnectionsSyncronizer { get; set; }
public DateTime LastSqlUpdate { get; set; }
public DateTime LastFileUpdate { get; set; }
public ConnectionTreeModel ConnectionTreeModel { get; private set; }

View File

@@ -8,7 +8,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace mRemoteNG.Properties {
namespace mRemoteNG {
using System;
using System;

View File

@@ -331,4 +331,7 @@
<data name="StartupProject_16x" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\StartupProject_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="test" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\test.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -2915,6 +2915,18 @@ namespace mRemoteNG.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int SaveConnectionsFrequency {
get {
return ((int)(this["SaveConnectionsFrequency"]));
}
set {
this["SaveConnectionsFrequency"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Highest")]

View File

@@ -725,6 +725,9 @@
<Setting Name="InhDefaultUseVmId" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SaveConnectionsFrequency" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="ConDefaultRdpVersion" Type="System.String" Scope="User">
<Value Profile="(Default)">Highest</Value>
</Setting>

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

View File

@@ -8,7 +8,11 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace mRemoteNG.Resources.Language {
namespace mRemoteNG.Resources.Language
{
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -85,7 +89,7 @@ namespace mRemoteNG.Resources.Language {
}
/// <summary>
/// Looks up a localized string similar to &amp;Warn me when closing connections.
/// Looks up a localized string similar to Warn me when closing connections.
/// </summary>
internal static string _CloseWarnAll {
get {
@@ -1287,6 +1291,51 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Daily.
/// </summary>
internal static string ConnectionsBackupFrequencyDaily {
get {
return ResourceManager.GetString("ConnectionsBackupFrequencyDaily", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Never backup connections.
/// </summary>
internal static string ConnectionsBackupFrequencyNever {
get {
return ResourceManager.GetString("ConnectionsBackupFrequencyNever", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to On Edit.
/// </summary>
internal static string ConnectionsBackupFrequencyOnEdit {
get {
return ResourceManager.GetString("ConnectionsBackupFrequencyOnEdit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to On Exit.
/// </summary>
internal static string ConnectionsBackupFrequencyOnExit {
get {
return ResourceManager.GetString("ConnectionsBackupFrequencyOnExit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Weekly.
/// </summary>
internal static string ConnectionsBackupFrequencyWeekly {
get {
return ResourceManager.GetString("ConnectionsBackupFrequencyWeekly", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Couldn&apos;t set default port!.
/// </summary>
@@ -4219,7 +4268,7 @@ namespace mRemoteNG.Resources.Language {
}
/// <summary>
/// Looks up a localized string similar to Start Program.
/// Looks up a localized string similar to Start Program/alternate shell.
/// </summary>
internal static string PropertyDescriptionStartProgram {
get {
@@ -5364,15 +5413,6 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Save connections on exit.
/// </summary>
internal static string SaveConsOnExit {
get {
return ResourceManager.GetString("SaveConsOnExit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Graphics Interchange Format File (.gif)|*.gif|Joint Photographic Experts Group File (.jpeg)|*.jpeg|Joint Photographic Experts Group File (.jpg)|*.jpg|Portable Network Graphics File (.png)|*.png.
/// </summary>
@@ -5625,15 +5665,6 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Start Program.
/// </summary>
internal static string StartProgram {
get {
return ResourceManager.GetString("StartProgram", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Socks 5.
/// </summary>
@@ -5849,18 +5880,16 @@ namespace mRemoteNG.Resources.Language {
return ResourceManager.GetString("StartMinimized", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Start minimized.
/// Looks up a localized string similar to Start Program.
/// </summary>
internal static string StartFullScreen
{
get
{
return ResourceManager.GetString("StartFullScreen", resourceCulture);
internal static string StartProgram {
get {
return ResourceManager.GetString("StartProgram", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Startup/Exit.
/// </summary>
@@ -5879,6 +5908,51 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Backup.
/// </summary>
internal static string strBackup {
get {
return ResourceManager.GetString("strBackup", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Browse....
/// </summary>
internal static string strBrowse {
get {
return ResourceManager.GetString("strBrowse", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Connection Backup Frequency.
/// </summary>
internal static string strConnectionBackupFrequency {
get {
return ResourceManager.GetString("strConnectionBackupFrequency", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Maximum number of backups.
/// </summary>
internal static string strConnectionsBackupMaxCount {
get {
return ResourceManager.GetString("strConnectionsBackupMaxCount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Location of connection file backup.
/// </summary>
internal static string strConnectionsBackupPath {
get {
return ResourceManager.GetString("strConnectionsBackupPath", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Support Forum.
/// </summary>

View File

@@ -1313,7 +1313,7 @@ If you run into such an error, please create a new connection file!</value>
<value>Creating quick connect failed</value>
</data>
<data name="_CloseWarnAll" xml:space="preserve">
<value>&amp;Warn me when closing connections</value>
<value>Warn me when closing connections</value>
</data>
<data name="RadioCloseWarnExit" xml:space="preserve">
<value>Warn me only when e&amp;xiting mRemoteNG</value>
@@ -1483,8 +1483,35 @@ If you run into such an error, please create a new connection file!</value>
<data name="SaveConnectionsFileBeforeOpeningAnother" xml:space="preserve">
<value>Do you want to save the current connections file before loading another?</value>
</data>
<data name="SaveConsOnExit" xml:space="preserve">
<value>Save connections on exit</value>
<data name="ConnectionsBackupFrequencyDaily" xml:space="preserve">
<value>Daily</value>
</data>
<data name="strConnectionBackupFrequency" xml:space="preserve">
<value>Connection Backup Frequency</value>
</data>
<data name="ConnectionsBackupFrequencyWeekly" xml:space="preserve">
<value>Weekly</value>
</data>
<data name="strConnectionsBackupMaxCount" xml:space="preserve">
<value>Maximum number of backups</value>
</data>
<data name="strConnectionsBackupPath" xml:space="preserve">
<value>Location of connection file backup</value>
</data>
<data name="ConnectionsBackupFrequencyOnEdit" xml:space="preserve">
<value>On Edit</value>
</data>
<data name="ConnectionsBackupFrequencyOnExit" xml:space="preserve">
<value>On Exit</value>
</data>
<data name="ConnectionsBackupFrequencyNever" xml:space="preserve">
<value>Never backup connections</value>
</data>
<data name="strBrowse" xml:space="preserve">
<value>Browse...</value>
</data>
<data name="strBackup" xml:space="preserve">
<value>Backup</value>
</data>
<data name="SaveImageFilter" xml:space="preserve">
<value>Graphics Interchange Format File (.gif)|*.gif|Joint Photographic Experts Group File (.jpeg)|*.jpeg|Joint Photographic Experts Group File (.jpg)|*.jpg|Portable Network Graphics File (.png)|*.png</value>

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -0,0 +1,164 @@
namespace mRemoteNG.UI.Forms.OptionsPages
{
public sealed partial class BackupPage : OptionsPage
{
//UserControl overrides dispose to clean up the component list.
[System.Diagnostics.DebuggerNonUserCode()]protected override void Dispose(bool disposing)
{
try
{
if (disposing && components != null)
{
components.Dispose();
}
}
finally
{
base.Dispose(disposing);
}
}
//Required by the Windows Form Designer
private System.ComponentModel.Container components = null;
//NOTE: The following procedure is required by the Windows Form Designer
//It can be modified using the Windows Form Designer.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent()
{
this.tableLayoutPanelBackupFile = new System.Windows.Forms.TableLayoutPanel();
this.textBoxConnectionBackupPath = new System.Windows.Forms.TextBox();
this.lblConnectionsBackupPath = new System.Windows.Forms.Label();
this.lblConnectionsBackupFrequency = new System.Windows.Forms.Label();
this.lblConnectionsBackupMaxCount = new System.Windows.Forms.Label();
this.cmbConnectionBackupFrequency = new System.Windows.Forms.ComboBox();
this.buttonBrowsePath = new System.Windows.Forms.Button();
this.numMaxBackups = new System.Windows.Forms.NumericUpDown();
this.tableLayoutPanelBackupFile.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numMaxBackups)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanelBackupFile
//
this.tableLayoutPanelBackupFile.ColumnCount = 4;
this.tableLayoutPanelBackupFile.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBackupFile.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBackupFile.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBackupFile.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBackupFile.Controls.Add(this.textBoxConnectionBackupPath, 1, 2);
this.tableLayoutPanelBackupFile.Controls.Add(this.lblConnectionsBackupPath, 0, 2);
this.tableLayoutPanelBackupFile.Controls.Add(this.lblConnectionsBackupFrequency, 0, 0);
this.tableLayoutPanelBackupFile.Controls.Add(this.lblConnectionsBackupMaxCount, 0, 1);
this.tableLayoutPanelBackupFile.Controls.Add(this.cmbConnectionBackupFrequency, 1, 0);
this.tableLayoutPanelBackupFile.Controls.Add(this.buttonBrowsePath, 2, 2);
this.tableLayoutPanelBackupFile.Controls.Add(this.numMaxBackups, 1, 1);
this.tableLayoutPanelBackupFile.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanelBackupFile.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanelBackupFile.Name = "tableLayoutPanelBackupFile";
this.tableLayoutPanelBackupFile.RowCount = 4;
this.tableLayoutPanelBackupFile.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelBackupFile.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelBackupFile.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelBackupFile.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelBackupFile.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanelBackupFile.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanelBackupFile.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanelBackupFile.Size = new System.Drawing.Size(630, 412);
this.tableLayoutPanelBackupFile.TabIndex = 15;
//
// textBoxConnectionBackupPath
//
this.textBoxConnectionBackupPath.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxConnectionBackupPath.Location = new System.Drawing.Point(195, 58);
this.textBoxConnectionBackupPath.Name = "textBoxConnectionBackupPath";
this.textBoxConnectionBackupPath.Size = new System.Drawing.Size(250, 22);
this.textBoxConnectionBackupPath.TabIndex = 14;
//
// lblConnectionsBackupPath
//
this.lblConnectionsBackupPath.AutoSize = true;
this.lblConnectionsBackupPath.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblConnectionsBackupPath.Location = new System.Drawing.Point(3, 55);
this.lblConnectionsBackupPath.Name = "lblConnectionsBackupPath";
this.lblConnectionsBackupPath.Size = new System.Drawing.Size(186, 29);
this.lblConnectionsBackupPath.TabIndex = 13;
this.lblConnectionsBackupPath.Text = "Location of connection file backup";
this.lblConnectionsBackupPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblConnectionsBackupFrequency
//
this.lblConnectionsBackupFrequency.AutoSize = true;
this.lblConnectionsBackupFrequency.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblConnectionsBackupFrequency.Location = new System.Drawing.Point(3, 0);
this.lblConnectionsBackupFrequency.Name = "lblConnectionsBackupFrequency";
this.lblConnectionsBackupFrequency.Size = new System.Drawing.Size(186, 27);
this.lblConnectionsBackupFrequency.TabIndex = 14;
this.lblConnectionsBackupFrequency.Text = "Connection Backup Frequency";
this.lblConnectionsBackupFrequency.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblConnectionsBackupMaxCount
//
this.lblConnectionsBackupMaxCount.AutoSize = true;
this.lblConnectionsBackupMaxCount.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblConnectionsBackupMaxCount.Location = new System.Drawing.Point(3, 27);
this.lblConnectionsBackupMaxCount.Name = "lblConnectionsBackupMaxCount";
this.lblConnectionsBackupMaxCount.Size = new System.Drawing.Size(186, 28);
this.lblConnectionsBackupMaxCount.TabIndex = 13;
this.lblConnectionsBackupMaxCount.Text = "Maximum number of backups";
this.lblConnectionsBackupMaxCount.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// cmbConnectionBackupFrequency
//
this.cmbConnectionBackupFrequency.Dock = System.Windows.Forms.DockStyle.Fill;
this.cmbConnectionBackupFrequency.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbConnectionBackupFrequency.FormattingEnabled = true;
this.cmbConnectionBackupFrequency.Location = new System.Drawing.Point(195, 3);
this.cmbConnectionBackupFrequency.Name = "cmbConnectionBackupFrequency";
this.cmbConnectionBackupFrequency.Size = new System.Drawing.Size(250, 21);
this.cmbConnectionBackupFrequency.TabIndex = 13;
//
// buttonBrowsePath
//
this.buttonBrowsePath.Location = new System.Drawing.Point(451, 58);
this.buttonBrowsePath.Name = "buttonBrowsePath";
this.buttonBrowsePath.Size = new System.Drawing.Size(75, 23);
this.buttonBrowsePath.TabIndex = 15;
this.buttonBrowsePath.Text = "Browse";
this.buttonBrowsePath.UseVisualStyleBackColor = true;
this.buttonBrowsePath.Click += new System.EventHandler(this.ButtonBrowsePath_Click);
//
// numMaxBackups
//
this.numMaxBackups.Location = new System.Drawing.Point(195, 30);
this.numMaxBackups.Name = "numMaxBackups";
this.numMaxBackups.Size = new System.Drawing.Size(60, 22);
this.numMaxBackups.TabIndex = 16;
//
// BackupPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.tableLayoutPanelBackupFile);
this.Name = "BackupPage";
this.Size = new System.Drawing.Size(630, 412);
this.tableLayoutPanelBackupFile.ResumeLayout(false);
this.tableLayoutPanelBackupFile.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numMaxBackups)).EndInit();
this.ResumeLayout(false);
}
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelBackupFile;
private System.Windows.Forms.TextBox textBoxConnectionBackupPath;
private System.Windows.Forms.Label lblConnectionsBackupPath;
private System.Windows.Forms.Label lblConnectionsBackupFrequency;
private System.Windows.Forms.Label lblConnectionsBackupMaxCount;
private System.Windows.Forms.ComboBox cmbConnectionBackupFrequency;
private System.Windows.Forms.Button buttonBrowsePath;
private System.Windows.Forms.NumericUpDown numMaxBackups;
}
}

View File

@@ -0,0 +1,149 @@
using mRemoteNG.Config;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using mRemoteNG.App;
using mRemoteNG.Config.Connections;
using mRemoteNG.Security;
using mRemoteNG.Properties;
using mRemoteNG.Resources.Language;
namespace mRemoteNG.UI.Forms.OptionsPages
{
public sealed partial class BackupPage
{
private readonly FrmMain _frmMain = FrmMain.Default;
private List<DropdownList> _connectionBackup;
public BackupPage()
{
InitializeComponent();
ApplyTheme();
PageIcon = Properties.Resources.Backup_Icon;
}
public override string PageName
{
get => Language.strBackup;
set { }
}
public override void ApplyLanguage()
{
base.ApplyLanguage();
buttonBrowsePath.Text = Language.strBrowse;
_connectionBackup = new List<DropdownList>
{
{
new DropdownList((int) ConnectionsBackupFrequencyEnum.Never,
Language.ConnectionsBackupFrequencyNever)
},
{
new DropdownList((int) ConnectionsBackupFrequencyEnum.OnEdit,
Language.ConnectionsBackupFrequencyOnEdit)
},
{
new DropdownList((int) ConnectionsBackupFrequencyEnum.OnExit,
Language.ConnectionsBackupFrequencyOnExit)
},
{
new DropdownList((int) ConnectionsBackupFrequencyEnum.Daily,
Language.ConnectionsBackupFrequencyDaily)
},
{
new DropdownList((int) ConnectionsBackupFrequencyEnum.Weekly,
Language.ConnectionsBackupFrequencyWeekly)
},
//{ new DropdownList( (int)ConnectionsBackupFrequencyEnum.Custom, Language.ConnectionsBackupFrequencyCustom)}
};
cmbConnectionBackupFrequency.DataSource = _connectionBackup;
cmbConnectionBackupFrequency.DisplayMember = "DisplayString";
cmbConnectionBackupFrequency.ValueMember = "Index";
lblConnectionsBackupFrequency.Text = Language.strConnectionBackupFrequency;
lblConnectionsBackupMaxCount.Text = Language.strConnectionsBackupMaxCount;
lblConnectionsBackupPath.Text = Language.strConnectionsBackupPath;
}
public override void LoadSettings()
{
numMaxBackups.Value = Convert.ToDecimal(Settings.Default.BackupFileKeepCount);
if (Settings.Default.SaveConnectionsFrequency == (int) ConnectionsBackupFrequencyEnum.Unassigned)
{
if (Settings.Default.SaveConnectionsAfterEveryEdit)
{
Settings.Default.SaveConnectionsFrequency = (int) ConnectionsBackupFrequencyEnum.OnEdit;
}
else if (Settings.Default.SaveConsOnExit)
{
Settings.Default.SaveConnectionsFrequency = (int) ConnectionsBackupFrequencyEnum.OnExit;
}
else
{
Settings.Default.SaveConnectionsFrequency = (int) ConnectionsBackupFrequencyEnum.Never;
}
}
cmbConnectionBackupFrequency.SelectedValue = Settings.Default.SaveConnectionsFrequency;
textBoxConnectionBackupPath.Text = Settings.Default.CustomConsPath;
}
public override void SaveSettings()
{
Settings.Default.BackupFileKeepCount = (int) numMaxBackups.Value;
if (Settings.Default.AutoSaveEveryMinutes > 0)
{
_frmMain.tmrAutoSave.Interval = Settings.Default.AutoSaveEveryMinutes * 60000;
_frmMain.tmrAutoSave.Enabled = true;
}
else
{
_frmMain.tmrAutoSave.Enabled = false;
}
Settings.Default.SaveConnectionsFrequency = (int) cmbConnectionBackupFrequency.SelectedValue;
if (textBoxConnectionBackupPath.Text.Trim().Length <= 0)
{
Settings.Default.LoadConsFromCustomLocation = false;
Settings.Default.CustomConsPath = String.Empty;
}
else
{
var newFileName = textBoxConnectionBackupPath.Text;
Runtime.ConnectionsService.SaveConnections(Runtime.ConnectionsService.ConnectionTreeModel, false,
new SaveFilter(), newFileName);
if (newFileName == Runtime.ConnectionsService.GetDefaultStartupConnectionFileName())
{
Settings.Default.LoadConsFromCustomLocation = false;
}
else
{
Settings.Default.LoadConsFromCustomLocation = true;
Settings.Default.CustomConsPath = newFileName;
}
}
//Obsolete. Set to false
Settings.Default.SaveConnectionsAfterEveryEdit = false;
Settings.Default.SaveConsOnExit = false;
}
private void ButtonBrowsePath_Click(object sender, EventArgs e)
{
var saveDialog = DialogFactory.ConnectionsSaveAsDialog();
var dialogResult = saveDialog.ShowDialog(this);
textBoxConnectionBackupPath.Text = dialogResult == DialogResult.OK ? saveDialog.FileName : string.Empty;
}
}
}

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,5 +1,7 @@
using mRemoteNG.Config;
using System;
using System.Collections.Generic;
using mRemoteNG.Config.Connections;
using mRemoteNG.Properties;
using mRemoteNG.Resources.Language;
@@ -8,6 +10,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
public sealed partial class ConnectionsPage
{
private readonly FrmMain _frmMain = FrmMain.Default;
private List<DropdownList> _connectionWarning;
public ConnectionsPage()
{
@@ -25,12 +28,23 @@ namespace mRemoteNG.UI.Forms.OptionsPages
public override void ApplyLanguage()
{
base.ApplyLanguage();
_connectionWarning = new List<DropdownList>
{
{ new DropdownList((int)ConfirmCloseEnum.Never, Language.RadioCloseWarnMultiple)},
{ new DropdownList((int)ConfirmCloseEnum.Exit, Language.RadioCloseWarnExit)},
{ new DropdownList((int)ConfirmCloseEnum.Multiple, Language.RadioCloseWarnMultiple)},
{ new DropdownList((int)ConfirmCloseEnum.All, Language._CloseWarnAll)}
};
//comboBoxConnectionWarning.DataSource = _connectionWarning;
//comboBoxConnectionWarning.DisplayMember = "DisplayString";
//comboBoxConnectionWarning.ValueMember = "Index";
chkSingleClickOnConnectionOpensIt.Text = Language.SingleClickOnConnectionOpensIt;
chkSingleClickOnOpenedConnectionSwitchesToIt.Text = Language.SingleClickOnOpenConnectionSwitchesToIt;
chkConnectionTreeTrackActiveConnection.Text = Language.TrackActiveConnectionInConnectionTree;
chkHostnameLikeDisplayName.Text = Language.SetHostnameLikeDisplayName;
chkSaveConnectionsAfterEveryEdit.Text = Language.SaveConnectionsAfterEveryEdit;
chkUseFilterSearch.Text = Language.FilterSearchMatchesInConnectionTree;
chkPlaceSearchBarAboveConnectionTree.Text = Language.PlaceSearchBarAboveConnectionTree;
chkDoNotTrimUsername.Text = Language.DoNotTrimUsername;
@@ -38,12 +52,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
lblRdpReconnectionCount.Text = Language.RdpReconnectCount;
lblRDPConTimeout.Text = Language.RdpOverallConnectionTimeout;
lblAutoSave1.Text = Language.AutoSaveEvery;
//ngLabel1.Text = Language.strLabelClosingConnections;
lblClosingConnections.Text = Language.ClosingConnections;
radCloseWarnAll.Text = Language._CloseWarnAll;
radCloseWarnMultiple.Text = Language.RadioCloseWarnMultiple;
radCloseWarnExit.Text = Language.RadioCloseWarnExit;
radCloseWarnNever.Text = Language.RadioCloseWarnNever;
}
public override void LoadSettings()
@@ -52,7 +62,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
chkSingleClickOnOpenedConnectionSwitchesToIt.Checked = Settings.Default.SingleClickSwitchesToOpenConnection;
chkConnectionTreeTrackActiveConnection.Checked = Settings.Default.TrackActiveConnectionInConnectionTree;
chkHostnameLikeDisplayName.Checked = Settings.Default.SetHostnameLikeDisplayName;
chkSaveConnectionsAfterEveryEdit.Checked = Settings.Default.SaveConnectionsAfterEveryEdit;
chkUseFilterSearch.Checked = Settings.Default.UseFilterSearch;
chkPlaceSearchBarAboveConnectionTree.Checked = Settings.Default.PlaceSearchBarAboveConnectionTree;
chkDoNotTrimUsername.Checked = Settings.Default.DoNotTrimUsername;
@@ -61,20 +71,22 @@ namespace mRemoteNG.UI.Forms.OptionsPages
numRDPConTimeout.Value = Convert.ToDecimal(Settings.Default.ConRDPOverallConnectionTimeout);
numAutoSave.Value = Convert.ToDecimal(Settings.Default.AutoSaveEveryMinutes);
switch (Settings.Default.ConfirmCloseConnection)
//comboBoxConnectionWarning.SelectedValue = Settings.Default.ConfirmCloseConnection;
if (Settings.Default.SaveConnectionsFrequency == (int)ConnectionsBackupFrequencyEnum.Unassigned)
{
case (int)ConfirmCloseEnum.Never:
radCloseWarnNever.Checked = true;
break;
case (int)ConfirmCloseEnum.Exit:
radCloseWarnExit.Checked = true;
break;
case (int)ConfirmCloseEnum.Multiple:
radCloseWarnMultiple.Checked = true;
break;
default:
radCloseWarnAll.Checked = true;
break;
if (Settings.Default.SaveConnectionsAfterEveryEdit)
{
Settings.Default.SaveConnectionsFrequency = (int)ConnectionsBackupFrequencyEnum.OnEdit;
}
else if (Settings.Default.SaveConsOnExit)
{
Settings.Default.SaveConnectionsFrequency = (int)ConnectionsBackupFrequencyEnum.OnExit;
}
else
{
Settings.Default.SaveConnectionsFrequency = (int)ConnectionsBackupFrequencyEnum.Never;
}
}
}
@@ -84,7 +96,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
Settings.Default.SingleClickSwitchesToOpenConnection = chkSingleClickOnOpenedConnectionSwitchesToIt.Checked;
Settings.Default.TrackActiveConnectionInConnectionTree = chkConnectionTreeTrackActiveConnection.Checked;
Settings.Default.SetHostnameLikeDisplayName = chkHostnameLikeDisplayName.Checked;
Settings.Default.SaveConnectionsAfterEveryEdit = chkSaveConnectionsAfterEveryEdit.Checked;
Settings.Default.UseFilterSearch = chkUseFilterSearch.Checked;
Settings.Default.PlaceSearchBarAboveConnectionTree = chkPlaceSearchBarAboveConnectionTree.Checked;
Settings.Default.DoNotTrimUsername = chkDoNotTrimUsername.Checked;
@@ -102,25 +114,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
_frmMain.tmrAutoSave.Enabled = false;
}
if (radCloseWarnAll.Checked)
{
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.All;
}
if (radCloseWarnMultiple.Checked)
{
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.Multiple;
}
if (radCloseWarnExit.Checked)
{
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.Exit;
}
if (radCloseWarnNever.Checked)
{
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.Never;
}
//Settings.Default.ConfirmCloseConnection = (int)comboBoxConnectionWarning.SelectedValue;
}
}
}

View File

@@ -64,4 +64,15 @@ namespace mRemoteNG.UI.Forms.OptionsPages
ResumeLayout(false);
}
}
internal class DropdownList
{
public int Index { get; set; }
public string DisplayString { get; set; }
public DropdownList(int argIndex, string argDisplay)
{
Index = argIndex;
DisplayString = argDisplay;
}
}
}

View File

@@ -23,7 +23,6 @@ namespace mRemoteNG.UI.Forms.OptionsPages
{
base.ApplyLanguage();
chkSaveConsOnExit.Text = Language.SaveConsOnExit;
chkReconnectOnStart.Text = Language.ReconnectAtStartup;
chkSingleInstance.Text = Language.AllowOnlySingleInstance;
chkStartMinimized.Text = Language.StartMinimized;
@@ -33,7 +32,6 @@ namespace mRemoteNG.UI.Forms.OptionsPages
{
base.SaveSettings();
Settings.Default.SaveConsOnExit = chkSaveConsOnExit.Checked;
Settings.Default.OpenConsFromLastSession = chkReconnectOnStart.Checked;
Settings.Default.SingleInstance = chkSingleInstance.Checked;
Settings.Default.StartMinimized = chkStartMinimized.Checked;
@@ -42,7 +40,6 @@ namespace mRemoteNG.UI.Forms.OptionsPages
private void StartupExitPage_Load(object sender, EventArgs e)
{
chkSaveConsOnExit.Checked = Settings.Default.SaveConsOnExit;
chkReconnectOnStart.Checked = Settings.Default.OpenConsFromLastSession;
chkSingleInstance.Checked = Settings.Default.SingleInstance;
chkStartMinimized.Checked = Settings.Default.StartMinimized;

View File

@@ -82,6 +82,8 @@ namespace mRemoteNG.UI.Forms
{typeof(ThemePage).Name, new ThemePage {Dock = DockStyle.Fill}},
{typeof(SecurityPage).Name, new SecurityPage {Dock = DockStyle.Fill}},
{typeof(AdvancedPage).Name, new AdvancedPage {Dock = DockStyle.Fill}},
{typeof(BackupPage).Name, new BackupPage {Dock = DockStyle.Fill}},
{typeof(ComponentsPage).Name, new ComponentsPage {Dock = DockStyle.Fill}},
};
}

View File

@@ -591,12 +591,6 @@
<setting name="ConRDPOverallConnectionTimeout" serializeAs="String">
<value>20</value>
</setting>
<setting name="EncryptionEngine" serializeAs="String">
<value>AES</value>
</setting>
<setting name="EncryptionBlockCipherMode" serializeAs="String">
<value>GCM</value>
</setting>
<setting name="EncryptionKeyDerivationIterations" serializeAs="String">
<value>10000</value>
</setting>
@@ -747,6 +741,9 @@
<setting name="InhDefaultUseVmId" serializeAs="String">
<value>False</value>
</setting>
<setting name="SaveConnectionsFrequency" serializeAs="String">
<value>0</value>
</setting>
<setting name="ConDefaultRdpVersion" serializeAs="String">
<value>Highest</value>
</setting>

View File

@@ -74,6 +74,7 @@
<Compile Include="App\Update\UpdateFile.cs" />
<Compile Include="App\Update\UpdateInfo.cs" />
<Compile Include="App\Windows.cs" />
<Compile Include="Config\Connections\ConnectionsBackupFrequencyEnum.cs" />
<Compile Include="Config\Connections\ConnectionsLoadedEventArgs.cs" />
<Compile Include="Config\Connections\ConnectionsSavedEventArgs.cs" />
<Compile Include="Config\Connections\CsvConnectionsSaver.cs" />
@@ -511,6 +512,15 @@
<Compile Include="UI\Forms\OptionsPages\AppearancePage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Forms\OptionsPages\BackupPage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Forms\OptionsPages\BackupPage.Designer.cs">
<DependentUpon>BackupPage.cs</DependentUpon>
</Compile>
<Compile Include="UI\Forms\OptionsPages\ComponentsPage.Designer.cs">
<DependentUpon>ComponentsPage.cs</DependentUpon>
</Compile>
<Compile Include="UI\Forms\OptionsPages\CredentialsPage.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -876,6 +886,9 @@
<EmbeddedResource Include="UI\Forms\OptionsPages\AppearancePage.resx">
<DependentUpon>AppearancePage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Forms\OptionsPages\BackupPage.resx">
<DependentUpon>BackupPage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Forms\OptionsPages\ConnectionsPage.resx">
<DependentUpon>ConnectionsPage.cs</DependentUpon>
</EmbeddedResource>
@@ -1088,6 +1101,7 @@
<None Include="Resources\Tiles\VisualElements_150.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\Backup_Icon.ico" />
<Content Include="Icons\Infrastructure.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

View File

@@ -18,9 +18,6 @@ Options below are for the various settings for Startup/Exit of mRemoteNG.
* - Option
- Default
- Description
* - Save connection on exit
- On
- Save to connection file/database on exit of mRemoteNG
* - Reconnect to previously opened sessions on startup
- Off
- This option will allow you to open the connection from which you where connected to after last exit of application
@@ -109,32 +106,46 @@ Connections
* - Set hostname like display name when creating or renaming connections
- Off
- Will make mRemoteNG try to use the remote host hostname to set the title of the tab in mRemoteNG.
* - Save connections after every exit
- On
- When active mRemoteNG will save the connection tree to the active config after every exit. If inactive then you have to save using **File > Save Connection File** or keyboard shortcut Ctrl+S
* - Filter search matches in connection tree
- Off
- Allows you to filter out the connections to which does not match your filter search in the connection tree. If not active the search will only select the filter to which you do search.
* - RDP Reconnect count
- 5
- Value in seconds
- Value in seconds
* - RDP Connection Timeout
- 20
- Value in seconds
- Value in seconds
* - Auto save time in minutes (0 means disabled)
- 0
- Value in minutes
* - When closing connections
- Warn me when closing connections
* - When closing connections Warn me...
- ... when any connection closes
- Various options of how mRemoteNG should act when you close connections. The different options are listed below:
::
- Warn me when closing connections
- Warn me only when closing multiple connections
- Warn me only when exiting mRemoteNG
- Do not warn me when closing connections
- ... when any connection closes
- ... when closing multiple connections
- ... only when exiting mRemoteNG
- ... never
By default a warning will come up on closing a connection. Change this value based on your prefered settings.
* - Connection Backup Frequency
- On Edit
- Various options of when mRemoteNG should create a backup of the connections file. The different options are listed below:
::
- Never backup connections
- On Edit
- On Exit
- Daily
- Weekly
By default a backup will be saved every time the connections are edited. Change this value based on your prefered settings.
* - Maximum number of backups
- 10
- Number of backup copies of the connection file to keep.
* - Location of backup files
- (blank)
- Full path of backup copies of the connection files.
Credentials
===========
Options for credentials in mRemoteNG. The main purpose here is that when you have empty username, password or domain field then use below information.