aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-individual-store.c100
-rw-r--r--libempathy-gtk/empathy-tls-dialog.c1
-rw-r--r--src/empathy-preferences.c6
-rw-r--r--src/empathy-preferences.ui47
4 files changed, 97 insertions, 57 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index aa3f6334d..c22e11149 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -330,94 +330,100 @@ void
empathy_individual_store_add_individual (EmpathyIndividualStore *self,
FolksIndividual *individual)
{
- GtkTreeIter iter;
- GeeIterator *group_iter = NULL;
+ GtkTreeIter iter, iter_group;
+ GeeSet *group_set = NULL;
+ gboolean grouped = FALSE;
if (EMP_STR_EMPTY (folks_alias_details_get_alias (
FOLKS_ALIAS_DETAILS (individual))))
return;
- if (self->priv->show_groups)
+ if (!self->priv->show_groups)
{
- GeeSet *group_set = NULL;
-
- group_set = folks_group_details_get_groups (
- FOLKS_GROUP_DETAILS (individual));
+ /* add our individual to the toplevel of the store */
+ add_individual_to_store (GTK_TREE_STORE (self), &iter, NULL,
+ individual);
- if (gee_collection_get_size (GEE_COLLECTION (group_set)) > 0)
- group_iter = gee_iterable_iterator (GEE_ITERABLE (group_set));
+ goto finally;
}
- /* fall-back groups, in case there are no named groups */
- if (group_iter == NULL)
+ group_set = folks_group_details_get_groups (
+ FOLKS_GROUP_DETAILS (individual));
+
+ if (gee_collection_get_size (GEE_COLLECTION (group_set)) > 0)
+ {
+ /* add the contact to its groups */
+ GeeIterator *group_iter =
+ gee_iterable_iterator (GEE_ITERABLE (group_set));
+
+ while (group_iter != NULL && gee_iterator_next (group_iter))
+ {
+ gchar *group_name = gee_iterator_get (group_iter);
+
+ individual_store_get_group (self, group_name, &iter_group,
+ NULL, NULL, FALSE);
+
+ add_individual_to_store (GTK_TREE_STORE (self), &iter, &iter_group,
+ individual);
+ grouped = TRUE;
+
+ g_free (group_name);
+ }
+
+ g_clear_object (&group_iter);
+ }
+ else
{
- GtkTreeIter iter_group, *parent;
+ /* fall-back groups, in case there are no named groups */
EmpathyContact *contact;
TpConnection *connection;
- gchar *protocol_name = NULL;
-
- parent = &iter_group;
+ const gchar *protocol_name = NULL;
contact = empathy_contact_dup_from_folks_individual (individual);
if (contact != NULL)
{
connection = empathy_contact_get_connection (contact);
- tp_connection_parse_object_path (connection, &protocol_name, NULL);
+ protocol_name = tp_connection_get_protocol_name (connection);
}
- if (!self->priv->show_groups)
- parent = NULL;
- else if (!tp_strdiff (protocol_name, "local-xmpp"))
+ if (!tp_strdiff (protocol_name, "local-xmpp"))
{
/* these are People Nearby */
individual_store_get_group (self,
EMPATHY_INDIVIDUAL_STORE_PEOPLE_NEARBY, &iter_group, NULL, NULL,
TRUE);
+ add_individual_to_store (GTK_TREE_STORE (self), &iter, &iter_group,
+ individual);
+ grouped = TRUE;
}
- else
- {
- individual_store_get_group (self,
- EMPATHY_INDIVIDUAL_STORE_UNGROUPED,
- &iter_group, NULL, NULL, TRUE);
- }
-
- add_individual_to_store (GTK_TREE_STORE (self), &iter, parent,
- individual);
- g_free (protocol_name);
g_clear_object (&contact);
}
- /* Else add to each group. */
- while (group_iter != NULL && gee_iterator_next (group_iter))
+ if (folks_favourite_details_get_is_favourite (
+ FOLKS_FAVOURITE_DETAILS (individual)))
{
- gchar *group_name = gee_iterator_get (group_iter);
- GtkTreeIter iter_group;
-
- individual_store_get_group (self, group_name, &iter_group, NULL, NULL,
- FALSE);
+ /* Add contact to the fake 'Favorites' group */
+ individual_store_get_group (self, EMPATHY_INDIVIDUAL_STORE_FAVORITE,
+ &iter_group, NULL, NULL, TRUE);
add_individual_to_store (GTK_TREE_STORE (self), &iter, &iter_group,
individual);
-
- g_free (group_name);
+ grouped = TRUE;
}
- g_clear_object (&group_iter);
- if (self->priv->show_groups &&
- folks_favourite_details_get_is_favourite (
- FOLKS_FAVOURITE_DETAILS (individual)))
+ if (!grouped)
{
- /* Add contact to the fake 'Favorites' group */
- GtkTreeIter iter_group;
-
- individual_store_get_group (self, EMPATHY_INDIVIDUAL_STORE_FAVORITE,
+ /* Else add the contact to 'Ungrouped' */
+ individual_store_get_group (self,
+ EMPATHY_INDIVIDUAL_STORE_UNGROUPED,
&iter_group, NULL, NULL, TRUE);
-
add_individual_to_store (GTK_TREE_STORE (self), &iter, &iter_group,
individual);
}
+
+finally:
individual_store_contact_update (self, individual);
}
diff --git a/libempathy-gtk/empathy-tls-dialog.c b/libempathy-gtk/empathy-tls-dialog.c
index 991f52133..7eb59a214 100644
--- a/libempathy-gtk/empathy-tls-dialog.c
+++ b/libempathy-gtk/empathy-tls-dialog.c
@@ -284,6 +284,7 @@ empathy_tls_dialog_constructed (GObject *object)
text = reason_to_string (self);
g_object_set (message_dialog,
+ "title", _("Untrusted connection"),
"text", _("This connection is untrusted. Would you like to "
"continue anyway?"),
"secondary-text", text,
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index cd755a9ae..c96be4c52 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -67,7 +67,7 @@ struct _EmpathyPreferencesPriv {
GtkWidget *checkbutton_show_smileys;
GtkWidget *checkbutton_show_contacts_in_rooms;
- GtkWidget *checkbutton_separate_chat_windows;
+ GtkWidget *radiobutton_chats_new_windows;
GtkWidget *checkbutton_events_notif_area;
GtkWidget *checkbutton_autoconnect;
GtkWidget *checkbutton_logging;
@@ -248,7 +248,7 @@ preferences_setup_widgets (EmpathyPreferences *preferences)
g_settings_bind (priv->gsettings_ui,
EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS,
- priv->checkbutton_separate_chat_windows,
+ priv->radiobutton_chats_new_windows,
"active",
G_SETTINGS_BIND_DEFAULT);
@@ -1172,7 +1172,7 @@ empathy_preferences_init (EmpathyPreferences *preferences)
"combobox_chat_theme_variant", &priv->combobox_chat_theme_variant,
"hbox_chat_theme_variant", &priv->hbox_chat_theme_variant,
"sw_chat_theme_preview", &priv->sw_chat_theme_preview,
- "checkbutton_separate_chat_windows", &priv->checkbutton_separate_chat_windows,
+ "radiobutton_chats_new_windows", &priv->radiobutton_chats_new_windows,
"checkbutton_events_notif_area", &priv->checkbutton_events_notif_area,
"checkbutton_autoconnect", &priv->checkbutton_autoconnect,
"checkbutton_logging", &priv->checkbutton_logging,
diff --git a/src/empathy-preferences.ui b/src/empathy-preferences.ui
index 03a628cb6..f13f6c0b2 100644
--- a/src/empathy-preferences.ui
+++ b/src/empathy-preferences.ui
@@ -107,14 +107,47 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkCheckButton" id="checkbutton_separate_chat_windows">
- <property name="label" translatable="yes">_Open new chats in separate windows</property>
+ <object class="GtkBox" id="vbox2180">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">horizontal</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel" id="label1000">
+ <property name="label" translatable="yes">Start chats in:</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="radiobutton_chats_new_tabs">
+ <property name="label" translatable="yes">new ta_bs</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="radiobutton_chats_new_windows">
+ <property name="label" translatable="yes">new _windows</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radiobutton_chats_new_tabs</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>