Skip to content

Commit

Permalink
Add setting Enable toast notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
zenden2k committed May 5, 2024
1 parent 2a235b7 commit d05a509
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 17 deletions.
2 changes: 2 additions & 0 deletions COMPILING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ zlib http://www.zlib.net

Boost http://www.boost.org

Qt https://www.qt.io/

pcre http://www.pcre.org

pcre++ http://www.daemon.de/PCRE (patched version)
Expand Down
14 changes: 9 additions & 5 deletions Lang/imageuploader.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: imageuploader\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-10 16:24+0300\n"
"POT-Creation-Date: 2024-05-05 15:13+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -272,7 +272,7 @@ msgid "Aero only (Windows Vista or later)"
msgstr ""

#: ../Source/Gui/Dialogs/AddFtpServerDialog.cpp:199
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:83
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:86
#: ../Source/Gui/Dialogs/LogoSettings.cpp:166
#: ../Source/Gui/Dialogs/MainDlg.cpp:674
#: ../Source/Gui/Dialogs/UploadSettingsPage.cpp:227
Expand Down Expand Up @@ -610,7 +610,7 @@ msgstr ""
msgid "Checking for updates..."
msgstr ""

#: ../Source/Gui/Dialogs/GeneralSettings.cpp:55
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:57
msgid "Choose executable file"
msgstr ""

Expand Down Expand Up @@ -644,7 +644,7 @@ msgid "Choose more servers..."
msgstr ""

#: ../Source/Gui/Dialogs/AddFtpServerDialog.cpp:202
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:86
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:89
msgid "Choose program"
msgstr ""

Expand Down Expand Up @@ -1097,6 +1097,10 @@ msgstr ""
msgid "Ellipse"
msgstr ""

#: ../Source/Gui/Dialogs/GeneralSettings.cpp:45
msgid "Enable Toast notifications (Windows 8+)"
msgstr ""

#: ../Source/Gui/Dialogs/ImageDownloaderDlg.cpp:90
msgid "Enter URLs (one http:// or ftp:// link per line)"
msgstr ""
Expand Down Expand Up @@ -1194,7 +1198,7 @@ msgstr ""
msgid "Errors: %d"
msgstr ""

#: ../Source/Gui/Dialogs/GeneralSettings.cpp:82
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:85
msgid "Executables"
msgstr ""

Expand Down
16 changes: 10 additions & 6 deletions Lang/locale/ru/LC_MESSAGES/imageuploader.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: imageuploader\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-10 16:24+0300\n"
"PO-Revision-Date: 2024-04-10 16:25+0300\n"
"POT-Creation-Date: 2024-05-05 15:13+0300\n"
"PO-Revision-Date: 2024-05-05 15:14+0300\n"
"Last-Translator: \n"
"Language-Team: zenden2k@gmail.com\n"
"Language: ru\n"
Expand Down Expand Up @@ -283,7 +283,7 @@ msgid "Aero only (Windows Vista or later)"
msgstr "Только для Aero (Windows Vista и новее)"

#: ../Source/Gui/Dialogs/AddFtpServerDialog.cpp:199
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:83
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:86
#: ../Source/Gui/Dialogs/LogoSettings.cpp:166
#: ../Source/Gui/Dialogs/MainDlg.cpp:674
#: ../Source/Gui/Dialogs/UploadSettingsPage.cpp:227
Expand Down Expand Up @@ -633,7 +633,7 @@ msgstr "Проверить обновления"
msgid "Checking for updates..."
msgstr "Проверка обновлений..."

#: ../Source/Gui/Dialogs/GeneralSettings.cpp:55
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:57
msgid "Choose executable file"
msgstr "Выберите исполняемый файл"

Expand Down Expand Up @@ -667,7 +667,7 @@ msgid "Choose more servers..."
msgstr "Выбрать больше серверов..."

#: ../Source/Gui/Dialogs/AddFtpServerDialog.cpp:202
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:86
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:89
msgid "Choose program"
msgstr "Выберите программу"

Expand Down Expand Up @@ -1128,6 +1128,10 @@ msgstr "Редактировать..."
msgid "Ellipse"
msgstr "Эллипс"

#: ../Source/Gui/Dialogs/GeneralSettings.cpp:45
msgid "Enable Toast notifications (Windows 8+)"
msgstr "Включить всплывающие уведомления (Windows 8+)"

#: ../Source/Gui/Dialogs/ImageDownloaderDlg.cpp:90
msgid "Enter URLs (one http:// or ftp:// link per line)"
msgstr "Введите список ссылок (http:// или ftp://, по одной ccылке в строке)"
Expand Down Expand Up @@ -1225,7 +1229,7 @@ msgstr "Ошибка:"
msgid "Errors: %d"
msgstr "Ошибок: %d"

#: ../Source/Gui/Dialogs/GeneralSettings.cpp:82
#: ../Source/Gui/Dialogs/GeneralSettings.cpp:85
msgid "Executables"
msgstr "Исполняемые файлы"

Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Settings/WtlGuiSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ WtlGuiSettings::WtlGuiSettings() :
DropVideoFilesToTheList = false;
CodeLang = 0;
ConfirmOnExit = 1;
EnableToastNotifications = true;

ExplorerContextMenu = false;
ExplorerVideoContextMenu = true;
Expand Down Expand Up @@ -748,6 +749,7 @@ void WtlGuiSettings::BindToManager() {
//general.n_bind(AutoStartup);
general.n_bind(ShowTrayIcon);
general.n_bind(AutoCopyToClipboard);
general.n_bind(EnableToastNotifications);
general.n_bind(AutoShowLog);
general.n_bind(ImagesFolder);
general.n_bind(VideoFolder);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Settings/WtlGuiSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class WtlGuiSettings : public CommonGuiSettings {
bool DropVideoFilesToTheList;
bool ConfirmOnExit;
bool AutomaticallyCheckUpdates;
bool EnableToastNotifications;

bool AutoCopyToClipboard;
bool WatchClipboard;
Expand Down
5 changes: 4 additions & 1 deletion Source/Gui/Dialogs/GeneralSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ LRESULT CGeneralSettings::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
TRC(IDC_DROPVIDEOFILESTOTHELIST, "Add video files to the list after Drag'n'Drop");
TRC(IDC_DEVELOPERMODE, "Developer mode");
TRC(IDC_CHECKUPDATES, "Automatically check for updates");
TRC(IDC_ENABLETOASTS, "Enable Toast notifications (Windows 8+)");

SetDlgItemText(IDC_IMAGEEDITORPATH, settings->ImageEditorPath);

if (ServiceLocator::instance()->translator()->isRTL()) {
Expand Down Expand Up @@ -73,6 +75,7 @@ LRESULT CGeneralSettings::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
GuiTools::SetCheck(m_hWnd, IDC_DROPVIDEOFILESTOTHELIST, settings->DropVideoFilesToTheList);
GuiTools::SetCheck(m_hWnd, IDC_DEVELOPERMODE, settings->DeveloperMode);
GuiTools::SetCheck(m_hWnd, IDC_CHECKUPDATES, settings->AutomaticallyCheckUpdates);
GuiTools::SetCheck(m_hWnd, IDC_ENABLETOASTS, settings->EnableToastNotifications);
return 1; // Let the system set the focus
}

Expand Down Expand Up @@ -120,7 +123,7 @@ bool CGeneralSettings::Apply()
settings->DropVideoFilesToTheList = GuiTools::GetCheck(m_hWnd, IDC_DROPVIDEOFILESTOTHELIST);
GuiTools::GetCheck(m_hWnd, IDC_DEVELOPERMODE, settings->DeveloperMode);
GuiTools::GetCheck(m_hWnd, IDC_CHECKUPDATES, settings->AutomaticallyCheckUpdates);

GuiTools::GetCheck(m_hWnd, IDC_ENABLETOASTS, settings->EnableToastNotifications);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Gui/Dialogs/WizardDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ void CWizardDlg::showScreenshotCopiedToClipboardMessage(std::shared_ptr<Gdiplus:
floatWnd_->ShowScreenshotCopiedToClipboardMessage();
} else {
using namespace WinToastLib;
if (WinToast::isCompatible()) {
if (Settings.EnableToastNotifications && WinToast::isCompatible()) {
if (!winToastHandler_) {
winToastHandler_ = std::make_unique<WinToastHandler>();
}
Expand Down
12 changes: 9 additions & 3 deletions Source/Image Uploader.rc
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,10 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,87,239,10
CONTROL "#Developer mode",IDC_DEVELOPERMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,105,225,10
CONTROL "#Check updates",IDC_CHECKUPDATES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,121,232,10
GROUPBOX "#",IDC_LOGGROUP,8,137,250,53
CONTROL "#",IDC_AUTOSHOWLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,151,229,10
PUSHBUTTON "View log",IDC_VIEWLOG,19,167,126,14
CONTROL "#enable toast notifications",IDC_ENABLETOASTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,136,232,10
GROUPBOX "#",IDC_LOGGROUP,8,151,250,53
CONTROL "#",IDC_AUTOSHOWLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,165,229,10
PUSHBUTTON "View log",IDC_VIEWLOG,19,181,126,14
END

IDD_SIZEEXCEED DIALOGEX 0, 0, 339, 169
Expand Down Expand Up @@ -1783,6 +1784,11 @@ BEGIN
0
END

IDD_GENERALSETTINGS AFX_DIALOG_LAYOUT
BEGIN
0
END

#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 2 additions & 1 deletion Source/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@
#define IDC_CHECK5 1273
#define IDC_REMEMBERFILESERVERSETTINGS 1273
#define IDC_ALLOWALTTABINIMAGEEDITOR 1273
#define IDC_ENABLETOASTS 1273
#define IDC_FOUNDABUG 1274
#define IDC_RESULTSLABEL 1274
#define IDC_OUTPUTTEXT 1275
Expand Down Expand Up @@ -789,7 +790,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 335
#define _APS_NEXT_RESOURCE_VALUE 336
#define _APS_NEXT_COMMAND_VALUE 32821
#define _APS_NEXT_CONTROL_VALUE 1341
#define _APS_NEXT_SYMED_VALUE 128
Expand Down

0 comments on commit d05a509

Please sign in to comment.