diff options
-rw-r--r-- | src/gui/mphoneform.cpp | 3 | ||||
-rw-r--r-- | src/gui/syssettingsform.cpp | 6 | ||||
-rw-r--r-- | src/gui/syssettingsform.ui | 15 | ||||
-rw-r--r-- | src/sys_settings.cpp | 15 | ||||
-rw-r--r-- | src/sys_settings.h | 5 |
5 files changed, 42 insertions, 2 deletions
diff --git a/src/gui/mphoneform.cpp b/src/gui/mphoneform.cpp index 9f90b29..a0260b4 100644 --- a/src/gui/mphoneform.cpp +++ b/src/gui/mphoneform.cpp @@ -816,7 +816,8 @@ void MphoneForm::updateState() name = cr.from_uri.encode_no_params_hdrs(false); incomingCallPopup->setCallerName(QString::fromStdString(name)); - showIncomingCallPopup = true; + if (sys_config->get_gui_show_incoming_popup()) + showIncomingCallPopup = true; break; } diff --git a/src/gui/syssettingsform.cpp b/src/gui/syssettingsform.cpp index 355df59..aa9bb7d 100644 --- a/src/gui/syssettingsform.cpp +++ b/src/gui/syssettingsform.cpp @@ -268,6 +268,9 @@ void SysSettingsForm::populate() // Call history histSizeSpinBox->setValue(sys_config->get_ch_max_size()); + // Show popup on incoming call + incomingPopupCheckBox->setChecked(sys_config->get_gui_show_incoming_popup()); + // Auto show on incoming call autoShowCheckBox->setChecked(sys_config->get_gui_auto_show_incoming()); autoShowTimeoutSpinBox->setValue(sys_config->get_gui_auto_show_timeout()); @@ -377,6 +380,9 @@ void SysSettingsForm::validate() sys_config->set_gui_hide_on_close(guiHideCheckBox->isChecked()); sys_config->set_gui_show_call_osd(osdCheckBox->isChecked()); + // Show popup on incoming call + sys_config->set_gui_show_incoming_popup(incomingPopupCheckBox->isChecked()); + // Auto show on incoming call sys_config->set_gui_auto_show_incoming(autoShowCheckBox->isChecked()); sys_config->set_gui_auto_show_timeout(autoShowTimeoutSpinBox->value()); diff --git a/src/gui/syssettingsform.ui b/src/gui/syssettingsform.ui index a792f81..d9e5262 100644 --- a/src/gui/syssettingsform.ui +++ b/src/gui/syssettingsform.ui @@ -890,6 +890,19 @@ If before answering a call, the microphone or speaker appears to be invalid, a w </layout> </item> <item row="6" column="0"> + <widget class="QCheckBox" name="incomingPopupCheckBox"> + <property name="whatsThis"> + <string>Display a popup window with "Answer" and "Reject" buttons on an incoming call.</string> + </property> + <property name="text"> + <string>Show &popup window on incoming call</string> + </property> + <property name="shortcut"> + <string>Alt+P</string> + </property> + </widget> + </item> + <item row="7" column="0"> <layout class="QHBoxLayout"> <item> <widget class="QCheckBox" name="autoShowCheckBox"> @@ -942,7 +955,7 @@ If before answering a call, the microphone or speaker appears to be invalid, a w </item> </layout> </item> - <item row="7" column="0"> + <item row="8" column="0"> <layout class="QHBoxLayout"> <item> <widget class="QLabel" name="browserTextLabel"> diff --git a/src/sys_settings.cpp b/src/sys_settings.cpp index b8af8fe..f8c81c4 100644 --- a/src/sys_settings.cpp +++ b/src/sys_settings.cpp @@ -72,6 +72,7 @@ using namespace utils; // GUI settings #define FLD_GUI_USE_SYSTRAY "gui_use_systray" #define FLD_GUI_HIDE_ON_CLOSE "gui_hide_on_close" +#define FLD_GUI_SHOW_INCOMING_POPUP "gui_show_incoming_popup" #define FLD_GUI_AUTO_SHOW_INCOMING "gui_auto_show_incoming" #define FLD_GUI_AUTO_SHOW_TIMEOUT "gui_auto_show_timeout" #define FLD_GUI_BROWSER_CMD "gui_browser_cmd" @@ -252,6 +253,7 @@ t_sys_settings::t_sys_settings() { gui_use_systray = true; gui_hide_on_close = true; + gui_show_incoming_popup = true; gui_auto_show_incoming = false; gui_auto_show_timeout = 10; gui_show_call_osd = true; @@ -401,6 +403,11 @@ bool t_sys_settings::get_gui_use_systray(void) const { return gui_use_systray; } +bool t_sys_settings::get_gui_show_incoming_popup(void) const { + t_mutex_guard guard(mtx_sys); + return gui_show_incoming_popup; +} + bool t_sys_settings::get_gui_auto_show_incoming(void) const { t_mutex_guard guard(mtx_sys); return gui_auto_show_incoming; @@ -756,6 +763,11 @@ void t_sys_settings::set_gui_hide_on_close(bool b) { gui_hide_on_close = b; } +void t_sys_settings::set_gui_show_incoming_popup(bool b) { + t_mutex_guard guard(mtx_sys); + gui_show_incoming_popup = b; +} + void t_sys_settings::set_gui_auto_show_incoming(bool b) { t_mutex_guard guard(mtx_sys); gui_auto_show_incoming = b; @@ -1579,6 +1591,8 @@ bool t_sys_settings::read_config(string &error_msg) { gui_use_systray = yesno2bool(value); } else if (parameter == FLD_GUI_HIDE_ON_CLOSE) { gui_hide_on_close = yesno2bool(value); + } else if (parameter == FLD_GUI_SHOW_INCOMING_POPUP) { + gui_show_incoming_popup = yesno2bool(value); } else if (parameter == FLD_GUI_AUTO_SHOW_INCOMING) { gui_auto_show_incoming = yesno2bool(value); } else if (parameter == FLD_GUI_AUTO_SHOW_TIMEOUT) { @@ -1723,6 +1737,7 @@ bool t_sys_settings::write_config(string &error_msg) { config << "# GUI\n"; config << FLD_GUI_USE_SYSTRAY << '=' << bool2yesno(gui_use_systray) << endl; config << FLD_GUI_HIDE_ON_CLOSE << '=' << bool2yesno(gui_hide_on_close) << endl; + config << FLD_GUI_SHOW_INCOMING_POPUP << '=' << bool2yesno(gui_show_incoming_popup) << endl; config << FLD_GUI_AUTO_SHOW_INCOMING << '=' << bool2yesno(gui_auto_show_incoming) << endl; config << FLD_GUI_AUTO_SHOW_TIMEOUT << '=' << gui_auto_show_timeout << endl; config << FLD_GUI_BROWSER_CMD << '=' << gui_browser_cmd << endl; diff --git a/src/sys_settings.h b/src/sys_settings.h index 232c4f9..906af5e 100644 --- a/src/sys_settings.h +++ b/src/sys_settings.h @@ -147,6 +147,9 @@ private: bool gui_use_systray; bool gui_hide_on_close; + /** Show popup on incoming call */ + bool gui_show_incoming_popup; + /** Show main window on incoming call after a few seconds */ bool gui_auto_show_incoming; int gui_auto_show_timeout; @@ -291,6 +294,7 @@ public: bool get_log_show_debug(void) const; bool get_gui_use_systray(void) const; bool get_gui_hide_on_close(void) const; + bool get_gui_show_incoming_popup(void) const; bool get_gui_auto_show_incoming(void) const; int get_gui_auto_show_timeout(void) const; string get_gui_browser_cmd(void) const; @@ -347,6 +351,7 @@ public: void set_log_show_debug(bool b); void set_gui_use_systray(bool b); void set_gui_hide_on_close(bool b); + void set_gui_show_incoming_popup(bool b); void set_gui_auto_show_incoming(bool b); void set_gui_auto_show_timeout(int timeout); void set_gui_browser_cmd(const string &s); |