#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-status-presets.h>
+#include <libempathy-gtk/empathy-conf.h>
#include <libempathy-gtk/empathy-contact-dialogs.h>
#include <libempathy-gtk/empathy-contact-list-store.h>
#include <libempathy-gtk/empathy-contact-list-view.h>
-#include <libempathy-gtk/empathy-presence-chooser.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
#include <libempathy-gtk/empathy-geometry.h>
-#include <libempathy-gtk/empathy-conf.h>
-#include <libempathy-gtk/empathy-log-window.h>
-#include <libempathy-gtk/empathy-new-message-dialog.h>
#include <libempathy-gtk/empathy-gtk-enum-types.h>
-
-#include <libmissioncontrol/mission-control.h>
+#include <libempathy-gtk/empathy-new-message-dialog.h>
+#include <libempathy-gtk/empathy-log-window.h>
+#include <libempathy-gtk/empathy-presence-chooser.h>
+#include <libempathy-gtk/empathy-sound.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
#include "empathy-accounts-dialog.h"
#include "empathy-main-window.h"
#include "ephy-spinner.h"
#include "empathy-preferences.h"
#include "empathy-about-dialog.h"
+#include "empathy-debug-dialog.h"
#include "empathy-new-chatroom-dialog.h"
#include "empathy-map-view.h"
#include "empathy-chatrooms-window.h"
events = empathy_event_manager_get_events (window->event_manager);
for (l = events; l; l = l->next) {
data.event = l->data;
- if (!data.event->contact) {
+ if (!data.event->contact || !data.event->must_ack) {
continue;
}
main_window_error_edit_clicked_cb (GtkButton *button,
EmpathyMainWindow *window)
{
- McAccount *account;
+ EmpathyAccount *account;
GtkWidget *error_widget;
account = g_object_get_data (G_OBJECT (button), "account");
main_window_error_clear_clicked_cb (GtkButton *button,
EmpathyMainWindow *window)
{
- McAccount *account;
+ EmpathyAccount *account;
GtkWidget *error_widget;
account = g_object_get_data (G_OBJECT (button), "account");
static void
main_window_error_display (EmpathyMainWindow *window,
- McAccount *account,
+ EmpathyAccount *account,
const gchar *message)
{
GtkWidget *child;
/* Just set the latest error and return */
str = g_markup_printf_escaped ("<b>%s</b>\n%s",
- mc_account_get_display_name (account),
+ empathy_account_get_display_name (account),
message);
gtk_label_set_markup (GTK_LABEL (label), str);
g_free (str);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
str = g_markup_printf_escaped ("<b>%s</b>\n%s",
- mc_account_get_display_name (account),
+ empathy_account_get_display_name (account),
message);
gtk_label_set_markup (GTK_LABEL (label), str);
g_free (str);
static void
main_window_connection_changed_cb (EmpathyAccountManager *manager,
- McAccount *account,
+ EmpathyAccount *account,
TpConnectionStatusReason reason,
TpConnectionStatus current,
TpConnectionStatus previous,
static void
main_window_contact_presence_changed_cb (EmpathyContactMonitor *monitor,
EmpathyContact *contact,
- McPresence current,
- McPresence previous,
+ TpConnectionPresenceType current,
+ TpConnectionPresenceType previous,
EmpathyMainWindow *window)
{
- McAccount *account;
+ EmpathyAccount *account;
gboolean should_play;
account = empathy_contact_get_account (contact);
- should_play = !empathy_account_manager_is_account_just_connected (window->account_manager, account);
+ should_play = !empathy_account_is_just_connected (account);
if (!should_play) {
return;
}
- if (previous < MC_PRESENCE_AVAILABLE && current > MC_PRESENCE_OFFLINE) {
- /* someone is logging in */
- empathy_sound_play (GTK_WIDGET (window->window),
- EMPATHY_SOUND_CONTACT_CONNECTED);
- return;
- }
-
- if (previous > MC_PRESENCE_OFFLINE && current < MC_PRESENCE_AVAILABLE) {
- /* someone is logging off */
- empathy_sound_play (GTK_WIDGET (window->window),
- EMPATHY_SOUND_CONTACT_DISCONNECTED);
- }
+ if (tp_connection_presence_type_cmp_availability (previous,
+ TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0)
+ {
+ /* contact was online */
+ if (tp_connection_presence_type_cmp_availability (current,
+ TP_CONNECTION_PRESENCE_TYPE_OFFLINE) <= 0)
+ /* someone is logging off */
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_SOUND_CONTACT_DISCONNECTED);
+ }
+ else
+ {
+ /* contact was offline */
+ if (tp_connection_presence_type_cmp_availability (current,
+ TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0)
+ /* someone is logging in */
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_SOUND_CONTACT_CONNECTED);
+ }
}
static void
main_window_view_show_ft_manager (GtkAction *action,
EmpathyMainWindow *window)
{
- EmpathyFTManager *manager;
- GtkWidget *dialog;
-
- manager = empathy_ft_manager_dup_singleton ();
- dialog = empathy_ft_manager_get_dialog (manager);
-
- gtk_window_present (GTK_WINDOW (dialog));
- g_object_unref (manager);
+ empathy_ft_manager_show ();
}
static void
static void
main_window_favorite_chatroom_join (EmpathyChatroom *chatroom)
{
- EmpathyAccountManager *manager;
- McAccount *account;
+ EmpathyAccount *account;
TpConnection *connection;
const gchar *room;
- manager = empathy_account_manager_dup_singleton ();
account = empathy_chatroom_get_account (chatroom);
- connection = empathy_account_manager_get_connection (manager, account);
+ connection = empathy_account_get_connection (account);
room = empathy_chatroom_get_room (chatroom);
- g_object_unref (manager);
if (connection != NULL) {
DEBUG ("Requesting channel for '%s'", room);
empathy_about_dialog_new (GTK_WINDOW (window->window));
}
+static void
+main_window_help_debug_cb (GtkAction *action,
+ EmpathyMainWindow *window)
+{
+ empathy_debug_dialog_new (GTK_WINDOW (window->window));
+}
+
static void
main_window_help_contents_cb (GtkAction *action,
EmpathyMainWindow *window)
static void
main_window_account_created_or_deleted_cb (EmpathyAccountManager *manager,
- McAccount *account,
+ EmpathyAccount *account,
EmpathyMainWindow *window)
{
gtk_action_set_sensitive (window->view_history,
"edit_personal_information", "activate", main_window_edit_personal_information_cb,
"edit_preferences", "activate", main_window_edit_preferences_cb,
"help_about", "activate", main_window_help_about_cb,
+ "help_debug", "activate", main_window_help_debug_cb,
"help_contents", "activate", main_window_help_contents_cb,
NULL);