diff --git a/Data/servers.xml b/Data/servers.xml index 624229bb..280e8142 100644 --- a/Data/servers.xml +++ b/Data/servers.xml @@ -209,7 +209,7 @@ diff --git a/Lang/imageuploader.pot b/Lang/imageuploader.pot index 37e9091e..4a3f6720 100644 --- a/Lang/imageuploader.pot +++ b/Lang/imageuploader.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: imageuploader\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-07 10:41+0300\n" +"POT-Creation-Date: 2024-12-07 17:14+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -381,16 +381,17 @@ msgstr "" msgid "Are you sure you want to delete profile '%s'?" msgstr "" +#: ../Source/Gui/Dialogs/HistoryWindow.cpp:386 +#, c-format +msgid "Are you sure you want to delete the file '%s' from the server?" +msgstr "" + #: ../Source/Gui/Dialogs/LoginDlg.cpp:168 msgid "" "Are you sure you want to delete this account from Image Uploader's internal " "list?" msgstr "" -#: ../Source/Gui/Dialogs/HistoryWindow.cpp:381 -msgid "Are you sure?" -msgstr "" - #: ../Source/ImageEditor/Gui/ImageEditorWindow.cpp:934 msgid "Arrow" msgstr "" @@ -1054,7 +1055,7 @@ msgstr "" msgid "Delete file from server" msgstr "" -#: ../Source/Gui/Dialogs/HistoryWindow.cpp:381 +#: ../Source/Gui/Dialogs/HistoryWindow.cpp:389 msgid "Deleting the file from the server" msgstr "" @@ -1618,7 +1619,7 @@ msgstr "" msgid "History" msgstr "" -#: ../Source/Gui/Dialogs/HistoryWindow.cpp:494 +#: ../Source/Gui/Dialogs/HistoryWindow.cpp:499 msgid "History has been cleared successfully." msgstr "" diff --git a/Lang/locale/ru/LC_MESSAGES/imageuploader.po b/Lang/locale/ru/LC_MESSAGES/imageuploader.po index b8034881..7b70aad5 100644 --- a/Lang/locale/ru/LC_MESSAGES/imageuploader.po +++ b/Lang/locale/ru/LC_MESSAGES/imageuploader.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: imageuploader\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-07 10:41+0300\n" -"PO-Revision-Date: 2024-12-07 10:42+0300\n" +"POT-Creation-Date: 2024-12-07 17:14+0300\n" +"PO-Revision-Date: 2024-12-07 17:15+0300\n" "Last-Translator: \n" "Language-Team: zenden2k@gmail.com\n" "Language: ru\n" @@ -397,6 +397,11 @@ msgstr "Вы действительно хотите выйти из прогр msgid "Are you sure you want to delete profile '%s'?" msgstr "Вы действительно хотите удалить профиль '%s'?" +#: ../Source/Gui/Dialogs/HistoryWindow.cpp:386 +#, c-format +msgid "Are you sure you want to delete the file '%s' from the server?" +msgstr "Вы действительно хотите удалить файл '%s' с сервера?" + #: ../Source/Gui/Dialogs/LoginDlg.cpp:168 msgid "" "Are you sure you want to delete this account from Image Uploader's internal " @@ -404,10 +409,6 @@ msgid "" msgstr "" "Вы действительно хотите удалить этот аккаунт из внутреннего списка программы?" -#: ../Source/Gui/Dialogs/HistoryWindow.cpp:381 -msgid "Are you sure?" -msgstr "Вы уверены?" - #: ../Source/ImageEditor/Gui/ImageEditorWindow.cpp:934 msgid "Arrow" msgstr "Стрелка" @@ -1087,7 +1088,7 @@ msgstr "Удалить аккаунт" msgid "Delete file from server" msgstr "Удалить файл с сервера" -#: ../Source/Gui/Dialogs/HistoryWindow.cpp:381 +#: ../Source/Gui/Dialogs/HistoryWindow.cpp:389 msgid "Deleting the file from the server" msgstr "Удаление файла с сервера" @@ -1659,7 +1660,7 @@ msgstr "Подсвечивающий маркер" msgid "History" msgstr "История" -#: ../Source/Gui/Dialogs/HistoryWindow.cpp:494 +#: ../Source/Gui/Dialogs/HistoryWindow.cpp:499 msgid "History has been cleared successfully." msgstr "История была успешно очищена." @@ -3390,6 +3391,9 @@ msgstr "Переводчикам:" msgid "unknown server" msgstr "неизвестный сервер" +#~ msgid "Are you sure?" +#~ msgstr "Вы уверены?" + #~ msgid "Add folder" #~ msgstr "Добавить папку" diff --git a/Source/Gui/Dialogs/FloatingWindow.cpp b/Source/Gui/Dialogs/FloatingWindow.cpp index 5bcdc041..04ee27cc 100644 --- a/Source/Gui/Dialogs/FloatingWindow.cpp +++ b/Source/Gui/Dialogs/FloatingWindow.cpp @@ -941,7 +941,8 @@ void CFloatingWindow::ShowImageUploadedMessage(UploadTask* task, const CString& auto generator = factory.createOutputGenerator(generatorId, codeType); generator->setPreferDirectLinks(settings->UseDirectLinks); generator->setItemsPerLine(settings->ThumbsPerLine); - generator->setGroupByFile(settings->GroupByFilename); + generator->setGroupByFile(settings->GroupByFilename); + generator->setShortenUrl(task->serverProfile().shortenLinks()); if (generatorId == gidXmlTemplate) { int templateIndex = settings->CodeType - 4; diff --git a/Source/Gui/Dialogs/HistoryWindow.cpp b/Source/Gui/Dialogs/HistoryWindow.cpp index 494f0eb4..4b2eafd1 100644 --- a/Source/Gui/Dialogs/HistoryWindow.cpp +++ b/Source/Gui/Dialogs/HistoryWindow.cpp @@ -378,11 +378,16 @@ LRESULT CHistoryWindow::OnDeleteFileOnServer(WORD wNotifyCode, WORD wID, HWND hW { TreeItem* item = m_treeView.selectedItem(); if (!item) return 0; - if (LocalizedMessageBox(TR("Are you sure?"), TR("Deleting the file from the server"), MB_ICONQUESTION|MB_YESNO) == IDYES) { - HistoryItem* historyItem = CHistoryTreeControl::getItemData(item); - if (historyItem) { - DesktopUtils::ShellOpenUrl(historyItem->deleteUrl); - } + HistoryItem* historyItem = CHistoryTreeControl::getItemData(item); + if (!historyItem) { + return 0; + } + std::string message = str( + boost::format(_("Are you sure you want to delete the file '%s' from the server?")) + % historyItem->displayName + ); + if (LocalizedMessageBox(U2W(message), TR("Deleting the file from the server"), MB_ICONQUESTION|MB_YESNO) == IDYES) { + DesktopUtils::ShellOpenUrl(historyItem->deleteUrl); } return 0; diff --git a/Source/Gui/Dialogs/ResultsPanel.cpp b/Source/Gui/Dialogs/ResultsPanel.cpp index 750d77d5..9789a8ca 100644 --- a/Source/Gui/Dialogs/ResultsPanel.cpp +++ b/Source/Gui/Dialogs/ResultsPanel.cpp @@ -256,6 +256,7 @@ std::string CResultsPanel::GenerateOutput() generator->setPreferDirectLinks(preferDirectLinks); generator->setItemsPerLine(p); generator->setGroupByFile(groupByFileName_); + generator->setShortenUrl(shortenUrl_); if (generatorId == OG::gidXmlTemplate) { int templateIndex = Index - 4; @@ -531,6 +532,8 @@ LRESULT CResultsPanel::OnShortenUrlClicked(WORD /*wNotifyCode*/, WORD /*wID*/, H shortenUrl_ = !shortenUrl_; if (onShortenUrlChanged_) { onShortenUrlChanged_(shortenUrl_); + } else { + UpdateOutput(true); } return 0; } diff --git a/Source/ServerListTool/ServersChecker.cpp b/Source/ServerListTool/ServersChecker.cpp index aae5375a..e5c21a27 100644 --- a/Source/ServerListTool/ServersChecker.cpp +++ b/Source/ServerListTool/ServersChecker.cpp @@ -223,11 +223,16 @@ void ServersChecker::checkShortUrl(UploadTask* task) { int i = 0; //counter for limiting max redirects if (!targetUrl.empty()) { int responseCode = 0; + do { client->setCurlOptionInt(CURLOPT_FOLLOWLOCATION, 0); client->doGet(targetUrl); + responseCode = client->responseCode(); - targetUrl = client->responseHeaderByName("Location"); + if (responseCode == 302 || responseCode == 301) { + targetUrl = client->getCurlInfoString(CURLINFO_REDIRECT_URL); + } + i++; } while (i < 6 && !targetUrl.empty() && (responseCode == 302 || responseCode == 301) && targetUrl != urlTask->getUrl());