Skip to content

Commit 9556f14

Browse files
committed
Add option to enable clipboard patching only for images
Closes #88
1 parent b1dbace commit 9556f14

File tree

9 files changed

+88
-3
lines changed

9 files changed

+88
-3
lines changed

PasteIntoFile/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
<setting name="trayPatchingEnabled" serializeAs="String">
4141
<value>False</value>
4242
</setting>
43+
<setting name="trayPatchingEnabledOnlyImageLike" serializeAs="String">
44+
<value>False</value>
45+
</setting>
4346
<setting name="updateLatestVersion" serializeAs="String">
4447
<value />
4548
</setting>

PasteIntoFile/Main.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ public static IDataObject PatchedClipboardContents() {
370370
var ext = Dialog.determineExtension(clipData);
371371
var contentToSave = clipData.ForExtension(ext);
372372
if (contentToSave == null) return null;
373+
if (Settings.Default.trayPatchingEnabledOnlyImageLike && !(contentToSave is ImageLikeContent)) return null;
373374

374375
// Save clipboard content to temporary file
375376
var dirname = Path.Combine(Path.GetTempPath(), "PasteIntoFile");

PasteIntoFile/Properties/Resources.Designer.cs

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

PasteIntoFile/Properties/Resources.de.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,7 @@ Allows to keep application window always on top (in foreground of other windows)
318318
<data name="str_preview_calendar" xml:space="preserve">
319319
<value>Kalender Vorschau ({0} Termin(e))</value>
320320
</data>
321+
<data name="str_wizard_tray_patching_img_only" xml:space="preserve">
322+
<value>nur für Bilder</value>
323+
</data>
321324
</root>

PasteIntoFile/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,7 @@ Allows to keep application window always on top (in foreground of other windows)
330330
<data name="str_preview_calendar" xml:space="preserve">
331331
<value>Calendar preview ({0} event(s))</value>
332332
</data>
333+
<data name="str_wizard_tray_patching_img_only" xml:space="preserve">
334+
<value>only for images</value>
335+
</data>
333336
</root>

PasteIntoFile/Properties/Settings.Designer.cs

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

PasteIntoFile/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
<Setting Name="trayPatchingEnabled" Type="System.Boolean" Scope="User">
3030
<Value Profile="(Default)">False</Value>
3131
</Setting>
32+
<Setting Name="trayPatchingEnabledOnlyImageLike" Type="System.Boolean" Scope="User">
33+
<Value Profile="(Default)">False</Value>
34+
</Setting>
3235
<Setting Name="updateLatestVersion" Type="System.String" Scope="User">
3336
<Value Profile="(Default)" />
3437
</Setting>

PasteIntoFile/Wizard.Designer.cs

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

PasteIntoFile/Wizard.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ private void ReloadUi() {
3434
autostartCheckBox.Checked = RegistryUtil.IsAutostartRegistered();
3535
patchingCheckBox.Checked = Settings.Default.trayPatchingEnabled;
3636
patchingCheckBox.Enabled = autostartCheckBox.Checked;
37+
patchingCheckBoxImg.Enabled = patchingCheckBox.Checked;
3738

3839
// Menu
3940
UpdateLanguageMenu();
@@ -174,6 +175,15 @@ private void ChkAutostart_CheckedChanged(object sender, EventArgs e) {
174175
private void ChkPatching_CheckedChanged(object sender, EventArgs e) {
175176
if (Settings.Default.trayPatchingEnabled != patchingCheckBox.Checked) {
176177
Settings.Default.trayPatchingEnabled = patchingCheckBox.Checked;
178+
patchingCheckBoxImg.Enabled = patchingCheckBox.Checked;
179+
Settings.Default.Save();
180+
// no SavedAnimation so as not to give the feeling this would take effect immediately
181+
}
182+
}
183+
184+
private void ChkPatchingImg_CheckedChanged(object sender, EventArgs e) {
185+
if (Settings.Default.trayPatchingEnabledOnlyImageLike != patchingCheckBoxImg.Checked) {
186+
Settings.Default.trayPatchingEnabledOnlyImageLike = patchingCheckBoxImg.Checked;
177187
Settings.Default.Save();
178188
// no SavedAnimation so as not to give the feeling this would take effect immediately
179189
}

0 commit comments

Comments
 (0)