Browse Source

#87 Ctrl-Q for quick save

circular17 3 years ago
parent
commit
7ccfad0815

+ 8 - 0
lazpaint/lazpaintmainform.lfm

@@ -5565,6 +5565,14 @@ object FMain: TFMain
       ImageIndex = 3
       OnExecute = LayerExportExecute
     end
+    object FileQuickSave: TAction
+      Category = 'File'
+      Caption = 'Quick save'
+      Hint = 'Save current file without dialogs'
+      OnExecute = FileQuickSaveExecute
+      OnUpdate = FileSaveUpdate
+      ShortCut = 16465
+    end
   end
   object ColorDialog1: TColorDialog
     Title = 'Choose color'

+ 2 - 0
lazpaint/lazpaintmainform.lrj

@@ -286,6 +286,8 @@
 {"hash":51121525,"name":"tfmain.toolopenedcurve.hint","sourcebytes":[79,112,101,110,101,100,32,99,117,114,118,101],"value":"Opened curve"},
 {"hash":124337662,"name":"tfmain.fileexport.caption","sourcebytes":[69,120,112,111,114,116,46,46,46],"value":"Export..."},
 {"hash":124337662,"name":"tfmain.layerexport.hint","sourcebytes":[69,120,112,111,114,116,46,46,46],"value":"Export..."},
+{"hash":164762421,"name":"tfmain.filequicksave.caption","sourcebytes":[81,117,105,99,107,32,115,97,118,101],"value":"Quick save"},
+{"hash":215358547,"name":"tfmain.filequicksave.hint","sourcebytes":[83,97,118,101,32,99,117,114,114,101,110,116,32,102,105,108,101,32,119,105,116,104,111,117,116,32,100,105,97,108,111,103,115],"value":"Save current file without dialogs"},
 {"hash":66536946,"name":"tfmain.colordialog1.title","sourcebytes":[67,104,111,111,115,101,32,99,111,108,111,114],"value":"Choose color"},
 {"hash":315429,"name":"tfmain.menufile.caption","sourcebytes":[70,105,108,101],"value":"File"},
 {"hash":167619026,"name":"tfmain.itemuseimagebrowser.caption","sourcebytes":[85,115,101,32,105,109,97,103,101,32,98,114,111,119,115,101,114],"value":"Use image browser"},

+ 13 - 1
lazpaint/lazpaintmainform.pas

@@ -24,6 +24,7 @@ type
   { TFMain }
 
   TFMain = class(TForm)
+    FileQuickSave: TAction;
     SVGRasterImageList1: TBGRAImageList;
     Panel_TextMore: TPanel;
     SVGImageList1: TBGRASVGImageList;
@@ -481,6 +482,7 @@ type
     procedure FileExportExecute(Sender: TObject);
     procedure FileImport3DUpdate(Sender: TObject);
     procedure FilePrintExecute(Sender: TObject);
+    procedure FileQuickSaveExecute(Sender: TObject);
     procedure FileRememberSaveFormatExecute(Sender: TObject);
     procedure FileRunScriptExecute(Sender: TObject);
     procedure FileSaveAsInSameFolderExecute(Sender: TObject);
@@ -1597,7 +1599,7 @@ end;
 function TFMain.ScriptFileSave(AVars: TVariableSet): TScriptResult;
 begin
   if (Image.CurrentFilenameUTF8 = '') or not Image.AbleToSaveAsUTF8(Image.CurrentFilenameUTF8) then
-    result := Scripting.CallScriptFunction('FileSaveAs', True) else
+    result := Scripting.CallScriptFunction('FileSaveAs', True, AVars) else
     begin
       AskMergeSelection(rsSave);
       try
@@ -1737,6 +1739,7 @@ end;
 procedure TFMain.FileSaveUpdate(Sender: TObject);
 begin
    FileSave.Enabled := image.IsFileModified;
+   FileQuickSave.Enabled := image.IsFileModified;
 end;
 
 procedure TFMain.FilterAnyExecute(Sender: TObject);
@@ -3560,6 +3563,15 @@ begin
   LazPaintInstance.ShowPrintDlg;
 end;
 
+procedure TFMain.FileQuickSaveExecute(Sender: TObject);
+var params: TVariableSet;
+begin
+  params := TVariableSet.Create('FileSave');
+  params.Booleans['SkipOptions'] := true;
+  Scripting.CallScriptFunction(params);
+  params.Free;
+end;
+
 procedure TFMain.FileRememberSaveFormatExecute(Sender: TObject);
 begin
   FileRememberSaveFormat.Checked := not FileRememberSaveFormat.Checked;

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.ar.po

@@ -841,6 +841,14 @@ msgstr "فتح ملف موجود"
 msgid "Print..."
 msgstr "طباعة..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.bg.po

@@ -838,6 +838,14 @@ msgstr "Отварянето на съществуващ файл"
 msgid "Print..."
 msgstr "Разпечатване..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.cs.po

@@ -843,6 +843,14 @@ msgstr "Otevřít existující soubor"
 msgid "Print..."
 msgstr "Tisk..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.de.po

@@ -851,6 +851,14 @@ msgstr "Datei öffnen"
 msgid "Print..."
 msgstr "Drucken..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.es.po

@@ -842,6 +842,14 @@ msgstr "Abrir archivo existente"
 msgid "Print..."
 msgstr "Imprimir..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.fi.po

@@ -830,6 +830,14 @@ msgstr "Avaa tiedosto"
 msgid "Print..."
 msgstr "Tulosta..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.fr.po

@@ -841,6 +841,14 @@ msgstr "Ouvrir un fichier existant"
 msgid "Print..."
 msgstr "Imprimer..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.it.po

@@ -829,6 +829,14 @@ msgstr "Apri un file esistente"
 msgid "Print..."
 msgstr "Stampa"
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.ja.po

@@ -839,6 +839,14 @@ msgstr "既存ファイルを開く"
 msgid "Print..."
 msgstr ""
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.kab.po

@@ -843,6 +843,14 @@ msgstr "Ldi afaylu yellan"
 msgid "Print..."
 msgstr "Siggez..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.lv.po

@@ -848,6 +848,14 @@ msgstr "Atvērt esošu attēlu"
 msgid "Print..."
 msgstr "Izdrukāt ..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.nl.po

@@ -866,6 +866,14 @@ msgstr "Bestaand bestand openen"
 msgid "Print..."
 msgstr "Print..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.pl.po

@@ -851,6 +851,14 @@ msgstr "Otwórz istniejący plik"
 msgid "Print..."
 msgstr "Drukuj..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.pot

@@ -791,6 +791,14 @@ msgstr ""
 msgid "Print..."
 msgstr ""
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgid "Quit"
 msgstr ""

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.pt_BR.po

@@ -840,6 +840,14 @@ msgstr "Abrir arquivo existente"
 msgid "Print..."
 msgstr "Imprimir..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 10 - 1
lazpaint/release/bin/i18n/lazpaint.ru.po

@@ -833,6 +833,14 @@ msgstr "Открыть существующий файл"
 msgid "Print..."
 msgstr "Печать..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"
@@ -3741,4 +3749,5 @@ msgstr "Увеличить размер стопки слоёв"
 #: uresourcestrings.rszoomlayerstackout
 msgctxt "uresourcestrings.rszoomlayerstackout"
 msgid "Zoom layer stack out"
-msgstr "Увеличить размер стопки слоёв"
+msgstr "Увеличить размер стопки слоёв"
+

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.sv.po

@@ -840,6 +840,14 @@ msgstr "Öppna befintlig fil"
 msgid "Print..."
 msgstr "Skriva ut..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"

+ 8 - 0
lazpaint/release/bin/i18n/lazpaint.zh_CN.po

@@ -842,6 +842,14 @@ msgstr "打开文件"
 msgid "Print..."
 msgstr "打印..."
 
+#: tfmain.filequicksave.caption
+msgid "Quick save"
+msgstr ""
+
+#: tfmain.filequicksave.hint
+msgid "Save current file without dialogs"
+msgstr ""
+
 #: tfmain.filequit.hint
 msgctxt "TFMAIN.FILEQUIT.HINT"
 msgid "Quit"