Skip to content
This repository
Browse code

Merge pull request #51 from jmclocklin/master

Added an opt-in solution for issue #27 and made issue #9 significantly easier.
  • Loading branch information...
commit 647720ec79299c65b6fed2d60b2caad176062744 2 parents 4f3098c + e54504d
Mark Lagendijk authored
2  WinLess/Forms/mainForm.Designer.cs
@@ -71,6 +71,7 @@ private void InitializeComponent()
71 71 this.notifyIconMenuOpen = new System.Windows.Forms.ToolStripMenuItem();
72 72 this.notifyIconMenuExit = new System.Windows.Forms.ToolStripMenuItem();
73 73 this.outputFolderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
  74 + this.advancedOutputFolderBrowserDialog = new System.Windows.Forms.OpenFileDialog();
74 75 this.logoPictureBox = new System.Windows.Forms.PictureBox();
75 76 this.compileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
76 77 ((System.ComponentModel.ISupportInitialize)(this.directoryBindingSource)).BeginInit();
@@ -558,6 +559,7 @@ private void InitializeComponent()
558 559 private System.Windows.Forms.ToolStripMenuItem fileOpenFolderToolStripMenuItem;
559 560 private System.Windows.Forms.ToolStripMenuItem openFiletoolStripMenuItem;
560 561 private System.Windows.Forms.FolderBrowserDialog outputFolderBrowserDialog;
  562 + private System.Windows.Forms.OpenFileDialog advancedOutputFolderBrowserDialog;
561 563 private System.Windows.Forms.PictureBox logoPictureBox;
562 564 private System.Windows.Forms.DataGridViewTextBoxColumn timeDataGridViewTextBoxColumn;
563 565 private System.Windows.Forms.DataGridViewTextBoxColumn fileDataGridViewTextBoxColumn;
30 WinLess/Forms/mainForm.cs
@@ -299,13 +299,29 @@ private void fileSelectOutputToolStripMenuItem_Click(object sender, EventArgs e)
299 299 DataGridViewCell cell = filesDataGridView.SelectedCells[0];
300 300 Models.File file = (Models.File)cell.OwningRow.DataBoundItem;
301 301 FileInfo fileInfo = new FileInfo(file.OutputPath);
302   - outputFolderBrowserDialog.SelectedPath = fileInfo.DirectoryName;
303   - if (outputFolderBrowserDialog.ShowDialog() == DialogResult.OK)
304   - {
305   - file.OutputPath = string.Format("{0}\\{1}", outputFolderBrowserDialog.SelectedPath, fileInfo.Name);
306   - filesDataGridView_DataChanged();
307   - Program.Settings.SaveSettings();
308   - }
  302 +
  303 + if (!Program.Settings.UseAdvancedOutputFileSelector)
  304 + {
  305 + outputFolderBrowserDialog.SelectedPath = fileInfo.DirectoryName;
  306 + if (outputFolderBrowserDialog.ShowDialog() == DialogResult.OK)
  307 + {
  308 + file.OutputPath = string.Format("{0}\\{1}", outputFolderBrowserDialog.SelectedPath, fileInfo.Name);
  309 + filesDataGridView_DataChanged();
  310 + Program.Settings.SaveSettings();
  311 + }
  312 + }
  313 + else
  314 + {
  315 + advancedOutputFolderBrowserDialog.InitialDirectory = fileInfo.DirectoryName;
  316 + advancedOutputFolderBrowserDialog.FileName = fileInfo.Name;
  317 + if (advancedOutputFolderBrowserDialog.ShowDialog() == DialogResult.OK)
  318 + {
  319 + file.OutputPath = advancedOutputFolderBrowserDialog.FileName;
  320 + }
  321 + }
  322 +
  323 + filesDataGridView_DataChanged();
  324 + Program.Settings.SaveSettings();
309 325 }
310 326
311 327 #endregion
263 WinLess/Forms/settingsForm.Designer.cs
@@ -28,130 +28,142 @@ protected override void Dispose(bool disposing)
28 28 /// </summary>
29 29 private void InitializeComponent()
30 30 {
31   - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(settingsForm));
32   - this.cancelButton = new System.Windows.Forms.Button();
33   - this.okButton = new System.Windows.Forms.Button();
34   - this.generalGroupBox = new System.Windows.Forms.GroupBox();
35   - this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox();
36   - this.startWithWindowsCheckBox = new System.Windows.Forms.CheckBox();
37   - this.compilingGroupBox = new System.Windows.Forms.GroupBox();
38   - this.compileOnSaveCheckBox = new System.Windows.Forms.CheckBox();
39   - this.defaultMinifyCheckBox = new System.Windows.Forms.CheckBox();
40   - this.showSuccessMessagesCheckbox = new System.Windows.Forms.CheckBox();
41   - this.generalGroupBox.SuspendLayout();
42   - this.compilingGroupBox.SuspendLayout();
43   - this.SuspendLayout();
44   - //
45   - // cancelButton
46   - //
47   - this.cancelButton.Location = new System.Drawing.Point(197, 197);
48   - this.cancelButton.Name = "cancelButton";
49   - this.cancelButton.Size = new System.Drawing.Size(75, 23);
50   - this.cancelButton.TabIndex = 0;
51   - this.cancelButton.Text = "Cancel";
52   - this.cancelButton.UseVisualStyleBackColor = true;
53   - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
54   - //
55   - // okButton
56   - //
57   - this.okButton.Location = new System.Drawing.Point(116, 197);
58   - this.okButton.Name = "okButton";
59   - this.okButton.Size = new System.Drawing.Size(75, 23);
60   - this.okButton.TabIndex = 1;
61   - this.okButton.Text = "Ok";
62   - this.okButton.UseVisualStyleBackColor = true;
63   - this.okButton.Click += new System.EventHandler(this.okButton_Click);
64   - //
65   - // generalGroupBox
66   - //
67   - this.generalGroupBox.Controls.Add(this.startMinimizedCheckBox);
68   - this.generalGroupBox.Controls.Add(this.startWithWindowsCheckBox);
69   - this.generalGroupBox.Location = new System.Drawing.Point(13, 13);
70   - this.generalGroupBox.Name = "generalGroupBox";
71   - this.generalGroupBox.Size = new System.Drawing.Size(259, 72);
72   - this.generalGroupBox.TabIndex = 2;
73   - this.generalGroupBox.TabStop = false;
74   - this.generalGroupBox.Text = "General";
75   - //
76   - // startMinimizedCheckBox
77   - //
78   - this.startMinimizedCheckBox.AutoSize = true;
79   - this.startMinimizedCheckBox.Location = new System.Drawing.Point(7, 44);
80   - this.startMinimizedCheckBox.Name = "startMinimizedCheckBox";
81   - this.startMinimizedCheckBox.Size = new System.Drawing.Size(96, 17);
82   - this.startMinimizedCheckBox.TabIndex = 1;
83   - this.startMinimizedCheckBox.Text = "Start minimized";
84   - this.startMinimizedCheckBox.UseVisualStyleBackColor = true;
85   - //
86   - // startWithWindowsCheckBox
87   - //
88   - this.startWithWindowsCheckBox.AutoSize = true;
89   - this.startWithWindowsCheckBox.Location = new System.Drawing.Point(7, 20);
90   - this.startWithWindowsCheckBox.Name = "startWithWindowsCheckBox";
91   - this.startWithWindowsCheckBox.Size = new System.Drawing.Size(117, 17);
92   - this.startWithWindowsCheckBox.TabIndex = 0;
93   - this.startWithWindowsCheckBox.Text = "Start with Windows";
94   - this.startWithWindowsCheckBox.UseVisualStyleBackColor = true;
95   - //
96   - // compilingGroupBox
97   - //
98   - this.compilingGroupBox.Controls.Add(this.showSuccessMessagesCheckbox);
99   - this.compilingGroupBox.Controls.Add(this.compileOnSaveCheckBox);
100   - this.compilingGroupBox.Controls.Add(this.defaultMinifyCheckBox);
101   - this.compilingGroupBox.Location = new System.Drawing.Point(13, 91);
102   - this.compilingGroupBox.Name = "compilingGroupBox";
103   - this.compilingGroupBox.Size = new System.Drawing.Size(259, 100);
104   - this.compilingGroupBox.TabIndex = 3;
105   - this.compilingGroupBox.TabStop = false;
106   - this.compilingGroupBox.Text = "Compiling";
107   - //
108   - // compileOnSaveCheckBox
109   - //
110   - this.compileOnSaveCheckBox.AutoSize = true;
111   - this.compileOnSaveCheckBox.Location = new System.Drawing.Point(7, 44);
112   - this.compileOnSaveCheckBox.Name = "compileOnSaveCheckBox";
113   - this.compileOnSaveCheckBox.Size = new System.Drawing.Size(209, 17);
114   - this.compileOnSaveCheckBox.TabIndex = 1;
115   - this.compileOnSaveCheckBox.Text = "Automatically compile files when saved";
116   - this.compileOnSaveCheckBox.UseVisualStyleBackColor = true;
117   - //
118   - // defaultMinifyCheckBox
119   - //
120   - this.defaultMinifyCheckBox.AutoSize = true;
121   - this.defaultMinifyCheckBox.Location = new System.Drawing.Point(7, 21);
122   - this.defaultMinifyCheckBox.Name = "defaultMinifyCheckBox";
123   - this.defaultMinifyCheckBox.Size = new System.Drawing.Size(102, 17);
124   - this.defaultMinifyCheckBox.TabIndex = 0;
125   - this.defaultMinifyCheckBox.Text = "Minify by default";
126   - this.defaultMinifyCheckBox.UseVisualStyleBackColor = true;
127   - //
128   - // showSuccessMessagesCheckbox
129   - //
130   - this.showSuccessMessagesCheckbox.AutoSize = true;
131   - this.showSuccessMessagesCheckbox.Location = new System.Drawing.Point(7, 68);
132   - this.showSuccessMessagesCheckbox.Name = "showSuccessMessagesCheckbox";
133   - this.showSuccessMessagesCheckbox.Size = new System.Drawing.Size(200, 17);
134   - this.showSuccessMessagesCheckbox.TabIndex = 2;
135   - this.showSuccessMessagesCheckbox.Text = "Show message on succesful compile";
136   - this.showSuccessMessagesCheckbox.UseVisualStyleBackColor = true;
137   - //
138   - // settingsForm
139   - //
140   - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
141   - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
142   - this.ClientSize = new System.Drawing.Size(289, 232);
143   - this.Controls.Add(this.compilingGroupBox);
144   - this.Controls.Add(this.generalGroupBox);
145   - this.Controls.Add(this.okButton);
146   - this.Controls.Add(this.cancelButton);
147   - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
148   - this.Name = "settingsForm";
149   - this.Text = "Settings";
150   - this.generalGroupBox.ResumeLayout(false);
151   - this.generalGroupBox.PerformLayout();
152   - this.compilingGroupBox.ResumeLayout(false);
153   - this.compilingGroupBox.PerformLayout();
154   - this.ResumeLayout(false);
  31 + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(settingsForm));
  32 + this.cancelButton = new System.Windows.Forms.Button();
  33 + this.okButton = new System.Windows.Forms.Button();
  34 + this.generalGroupBox = new System.Windows.Forms.GroupBox();
  35 + this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox();
  36 + this.startWithWindowsCheckBox = new System.Windows.Forms.CheckBox();
  37 + this.compilingGroupBox = new System.Windows.Forms.GroupBox();
  38 + this.showSuccessMessagesCheckbox = new System.Windows.Forms.CheckBox();
  39 + this.compileOnSaveCheckBox = new System.Windows.Forms.CheckBox();
  40 + this.defaultMinifyCheckBox = new System.Windows.Forms.CheckBox();
  41 + this.useAdvancedOutputFileSelector = new System.Windows.Forms.CheckBox();
  42 + this.generalGroupBox.SuspendLayout();
  43 + this.compilingGroupBox.SuspendLayout();
  44 + this.SuspendLayout();
  45 + //
  46 + // cancelButton
  47 + //
  48 + this.cancelButton.Location = new System.Drawing.Point(202, 226);
  49 + this.cancelButton.Name = "cancelButton";
  50 + this.cancelButton.Size = new System.Drawing.Size(75, 23);
  51 + this.cancelButton.TabIndex = 0;
  52 + this.cancelButton.Text = "Cancel";
  53 + this.cancelButton.UseVisualStyleBackColor = true;
  54 + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
  55 + //
  56 + // okButton
  57 + //
  58 + this.okButton.Location = new System.Drawing.Point(121, 226);
  59 + this.okButton.Name = "okButton";
  60 + this.okButton.Size = new System.Drawing.Size(75, 23);
  61 + this.okButton.TabIndex = 1;
  62 + this.okButton.Text = "OK";
  63 + this.okButton.UseVisualStyleBackColor = true;
  64 + this.okButton.Click += new System.EventHandler(this.okButton_Click);
  65 + //
  66 + // generalGroupBox
  67 + //
  68 + this.generalGroupBox.Controls.Add(this.startMinimizedCheckBox);
  69 + this.generalGroupBox.Controls.Add(this.startWithWindowsCheckBox);
  70 + this.generalGroupBox.Location = new System.Drawing.Point(13, 13);
  71 + this.generalGroupBox.Name = "generalGroupBox";
  72 + this.generalGroupBox.Size = new System.Drawing.Size(259, 72);
  73 + this.generalGroupBox.TabIndex = 2;
  74 + this.generalGroupBox.TabStop = false;
  75 + this.generalGroupBox.Text = "General";
  76 + //
  77 + // startMinimizedCheckBox
  78 + //
  79 + this.startMinimizedCheckBox.AutoSize = true;
  80 + this.startMinimizedCheckBox.Location = new System.Drawing.Point(7, 44);
  81 + this.startMinimizedCheckBox.Name = "startMinimizedCheckBox";
  82 + this.startMinimizedCheckBox.Size = new System.Drawing.Size(96, 17);
  83 + this.startMinimizedCheckBox.TabIndex = 1;
  84 + this.startMinimizedCheckBox.Text = "Start minimized";
  85 + this.startMinimizedCheckBox.UseVisualStyleBackColor = true;
  86 + //
  87 + // startWithWindowsCheckBox
  88 + //
  89 + this.startWithWindowsCheckBox.AutoSize = true;
  90 + this.startWithWindowsCheckBox.Location = new System.Drawing.Point(7, 20);
  91 + this.startWithWindowsCheckBox.Name = "startWithWindowsCheckBox";
  92 + this.startWithWindowsCheckBox.Size = new System.Drawing.Size(117, 17);
  93 + this.startWithWindowsCheckBox.TabIndex = 0;
  94 + this.startWithWindowsCheckBox.Text = "Start with Windows";
  95 + this.startWithWindowsCheckBox.UseVisualStyleBackColor = true;
  96 + //
  97 + // compilingGroupBox
  98 + //
  99 + this.compilingGroupBox.Controls.Add(this.useAdvancedOutputFileSelector);
  100 + this.compilingGroupBox.Controls.Add(this.showSuccessMessagesCheckbox);
  101 + this.compilingGroupBox.Controls.Add(this.compileOnSaveCheckBox);
  102 + this.compilingGroupBox.Controls.Add(this.defaultMinifyCheckBox);
  103 + this.compilingGroupBox.Location = new System.Drawing.Point(13, 91);
  104 + this.compilingGroupBox.Name = "compilingGroupBox";
  105 + this.compilingGroupBox.Size = new System.Drawing.Size(259, 120);
  106 + this.compilingGroupBox.TabIndex = 3;
  107 + this.compilingGroupBox.TabStop = false;
  108 + this.compilingGroupBox.Text = "Compiling";
  109 + //
  110 + // showSuccessMessagesCheckbox
  111 + //
  112 + this.showSuccessMessagesCheckbox.AutoSize = true;
  113 + this.showSuccessMessagesCheckbox.Location = new System.Drawing.Point(7, 68);
  114 + this.showSuccessMessagesCheckbox.Name = "showSuccessMessagesCheckbox";
  115 + this.showSuccessMessagesCheckbox.Size = new System.Drawing.Size(200, 17);
  116 + this.showSuccessMessagesCheckbox.TabIndex = 2;
  117 + this.showSuccessMessagesCheckbox.Text = "Show message on succesful compile";
  118 + this.showSuccessMessagesCheckbox.UseVisualStyleBackColor = true;
  119 + //
  120 + // compileOnSaveCheckBox
  121 + //
  122 + this.compileOnSaveCheckBox.AutoSize = true;
  123 + this.compileOnSaveCheckBox.Location = new System.Drawing.Point(7, 44);
  124 + this.compileOnSaveCheckBox.Name = "compileOnSaveCheckBox";
  125 + this.compileOnSaveCheckBox.Size = new System.Drawing.Size(209, 17);
  126 + this.compileOnSaveCheckBox.TabIndex = 1;
  127 + this.compileOnSaveCheckBox.Text = "Automatically compile files when saved";
  128 + this.compileOnSaveCheckBox.UseVisualStyleBackColor = true;
  129 + //
  130 + // defaultMinifyCheckBox
  131 + //
  132 + this.defaultMinifyCheckBox.AutoSize = true;
  133 + this.defaultMinifyCheckBox.Location = new System.Drawing.Point(7, 21);
  134 + this.defaultMinifyCheckBox.Name = "defaultMinifyCheckBox";
  135 + this.defaultMinifyCheckBox.Size = new System.Drawing.Size(102, 17);
  136 + this.defaultMinifyCheckBox.TabIndex = 0;
  137 + this.defaultMinifyCheckBox.Text = "Minify by default";
  138 + this.defaultMinifyCheckBox.UseVisualStyleBackColor = true;
  139 + //
  140 + // useAdvancedOutputFileSelector
  141 + //
  142 + this.useAdvancedOutputFileSelector.AutoSize = true;
  143 + this.useAdvancedOutputFileSelector.Location = new System.Drawing.Point(7, 91);
  144 + this.useAdvancedOutputFileSelector.Name = "useAdvancedOutputFileSelector";
  145 + this.useAdvancedOutputFileSelector.Size = new System.Drawing.Size(185, 17);
  146 + this.useAdvancedOutputFileSelector.TabIndex = 0;
  147 + this.useAdvancedOutputFileSelector.Text = "Use advanced output file selector";
  148 + this.useAdvancedOutputFileSelector.UseVisualStyleBackColor = true;
  149 + //
  150 + // settingsForm
  151 + //
  152 + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  153 + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  154 + this.ClientSize = new System.Drawing.Size(289, 260);
  155 + this.Controls.Add(this.compilingGroupBox);
  156 + this.Controls.Add(this.generalGroupBox);
  157 + this.Controls.Add(this.okButton);
  158 + this.Controls.Add(this.cancelButton);
  159 + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  160 + this.Name = "settingsForm";
  161 + this.Text = "Settings";
  162 + this.generalGroupBox.ResumeLayout(false);
  163 + this.generalGroupBox.PerformLayout();
  164 + this.compilingGroupBox.ResumeLayout(false);
  165 + this.compilingGroupBox.PerformLayout();
  166 + this.ResumeLayout(false);
155 167
156 168 }
157 169
@@ -165,6 +177,7 @@ private void InitializeComponent()
165 177 private System.Windows.Forms.GroupBox compilingGroupBox;
166 178 private System.Windows.Forms.CheckBox defaultMinifyCheckBox;
167 179 private System.Windows.Forms.CheckBox compileOnSaveCheckBox;
168   - private System.Windows.Forms.CheckBox showSuccessMessagesCheckbox;
  180 + private System.Windows.Forms.CheckBox showSuccessMessagesCheckbox;
  181 + private System.Windows.Forms.CheckBox useAdvancedOutputFileSelector;
169 182 }
170 183 }
2  WinLess/Forms/settingsForm.cs
@@ -23,6 +23,7 @@ private void loadSettings()
23 23 defaultMinifyCheckBox.Checked = Program.Settings.DefaultMinify;
24 24 compileOnSaveCheckBox.Checked = Program.Settings.CompileOnSave;
25 25 showSuccessMessagesCheckbox.Checked = Program.Settings.ShowSuccessMessages;
  26 + useAdvancedOutputFileSelector.Checked = Program.Settings.UseAdvancedOutputFileSelector;
26 27 }
27 28
28 29 private void saveSettings()
@@ -32,6 +33,7 @@ private void saveSettings()
32 33 Program.Settings.DefaultMinify = defaultMinifyCheckBox.Checked;
33 34 Program.Settings.CompileOnSave = compileOnSaveCheckBox.Checked;
34 35 Program.Settings.ShowSuccessMessages = showSuccessMessagesCheckbox.Checked;
  36 + Program.Settings.UseAdvancedOutputFileSelector = useAdvancedOutputFileSelector.Checked;
35 37 Program.Settings.SaveSettings();
36 38 }
37 39
2  WinLess/Settings.cs
@@ -19,6 +19,7 @@ public Settings()
19 19 ShowSuccessMessages = false;
20 20 StartWithWindows = true;
21 21 StartMinified = false;
  22 + UseAdvancedOutputFileSelector = false;
22 23 ApplyStartWithWindows();
23 24 }
24 25
@@ -27,6 +28,7 @@ public Settings()
27 28 public bool CompileOnSave { get; set; }
28 29 public bool ShowSuccessMessages { get; set; }
29 30 public bool StartMinified { get; set; }
  31 + public bool UseAdvancedOutputFileSelector { get; set; }
30 32
31 33 private bool startWithWindows;
32 34 public bool StartWithWindows

0 comments on commit 647720e

Please sign in to comment.
Something went wrong with that request. Please try again.