]> git.0d.be Git - empathy.git/commitdiff
remove empathy-contact-dialogs
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 11 Jul 2012 09:02:48 +0000 (11:02 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 11 Jul 2012 09:36:46 +0000 (11:36 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=679111

libempathy-gtk/Makefile.am
libempathy-gtk/empathy-contact-dialogs.c [deleted file]
libempathy-gtk/empathy-contact-dialogs.h [deleted file]
libempathy-gtk/empathy-contact-dialogs.ui [deleted file]
po/POTFILES.in

index f059022aba390e236c86d021827328773e200180..071129bd17da874a9d4d2315f1c1237bb6fbe401 100644 (file)
@@ -45,7 +45,6 @@ libempathy_gtk_handwritten_source =                   \
        empathy-cell-renderer-text.c            \
        empathy-chat.c                          \
        empathy-contact-blocking-dialog.c       \
        empathy-cell-renderer-text.c            \
        empathy-chat.c                          \
        empathy-contact-blocking-dialog.c       \
-       empathy-contact-dialogs.c               \
        empathy-contact-chooser.c               \
        empathy-contactinfo-utils.c             \
        empathy-live-search.c                   \
        empathy-contact-chooser.c               \
        empathy-contactinfo-utils.c             \
        empathy-live-search.c                   \
@@ -113,7 +112,6 @@ libempathy_gtk_headers =                    \
        empathy-cell-renderer-text.h            \
        empathy-chat.h                          \
        empathy-contact-blocking-dialog.h       \
        empathy-cell-renderer-text.h            \
        empathy-chat.h                          \
        empathy-contact-blocking-dialog.h       \
-       empathy-contact-dialogs.h               \
        empathy-contact-chooser.h               \
        empathy-live-search.h                   \
        empathy-contact-search-dialog.h         \
        empathy-contact-chooser.h               \
        empathy-live-search.h                   \
        empathy-contact-search-dialog.h         \
@@ -200,7 +198,6 @@ check-local: check-coding-style
 uidir = $(datadir)/empathy
 ui_DATA =                                      \
        empathy-contact-widget.ui               \
 uidir = $(datadir)/empathy
 ui_DATA =                                      \
        empathy-contact-widget.ui               \
-       empathy-contact-dialogs.ui              \
        empathy-contact-blocking-dialog.ui      \
        empathy-account-widget-generic.ui       \
        empathy-account-widget-jabber.ui        \
        empathy-contact-blocking-dialog.ui      \
        empathy-account-widget-generic.ui       \
        empathy-account-widget-jabber.ui        \
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
deleted file mode 100644 (file)
index 5f885e8..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007-2008 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- *          Danielle Madeley <danielle.madeley@collabora.co.uk>
- */
-
-#include <config.h>
-
-#include <string.h>
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-#include <glib/gi18n-lib.h>
-
-#include <telepathy-glib/account-manager.h>
-
-#include <libempathy/empathy-utils.h>
-
-#include "empathy-contact-dialogs.h"
-#include "empathy-contact-widget.h"
-#include "empathy-ui-utils.h"
-
-static GList *information_dialogs = NULL;
-static GtkWidget *new_contact_dialog = NULL;
-
-static gint
-contact_dialogs_find (GtkDialog      *dialog,
-                     EmpathyContact *contact)
-{
-       GtkWidget     *contact_widget;
-       EmpathyContact *this_contact;
-
-       contact_widget = g_object_get_data (G_OBJECT (dialog), "contact_widget");
-       this_contact = empathy_contact_widget_get_contact (contact_widget);
-
-       return contact != this_contact;
-}
-
-/*
- *  Information dialog
- */
-
-static void
-contact_dialogs_response_cb (GtkDialog *dialog,
-                            gint       response,
-                            GList    **dialogs)
-{
-       *dialogs = g_list_remove (*dialogs, dialog);
-       gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-void
-empathy_contact_information_dialog_show (EmpathyContact *contact,
-                                        GtkWindow      *parent)
-{
-       GtkWidget *dialog;
-       GtkWidget *button;
-       GtkWidget *contact_widget;
-       GList     *l;
-
-       g_return_if_fail (EMPATHY_IS_CONTACT (contact));
-
-       l = g_list_find_custom (information_dialogs,
-                               contact,
-                               (GCompareFunc) contact_dialogs_find);
-       if (l) {
-               gtk_window_present (GTK_WINDOW (l->data));
-               return;
-       }
-
-       /* Create dialog */
-       dialog = gtk_dialog_new ();
-       gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-       gtk_window_set_title (GTK_WINDOW (dialog),
-               empathy_contact_get_alias (contact));
-
-       /* Close button */
-       button = gtk_button_new_with_label (GTK_STOCK_CLOSE);
-       gtk_button_set_use_stock (GTK_BUTTON (button), TRUE);
-       gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
-                                     button,
-                                     GTK_RESPONSE_CLOSE);
-       gtk_widget_set_can_default (button, TRUE);
-       gtk_window_set_default (GTK_WINDOW (dialog), button);
-       gtk_widget_show (button);
-
-       /* Contact info widget */
-       contact_widget = empathy_contact_widget_new (contact,
-               EMPATHY_CONTACT_WIDGET_SHOW_LOCATION |
-               EMPATHY_CONTACT_WIDGET_SHOW_DETAILS);
-       gtk_container_set_border_width (GTK_CONTAINER (contact_widget), 8);
-       gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
-                           contact_widget,
-                           TRUE, TRUE, 0);
-       gtk_widget_show (contact_widget);
-
-       g_object_set_data (G_OBJECT (dialog), "contact_widget", contact_widget);
-       information_dialogs = g_list_prepend (information_dialogs, dialog);
-
-       g_signal_connect (dialog, "response",
-                         G_CALLBACK (contact_dialogs_response_cb),
-                         &information_dialogs);
-
-       if (parent) {
-               gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
-       }
-
-       gtk_widget_show (dialog);
-}
-
-/*
- *  New contact dialog
- */
-
-static void
-can_add_contact_to_account (TpAccount                                 *account,
-                           EmpathyAccountChooserFilterResultCallback  callback,
-                           gpointer                                   callback_data,
-                           gpointer                                   user_data)
-{
-       TpConnection          *connection;
-       gboolean               result;
-
-       connection = tp_account_get_connection (account);
-       if (connection == NULL) {
-               callback (FALSE, callback_data);
-               return;
-       }
-
-       result = tp_connection_get_can_change_contact_list (connection);
-
-       callback (result, callback_data);
-}
-
-static void
-new_contact_response_cb (GtkDialog *dialog,
-                        gint       response,
-                        GtkWidget *contact_widget)
-{
-       EmpathyContact         *contact;
-
-       contact = empathy_contact_widget_get_contact (contact_widget);
-
-       if (contact && response == GTK_RESPONSE_OK) {
-               empathy_contact_add_to_contact_list (contact, "");
-       }
-
-       new_contact_dialog = NULL;
-       gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-void
-empathy_new_contact_dialog_show (GtkWindow *parent)
-{
-       empathy_new_contact_dialog_show_with_contact (parent, NULL);
-}
-
-void
-empathy_new_contact_dialog_show_with_contact (GtkWindow *parent,
-                                              EmpathyContact *contact)
-{
-       GtkWidget *dialog;
-       GtkWidget *button;
-       GtkWidget *contact_widget;
-
-       if (new_contact_dialog) {
-               gtk_window_present (GTK_WINDOW (new_contact_dialog));
-               return;
-       }
-
-       /* Create dialog */
-       dialog = gtk_dialog_new ();
-       gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-       gtk_window_set_title (GTK_WINDOW (dialog), _("New Contact"));
-
-       /* Cancel button */
-       button = gtk_button_new_with_label (GTK_STOCK_CANCEL);
-       gtk_button_set_use_stock (GTK_BUTTON (button), TRUE);
-       gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
-                                     button,
-                                     GTK_RESPONSE_CANCEL);
-       gtk_widget_show (button);
-
-       /* Add button */
-       button = gtk_button_new_with_label (GTK_STOCK_ADD);
-       gtk_button_set_use_stock (GTK_BUTTON (button), TRUE);
-       gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
-                                     button,
-                                     GTK_RESPONSE_OK);
-       gtk_widget_show (button);
-
-       /* Contact info widget */
-       contact_widget = empathy_contact_widget_new (contact,
-                                                    EMPATHY_CONTACT_WIDGET_EDIT_ALIAS |
-                                                    EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT |
-                                                    EMPATHY_CONTACT_WIDGET_EDIT_ID |
-                                                    EMPATHY_CONTACT_WIDGET_EDIT_GROUPS);
-       gtk_container_set_border_width (GTK_CONTAINER (contact_widget), 8);
-       gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
-                           contact_widget,
-                           TRUE, TRUE, 0);
-       empathy_contact_widget_set_account_filter (contact_widget,
-                                                  can_add_contact_to_account,
-                                                  NULL);
-       gtk_widget_show (contact_widget);
-
-       new_contact_dialog = dialog;
-
-       g_signal_connect (dialog, "response",
-                         G_CALLBACK (new_contact_response_cb),
-                         contact_widget);
-
-       if (parent) {
-               gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
-       }
-
-       gtk_widget_show (dialog);
-}
diff --git a/libempathy-gtk/empathy-contact-dialogs.h b/libempathy-gtk/empathy-contact-dialogs.h
deleted file mode 100644 (file)
index 9938fd8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2007-2008 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Authors: Xavier Claessens <xclaesse@gmail.com>
- */
-
-#ifndef __EMPATHY_CONTACT_DIALOGS_H__
-#define __EMPATHY_CONTACT_DIALOGS_H__
-
-#include <gtk/gtk.h>
-
-#include <libempathy/empathy-contact.h>
-
-G_BEGIN_DECLS
-
-void empathy_contact_information_dialog_show (EmpathyContact *contact,
-                                             GtkWindow      *parent);
-void empathy_new_contact_dialog_show         (GtkWindow     *parent);
-void empathy_new_contact_dialog_show_with_contact (GtkWindow     *parent,
-                                                   EmpathyContact *contact);
-
-G_END_DECLS
-
-#endif /*  __EMPATHY_CONTACT_DIALOGS_H__ */
diff --git a/libempathy-gtk/empathy-contact-dialogs.ui b/libempathy-gtk/empathy-contact-dialogs.ui
deleted file mode 100644 (file)
index 7f29d04..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkDialog" id="subscription_request_dialog">
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Subscription Request</property>
-    <property name="role">subscription_request</property>
-    <property name="resizable">False</property>
-    <property name="window_position">center-on-parent</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox4">
-        <property name="visible">True</property>
-        <property name="spacing">2</property>
-        <child>
-          <object class="GtkHBox" id="hbox_subscription">
-            <property name="visible">True</property>
-            <property name="border_width">5</property>
-            <property name="spacing">12</property>
-            <child>
-              <object class="GtkImage" id="image5">
-                <property name="visible">True</property>
-                <property name="yalign">0</property>
-                <property name="stock">gtk-dialog-question</property>
-                <property name="icon-size">6</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area4">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="block-user-button">
-                <property name="label" translatable="yes">_Block User</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button19">
-                <property name="label" translatable="yes">Decide _Later</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button20">
-                <property name="label">_Reject</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button21">
-                <property name="label">_Accept</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-2">block-user-button</action-widget>
-      <action-widget response="-6">button19</action-widget>
-      <action-widget response="-9">button20</action-widget>
-      <action-widget response="-8">button21</action-widget>
-    </action-widgets>
-  </object>
-</interface>
index 61dbbe22bfd020ddb004046149ebf612949f63ae..8b171b4862a3c29cae48dddeb0308ef0df8c493a 100644 (file)
@@ -32,8 +32,6 @@ libempathy-gtk/empathy-chat.c
 [type: gettext/glade]libempathy-gtk/empathy-chat.ui
 libempathy-gtk/empathy-contact-blocking-dialog.c
 [type: gettext/glade]libempathy-gtk/empathy-contact-blocking-dialog.ui
 [type: gettext/glade]libempathy-gtk/empathy-chat.ui
 libempathy-gtk/empathy-contact-blocking-dialog.c
 [type: gettext/glade]libempathy-gtk/empathy-contact-blocking-dialog.ui
-libempathy-gtk/empathy-contact-dialogs.c
-[type: gettext/glade]libempathy-gtk/empathy-contact-dialogs.ui
 libempathy-gtk/empathy-contact-search-dialog.c
 libempathy-gtk/empathy-contact-widget.c
 libempathy-gtk/empathy-contactinfo-utils.c
 libempathy-gtk/empathy-contact-search-dialog.c
 libempathy-gtk/empathy-contact-widget.c
 libempathy-gtk/empathy-contactinfo-utils.c