mirror of
https://github.com/Stone-Red-Code/AutoBackup.git
synced 2026-09-04 00:46:07 +02:00
- Fix formatting
This commit is contained in:
Generated
+1
-1
@@ -218,7 +218,7 @@
|
|||||||
this.mainPanel.Controls.Add(this.addDestinationFolderButton);
|
this.mainPanel.Controls.Add(this.addDestinationFolderButton);
|
||||||
this.mainPanel.Location = new System.Drawing.Point(0, 0);
|
this.mainPanel.Location = new System.Drawing.Point(0, 0);
|
||||||
this.mainPanel.Name = "mainPanel";
|
this.mainPanel.Name = "mainPanel";
|
||||||
this.mainPanel.Size = new System.Drawing.Size(774, 440);
|
this.mainPanel.Size = new System.Drawing.Size(759, 440);
|
||||||
this.mainPanel.TabIndex = 8;
|
this.mainPanel.TabIndex = 8;
|
||||||
//
|
//
|
||||||
// optionsPanel
|
// optionsPanel
|
||||||
|
|||||||
+31
-19
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@@ -43,9 +44,9 @@ namespace AutoBackup
|
|||||||
if ((string)Registry.GetValue(registrykey, "OnOff", "Off") == "On")
|
if ((string)Registry.GetValue(registrykey, "OnOff", "Off") == "On")
|
||||||
{
|
{
|
||||||
OnOffToggleButton_Click(null, null);
|
OnOffToggleButton_Click(null, null);
|
||||||
this.ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
this.Visible = false;
|
Visible = false;
|
||||||
this.WindowState = FormWindowState.Minimized;
|
WindowState = FormWindowState.Minimized;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
@@ -53,9 +54,9 @@ namespace AutoBackup
|
|||||||
MainForm_SizeChanged(null, null);
|
MainForm_SizeChanged(null, null);
|
||||||
MainTimer.Start();
|
MainTimer.Start();
|
||||||
|
|
||||||
notifyIcon.Icon = this.Icon;
|
notifyIcon.Icon = Icon;
|
||||||
notifyIcon.Visible = true;
|
notifyIcon.Visible = true;
|
||||||
notifyIcon.Text = this.Text;
|
notifyIcon.Text = Text;
|
||||||
|
|
||||||
toolTip.SetToolTip(maxBackupsNumericUpDown, "0 = no limit");
|
toolTip.SetToolTip(maxBackupsNumericUpDown, "0 = no limit");
|
||||||
|
|
||||||
@@ -102,7 +103,9 @@ namespace AutoBackup
|
|||||||
private void LoadFolders()
|
private void LoadFolders()
|
||||||
{
|
{
|
||||||
if (!File.Exists(localApplicationDataPath + "\\data.save"))
|
if (!File.Exists(localApplicationDataPath + "\\data.save"))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
@@ -195,7 +198,7 @@ namespace AutoBackup
|
|||||||
|
|
||||||
private void SelectFolderButton_Click(object sender, EventArgs e)
|
private void SelectFolderButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using (var fbd = new FolderBrowserDialog())
|
using (FolderBrowserDialog fbd = new FolderBrowserDialog())
|
||||||
{
|
{
|
||||||
DialogResult result = fbd.ShowDialog();
|
DialogResult result = fbd.ShowDialog();
|
||||||
|
|
||||||
@@ -296,7 +299,10 @@ namespace AutoBackup
|
|||||||
|
|
||||||
private void BackupTimeNumericUpDown_ValueChanged(object sender, EventArgs e)
|
private void BackupTimeNumericUpDown_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (blockWrite) return;
|
if (blockWrite)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
//Registry.SetValue(registrykey, "backupTime", backupTimeNumericUpDown.Value);
|
//Registry.SetValue(registrykey, "backupTime", backupTimeNumericUpDown.Value);
|
||||||
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
@@ -311,7 +317,10 @@ namespace AutoBackup
|
|||||||
|
|
||||||
private void TimeUnitComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
private void TimeUnitComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (blockWrite) return;
|
if (blockWrite)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
//Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex);
|
//Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex);
|
||||||
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
@@ -326,7 +335,10 @@ namespace AutoBackup
|
|||||||
|
|
||||||
private void MaxBackupsNumericUpDown_ValueChanged(object sender, EventArgs e)
|
private void MaxBackupsNumericUpDown_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (blockWrite) return;
|
if (blockWrite)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
//Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex);
|
//Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex);
|
||||||
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
@@ -341,24 +353,24 @@ namespace AutoBackup
|
|||||||
|
|
||||||
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
|
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
this.WindowState = FormWindowState.Normal;
|
WindowState = FormWindowState.Normal;
|
||||||
this.Visible = true;
|
Visible = true;
|
||||||
this.ShowInTaskbar = true;
|
ShowInTaskbar = true;
|
||||||
backup.windowVisible = true;
|
backup.windowVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainForm_SizeChanged(object sender, EventArgs e)
|
private void MainForm_SizeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
addFolderPopup.Location = new Point(this.Width / 2 - addFolderPopup.Width / 2, this.Height / 2 - addFolderPopup.Height / 2);
|
addFolderPopup.Location = new Point(Width / 2 - addFolderPopup.Width / 2, Height / 2 - addFolderPopup.Height / 2);
|
||||||
|
|
||||||
int space = 20;
|
int space = 20;
|
||||||
|
|
||||||
sourceFoldersListBox.Height = this.Height - 243;
|
sourceFoldersListBox.Height = Height - 243;
|
||||||
sourceFoldersListBox.Width = this.Width / 2 - 13 - space;
|
sourceFoldersListBox.Width = Width / 2 - 13 - space;
|
||||||
|
|
||||||
destinationFoldersListBox.Height = this.Height - 243;
|
destinationFoldersListBox.Height = Height - 243;
|
||||||
destinationFoldersListBox.Location = new Point(this.Width / 2 - 15 + space, destinationFoldersListBox.Location.Y);
|
destinationFoldersListBox.Location = new Point(Width / 2 - 15 + space, destinationFoldersListBox.Location.Y);
|
||||||
destinationFoldersListBox.Width = this.Width / 2 - 13 - space;
|
destinationFoldersListBox.Width = Width / 2 - 13 - space;
|
||||||
|
|
||||||
addSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X, sourceFoldersListBox.Height + 25);
|
addSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X, sourceFoldersListBox.Height + 25);
|
||||||
removeSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width - removeSourceFolderButton.Width, sourceFoldersListBox.Height + 25);
|
removeSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width - removeSourceFolderButton.Width, sourceFoldersListBox.Height + 25);
|
||||||
@@ -369,7 +381,7 @@ namespace AutoBackup
|
|||||||
sourceDirectoriesLabel.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width / 2 - sourceDirectoriesLabel.Width / 2, sourceDirectoriesLabel.Location.Y);
|
sourceDirectoriesLabel.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width / 2 - sourceDirectoriesLabel.Width / 2, sourceDirectoriesLabel.Location.Y);
|
||||||
destinationDirectoriesLabel.Location = new Point(destinationFoldersListBox.Location.X + destinationFoldersListBox.Width / 2 - destinationDirectoriesLabel.Width / 2, destinationDirectoriesLabel.Location.Y);
|
destinationDirectoriesLabel.Location = new Point(destinationFoldersListBox.Location.X + destinationFoldersListBox.Width / 2 - destinationDirectoriesLabel.Width / 2, destinationDirectoriesLabel.Location.Y);
|
||||||
|
|
||||||
mainPanel.Height = this.Height;
|
mainPanel.Height = Height;
|
||||||
|
|
||||||
if (WindowState == FormWindowState.Minimized && ShowInTaskbar == true)
|
if (WindowState == FormWindowState.Minimized && ShowInTaskbar == true)
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user