Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
[4.2.0] Added path for accessing config screen on startup, can now se…
Browse files Browse the repository at this point in the history
…t up rclone remotes from scratch within the GUI
  • Loading branch information
andrewiankidd committed Dec 3, 2016
1 parent ebe09f2 commit a65124c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
Binary file modified .vs/rcloneExplorer/v14/.suo
Binary file not shown.
25 changes: 13 additions & 12 deletions rcloneExplorer/rcloneExplorer.Auxiliary.SetupWiz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;

Expand All @@ -14,7 +15,7 @@ namespace rcloneExplorer
public partial class rcloneExplorerSetupWiz : Form
{
rcloneExplorerInternalExec internalExecHandler;
rcloneExplorerExploreHandler exploreHandler;
rcloneExplorerExploreHandler exploreHandler;
IniFile iniSettings;
string[] providers = { "crypt", "amazon cloud drive", "s3", "b2", "dropbox", "google cloud storage", "drive", "hubic", "onedrive", "swift", "yandex" };

Expand Down Expand Up @@ -69,19 +70,19 @@ private void loadConfigs()

private void openSelectedRemote()
{
if (lstConfigs.SelectedItems.Count>0)
{
if (!String.IsNullOrEmpty(lstConfigs.SelectedItems[0].Text))
{
//write newly selected config to ini
iniSettings.Write("rcloneRemote", lstConfigs.SelectedItems[0].Text.ToString());
if (lstConfigs.SelectedItems.Count > 0 && !String.IsNullOrEmpty(lstConfigs.SelectedItems[0].Text))
{
//write newly selected config to ini
iniSettings.Write("rcloneRemote", lstConfigs.SelectedItems[0].Text.ToString());
//not doing first time setup so clear the CD and refresh view
if (!rcloneExplorer.initialSetup) {
//set current path to root
rcloneExplorer.remoteCD = "";
//refresh the explorer lst
exploreHandler.refreshlstExplorer();
//close config screen
this.Close();
}
}
//close config screen
this.Close();
}
}

Expand Down Expand Up @@ -143,9 +144,9 @@ private void cmbProviderList_TextChanged(object sender, EventArgs e)
cmbProviderList.Visible = false;

//if user doesnt enter a valid remote name, keep asking
while (String.IsNullOrEmpty(nRemoteName.Trim()))
while (String.IsNullOrEmpty(nRemoteName.Trim()) || !Regex.IsMatch("^[a-zA-Z][a-zA-Z0-9]*$", nRemoteName.Trim()))
{
nRemoteName = PromptGenerator.ShowDialog("Remote Name:", "");
nRemoteName = PromptGenerator.ShowDialog("Remote Name:", "Please enter an alphanumeric name for the remote").Replace(@"\", @"");
}

//build command list
Expand Down
12 changes: 4 additions & 8 deletions rcloneExplorer/rcloneExplorer.Core.Initialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ public void initRcloneSettings()
//config found, checking for settings
if (string.IsNullOrEmpty(iniSettings.Read("rcloneRemote")))
{
MessageBox.Show("ERR: Incorrect config\r\n\r\nPlease add an rclone remote Name to the config ini");
Process.Start("cmd.exe", "/c rclone config");
Process.Start("notepad.exe", "rcloneExplorer.ini");
Environment.Exit(0);
MessageBox.Show("ERR: Incorrect config\r\n\r\nLoading config, this may take a minute...");
rcloneExplorer.initialSetup = true;
}
else
{
Expand All @@ -57,10 +55,8 @@ public void initRcloneSettings()
iniSettings.Write("rcloneSyncBandwidthLimit", "0");
iniSettings.Write("rcloneSyncMinFileSize", "0");
iniSettings.Write("rcloneSyncMaxFileSize", "0");
MessageBox.Show("No ini file found!\r\n\r\nPlease add an rclone remote Name to the config ini");
Process.Start("cmd.exe", "/c rclone config");
Process.Start("notepad.exe", "rcloneExplorer.ini");
Environment.Exit(0);
MessageBox.Show("ERR: No ini file found!\r\n\r\nLoading config, this may take a minute...");
rcloneExplorer.initialSetup = true;
}
if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\ffplay.exe"))
{
Expand Down
7 changes: 7 additions & 0 deletions rcloneExplorer/rcloneExplorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public partial class rcloneExplorer : Form
public static string remoteCD = "";
public static long totalFilesize = 0;
public static bool loaded = false;
public static bool initialSetup = false;
public static bool streamingEnabled = false;
public static System.Windows.Forms.Timer transferTimer = new System.Windows.Forms.Timer();

Expand All @@ -45,6 +46,12 @@ public rcloneExplorer()
tickHandler.init();
//init rclone settings
InitializationHandler.initRcloneSettings();
//wait for initial setup to complete if need be
if (initialSetup) {
var SetupWiz = new rcloneExplorerSetupWiz();
var waitforcomplete = SetupWiz.ShowDialog();
initialSetup = false;
}
//start the splashscreen in a background thread so the main form can work away
new Thread(() =>
{
Expand Down

0 comments on commit a65124c

Please sign in to comment.