summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuboš Doležel <lubos@dolezel.info>2016-10-05 20:13:39 +0200
committerGitHub <noreply@github.com>2016-10-05 20:13:39 +0200
commitb7885efb5a7ad7b1dd024715a08b6d3a1bd6088e (patch)
tree3e2ba486a8efdb32fcbbe2a0bf07487047528e3e /src
parentac00a87ce01dbeb1bcd7502c38e027e10358b588 (diff)
parent5be7b2c552c4b904936db8ad8d5a34415b2a5512 (diff)
downloadtwinkle-b7885efb5a7ad7b1dd024715a08b6d3a1bd6088e.tar
twinkle-b7885efb5a7ad7b1dd024715a08b6d3a1bd6088e.tar.gz
twinkle-b7885efb5a7ad7b1dd024715a08b6d3a1bd6088e.tar.lz
twinkle-b7885efb5a7ad7b1dd024715a08b6d3a1bd6088e.tar.xz
twinkle-b7885efb5a7ad7b1dd024715a08b6d3a1bd6088e.zip
Merge pull request #83 from fbriere/issue/74-freeze-on-refer
Invoke "ask user to refer" from within the GUI thread
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui.cpp25
-rw-r--r--src/gui/gui.h4
2 files changed, 23 insertions, 6 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 160f982..bee6b0a 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -744,6 +744,7 @@ t_gui::t_gui(t_phone *_phone) : t_userintf(_phone), timerUpdateMessageSessions(N
qRegisterMetaType<t_register_type>("t_register_type");
qRegisterMetaType<t_transfer_type>("t_transfer_type");
qRegisterMetaType<t_cf_type>("t_cf_type");
+ qRegisterMetaType<string>("string");
qRegisterMetaType<std::list<std::string>>("std::list<std::string>");
mainWindow = new MphoneForm;
@@ -2289,16 +2290,17 @@ bool t_gui::do_cb_ask_user_to_redirect_request(t_user *user_config, const t_url
return permission;
}
-void t_gui::cb_ask_user_to_refer(t_user *user_config, const t_url &refer_to_uri,
+void t_gui::do_cb_ask_user_to_refer(t_user *user_config, const string &refer_to_uri_str,
const string &refer_to_display,
- const t_url &referred_by_uri,
+ const string &referred_by_uri_str,
const string &referred_by_display)
{
+ t_url refer_to_uri(refer_to_uri_str);
+ t_url referred_by_uri(referred_by_uri_str);
+
QString s;
QString title;
- lock();
-
title = PRODUCT_NAME;
title.append(" - ").append(qApp->translate("GUI", "Transferring call"));
@@ -2333,8 +2335,19 @@ void t_gui::cb_ask_user_to_refer(t_user *user_config, const t_url &refer_to_uri,
ReferPermissionDialog *dialog = new ReferPermissionDialog(mainWindow, title, s);
// Do not report to MEMMAN as Qt will auto destruct this dialog on close.
dialog->show();
-
- unlock();
+}
+
+void t_gui::cb_ask_user_to_refer(t_user *user_config, const t_url &refer_to_uri,
+ const string &refer_to_display,
+ const t_url &referred_by_uri,
+ const string &referred_by_display)
+{
+ QMetaObject::invokeMethod(this, "do_cb_ask_user_to_refer",
+ Q_ARG(t_user*, user_config),
+ Q_ARG(const string&, refer_to_uri.encode()),
+ Q_ARG(const string&, refer_to_display),
+ Q_ARG(const string&, referred_by_uri.encode()),
+ Q_ARG(const string&, referred_by_display));
}
void t_gui::cb_show_msg(const string &msg, t_msg_priority prio) {
diff --git a/src/gui/gui.h b/src/gui/gui.h
index db27ad0..d0cada0 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -436,6 +436,10 @@ private slots:
const string &display, t_method method);
bool do_cb_ask_credentials(t_user *user_config, const string &realm, string &username,
string &password);
+ void do_cb_ask_user_to_refer(t_user *user_config, const string &refer_to_uri_str,
+ const string &refer_to_display,
+ const string &referred_by_uri_str,
+ const string &referred_by_display);
void do_cb_register_inprog(t_user *user_config, t_register_type register_type);
};