From 3ee2e917abd1f6906ca43ee3f7b89d25a0dec05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Tue, 17 Sep 2024 18:21:58 -0300 Subject: [PATCH] Added Image/Go to/. New translations. --- src/docs/HISTORY.md | 4 ++++ src/lib/mrvFl/mrvCallbacks.cpp | 10 ++++++++++ src/lib/mrvFl/mrvCallbacks.h | 1 + src/lib/mrvUI/mrvMenus.cpp | 11 +++++++++++ src/po/de.po | 3 +++ src/po/en.po | 3 +++ src/po/es.po | 3 +++ src/po/fr.po | 3 +++ src/po/hi_IN.po | 3 +++ src/po/it.po | 3 +++ src/po/messages.pot | 3 +++ src/po/pt.po | 3 +++ src/po/zh-CN.po | 3 +++ 13 files changed, 53 insertions(+) diff --git a/src/docs/HISTORY.md b/src/docs/HISTORY.md index f4281de1c..4bb69e36d 100644 --- a/src/docs/HISTORY.md +++ b/src/docs/HISTORY.md @@ -28,6 +28,10 @@ v1.2.8 was on. - Made Status Bar error/warnings remain longer (8 seconds instead of 5). - Fixed a precision issue on Windows with arbitrary scalings like 115%. +- Added Image/Previous Limited and Image/Next Limited to go from previous to + next images, without looping. +- Added Image/Go to/ to switch from one clip to the next without having + to bring up the Files Panel. - Made UI at start up wider to account for new menus and new language translations. diff --git a/src/lib/mrvFl/mrvCallbacks.cpp b/src/lib/mrvFl/mrvCallbacks.cpp index 1482a5206..462cc5a81 100644 --- a/src/lib/mrvFl/mrvCallbacks.cpp +++ b/src/lib/mrvFl/mrvCallbacks.cpp @@ -275,6 +275,16 @@ namespace mrv model->next(); } + void goto_file_cb(Fl_Widget* w, void* data) + { + size_t Aindex = (size_t) data; + auto model = App::app->filesModel(); + auto numFiles = model->observeFiles()->getSize(); + if (Aindex < 0 || Aindex >= numFiles) + return; + model->setA(Aindex); + } + static std::string lastSavedFile; static mrv::SaveOptions lastSavedOptions; diff --git a/src/lib/mrvFl/mrvCallbacks.h b/src/lib/mrvFl/mrvCallbacks.h index 105cd9491..faf131acf 100644 --- a/src/lib/mrvFl/mrvCallbacks.h +++ b/src/lib/mrvFl/mrvCallbacks.h @@ -60,6 +60,7 @@ namespace mrv void next_file_cb(Fl_Widget* w, ViewerUI* ui); void previous_file_limited_cb(Fl_Widget* w, ViewerUI* ui); void next_file_limited_cb(Fl_Widget* w, ViewerUI* ui); + void goto_file_cb(Fl_Widget* w, void* idx); void exit_cb(Fl_Widget* w, ViewerUI* ui); diff --git a/src/lib/mrvUI/mrvMenus.cpp b/src/lib/mrvUI/mrvMenus.cpp index 5c0c88cab..e4f908794 100644 --- a/src/lib/mrvUI/mrvMenus.cpp +++ b/src/lib/mrvUI/mrvMenus.cpp @@ -1118,6 +1118,17 @@ namespace mrv menu->add( _("Image/Previous Limited"), kPreviousImageLimited.hotkey(), (Fl_Callback*)previous_file_limited_cb, ui); + + for (size_t i = 0; i < numFiles; ++i) + { + const auto& path = files[i]->path; + fileName = path.getBaseName() + path.getNumber() + + path.getExtension(); + snprintf(buf, 256, _("Image/Go to/%s"), fileName.c_str()); + void* ptr = nullptr; + ptr = (void*)i; + menu->add(buf, 0, (Fl_Callback*)goto_file_cb, ptr); + } } if (has_version) diff --git a/src/po/de.po b/src/po/de.po index 9047db337..61103c4b5 100644 --- a/src/po/de.po +++ b/src/po/de.po @@ -3909,6 +3909,9 @@ msgstr "Bild/Zurck" msgid "Image/Previous Limited" msgstr "Bild/Früher Begrenzt" +msgid "Image/Go to/%s" +msgstr "Bild/Gehen Sie zu/%s" + msgid "Image/Version/First" msgstr "Bild/Fassung/Zuerst" diff --git a/src/po/en.po b/src/po/en.po index e719bba4c..ce94ed2b6 100644 --- a/src/po/en.po +++ b/src/po/en.po @@ -3929,6 +3929,9 @@ msgstr "Image/Previous" msgid "Image/Previous Limited" msgstr "Image/Previous Limited" +msgid "Image/Go to/%s" +msgstr "Image/Go to/%s" + msgid "Image/Version/First" msgstr "Image/Version/First" diff --git a/src/po/es.po b/src/po/es.po index ca96164f4..eefd80193 100644 --- a/src/po/es.po +++ b/src/po/es.po @@ -3985,6 +3985,9 @@ msgstr "Imagen/Previa" msgid "Image/Previous Limited" msgstr "Imagen/Anterior Limitado" +msgid "Image/Go to/%s" +msgstr "Imagen/Ve a/%s" + msgid "Image/Version/First" msgstr "Imagen/Versión/Primera" diff --git a/src/po/fr.po b/src/po/fr.po index a58343990..4acd95c95 100644 --- a/src/po/fr.po +++ b/src/po/fr.po @@ -3911,6 +3911,9 @@ msgstr "Image/Précédent" msgid "Image/Previous Limited" msgstr "Image/Précédent Limité" +msgid "Image/Go to/%s" +msgstr "Image/Allez-y./%s" + msgid "Image/Version/First" msgstr "Image/Version/Première" diff --git a/src/po/hi_IN.po b/src/po/hi_IN.po index b8de659be..a51fedf72 100644 --- a/src/po/hi_IN.po +++ b/src/po/hi_IN.po @@ -3910,6 +3910,9 @@ msgstr "छवि/पिछला" msgid "Image/Previous Limited" msgstr "छवि/पिछला सीमा" +msgid "Image/Go to/%s" +msgstr "छवि/यहाँ जाएँ/%s" + msgid "Image/Version/First" msgstr "छवि/संस्करण/प्रथम" diff --git a/src/po/it.po b/src/po/it.po index 97ba05f21..463d479c7 100644 --- a/src/po/it.po +++ b/src/po/it.po @@ -3938,6 +3938,9 @@ msgstr "Immagine/Precedente" msgid "Image/Previous Limited" msgstr "Immagine/Precedente limitato" +msgid "Image/Go to/%s" +msgstr "Immagine/Vai a/%s" + msgid "Image/Version/First" msgstr "Immagine/Versione/Prima" diff --git a/src/po/messages.pot b/src/po/messages.pot index 75fa2481d..52c6b817f 100644 --- a/src/po/messages.pot +++ b/src/po/messages.pot @@ -3618,6 +3618,9 @@ msgstr "" msgid "Image/Previous Limited" msgstr "" +msgid "Image/Go to/%s" +msgstr "" + msgid "Image/Version/First" msgstr "" diff --git a/src/po/pt.po b/src/po/pt.po index 62c418ff7..4829cc66b 100644 --- a/src/po/pt.po +++ b/src/po/pt.po @@ -3904,6 +3904,9 @@ msgstr "Imagem/Anterior" msgid "Image/Previous Limited" msgstr "Imagem/Anterior Limitado" +msgid "Image/Go to/%s" +msgstr "Imagem/Vá para/%s" + msgid "Image/Version/First" msgstr "Imagem/Verso/Primeiro" diff --git a/src/po/zh-CN.po b/src/po/zh-CN.po index 79c3312cd..dd144557c 100644 --- a/src/po/zh-CN.po +++ b/src/po/zh-CN.po @@ -3862,6 +3862,9 @@ msgstr "图像/上一个" msgid "Image/Previous Limited" msgstr "图像/原有限公司" +msgid "Image/Go to/%s" +msgstr "图像/转到/%s" + msgid "Image/Version/First" msgstr "图像/版本/第一个"