Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ dotnet publish -c Release # Publish as single-file executable

There are no test projects or linting commands configured yet.

### Localization scripts

Translation scripts live in `src/Sic/locale/scripts/`. Run them with PowerShell:

```bash
# Compile .po files to .mo (required after editing translations)
powershell -ExecutionPolicy Bypass -File src/Sic/locale/scripts/compile-translations.ps1

# Extract new translatable strings from source into messages.pot
powershell -ExecutionPolicy Bypass -File src/Sic/locale/scripts/Extract-Strings.ps1

# Merge new strings into existing .po files (preserves existing translations)
powershell -ExecutionPolicy Bypass -File src/Sic/locale/scripts/Update-Translations.ps1
```

After editing `.po` files, always run `compile-translations.ps1` to regenerate the `.mo` binaries.

## Architecture

**Entry point:** `src/Sic/Program.cs` — Sets up Serilog logging. If CLI arguments are present, runs headless conversion via `System.CommandLine`; otherwise loads config and launches the WinForms `MainWindow`.
Expand Down
22 changes: 21 additions & 1 deletion src/Sic/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ private void SetupEventHandlers() {
// Keyboard
KeyPreview = true;
KeyDown += MainWindow_KeyDown;

// Closing
FormClosing += MainWindow_FormClosing;
}

private void PopulateFormatComboBox() {
Expand Down Expand Up @@ -726,7 +729,10 @@ private async void ImageListView_DragDrop(object? sender, DragEventArgs e) {
}

private void MainWindow_KeyDown(object? sender, KeyEventArgs e) {
if (e.KeyCode == Keys.Delete && imageListView.Focused) {
if (e.KeyCode == Keys.Escape) {
Close();
e.Handled = true;
} else if (e.KeyCode == Keys.Delete && imageListView.Focused) {
RemoveMenuItem_Click(sender, e);
e.Handled = true;
} else if (e.Control && e.KeyCode == Keys.V) {
Expand All @@ -735,6 +741,20 @@ private void MainWindow_KeyDown(object? sender, KeyEventArgs e) {
}
}

private void MainWindow_FormClosing(object? sender, FormClosingEventArgs e) {
if (_imageItems.Count > 0 && Config.General.ConfirmExitWithQueue) {
var result = MessageBox.Show(
_("There are images in the queue. Are you sure you want to exit?"),
_("Confirm Exit"),
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);

if (result == DialogResult.No) {
e.Cancel = true;
}
}
}

private async void HandlePaste() {
if (Clipboard.ContainsFileDropList()) {
var files = Clipboard.GetFileDropList();
Expand Down
30 changes: 23 additions & 7 deletions src/Sic/SettingsDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/Sic/SettingsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public SettingsDialog() {

private void LoadSettings() {
outputFolderTextBox.Text = Config.General.OutputFolder;
confirmExitCheckBox.Checked = Config.General.ConfirmExitWithQueue;

// "System" always first — uses the OS language
var systemDisplayName = _("System");
Expand Down Expand Up @@ -108,6 +109,7 @@ private void OkButton_Click(object? sender, EventArgs e) {
}

Config.General.OutputFolder = folder;
Config.General.ConfirmExitWithQueue = confirmExitCheckBox.Checked;
var selectedDisplay = languageComboBox.SelectedItem as string;
Config.General.Language = selectedDisplay != null && _languageMap.TryGetValue(selectedDisplay, out var code)
? code
Expand Down
1 change: 1 addition & 0 deletions src/Sic/Utils/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class SectionGeneral {
public string Language { get; set; } = "System";
public string OutputFolder { get; set; } = App.DefaultOutputFolder;
public string LastInputFolder { get; set; } = "";
public bool ConfirmExitWithQueue { get; set; } = true;
}

#endregion
Expand Down
12 changes: 10 additions & 2 deletions src/Sic/help/de/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ <h2>Inhalt</h2>
<li><a href="#resizing">Größe ändern</a></li>
<li><a href="#multi-size-ico">Mehrgrößen-ICO-Dateien erstellen</a></li>
<li><a href="#settings">Einstellungen</a></li>
<li><a href="#updates">Softwareaktualisierungen</a></li>
<li><a href="#cli">Kommandozeilenverwendung</a></li>
<li><a href="#keyboard-shortcuts">Tastenkombinationen</a></li>
<li><a href="#supported-formats">Unterstützte Formate</a></li>
Expand All @@ -137,7 +138,7 @@ <h3>Hauptfenster</h3>
<li><strong>Datei</strong> — Bilder hinzufügen (aus Dateien, Ordnern oder per Link), Einstellungen öffnen oder die Anwendung beenden.</li>
<li><strong>Bearbeiten</strong> — Ausgewählte oder alle Bilder aus der Warteschlange entfernen. Dieses Menü ist deaktiviert, wenn die Warteschlange leer ist.</li>
<li><strong>Konvertieren</strong> — Konvertierung starten oder ein Mehrgrößen-ICO erstellen. Dieses Menü ist deaktiviert, wenn die Warteschlange leer ist.</li>
<li><strong>Hilfe</strong> — Dieses Handbuch öffnen, spenden oder den Info-Dialog anzeigen.</li>
<li><strong>Hilfe</strong> — Dieses Handbuch öffnen, nach Softwareaktualisierungen suchen, spenden oder den Info-Dialog anzeigen.</li>
</ul>
</dd>

Expand Down Expand Up @@ -238,9 +239,16 @@ <h2 id="settings">Einstellungen</h2>

<dt>Sprache</dt>
<dd>Wählen Sie die Sprache der Benutzeroberfläche. Wählen Sie <em>System</em>, um der Windows-Spracheinstellung zu folgen.</dd>

<dt>Beenden bestätigen, wenn die Warteschlange nicht leer ist</dt>
<dd>Wenn aktiviert (Standardeinstellung), fragt SIC! vor dem Schließen nach einer Bestätigung, sofern sich noch Bilder in der Warteschlange befinden. Deaktivieren Sie diese Option, um ohne Nachfrage zu beenden.</dd>
</dl>
<p>Einstellungen werden in <code>Sic.cfg</code> innerhalb des Anwendungsdatenverzeichnisses gespeichert (den genauen Speicherort finden Sie unter <a href="#installation">Installationsmodi</a>).</p>

<h2 id="updates">Softwareaktualisierungen</h2>
<p>SIC! kann automatisch nach neuen Versionen suchen. Eine Aktualisierungsprüfung erfolgt beim Start und dann alle 24 Stunden, solange die Anwendung läuft. Sie können auch manuell über <strong>Hilfe > Nach Updates suchen</strong> prüfen.</p>
<p>Wenn eine Aktualisierung verfügbar ist, zeigt SIC! einen Dialog mit der neuen Versionsnummer an. Sie können wählen, ob Sie aktualisieren, diese Version überspringen oder später erinnert werden möchten. Wenn Sie auf <strong>Aktualisieren</strong> klicken, wird die neue Version automatisch heruntergeladen. Nach Abschluss des Downloads erscheint ein Bestätigungsdialog mit den Schaltflächen <strong>Installieren</strong> und <strong>Abbrechen</strong>. Durch Klicken auf <strong>Installieren</strong> wird die Installation gestartet.</p>

<h2 id="cli">Kommandozeilenverwendung</h2>
<p>SIC! kann auch über die Kommandozeile ohne Öffnen der grafischen Oberfläche verwendet werden. Dies ist nützlich für Skripte oder Stapelverarbeitung.</p>
<pre>sic -i input.png -o output.jpg
Expand Down Expand Up @@ -284,7 +292,7 @@ <h2 id="keyboard-shortcuts">Tastenkombinationen</h2>
<tr><td>Benutzerhandbuch</td><td><kbd>F1</kbd></td></tr>
<tr><td>Über SIC!</td><td><kbd>Umschalt+F1</kbd></td></tr>
<tr><td>Spenden</td><td><kbd>Strg+Umschalt+D</kbd></td></tr>
<tr><td>Beenden</td><td><kbd>Alt+F4</kbd></td></tr>
<tr><td>Beenden</td><td><kbd>Escape</kbd> / <kbd>Alt+F4</kbd></td></tr>
</tbody>
</table>

Expand Down
12 changes: 10 additions & 2 deletions src/Sic/help/en/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ <h2>Contents</h2>
<li><a href="#resizing">Resizing</a></li>
<li><a href="#multi-size-ico">Creating multi-size ICO files</a></li>
<li><a href="#settings">Settings</a></li>
<li><a href="#updates">Software updates</a></li>
<li><a href="#cli">Command-line usage</a></li>
<li><a href="#keyboard-shortcuts">Keyboard shortcuts</a></li>
<li><a href="#supported-formats">Supported formats</a></li>
Expand All @@ -137,7 +138,7 @@ <h3>Main window</h3>
<li><strong>File</strong> — add images (from files, folders, or links), open Settings, or exit the application.</li>
<li><strong>Edit</strong> — remove selected or all images from the queue. This menu is disabled when the queue is empty.</li>
<li><strong>Convert</strong> — run conversion or create a multi-size ICO. This menu is disabled when the queue is empty.</li>
<li><strong>Help</strong> — open this manual, donate, or view the About dialog.</li>
<li><strong>Help</strong> — open this manual, check for software updates, donate, or view the About dialog.</li>
</ul>
</dd>

Expand Down Expand Up @@ -238,9 +239,16 @@ <h2 id="settings">Settings</h2>

<dt>Language</dt>
<dd>Choose the interface language. Select <em>System</em> to follow your Windows language setting.</dd>

<dt>Confirm on exit with non-empty queue</dt>
<dd>When enabled (the default), SIC! asks for confirmation before closing if there are images remaining in the queue. Uncheck this option to exit without a prompt.</dd>
</dl>
<p>Settings are stored in <code>Sic.cfg</code> inside the application data directory (see <a href="#installation">Installation modes</a> for the exact location).</p>

<h2 id="updates">Software updates</h2>
<p>SIC! can check for new versions automatically. An update check runs on startup and then every 24 hours while the application is running. You can also check manually via <strong>Help > Check for Updates</strong>.</p>
<p>When an update is available, SIC! shows a dialog with the new version number. You can choose to update, skip this version, or be reminded later. If you click <strong>Update</strong>, the new version is downloaded automatically. Once the download finishes, a confirmation dialog appears with <strong>Install</strong> and <strong>Cancel</strong> buttons. Clicking <strong>Install</strong> starts the installation.</p>

<h2 id="cli">Command-line usage</h2>
<p>SIC! can also be used from the command line without opening the graphical interface. This is useful for scripting or batch processing.</p>
<pre>sic -i input.png -o output.jpg
Expand Down Expand Up @@ -284,7 +292,7 @@ <h2 id="keyboard-shortcuts">Keyboard shortcuts</h2>
<tr><td>User manual</td><td><kbd>F1</kbd></td></tr>
<tr><td>About SIC!</td><td><kbd>Shift+F1</kbd></td></tr>
<tr><td>Donate</td><td><kbd>Ctrl+Shift+D</kbd></td></tr>
<tr><td>Exit</td><td><kbd>Alt+F4</kbd></td></tr>
<tr><td>Exit</td><td><kbd>Escape</kbd> / <kbd>Alt+F4</kbd></td></tr>
</tbody>
</table>

Expand Down
12 changes: 10 additions & 2 deletions src/Sic/help/fr/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ <h2>Sommaire</h2>
<li><a href="#resizing">Redimensionnement</a></li>
<li><a href="#multi-size-ico">Créer des fichiers ICO multi-tailles</a></li>
<li><a href="#settings">Paramètres</a></li>
<li><a href="#updates">Mises à jour logicielles</a></li>
<li><a href="#cli">Utilisation en ligne de commande</a></li>
<li><a href="#keyboard-shortcuts">Raccourcis clavier</a></li>
<li><a href="#supported-formats">Formats pris en charge</a></li>
Expand All @@ -137,7 +138,7 @@ <h3>Fenêtre principale</h3>
<li><strong>Fichier</strong> — ajouter des images (depuis des fichiers, dossiers ou liens), ouvrir les paramètres ou quitter l'application.</li>
<li><strong>Édition</strong> — supprimer les images sélectionnées ou toutes les images de la file. Ce menu est désactivé lorsque la file est vide.</li>
<li><strong>Convertir</strong> — lancer la conversion ou créer un ICO multi-tailles. Ce menu est désactivé lorsque la file est vide.</li>
<li><strong>Aide</strong> — ouvrir ce manuel, faire un don ou afficher la boîte de dialogue À propos.</li>
<li><strong>Aide</strong> — ouvrir ce manuel, vérifier les mises à jour logicielles, faire un don ou afficher la boîte de dialogue À propos.</li>
</ul>
</dd>

Expand Down Expand Up @@ -238,9 +239,16 @@ <h2 id="settings">Paramètres</h2>

<dt>Langue</dt>
<dd>Choisissez la langue de l'interface. Sélectionnez <em>Système</em> pour suivre le paramètre de langue de Windows.</dd>

<dt>Confirmer la fermeture avec une file non vide</dt>
<dd>Lorsque cette option est activée (par défaut), SIC! demande une confirmation avant de se fermer s'il reste des images dans la file. Décochez cette option pour quitter sans confirmation.</dd>
</dl>
<p>Les paramètres sont stockés dans <code>Sic.cfg</code> à l'intérieur du répertoire de données de l'application (voir <a href="#installation">Modes d'installation</a> pour l'emplacement exact).</p>

<h2 id="updates">Mises à jour logicielles</h2>
<p>SIC! peut vérifier automatiquement la disponibilité de nouvelles versions. Une vérification est effectuée au démarrage, puis toutes les 24 heures tant que l'application est en cours d'exécution. Vous pouvez également vérifier manuellement via <strong>Aide > Vérifier les mises à jour</strong>.</p>
<p>Lorsqu'une mise à jour est disponible, SIC! affiche une boîte de dialogue avec le numéro de la nouvelle version. Vous pouvez choisir de mettre à jour, d'ignorer cette version ou d'être rappelé plus tard. Si vous cliquez sur <strong>Mettre à jour</strong>, la nouvelle version est téléchargée automatiquement. Une fois le téléchargement terminé, une boîte de dialogue de confirmation apparaît avec les boutons <strong>Installer</strong> et <strong>Annuler</strong>. Cliquer sur <strong>Installer</strong> lance l'installation.</p>

<h2 id="cli">Utilisation en ligne de commande</h2>
<p>SIC! peut également être utilisé depuis la ligne de commande sans ouvrir l'interface graphique. C'est utile pour les scripts ou le traitement par lots.</p>
<pre>sic -i input.png -o output.jpg
Expand Down Expand Up @@ -284,7 +292,7 @@ <h2 id="keyboard-shortcuts">Raccourcis clavier</h2>
<tr><td>Manuel utilisateur</td><td><kbd>F1</kbd></td></tr>
<tr><td>À propos de SIC!</td><td><kbd>Maj+F1</kbd></td></tr>
<tr><td>Faire un don</td><td><kbd>Ctrl+Maj+D</kbd></td></tr>
<tr><td>Quitter</td><td><kbd>Alt+F4</kbd></td></tr>
<tr><td>Quitter</td><td><kbd>Escape</kbd> / <kbd>Alt+F4</kbd></td></tr>
</tbody>
</table>

Expand Down
Loading