Commit e173b49c authored by Sébastien Blin's avatar Sébastien Blin

callview: fix show chat view button status

Change-Id: I813dfc383830ef3066db82456b1556b81f8f77a0
parent 53c8197b
......@@ -214,7 +214,6 @@ public:
QMetaObject::Connection state_change_connection;
QMetaObject::Connection renderer_connection;
QMetaObject::Connection new_message_connection;
QMetaObject::Connection smartinfo_refresh_connection;
// for clutter animations and to know when to fade in/out the overlays
......@@ -279,15 +278,6 @@ set_call_quality(CurrentCallView* view, bool auto_quality_on, double desired_qua
}
}
static void
on_new_chat_interactions(CurrentCallView* view)
{
g_return_if_fail(IS_CURRENT_CALL_VIEW(view));
auto* priv = CURRENT_CALL_VIEW_GET_PRIVATE(view);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->togglebutton_chat), TRUE);
}
static void
set_record_animation(CurrentCallViewPrivate* priv)
{
......@@ -674,7 +664,6 @@ CppImpl::~CppImpl()
QObject::disconnect(state_change_connection);
QObject::disconnect(renderer_connection);
QObject::disconnect(smartinfo_refresh_connection);
QObject::disconnect(new_message_connection);
g_clear_object(&widgets->settings);
g_source_remove(timer_fade);
......@@ -843,16 +832,6 @@ CppImpl::setCallInfo()
}
});
new_message_connection = QObject::connect(
&*(*accountInfo)->conversationModel,
&lrc::api::ConversationModel::newInteraction,
[this] (const std::string& uid, uint64_t msgId, lrc::api::interaction::Info msg) {
Q_UNUSED(uid)
Q_UNUSED(msgId)
Q_UNUSED(msg)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->togglebutton_chat), TRUE);
});
// catch double click to make full screen
g_signal_connect(widgets->video_widget, "button-press-event",
G_CALLBACK(on_button_press_in_video_event), self);
......@@ -870,8 +849,6 @@ CppImpl::setCallInfo()
*accountInfo, conversation);
gtk_container_add(GTK_CONTAINER(widgets->frame_chat), widgets->chat_view);
g_signal_connect_swapped(widgets->chat_view, "new-interactions-displayed",
G_CALLBACK(on_new_chat_interactions), self);
chat_view_set_header_visible(CHAT_VIEW(widgets->chat_view), FALSE);
}
......@@ -1219,6 +1196,15 @@ current_call_view_get_chat_view(CurrentCallView *self)
return priv->chat_view;
}
void
current_call_view_show_chat(CurrentCallView* view)
{
g_return_if_fail(IS_CURRENT_CALL_VIEW(view));
auto* priv = CURRENT_CALL_VIEW_GET_PRIVATE(view);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->togglebutton_chat), TRUE);
}
//==============================================================================
static void
......
......@@ -57,5 +57,6 @@ GtkWidget *current_call_view_new (WebKitChatContainer* view,
lrc::api::AVModel& avModel);
lrc::api::conversation::Info current_call_view_get_conversation(CurrentCallView*);
GtkWidget *current_call_view_get_chat_view(CurrentCallView*);
void current_call_view_show_chat(CurrentCallView*);
G_END_DECLS
......@@ -2196,6 +2196,10 @@ CppImpl::slotNewInteraction(const std::string& accountId, const std::string& con
uint64_t, const lrc::api::interaction::Info& interaction)
{
if (chatViewConversation_ && chatViewConversation_->uid == conversation) {
auto *old_view = gtk_bin_get_child(GTK_BIN(widgets->frame_call));
if (IS_CURRENT_CALL_VIEW(old_view)) {
current_call_view_show_chat(CURRENT_CALL_VIEW(old_view));
}
if (gtk_window_is_active(GTK_WINDOW(self))) {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment