From 9c0a76eedcb5725c9b836f911dffa11dcee13f82 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 27 Mar 2023 01:32:02 +0200 Subject: [PATCH 1/2] [GUI] alert user if loading/save is done --- avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp | 3 +++ avidemux/common/ADM_commonUI/GUI_ui.h | 2 ++ avidemux/common/gui_main.cpp | 2 ++ avidemux/common/gui_savenew.cpp | 1 + avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp | 8 ++++++++ 5 files changed, 16 insertions(+) diff --git a/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp b/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp index 9e26ffec35..ad8eebb6ee 100644 --- a/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp +++ b/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp @@ -213,4 +213,7 @@ void UI_notifyWarning(const char *message, int timeoutMs) {} void UI_notifyError(const char *message, int timeoutMs) {} + +void UI_needsAttention(void); +{} // EOF diff --git a/avidemux/common/ADM_commonUI/GUI_ui.h b/avidemux/common/ADM_commonUI/GUI_ui.h index 0293a7d064..14ce7da5a5 100644 --- a/avidemux/common/ADM_commonUI/GUI_ui.h +++ b/avidemux/common/ADM_commonUI/GUI_ui.h @@ -62,6 +62,8 @@ void UI_notifyInfo(const char *message, int timeoutMs); void UI_notifyWarning(const char *message, int timeoutMs); void UI_notifyError(const char *message, int timeoutMs); +void UI_needsAttention(void); + /* We need to know whether auto-repeat is firing */ bool UI_navigationButtonsPressed(void); diff --git a/avidemux/common/gui_main.cpp b/avidemux/common/gui_main.cpp index 49bae370b1..d521c8c735 100644 --- a/avidemux/common/gui_main.cpp +++ b/avidemux/common/gui_main.cpp @@ -1078,6 +1078,7 @@ int A_openVideo (const char *name) } delete[] longname; + UI_needsAttention(); // loading done, alert the user return 1; } /** @@ -1169,6 +1170,7 @@ int A_appendVideo (const char *name) ReSync(); GUI_setCurrentFrameAndTime(); UI_setMarkers (video_body->getMarkerAPts(),video_body->getMarkerBPts()); + UI_needsAttention(); // loading done, alert the user return 1; } diff --git a/avidemux/common/gui_savenew.cpp b/avidemux/common/gui_savenew.cpp index 27f028922c..5423f27a26 100644 --- a/avidemux/common/gui_savenew.cpp +++ b/avidemux/common/gui_savenew.cpp @@ -101,6 +101,7 @@ int A_Save(const char *name) ADM_slaveSendResult(r); A_Rewind(); GUI_GoToTime(current); + UI_needsAttention(); // saving done, alert the user return (int)r; } diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp index 38467f4d57..954f989e36 100644 --- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp +++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp @@ -3628,6 +3628,14 @@ void UI_notifyError(const char *message, int timeoutMs) { ((MainWindow *)QuiMainWindows)->notifyStatusBar(QT_TRANSLATE_NOOP("qgui2","ERROR: %1"), message, timeoutMs); } + +/** + \fn UI_needsAttention +*/ +void UI_needsAttention(void) +{ + QApplication::alert(NULL); +} /** * \fn dtor */ From 67bbaddd980d92b48dbbfc0202e82f21b4c97f59 Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 15 Apr 2023 03:46:23 +0200 Subject: [PATCH 2/2] [gui_none] fix code --- avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp b/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp index ad8eebb6ee..180ca9b9a4 100644 --- a/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp +++ b/avidemux/cli/ADM_userInterfaces/ADM_gui2/gui_none.cpp @@ -214,6 +214,6 @@ void UI_notifyWarning(const char *message, int timeoutMs) void UI_notifyError(const char *message, int timeoutMs) {} -void UI_needsAttention(void); +void UI_needsAttention(void) {} // EOF