Skip to content

Commit 87fed71

Browse files
committed
Added support for --pin and --unpin to "Select command" dialog
1 parent 427a9c8 commit 87fed71

File tree

4 files changed

+139
-19
lines changed

4 files changed

+139
-19
lines changed

src/Central.WinForms/SelectCommandDialog.Designer.cs

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Central.WinForms/SelectCommandDialog.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public SelectCommandDialog(FeedUri feedUri)
2727
toolTip.SetToolTip(comboBoxVersion, Commands.Properties.Resources.OptionVersionRange);
2828
toolTip.SetToolTip(comboBoxCommand, Commands.Properties.Resources.OptionCommand);
2929
toolTip.SetToolTip(checkBoxCustomize, Commands.Properties.Resources.OptionCustomize);
30+
toolTip.SetToolTip(checkBoxPin, Commands.Properties.Resources.OptionPin);
31+
toolTip.SetToolTip(checkBoxUnpin, Commands.Properties.Resources.OptionUnpin);
3032
toolTip.SetToolTip(checkBoxRefresh, Commands.Properties.Resources.OptionRefresh);
3133

3234
UpdateLabels(new(), EventArgs.Empty);
@@ -95,6 +97,18 @@ private void UpdateLabels(object sender, EventArgs e)
9597
textBoxCommandLine.Text = GetArgs().Except("--no-wait").Prepend("0install").JoinEscapeArguments();
9698
}
9799

100+
private void checkBoxPin_CheckedChanged(object sender, EventArgs e)
101+
{
102+
if (checkBoxPin.Checked) checkBoxUnpin.Checked = false;
103+
UpdateLabels(sender, e);
104+
}
105+
106+
private void checkBoxUnpin_CheckedChanged(object sender, EventArgs e)
107+
{
108+
if (checkBoxUnpin.Checked) checkBoxPin.Checked = false;
109+
UpdateLabels(sender, e);
110+
}
111+
98112
private void buttonOK_Click(object sender, EventArgs e)
99113
{
100114
CommandUtils.Start(GetArgs().ToArray());
@@ -128,6 +142,12 @@ private IEnumerable<string> GetArgs()
128142
if (checkBoxCustomize.Checked)
129143
yield return "--customize";
130144

145+
if (checkBoxPin.Checked)
146+
yield return "--pin";
147+
148+
if (checkBoxUnpin.Checked)
149+
yield return "--unpin";
150+
131151
if (checkBoxRefresh.Checked)
132152
yield return "--refresh";
133153

src/Central.WinForms/SelectCommandDialog.de.resx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@
7070
<value>&amp;Aktualisieren</value>
7171
<comment>Manually overriden.</comment>
7272
</data>
73+
<data name="checkBoxPin.Text" xml:space="preserve">
74+
<value>Version &amp;festhalten</value>
75+
<comment>Manually overriden.</comment>
76+
</data>
77+
<data name="checkBoxUnpin.Text" xml:space="preserve">
78+
<value>Version &amp;freigeben</value>
79+
<comment>Manually overriden.</comment>
80+
</data>
7381
<data name="groupBoxCommandLine.Text" xml:space="preserve">
7482
<value>Entsprechende Befehlszeile</value>
7583
<comment>Manually overriden.</comment>

src/Central.WinForms/SelectCommandDialog.resx

Lines changed: 91 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
</resheader>
120120
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
121121
<data name="buttonOK.Location" type="System.Drawing.Point, System.Drawing">
122-
<value>267, 226</value>
122+
<value>367, 246</value>
123123
</data>
124124
<data name="&gt;&gt;buttonOK.Name" xml:space="preserve">
125125
<value>buttonOK</value>
@@ -134,7 +134,7 @@
134134
<value>12</value>
135135
</data>
136136
<data name="buttonCancel.Location" type="System.Drawing.Point, System.Drawing">
137-
<value>348, 226</value>
137+
<value>448, 246</value>
138138
</data>
139139
<data name="&gt;&gt;buttonCancel.Name" xml:space="preserve">
140140
<value>buttonCancel</value>
@@ -184,7 +184,7 @@
184184
<value>94, 39</value>
185185
</data>
186186
<data name="comboBoxCommand.Size" type="System.Drawing.Size, System.Drawing">
187-
<value>290, 21</value>
187+
<value>390, 21</value>
188188
</data>
189189
<data name="comboBoxCommand.TabIndex" type="System.Int32, mscorlib">
190190
<value>3</value>
@@ -214,7 +214,7 @@
214214
<value>94, 63</value>
215215
</data>
216216
<data name="labelSummary.Size" type="System.Drawing.Size, System.Drawing">
217-
<value>328, 50</value>
217+
<value>428, 70</value>
218218
</data>
219219
<data name="labelSummary.TabIndex" type="System.Int32, mscorlib">
220220
<value>5</value>
@@ -241,7 +241,7 @@
241241
<value>NoControl</value>
242242
</data>
243243
<data name="labelOptions.Location" type="System.Drawing.Point, System.Drawing">
244-
<value>12, 118</value>
244+
<value>12, 138</value>
245245
</data>
246246
<data name="labelOptions.Size" type="System.Drawing.Size, System.Drawing">
247247
<value>46, 13</value>
@@ -310,7 +310,7 @@
310310
<value>NoControl</value>
311311
</data>
312312
<data name="checkBoxRefresh.Location" type="System.Drawing.Point, System.Drawing">
313-
<value>77, 0</value>
313+
<value>252, 0</value>
314314
</data>
315315
<data name="checkBoxRefresh.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
316316
<value>0, 0, 3, 0</value>
@@ -334,7 +334,7 @@
334334
<value>panelOptions</value>
335335
</data>
336336
<data name="&gt;&gt;checkBoxRefresh.ZOrder" xml:space="preserve">
337-
<value>1</value>
337+
<value>3</value>
338338
</data>
339339
<data name="labelArgs.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
340340
<value>Bottom, Left</value>
@@ -346,7 +346,7 @@
346346
<value>NoControl</value>
347347
</data>
348348
<data name="labelArgs.Location" type="System.Drawing.Point, System.Drawing">
349-
<value>12, 143</value>
349+
<value>12, 163</value>
350350
</data>
351351
<data name="labelArgs.Size" type="System.Drawing.Size, System.Drawing">
352352
<value>60, 13</value>
@@ -373,10 +373,10 @@
373373
<value>Bottom, Left, Right</value>
374374
</data>
375375
<data name="textBoxArgs.Location" type="System.Drawing.Point, System.Drawing">
376-
<value>94, 140</value>
376+
<value>94, 160</value>
377377
</data>
378378
<data name="textBoxArgs.Size" type="System.Drawing.Size, System.Drawing">
379-
<value>328, 20</value>
379+
<value>428, 20</value>
380380
</data>
381381
<data name="textBoxArgs.TabIndex" type="System.Int32, mscorlib">
382382
<value>9</value>
@@ -406,7 +406,7 @@
406406
<value>6, 19</value>
407407
</data>
408408
<data name="textBoxCommandLine.Size" type="System.Drawing.Size, System.Drawing">
409-
<value>398, 20</value>
409+
<value>498, 20</value>
410410
</data>
411411
<data name="textBoxCommandLine.TabIndex" type="System.Int32, mscorlib">
412412
<value>0</value>
@@ -424,10 +424,10 @@
424424
<value>0</value>
425425
</data>
426426
<data name="groupBoxCommandLine.Location" type="System.Drawing.Point, System.Drawing">
427-
<value>12, 171</value>
427+
<value>12, 191</value>
428428
</data>
429429
<data name="groupBoxCommandLine.Size" type="System.Drawing.Size, System.Drawing">
430-
<value>410, 49</value>
430+
<value>510, 49</value>
431431
</data>
432432
<data name="groupBoxCommandLine.TabIndex" type="System.Int32, mscorlib">
433433
<value>10</value>
@@ -450,11 +450,83 @@
450450
<data name="panelOptions.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
451451
<value>Bottom, Left, Right</value>
452452
</data>
453+
<data name="checkBoxPin.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
454+
<value>Bottom, Left</value>
455+
</data>
456+
<data name="checkBoxPin.AutoSize" type="System.Boolean, mscorlib">
457+
<value>True</value>
458+
</data>
459+
<data name="checkBoxPin.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
460+
<value>NoControl</value>
461+
</data>
462+
<data name="checkBoxPin.Location" type="System.Drawing.Point, System.Drawing">
463+
<value>77, 0</value>
464+
</data>
465+
<data name="checkBoxPin.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
466+
<value>0, 0, 3, 0</value>
467+
</data>
468+
<data name="checkBoxPin.Size" type="System.Drawing.Size, System.Drawing">
469+
<value>78, 17</value>
470+
</data>
471+
<data name="checkBoxPin.TabIndex" type="System.Int32, mscorlib">
472+
<value>2</value>
473+
</data>
474+
<data name="checkBoxPin.Text" xml:space="preserve">
475+
<value>&amp;Pin version</value>
476+
</data>
477+
<data name="&gt;&gt;checkBoxPin.Name" xml:space="preserve">
478+
<value>checkBoxPin</value>
479+
</data>
480+
<data name="&gt;&gt;checkBoxPin.Type" xml:space="preserve">
481+
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
482+
</data>
483+
<data name="&gt;&gt;checkBoxPin.Parent" xml:space="preserve">
484+
<value>panelOptions</value>
485+
</data>
486+
<data name="&gt;&gt;checkBoxPin.ZOrder" xml:space="preserve">
487+
<value>1</value>
488+
</data>
489+
<data name="checkBoxUnpin.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
490+
<value>Bottom, Left</value>
491+
</data>
492+
<data name="checkBoxUnpin.AutoSize" type="System.Boolean, mscorlib">
493+
<value>True</value>
494+
</data>
495+
<data name="checkBoxUnpin.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
496+
<value>NoControl</value>
497+
</data>
498+
<data name="checkBoxUnpin.Location" type="System.Drawing.Point, System.Drawing">
499+
<value>158, 0</value>
500+
</data>
501+
<data name="checkBoxUnpin.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
502+
<value>0, 0, 3, 0</value>
503+
</data>
504+
<data name="checkBoxUnpin.Size" type="System.Drawing.Size, System.Drawing">
505+
<value>91, 17</value>
506+
</data>
507+
<data name="checkBoxUnpin.TabIndex" type="System.Int32, mscorlib">
508+
<value>3</value>
509+
</data>
510+
<data name="checkBoxUnpin.Text" xml:space="preserve">
511+
<value>&amp;Unpin version</value>
512+
</data>
513+
<data name="&gt;&gt;checkBoxUnpin.Name" xml:space="preserve">
514+
<value>checkBoxUnpin</value>
515+
</data>
516+
<data name="&gt;&gt;checkBoxUnpin.Type" xml:space="preserve">
517+
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
518+
</data>
519+
<data name="&gt;&gt;checkBoxUnpin.Parent" xml:space="preserve">
520+
<value>panelOptions</value>
521+
</data>
522+
<data name="&gt;&gt;checkBoxUnpin.ZOrder" xml:space="preserve">
523+
<value>2</value>
524+
</data>
453525
<data name="panelOptions.Location" type="System.Drawing.Point, System.Drawing">
454-
<value>94, 116</value>
526+
<value>94, 136</value>
455527
</data>
456528
<data name="panelOptions.Size" type="System.Drawing.Size, System.Drawing">
457-
<value>328, 18</value>
529+
<value>428, 18</value>
458530
</data>
459531
<data name="panelOptions.TabIndex" type="System.Int32, mscorlib">
460532
<value>7</value>
@@ -478,7 +550,7 @@
478550
<value>94, 12</value>
479551
</data>
480552
<data name="comboBoxVersion.Size" type="System.Drawing.Size, System.Drawing">
481-
<value>290, 21</value>
553+
<value>390, 21</value>
482554
</data>
483555
<data name="comboBoxVersion.TabIndex" type="System.Int32, mscorlib">
484556
<value>1</value>
@@ -535,7 +607,7 @@
535607
<value>Segoe UI, 12pt</value>
536608
</data>
537609
<data name="buttonReload.Location" type="System.Drawing.Point, System.Drawing">
538-
<value>390, 12</value>
610+
<value>490, 12</value>
539611
</data>
540612
<data name="buttonReload.Size" type="System.Drawing.Size, System.Drawing">
541613
<value>32, 50</value>
@@ -568,7 +640,7 @@
568640
<value>6, 13</value>
569641
</data>
570642
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
571-
<value>434, 261</value>
643+
<value>534, 281</value>
572644
</data>
573645
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
574646
<value>320, 240</value>
@@ -586,6 +658,6 @@
586658
<value>SelectCommandDialog</value>
587659
</data>
588660
<data name="&gt;&gt;$this.Type" xml:space="preserve">
589-
<value>NanoByte.Common.Controls.OKCancelDialog, NanoByte.Common.WinForms, Version=2.13.4.0, Culture=neutral, PublicKeyToken=3090a828a7702cec</value>
661+
<value>NanoByte.Common.Controls.OKCancelDialog, NanoByte.Common.WinForms, Version=2.20.1.0, Culture=neutral, PublicKeyToken=3090a828a7702cec</value>
590662
</data>
591663
</root>

0 commit comments

Comments
 (0)