Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2018-02-22 17:03:54 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2018-02-22 17:03:54 +0300
commit1c110985ebf3c65928ab976de83067149cce2946 (patch)
tree12a82fa78254ccbe3be13dbe06cc3296ef06b785 /MainForm.cs
parentdca65b2c83fd8376fc0b20cfb794edb74c96c0a8 (diff)
More fixes
Diffstat (limited to 'MainForm.cs')
-rw-r--r--MainForm.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/MainForm.cs b/MainForm.cs
index 3f81a305..2480dae2 100644
--- a/MainForm.cs
+++ b/MainForm.cs
@@ -42,6 +42,7 @@ namespace com.clusterrr.hakchi_gui
public static ClovershellConnection Clovershell;
mooftpserv.Server ftpServer;
public static bool? DownloadCover;
+ CountResult stats = new CountResult();
static NesDefaultGame[] defaultNesGames = new NesDefaultGame[] {
new NesDefaultGame { Code = "CLV-P-NAAAE", Name = "Super Mario Bros.", Size = 25000 },
@@ -667,7 +668,7 @@ namespace com.clusterrr.hakchi_gui
{
try
{
- var stats = RecalculateSelectedGames();
+ stats = RecalculateSelectedGames();
showStats(stats);
}
catch
@@ -716,7 +717,8 @@ namespace com.clusterrr.hakchi_gui
return;
}
var maxGamesSize = DefaultMaxGamesSize * 1024 * 1024;
- if (WorkerForm.NandCTotal > 0)
+ var usb = (Control.ModifierKeys == Keys.Shift) || ConfigIni.AlwaysWriteToUSB;
+ if (WorkerForm.NandCTotal > 0 && !usb)
{
maxGamesSize = (WorkerForm.NandCFree + WorkerForm.WritedGamesSize) - WorkerForm.ReservedMemory * 1024 * 1024;
toolStripStatusLabelSize.Text = string.Format("{0:F1}MB / {1:F1}MB", stats.Size / 1024.0 / 1024.0, maxGamesSize / 1024.0 / 1024.0);
@@ -727,9 +729,9 @@ namespace com.clusterrr.hakchi_gui
}
toolStripStatusLabelSelected.Text = stats.Count + " " + Resources.GamesSelected;
toolStripProgressBar.Maximum = (int)maxGamesSize;
- toolStripProgressBar.Value = Math.Min((int)stats.Size, toolStripProgressBar.Maximum);
+ toolStripProgressBar.Value = !usb ? Math.Min((int)stats.Size, toolStripProgressBar.Maximum) : 0;
toolStripStatusLabelSize.ForeColor =
- (toolStripProgressBar.Value < toolStripProgressBar.Maximum) ?
+ ((toolStripProgressBar.Value < toolStripProgressBar.Maximum) || usb) ?
SystemColors.ControlText :
Color.Red;
}
@@ -1219,6 +1221,7 @@ namespace com.clusterrr.hakchi_gui
private void alwaysWriteGamesToUSBDriveToolStripMenuItem_Click(object sender, EventArgs e)
{
ConfigIni.AlwaysWriteToUSB = alwaysWriteGamesToUSBDriveToolStripMenuItem.Checked;
+ showStats(stats);
buttonStart.Text = (Control.ModifierKeys == Keys.Shift) || ConfigIni.AlwaysWriteToUSB ? Resources.SyncronizeUSB : Resources.Syncronize;
}
@@ -1872,7 +1875,10 @@ namespace com.clusterrr.hakchi_gui
private void MainForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.ShiftKey)
+ {
buttonStart.Text = Resources.SyncronizeUSB;
+ showStats(stats);
+ }
if (listViewGames.SelectedItems.Count != 1) return;
var selected = listViewGames.SelectedItems[0].Tag;
if ((e.KeyCode == Keys.E) && (e.Modifiers == (Keys.Alt | Keys.Control)) && (selected is SnesGame))
@@ -1885,7 +1891,10 @@ namespace com.clusterrr.hakchi_gui
private void MainForm_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.ShiftKey)
+ {
buttonStart.Text = ConfigIni.AlwaysWriteToUSB ? Resources.SyncronizeUSB : Resources.Syncronize;
+ showStats(stats);
+ }
}
private void MainForm_Activated(object sender, EventArgs e)