Commit 4e40993c authored by Stepan Salenikovich's avatar Stepan Salenikovich

gnome: adapt to LRC api changes

Refs #71035
Refs #70829
Refs #71781

Change-Id: I3722a62720be1cb4275ed2ae53f16b9dc5d88e07
parent 3475c6d1
......@@ -299,10 +299,9 @@ bool EdsContactBackend::reload()
return false;
}
CollectionInterface::SupportedFeatures EdsContactBackend::supportedFeatures() const
FlagPack<CollectionInterface::SupportedFeatures> EdsContactBackend::supportedFeatures() const
{
return (CollectionInterface::SupportedFeatures)(
CollectionInterface::SupportedFeatures::NONE |
return (CollectionInterface::SupportedFeatures::NONE |
CollectionInterface::SupportedFeatures::LOAD);
}
......
......@@ -83,7 +83,7 @@ public:
virtual QString category () const override;
virtual bool isEnabled() const override;
virtual QByteArray id () const override;
virtual SupportedFeatures supportedFeatures() const override;
virtual FlagPack<SupportedFeatures> supportedFeatures() const override;
void addContacts(GSList *contacts);
void parseContact(EContact *contact);
......
......@@ -227,9 +227,9 @@ bool MinimalHistoryBackend::reload()
return false;
}
CollectionInterface::SupportedFeatures MinimalHistoryBackend::supportedFeatures() const
FlagPack<CollectionInterface::SupportedFeatures> MinimalHistoryBackend::supportedFeatures() const
{
return (CollectionInterface::SupportedFeatures) (
return (
CollectionInterface::SupportedFeatures::NONE |
CollectionInterface::SupportedFeatures::LOAD |
CollectionInterface::SupportedFeatures::CLEAR |
......
......@@ -40,7 +40,7 @@ public:
virtual QVariant icon () const override;
virtual bool isEnabled() const override;
virtual QByteArray id () const override;
virtual SupportedFeatures supportedFeatures() const override;
virtual FlagPack<SupportedFeatures> supportedFeatures() const override;
private:
CollectionMediator<Call>* m_pMediator;
......
......@@ -181,6 +181,9 @@ update_state(CurrentCallView *view, Call *call)
case Call::State::INITIALIZATION:
gtk_label_set_text(GTK_LABEL(priv->label_status), "Initialization...");
break;
case Call::State::CONNECTED:
gtk_label_set_text(GTK_LABEL(priv->label_status), "Connected.");
break;
case Call::State::COUNT__:
break;
}
......
......@@ -173,6 +173,9 @@ update_state(IncomingCallView *view, Call *call)
case Call::State::INITIALIZATION:
gtk_label_set_text(GTK_LABEL(priv->label_status), "Initialization...");
break;
case Call::State::CONNECTED:
gtk_label_set_text(GTK_LABEL(priv->label_status), "Connected.");
break;
case Call::State::COUNT__:
break;
}
......@@ -202,6 +205,7 @@ update_state(IncomingCallView *view, Call *call)
case Call::State::CONFERENCE:
case Call::State::CONFERENCE_HOLD:
case Call::State::INITIALIZATION:
case Call::State::CONNECTED:
gtk_widget_show(priv->button_end_call);
break;
case Call::State::COUNT__:
......
......@@ -688,10 +688,12 @@ search_entry_text_changed(GtkEditable *search_entry, RingMainWindow *win)
/* get the text from the entry */
const gchar *text = gtk_entry_get_text(GTK_ENTRY(search_entry));
if (text)
priv->q_completion_model->setPrefix(text);
else
priv->q_completion_model->setPrefix(QString());
if (text) {
/* edit the the dialing call (or create a new one) */
Call *call = CallModel::instance()->dialingCall();
call->setDialNumber(text);
priv->q_completion_model->setCall(call);
}
}
static gboolean
......@@ -818,7 +820,13 @@ select_autocompletion(G_GNUC_UNUSED GtkEntryCompletion *widget,
QModelIndex idx = gtk_q_tree_model_get_source_idx(GTK_Q_TREE_MODEL(model), iter);
if (idx.isValid()) {
ContactMethod *n = priv->q_completion_model->number(idx);
place_new_call(n);
/* check if using a specific account */
QVariant var_acc = idx.data(NumberCompletionModel::Role::ACCOUNT);
Account *acc = var_acc.value<Account *>();
if (acc) {
g_debug("using account: %s", acc->alias().toUtf8().constData());
}
place_new_call(n, acc);
/* clear the entry */
gtk_entry_set_text(GTK_ENTRY(priv->search_entry), "");
......
......@@ -35,10 +35,12 @@
#include <QtCore/QItemSelectionModel>
void
place_new_call(const ContactMethod *n)
place_new_call(const ContactMethod *n, Account *acc)
{
Call *call = CallModel::instance()->dialingCall();
call->setDialNumber(n);
if (acc)
call->setAccount(acc);
call->performAction(Call::Action::ACCEPT);
/* make this the currently selected call */
......
......@@ -32,8 +32,9 @@
#define _CALLING_H
class ContactMethod;
class Account;
void
place_new_call(const ContactMethod *n);
place_new_call(const ContactMethod *n, Account *acc = nullptr);
#endif /* _CALLING_H */
\ No newline at end of file
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