Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed SingleInstance issue

-WinLess will now be restored from the tray if it is already running and if you didn't open it from the commandline (with arguments)
-Some casing fixes
  • Loading branch information...
commit f1efc3665694a49e4e62743f97faa8e69f953a8f 1 parent f8fdafd
@marklagendijk authored
View
2  Installer/WinLess.warsetup
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<WarSetup-Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" projectRunAfterInstall="true" mainTargetApp="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" nextUniqueId="1479" projectName="WinLess" projectUuid="aca1172c-5ac1-45cc-94f9-fb1f3f0eb2be" projectUpgradeUuid="b795642a-13ec-4b7c-bb13-d8f0311fc42d" projectVersion="1.5.1" projectOrganization="Mark Lagendijk" projectMustBeAdministratorToInstall="false" project64BitTarget="false" projectTargetDirectory="C:\projects\WinLess\installer" projectTargetName="WinLess-1.5.1" projectType="0" projectUserInterface="WixUI_Minimal">
+<WarSetup-Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" projectRunAfterInstall="true" mainTargetApp="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" nextUniqueId="1479" projectName="WinLess" projectUuid="aca1172c-5ac1-45cc-94f9-fb1f3f0eb2be" projectUpgradeUuid="b795642a-13ec-4b7c-bb13-d8f0311fc42d" projectVersion="1.5.2" projectOrganization="Mark Lagendijk" projectMustBeAdministratorToInstall="false" project64BitTarget="false" projectTargetDirectory="C:\projects\WinLess\installer" projectTargetName="WinLess-1.5.2" projectType="0" projectUserInterface="WixUI_Minimal">
<LicencePaths>
<string>C:\Program Files (x86)\Jgaa's Internet\War Setup\Licenses</string>
</LicencePaths>
View
42 WinLess/Forms/mainForm.cs
@@ -75,7 +75,7 @@ public void LoadDirectories(CommandLineArguments args)
}
}
foldersListBox_DataChanged();
- selectDirectory();
+ SelectDirectory();
Program.Settings.SaveSettings();
}
@@ -87,7 +87,7 @@ private void mainForm_Activated(object sender, EventArgs e)
if (Program.Settings.StartMinified)
{
- minimizeApp();
+ MinimizeToTray();
}
}
}
@@ -135,7 +135,7 @@ private void foldersListBox_DragDrop(object sender, DragEventArgs e)
{
Program.Settings.DirectoryList.AddDirectory(directoryInfo.FullName);
foldersListBox_DataChanged();
- selectDirectory();
+ SelectDirectory();
Program.Settings.SaveSettings();
}
}
@@ -145,13 +145,13 @@ private void foldersListBox_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
- removeDirectory();
+ RemoveDirectory();
}
}
private void foldersListBox_SelectedValueChanged(object sender, EventArgs e)
{
- selectDirectory();
+ SelectDirectory();
}
private void foldersListBox_DataChanged()
@@ -160,7 +160,7 @@ private void foldersListBox_DataChanged()
filesDataGridView_DataChanged();
}
- private void removeDirectory()
+ private void RemoveDirectory()
{
if (foldersListBox.SelectedItem != null)
{
@@ -173,7 +173,7 @@ private void removeDirectory()
}
- private void selectDirectory()
+ private void SelectDirectory()
{
Models.Directory directory = (Models.Directory)foldersListBox.SelectedItem;
if (directory != null)
@@ -325,7 +325,7 @@ private void addDirectoryButton_Click(object sender, EventArgs e)
private void removeDirectoryButton_Click(object sender, EventArgs e)
{
- removeDirectory();
+ RemoveDirectory();
}
private void refreshDirectoryButton_Click(object sender, EventArgs e)
@@ -334,7 +334,7 @@ private void refreshDirectoryButton_Click(object sender, EventArgs e)
{
Models.Directory directory = (Models.Directory)foldersListBox.SelectedItem;
directory.Refresh();
- selectDirectory();
+ SelectDirectory();
Program.Settings.SaveSettings();
}
}
@@ -359,11 +359,11 @@ private void compileSelectedButton_Click(object sender, EventArgs e)
#region compileResultsDataGridView
- public void addCompileResult(Models.CompileResult result)
+ public void AddCompileResult(Models.CompileResult result)
{
if (InvokeRequired)
{
- this.Invoke(new AddCompileResultDelegate(addCompileResult), new object[] { result });
+ this.Invoke(new AddCompileResultDelegate(AddCompileResult), new object[] { result });
return;
}
@@ -373,11 +373,11 @@ public void addCompileResult(Models.CompileResult result)
if (string.Compare(result.ResultText, "success", StringComparison.InvariantCultureIgnoreCase) != 0)
{
- showErrorNotification("Compile error", result.ResultText);
+ ShowErrorNotification("Compile error", result.ResultText);
}
else if (Program.Settings.ShowSuccessMessages)
{
- showSuccessNotification("Successful compile", result.FullPath);
+ ShowSuccessNotification("Successful compile", result.FullPath);
}
}
@@ -414,46 +414,46 @@ private void notifyIcon_DoubleClick(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
- restoreApp();
+ RestoreFromTray();
}
else
{
- minimizeApp();
+ MinimizeToTray();
}
}
private void notifyIcon_BalloonTipClicked(object sender, EventArgs e)
{
- restoreApp();
+ RestoreFromTray();
tabControl.SelectTab(compilerTabPage);
}
- private void minimizeApp()
+ private void MinimizeToTray()
{
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
this.Hide();
}
- private void restoreApp()
+ public void RestoreFromTray()
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
}
- private void showSuccessNotification(string title, string message){
+ private void ShowSuccessNotification(string title, string message){
notifyIcon.ShowBalloonTip(500, title, message, ToolTipIcon.Info);
}
- private void showErrorNotification(string title, string message)
+ private void ShowErrorNotification(string title, string message)
{
notifyIcon.ShowBalloonTip(500, title, message, ToolTipIcon.Error);
}
private void notifyIconMenuOpen_Click(object sender, EventArgs e)
{
- restoreApp();
+ RestoreFromTray();
}
private void notifyIconMenuExit_Click(object sender, EventArgs e)
View
2  WinLess/Less/Compiler.cs
@@ -15,7 +15,7 @@ public static void CompileLessFile(string lessPath, string cssPath, bool minify)
try
{
CompileResult compileResult = ExecuteCompileCommand(lessPath, cssPath, minify);
- mainForm.ActiveOrInActiveMainForm.addCompileResult(compileResult);
+ mainForm.ActiveOrInActiveMainForm.AddCompileResult(compileResult);
}
catch (Exception e)
{
View
4 WinLess/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.1.0")]
-[assembly: AssemblyFileVersion("1.5.1.0")]
+[assembly: AssemblyVersion("1.5.2.0")]
+[assembly: AssemblyFileVersion("1.5.2.0")]
View
11 WinLess/SingleInstanceController.cs
@@ -21,10 +21,17 @@ private void this_StartupNextInstance(object sender, StartupNextInstanceEventArg
eventArgs.CommandLine.CopyTo(args, 0);
CommandLineArguments commandLineArguments = new CommandLineArguments(args);
- if (commandLineArguments.HasArguments)
+ if (!commandLineArguments.ConsoleExit)
{
mainForm form = (mainForm)this.MainForm;
- form.LoadDirectories(commandLineArguments);
+ if (commandLineArguments.HasArguments)
+ {
+ form.LoadDirectories(commandLineArguments);
+ }
+ else
+ {
+ form.RestoreFromTray();
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.