Thu, 21 Jul 2022 01:10:22 -0500
Update pidgin for the purple_account_manager_get_(in)active deprecations
Testing Done:
Compiled and made sure the menus still functioned as expected.
Reviewed at https://reviews.imfreedom.org/r/1536/
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Pidgin - Internet Messenger |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #ifdef HAVE_CONFIG_H |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # include <config.h> |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #include <glib.h> |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #include <glib/gi18n-lib.h> |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | #include <glib/gstdio.h> |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include <gplugin.h> |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | #include <purple.h> |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | |
|
40873
68c7ef6c5320
Convert credentials page to use HdyPreferencesGroup and a list box.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
34 | #include <handy.h> |
|
68c7ef6c5320
Convert credentials page to use HdyPreferencesGroup and a list box.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
35 | |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | #include "pidginapplication.h" |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | #include "gtkaccount.h" |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | #include "gtkblist.h" |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
40 | #include "gtkdialogs.h" |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
41 | #include "gtkprivacy.h" |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
42 | #include "gtkroomlist.h" |
|
41320
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
43 | #include "gtksavedstatuses.h" |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
44 | #include "gtkxfer.h" |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
45 | #include "pidginabout.h" |
|
41310
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
46 | #include "pidginaccountmanager.h" |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41441
diff
changeset
|
47 | #include "pidginaccountsdisabledmenu.h" |
|
41304
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
48 | #include "pidginaccountsenabledmenu.h" |
|
41246
d2a2cc448987
Stop reaching into the PidginBuddyList struct from other files
Gary Kramlich <grim@reaperworld.com>
parents:
41234
diff
changeset
|
49 | #include "pidginconversationwindow.h" |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | #include "pidgincore.h" |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | #include "pidgindebug.h" |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
52 | #include "pidginmooddialog.h" |
|
41320
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
53 | #include "pidginpluginsdialog.h" |
|
41414
b76bc2b4d7cc
Convert plugin actions to GMenu and GAction
Gary Kramlich <grim@reaperworld.com>
parents:
41396
diff
changeset
|
54 | #include "pidginpluginsmenu.h" |
|
41416
253e831b0a1e
Remove the manager, editor, and substatus editor from gtksavedstatuses
Gary Kramlich <grim@reaperworld.com>
parents:
41414
diff
changeset
|
55 | #include "pidginstatuseditor.h" |
|
41320
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
56 | #include "pidginstatusmanager.h" |
|
40886
198bf5bc58ce
Move Pidgin preferences code into a subdirectory.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40873
diff
changeset
|
57 | #include "pidginprefs.h" |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | struct _PidginApplication { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | GtkApplication parent; |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
61 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
62 | GHashTable *action_groups; |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | }; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | /****************************************************************************** |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | * Globals |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | *****************************************************************************/ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | static gchar *opt_config_dir_arg = NULL; |
|
41336
844484fb31aa
The debug command line option does not actually take an argument.
Stu Tomlinson <stu@nosnilmot.com>
parents:
41320
diff
changeset
|
69 | static gboolean opt_debug = FALSE; |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | static gboolean opt_nologin = FALSE; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | static GOptionEntry option_entries[] = { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | "config", 'c', 0, G_OPTION_ARG_FILENAME, &opt_config_dir_arg, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | N_("use DIR for config files"), N_("DIR") |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | }, { |
|
41336
844484fb31aa
The debug command line option does not actually take an argument.
Stu Tomlinson <stu@nosnilmot.com>
parents:
41320
diff
changeset
|
77 | "debug", 'd', 0, G_OPTION_ARG_NONE, &opt_debug, |
|
41127
cd297cfc56f3
Move debug command-line option to the UIs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41117
diff
changeset
|
78 | N_("print debugging messages to stdout"), NULL |
|
cd297cfc56f3
Move debug command-line option to the UIs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41117
diff
changeset
|
79 | }, { |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | "nologin", 'n', 0, G_OPTION_ARG_NONE, &opt_nologin, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | N_("don't automatically login"), NULL |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | }, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | "version", 'v', 0, G_OPTION_ARG_NONE, NULL, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | N_("display the current version and exit"), NULL |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | }, { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | NULL |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | }; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | G_DEFINE_TYPE(PidginApplication, pidgin_application, GTK_TYPE_APPLICATION) |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | /****************************************************************************** |
|
41169
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
94 | * Helpers |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
95 | *****************************************************************************/ |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
96 | static void |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
97 | pidgin_application_init_plugins(void) { |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
98 | GPluginManager *manager = gplugin_manager_get_default(); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
99 | |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
100 | gplugin_manager_append_paths_from_environment(manager, |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
101 | "PIDGIN_PLUGIN_PATH"); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
102 | |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
103 | if(g_getenv("PURPLE_PLUGINS_SKIP")) { |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
104 | g_message("PURPLE_PLUGINS_SKIP environment variable set, skipping " |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
105 | "normal Pidgin plugin paths"); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
106 | } else { |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
107 | gchar *path = g_build_filename(purple_data_dir(), "plugins", NULL); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
108 | |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
109 | if(!g_file_test(path, G_FILE_TEST_IS_DIR)) { |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
110 | g_mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
111 | } |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
112 | |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
113 | gplugin_manager_append_path(manager, path); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
114 | g_free(path); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
115 | |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
116 | gplugin_manager_append_path(manager, PIDGIN_LIBDIR); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
117 | } |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
118 | |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
119 | purple_plugins_refresh(); |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
120 | } |
|
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
121 | |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
122 | static void |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
123 | pidgin_application_populate_dynamic_menus(PidginApplication *application) { |
|
41304
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
124 | GMenu *source = NULL, *target = NULL; |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41314
diff
changeset
|
125 | GMenuModel *model = NULL; |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
126 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41441
diff
changeset
|
127 | /* Link the AccountsDisabledMenu into its proper location. */ |
|
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41441
diff
changeset
|
128 | model = pidgin_accounts_disabled_menu_new(); |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
129 | target = gtk_application_get_menu_by_id(GTK_APPLICATION(application), |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41441
diff
changeset
|
130 | "disabled-accounts"); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41314
diff
changeset
|
131 | g_menu_append_section(target, NULL, model); |
|
41304
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
132 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
133 | /* Link the AccountsEnabledMenu into its proper location. */ |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
134 | source = pidgin_accounts_enabled_menu_new(); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
135 | target = gtk_application_get_menu_by_id(GTK_APPLICATION(application), |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
136 | "enabled-accounts"); |
|
41303
c4c79576ef12
Fix a type warning in new dynamic menu
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41298
diff
changeset
|
137 | g_menu_append_section(target, NULL, G_MENU_MODEL(source)); |
|
41414
b76bc2b4d7cc
Convert plugin actions to GMenu and GAction
Gary Kramlich <grim@reaperworld.com>
parents:
41396
diff
changeset
|
138 | |
|
b76bc2b4d7cc
Convert plugin actions to GMenu and GAction
Gary Kramlich <grim@reaperworld.com>
parents:
41396
diff
changeset
|
139 | /* Link the PluginsMenu into its proper location. */ |
|
b76bc2b4d7cc
Convert plugin actions to GMenu and GAction
Gary Kramlich <grim@reaperworld.com>
parents:
41396
diff
changeset
|
140 | model = pidgin_plugins_menu_new(); |
|
b76bc2b4d7cc
Convert plugin actions to GMenu and GAction
Gary Kramlich <grim@reaperworld.com>
parents:
41396
diff
changeset
|
141 | target = gtk_application_get_menu_by_id(GTK_APPLICATION(application), |
|
b76bc2b4d7cc
Convert plugin actions to GMenu and GAction
Gary Kramlich <grim@reaperworld.com>
parents:
41396
diff
changeset
|
142 | "plugins-menu"); |
|
b76bc2b4d7cc
Convert plugin actions to GMenu and GAction
Gary Kramlich <grim@reaperworld.com>
parents:
41396
diff
changeset
|
143 | g_menu_append_section(target, NULL, model); |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
144 | } |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
145 | |
|
41169
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
146 | /****************************************************************************** |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
147 | * Actions |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
148 | *****************************************************************************/ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
149 | /**< private > |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
150 | * pidgin_application_online_actions: |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
151 | * |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
152 | * This list keeps track of which actions should only be enabled while online. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
153 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
154 | static const gchar *pidgin_application_online_actions[] = { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
155 | "add-buddy", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
156 | "add-group", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
157 | "get-user-info", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
158 | "new-message", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
159 | "privacy", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
160 | "set-mood", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
161 | }; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
162 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
163 | /**< private > |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
164 | * pidgin_application_chat_actions: |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
165 | * |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
166 | * This list keeps track of which actions should only be enabled if a protocol |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
167 | * supporting groups chats is connected. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
168 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
169 | static const gchar *pidgin_application_chat_actions[] = { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
170 | "add-chat", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
171 | "join-chat", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
172 | }; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
173 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
174 | /**< private > |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
175 | * pidgin_application_room_list_actions: |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
176 | * |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
177 | * This list keeps track of which actions should only be enabled if an online |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
178 | * account supports room lists. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
179 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
180 | static const gchar *pidgin_application_room_list_actions[] = { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
181 | "room-list", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
182 | }; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
183 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
184 | /*< private > |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
185 | * pidgin_action_group_actions_set_enable: |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
186 | * @group: The #PidginActionGroup instance. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
187 | * @actions: The action names. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
188 | * @n_actions: The number of @actions. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
189 | * @enabled: Whether or not to enable the actions. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
190 | * |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
191 | * Sets the enabled property of the named actions to @enabled. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
192 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
193 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
194 | pidgin_application_actions_set_enabled(PidginApplication *application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
195 | const gchar *const *actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
196 | gint n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
197 | gboolean enabled) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
198 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
199 | gint i = 0; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
200 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
201 | for(i = 0; i < n_actions; i++) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
202 | GAction *action = NULL; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
203 | const gchar *name = actions[i]; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
204 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
205 | action = g_action_map_lookup_action(G_ACTION_MAP(application), name); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
206 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
207 | if(action != NULL) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
208 | g_simple_action_set_enabled(G_SIMPLE_ACTION(action), enabled); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
209 | } else { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
210 | g_warning("Failed to find action named %s", name); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
211 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
212 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
213 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
214 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
215 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
216 | pidgin_application_about(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
217 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
218 | { |
|
41307
685bab46fad2
Move the singleton handling of the about dialog to the action handler.
Gary Kramlich <grim@reaperworld.com>
parents:
41306
diff
changeset
|
219 | static GtkWidget *about = NULL; |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
220 | |
|
41307
685bab46fad2
Move the singleton handling of the about dialog to the action handler.
Gary Kramlich <grim@reaperworld.com>
parents:
41306
diff
changeset
|
221 | if(!GTK_IS_WIDGET(about)) { |
|
685bab46fad2
Move the singleton handling of the about dialog to the action handler.
Gary Kramlich <grim@reaperworld.com>
parents:
41306
diff
changeset
|
222 | about = pidgin_about_dialog_new(); |
|
685bab46fad2
Move the singleton handling of the about dialog to the action handler.
Gary Kramlich <grim@reaperworld.com>
parents:
41306
diff
changeset
|
223 | g_object_add_weak_pointer(G_OBJECT(about), (gpointer)&about); |
|
685bab46fad2
Move the singleton handling of the about dialog to the action handler.
Gary Kramlich <grim@reaperworld.com>
parents:
41306
diff
changeset
|
224 | } |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
225 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
226 | gtk_widget_show_all(about); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
227 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
228 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
229 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
230 | pidgin_application_accounts(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
231 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
232 | { |
|
41310
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
233 | static GtkWidget *manager = NULL; |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
234 | |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
235 | if(!GTK_IS_WIDGET(manager)) { |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
236 | manager = pidgin_account_manager_new(); |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
237 | g_object_add_weak_pointer(G_OBJECT(manager), (gpointer)&manager); |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
238 | } |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
239 | |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
240 | |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
241 | gtk_window_present_with_time(GTK_WINDOW(manager), GDK_CURRENT_TIME); |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
242 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
243 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
244 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
245 | pidgin_application_add_buddy(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
246 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
247 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
248 | purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
249 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
250 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
251 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
252 | pidgin_application_add_chat(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
253 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
254 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
255 | purple_blist_request_add_chat(NULL, NULL, NULL, NULL); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
256 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
257 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
258 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
259 | pidgin_application_add_group(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
260 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
261 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
262 | purple_blist_request_add_group(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
263 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
264 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
265 | static void |
|
41441
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
266 | pidgin_application_connect_account(GSimpleAction *simple, GVariant *parameter, |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
267 | gpointer data) |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
268 | { |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
269 | PurpleAccount *account = NULL; |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
270 | PurpleAccountManager *manager = NULL; |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
271 | const gchar *id = NULL; |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
272 | |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
273 | id = g_variant_get_string(parameter, NULL); |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
274 | |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
275 | manager = purple_account_manager_get_default(); |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
276 | |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
277 | account = purple_account_manager_find_by_id(manager, id); |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
278 | if(PURPLE_IS_ACCOUNT(account)) { |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
279 | purple_account_connect(account); |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
280 | } |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
281 | } |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
282 | |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
283 | static void |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
284 | pidgin_application_debug(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
285 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
286 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
287 | gboolean old = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled"); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
288 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", !old); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
289 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
290 | |
|
41304
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
291 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
292 | static void |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
293 | pidgin_application_disable_account(GSimpleAction *simple, GVariant *parameter, |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
294 | gpointer data) |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
295 | { |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
296 | PurpleAccount *account = NULL; |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
297 | PurpleAccountManager *manager = NULL; |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
298 | const gchar *id = NULL; |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
299 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
300 | id = g_variant_get_string(parameter, NULL); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
301 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
302 | manager = purple_account_manager_get_default(); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
303 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
304 | account = purple_account_manager_find_by_id(manager, id); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
305 | if(PURPLE_IS_ACCOUNT(account)) { |
|
41392
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41354
diff
changeset
|
306 | if(purple_account_get_enabled(account)) { |
|
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41354
diff
changeset
|
307 | purple_account_set_enabled(account, FALSE); |
|
41304
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
308 | } |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
309 | } |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
310 | } |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
311 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
312 | static void |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
313 | pidgin_application_edit_account(GSimpleAction *simple, GVariant *parameter, |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
314 | gpointer data) |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
315 | { |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
316 | PurpleAccount *account = NULL; |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
317 | PurpleAccountManager *manager = NULL; |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
318 | const gchar *id = NULL; |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
319 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
320 | id = g_variant_get_string(parameter, NULL); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
321 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
322 | manager = purple_account_manager_get_default(); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
323 | |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
324 | account = purple_account_manager_find_by_id(manager, id); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
325 | if(PURPLE_IS_ACCOUNT(account)) { |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
326 | pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
327 | } |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
328 | } |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
329 | |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
330 | static void |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
331 | pidgin_application_enable_account(GSimpleAction *simple, GVariant *parameter, |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
332 | gpointer data) |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
333 | { |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
334 | PurpleAccount *account = NULL; |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
335 | PurpleAccountManager *manager = NULL; |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
336 | const gchar *id = NULL; |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
337 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
338 | id = g_variant_get_string(parameter, NULL); |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
339 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
340 | manager = purple_account_manager_get_default(); |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
341 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
342 | account = purple_account_manager_find_by_id(manager, id); |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
343 | if(PURPLE_IS_ACCOUNT(account)) { |
|
41392
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41354
diff
changeset
|
344 | if(!purple_account_get_enabled(account)) { |
|
b5c84f55d5d2
Remove the ui parameter from purple_account_[gs]et_enabled
Gary Kramlich <grim@reaperworld.com>
parents:
41354
diff
changeset
|
345 | purple_account_set_enabled(account, TRUE); |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
346 | } |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
347 | } |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
348 | } |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
349 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
350 | static void |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
351 | pidgin_application_file_transfers(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
352 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
353 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
354 | pidgin_xfer_dialog_show(NULL); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
355 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
356 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
357 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
358 | pidgin_application_get_user_info(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
359 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
360 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
361 | pidgin_dialogs_info(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
362 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
363 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
364 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
365 | pidgin_application_join_chat(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
366 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
367 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
368 | pidgin_blist_joinchat_show(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
369 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
370 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
371 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
372 | pidgin_application_new_message(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
373 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
374 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
375 | pidgin_dialogs_im(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
376 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
377 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
378 | static void |
|
41320
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
379 | pidgin_application_new_status(G_GNUC_UNUSED GSimpleAction *simple, |
|
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
380 | G_GNUC_UNUSED GVariant *parameter, |
|
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
381 | G_GNUC_UNUSED gpointer data) |
|
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
382 | { |
|
41416
253e831b0a1e
Remove the manager, editor, and substatus editor from gtksavedstatuses
Gary Kramlich <grim@reaperworld.com>
parents:
41414
diff
changeset
|
383 | GtkWidget *editor = pidgin_status_editor_new(NULL); |
|
253e831b0a1e
Remove the manager, editor, and substatus editor from gtksavedstatuses
Gary Kramlich <grim@reaperworld.com>
parents:
41414
diff
changeset
|
384 | gtk_widget_show(editor); |
|
41320
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
385 | } |
|
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
386 | |
|
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
387 | static void |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
388 | pidgin_application_online_help(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
389 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
390 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
391 | purple_notify_uri(NULL, PURPLE_WEBSITE "help"); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
392 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
393 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
394 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
395 | pidgin_application_plugins(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
396 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
397 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
398 | GtkWidget *dialog = pidgin_plugins_dialog_new(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
399 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
400 | /* fixme? */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
401 | #if 0 |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
402 | gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window)); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
403 | #endif |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
404 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
405 | gtk_widget_show_all(dialog); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
406 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
407 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
408 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
409 | pidgin_application_preferences(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
410 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
411 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
412 | pidgin_prefs_show(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
413 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
414 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
415 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
416 | pidgin_application_privacy(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
417 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
418 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
419 | pidgin_privacy_dialog_show(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
420 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
421 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
422 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
423 | pidgin_application_quit(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
424 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
425 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
426 | purple_core_quit(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
427 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
428 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
429 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
430 | pidgin_application_room_list(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
431 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
432 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
433 | pidgin_roomlist_dialog_show(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
434 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
435 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
436 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
437 | pidgin_application_set_mood(GSimpleAction *simple, GVariant *parameter, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
438 | gpointer data) |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
439 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
440 | pidgin_mood_dialog_show(NULL); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
441 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
442 | |
|
41234
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
443 | static void |
|
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
444 | pidgin_application_show_status_manager(GSimpleAction *simple, |
|
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
445 | GVariant *parameter, gpointer data) |
|
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
446 | { |
|
41306
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
447 | static GtkWidget *manager = NULL; |
|
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
448 | |
|
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
449 | if(!GTK_IS_WIDGET(manager)) { |
|
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
450 | manager = pidgin_status_manager_new(); |
|
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
451 | g_object_add_weak_pointer(G_OBJECT(manager), (gpointer)&manager); |
|
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
452 | } |
|
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
453 | |
|
8befd71928c2
Create a new status manager that's built in glade
Gary Kramlich <grim@reaperworld.com>
parents:
41304
diff
changeset
|
454 | gtk_widget_show_all(manager); |
|
41234
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
455 | } |
|
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
456 | |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
457 | static GActionEntry app_entries[] = { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
458 | { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
459 | .name = "about", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
460 | .activate = pidgin_application_about, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
461 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
462 | .name = "add-buddy", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
463 | .activate = pidgin_application_add_buddy, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
464 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
465 | .name = "add-chat", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
466 | .activate = pidgin_application_add_chat, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
467 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
468 | .name = "add-group", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
469 | .activate = pidgin_application_add_group, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
470 | }, { |
|
41441
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
471 | .name = "connect-account", |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
472 | .activate = pidgin_application_connect_account, |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
473 | .parameter_type = "s", |
|
e114ed471a1e
Implement the UI for the new Notifications API.
Gary Kramlich <grim@reaperworld.com>
parents:
41416
diff
changeset
|
474 | }, { |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
475 | .name = "debug", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
476 | .activate = pidgin_application_debug, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
477 | }, { |
|
41304
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
478 | .name = "disable-account", |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
479 | .activate = pidgin_application_disable_account, |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
480 | .parameter_type = "s", |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
481 | }, { |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
482 | .name = "edit-account", |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
483 | .activate = pidgin_application_edit_account, |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
484 | .parameter_type = "s", |
|
25830cad9bfc
Add a menu controller for the accounts enabled section of the accounts menu
Gary Kramlich <grim@reaperworld.com>
parents:
41303
diff
changeset
|
485 | }, { |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
486 | .name = "enable-account", |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
487 | .activate = pidgin_application_enable_account, |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
488 | .parameter_type = "s", |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
489 | }, { |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
490 | .name = "file-transfers", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
491 | .activate = pidgin_application_file_transfers, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
492 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
493 | .name = "get-user-info", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
494 | .activate = pidgin_application_get_user_info, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
495 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
496 | .name = "join-chat", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
497 | .activate = pidgin_application_join_chat, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
498 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
499 | .name = "manage-accounts", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
500 | .activate = pidgin_application_accounts, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
501 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
502 | .name = "manage-plugins", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
503 | .activate = pidgin_application_plugins, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
504 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
505 | .name = "new-message", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
506 | .activate = pidgin_application_new_message, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
507 | }, { |
|
41320
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
508 | .name = "new-status", |
|
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
509 | .activate = pidgin_application_new_status, |
|
1695e758b590
Overhaul the status box
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
510 | }, { |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
511 | .name = "online-help", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
512 | .activate = pidgin_application_online_help, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
513 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
514 | .name = "preferences", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
515 | .activate = pidgin_application_preferences, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
516 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
517 | .name = "privacy", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
518 | .activate = pidgin_application_privacy, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
519 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
520 | .name = "quit", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
521 | .activate = pidgin_application_quit, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
522 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
523 | .name = "room-list", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
524 | .activate = pidgin_application_room_list, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
525 | }, { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
526 | .name = "set-mood", |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
527 | .activate = pidgin_application_set_mood, |
|
41234
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
528 | }, { |
|
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
529 | .name = "status-manager", |
|
293ee44d15a7
Add a statuses item to the tools menu that opens the status manager
Gary Kramlich <grim@reaperworld.com>
parents:
41209
diff
changeset
|
530 | .activate = pidgin_application_show_status_manager, |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
531 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
532 | }; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
533 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
534 | /****************************************************************************** |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
535 | * Purple Signal Callbacks |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
536 | *****************************************************************************/ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
537 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
538 | pidgin_application_online_cb(gpointer data) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
539 | gint n_actions = G_N_ELEMENTS(pidgin_application_online_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
540 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
541 | pidgin_application_actions_set_enabled(PIDGIN_APPLICATION(data), |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
542 | pidgin_application_online_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
543 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
544 | TRUE); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
545 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
546 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
547 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
548 | pidgin_application_offline_cb(gpointer data) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
549 | gint n_actions = G_N_ELEMENTS(pidgin_application_online_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
550 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
551 | pidgin_application_actions_set_enabled(PIDGIN_APPLICATION(data), |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
552 | pidgin_application_online_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
553 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
554 | FALSE); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
555 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
556 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
557 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
558 | pidgin_application_signed_on_cb(PurpleAccount *account, gpointer data) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
559 | PidginApplication *application = PIDGIN_APPLICATION(data); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
560 | PurpleProtocol *protocol = NULL; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
561 | gboolean should_enable_chat = FALSE, should_enable_room_list = FALSE; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
562 | gint n_actions = 0; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
563 | |
|
40803
0e11ce1049b2
Port Pidgin from purple_protocols to PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents:
40683
diff
changeset
|
564 | protocol = purple_account_get_protocol(account); |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
565 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
566 | /* We assume that the current state is correct, so we don't bother changing |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
567 | * state unless the newly connected account implements the chat interface, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
568 | * which would cause a state change. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
569 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
570 | should_enable_chat = PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, info); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
571 | if(should_enable_chat) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
572 | n_actions = G_N_ELEMENTS(pidgin_application_chat_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
573 | pidgin_application_actions_set_enabled(application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
574 | pidgin_application_chat_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
575 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
576 | TRUE); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
577 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
578 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
579 | /* likewise, for the room list, we only care about enabling in this |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
580 | * handler. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
581 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
582 | should_enable_room_list = PURPLE_PROTOCOL_IMPLEMENTS(protocol, ROOMLIST, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
583 | get_list); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
584 | if(should_enable_room_list) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
585 | n_actions = G_N_ELEMENTS(pidgin_application_room_list_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
586 | pidgin_application_actions_set_enabled(application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
587 | pidgin_application_room_list_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
588 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
589 | TRUE); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
590 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
591 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
592 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
593 | static void |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
594 | pidgin_application_signed_off_cb(PurpleAccount *account, gpointer data) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
595 | PidginApplication *application = PIDGIN_APPLICATION(data); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
596 | gboolean should_disable_chat = TRUE, should_disable_room_list = TRUE; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
597 | GList *connections = NULL, *l = NULL; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
598 | gint n_actions = 0; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
599 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
600 | /* walk through all the connections, looking for online ones that implement |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
601 | * the chat interface. We don't bother checking the account that this |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
602 | * signal was emitted for, because it's already offline and will be |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
603 | * filtered out by the online check. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
604 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
605 | connections = purple_connections_get_all(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
606 | for(l = connections; l != NULL; l = l->next) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
607 | PurpleConnection *connection = PURPLE_CONNECTION(l->data); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
608 | PurpleProtocol *protocol = NULL; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
609 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
610 | /* if the connection isn't online, we don't care about it */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
611 | if(!PURPLE_CONNECTION_IS_CONNECTED(connection)) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
612 | continue; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
613 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
614 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
615 | protocol = purple_connection_get_protocol(connection); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
616 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
617 | /* check if the protocol implements the chat interface */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
618 | if(PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, info)) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
619 | should_disable_chat = FALSE; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
620 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
621 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
622 | /* check if the protocol implements the room list interface */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
623 | if(PURPLE_PROTOCOL_IMPLEMENTS(protocol, ROOMLIST, get_list)) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
624 | should_disable_room_list = FALSE; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
625 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
626 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
627 | /* if we can't disable both, we can bail out of the loop */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
628 | if(!should_disable_chat && !should_disable_room_list) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
629 | break; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
630 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
631 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
632 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
633 | if(should_disable_chat) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
634 | n_actions = G_N_ELEMENTS(pidgin_application_chat_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
635 | pidgin_application_actions_set_enabled(application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
636 | pidgin_application_chat_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
637 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
638 | FALSE); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
639 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
640 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
641 | if(should_disable_room_list) { |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
642 | n_actions = G_N_ELEMENTS(pidgin_application_room_list_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
643 | pidgin_application_actions_set_enabled(application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
644 | pidgin_application_room_list_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
645 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
646 | FALSE); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
647 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
648 | } |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
649 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
650 | /****************************************************************************** |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
651 | * GtkApplication Implementation |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
652 | *****************************************************************************/ |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
653 | static void |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
654 | pidgin_application_window_added(GtkApplication *application, |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
655 | GtkWindow *window) |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
656 | { |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
657 | PidginApplication *pidgin_application = PIDGIN_APPLICATION(application); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
658 | GHashTableIter iter; |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
659 | gpointer key, value; |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
660 | |
|
41354
ba08026458f4
Chain up to the parent class's implementation of the window_added default signal handler
Gary Kramlich <grim@reaperworld.com>
parents:
41353
diff
changeset
|
661 | GTK_APPLICATION_CLASS(pidgin_application_parent_class)->window_added(application, |
|
ba08026458f4
Chain up to the parent class's implementation of the window_added default signal handler
Gary Kramlich <grim@reaperworld.com>
parents:
41353
diff
changeset
|
662 | window); |
|
ba08026458f4
Chain up to the parent class's implementation of the window_added default signal handler
Gary Kramlich <grim@reaperworld.com>
parents:
41353
diff
changeset
|
663 | |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
664 | g_hash_table_iter_init(&iter, pidgin_application->action_groups); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
665 | while(g_hash_table_iter_next(&iter, &key, &value)) { |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
666 | GActionGroup *action_group = value; |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
667 | gchar *prefix = key; |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
668 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
669 | gtk_widget_insert_action_group(GTK_WIDGET(window), prefix, |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
670 | action_group); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
671 | } |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
672 | } |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
673 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
674 | /****************************************************************************** |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
675 | * GApplication Implementation |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
676 | *****************************************************************************/ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
677 | static void |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
678 | pidgin_application_startup(GApplication *application) { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41169
diff
changeset
|
679 | PurpleAccountManager *manager = NULL; |
|
41396
2ef3d6eeffb3
Update purple_core_init to take a PurpleUiInfo instance
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
680 | PurpleUiInfo *ui_info = NULL; |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
681 | GtkCssProvider *provider = NULL; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
682 | GError *error = NULL; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
683 | GList *active_accounts = NULL; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
684 | gchar *search_path = NULL; |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
685 | gpointer handle = NULL; |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
686 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
687 | G_APPLICATION_CLASS(pidgin_application_parent_class)->startup(application); |
|
40873
68c7ef6c5320
Convert credentials page to use HdyPreferencesGroup and a list box.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
688 | hdy_init(); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
689 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
690 | /* set a user-specified config directory */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
691 | if (opt_config_dir_arg != NULL) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
692 | if (g_path_is_absolute(opt_config_dir_arg)) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
693 | purple_util_set_user_dir(opt_config_dir_arg); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
694 | } else { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
695 | /* Make an absolute (if not canonical) path */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
696 | gchar *cwd = g_get_current_dir(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
697 | gchar *path = g_build_filename(cwd, opt_config_dir_arg, NULL); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
698 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
699 | purple_util_set_user_dir(path); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
700 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
701 | g_free(cwd); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
702 | g_free(path); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
703 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
704 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
705 | |
|
41117
6dc7e403f8f2
Initialize Pidgin GLib logging handler earlier
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41106
diff
changeset
|
706 | pidgin_debug_init_handler(); |
|
41127
cd297cfc56f3
Move debug command-line option to the UIs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41117
diff
changeset
|
707 | #ifdef DEBUG |
|
cd297cfc56f3
Move debug command-line option to the UIs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41117
diff
changeset
|
708 | pidgin_debug_set_print_enabled(TRUE); |
|
41336
844484fb31aa
The debug command line option does not actually take an argument.
Stu Tomlinson <stu@nosnilmot.com>
parents:
41320
diff
changeset
|
709 | #else |
|
844484fb31aa
The debug command line option does not actually take an argument.
Stu Tomlinson <stu@nosnilmot.com>
parents:
41320
diff
changeset
|
710 | pidgin_debug_set_print_enabled(opt_debug); |
|
41127
cd297cfc56f3
Move debug command-line option to the UIs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41117
diff
changeset
|
711 | #endif |
|
41117
6dc7e403f8f2
Initialize Pidgin GLib logging handler earlier
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41106
diff
changeset
|
712 | |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
713 | provider = gtk_css_provider_new(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
714 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
715 | search_path = g_build_filename(purple_config_dir(), "gtk-3.0.css", NULL); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
716 | gtk_css_provider_load_from_path(provider, search_path, &error); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
717 | if(error != NULL) { |
|
41134
138d55c90767
Adjust some debug levels which were throwing warning messages when they shouldn't have
Gary Kramlich <grim@reaperworld.com>
parents:
41127
diff
changeset
|
718 | purple_debug_info("gtk", "Unable to load custom gtk-3.0.css: %s\n", |
|
138d55c90767
Adjust some debug levels which were throwing warning messages when they shouldn't have
Gary Kramlich <grim@reaperworld.com>
parents:
41127
diff
changeset
|
719 | error->message); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
720 | g_clear_error(&error); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
721 | } else { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
722 | GdkScreen *screen = gdk_screen_get_default(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
723 | gtk_style_context_add_provider_for_screen(screen, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
724 | GTK_STYLE_PROVIDER(provider), |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
725 | GTK_STYLE_PROVIDER_PRIORITY_USER); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
726 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
727 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
728 | g_free(search_path); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
729 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
730 | #ifdef _WIN32 |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
731 | winpidgin_init(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
732 | #endif |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
733 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
734 | purple_core_set_ui_ops(pidgin_core_get_ui_ops()); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
735 | |
|
41396
2ef3d6eeffb3
Update purple_core_init to take a PurpleUiInfo instance
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
736 | ui_info = purple_ui_info_new(PIDGIN_UI, PIDGIN_NAME, VERSION, |
|
2ef3d6eeffb3
Update purple_core_init to take a PurpleUiInfo instance
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
737 | "https://pidgin.im", |
|
2ef3d6eeffb3
Update purple_core_init to take a PurpleUiInfo instance
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
738 | "https://developer.pidgin.im", "pc"); |
|
2ef3d6eeffb3
Update purple_core_init to take a PurpleUiInfo instance
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
739 | |
|
2ef3d6eeffb3
Update purple_core_init to take a PurpleUiInfo instance
Gary Kramlich <grim@reaperworld.com>
parents:
41392
diff
changeset
|
740 | if(!purple_core_init(ui_info)) { |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
741 | fprintf(stderr, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
742 | _("Initialization of the libpurple core failed. Aborting!\n" |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
743 | "Please report this!\n")); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
744 | g_abort(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
745 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
746 | |
|
41169
4103b3869912
Upgrade to gplugin 0.37.0
Gary Kramlich <grim@reaperworld.com>
parents:
41134
diff
changeset
|
747 | pidgin_application_init_plugins(); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
748 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
749 | /* load plugins we had when we quit */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
750 | purple_plugins_load_saved(PIDGIN_PREFS_ROOT "/plugins/loaded"); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
751 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
752 | /* gk 20201008: this needs to be moved to the buddy list initialization. */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
753 | pidgin_blist_setup_sort_methods(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
754 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
755 | gtk_window_set_default_icon_name("pidgin"); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
756 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
757 | g_free(opt_config_dir_arg); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
758 | opt_config_dir_arg = NULL; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
759 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
760 | /* |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
761 | * We want to show the blist early in the init process so the |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
762 | * user feels warm and fuzzy. |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
763 | */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
764 | purple_blist_show(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
765 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
766 | if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
767 | pidgin_debug_window_show(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
768 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
769 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
770 | if(opt_nologin) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
771 | /* Set all accounts to "offline" */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
772 | PurpleSavedStatus *saved_status; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
773 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
774 | /* If we've used this type+message before, lookup the transient status */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
775 | saved_status = purple_savedstatus_find_transient_by_type_and_message( |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
776 | PURPLE_STATUS_OFFLINE, NULL); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
777 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
778 | /* If this type+message is unique then create a new transient saved status */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
779 | if(saved_status == NULL) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
780 | saved_status = purple_savedstatus_new(NULL, PURPLE_STATUS_OFFLINE); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
781 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
782 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
783 | /* Set the status for each account */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
784 | purple_savedstatus_activate(saved_status); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
785 | } else { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
786 | /* Everything is good to go--sign on already */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
787 | if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
788 | purple_savedstatus_activate(purple_savedstatus_get_startup()); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
789 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
790 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
791 | purple_accounts_restore_current_statuses(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
792 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
793 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41169
diff
changeset
|
794 | manager = purple_account_manager_get_default(); |
|
41454
7cc69bde919d
Update pidgin for the purple_account_manager_get_(in)active deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
41450
diff
changeset
|
795 | active_accounts = purple_account_manager_get_enabled(manager); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41169
diff
changeset
|
796 | if(active_accounts == NULL) { |
|
41310
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
797 | g_action_group_activate_action(G_ACTION_GROUP(application), |
|
53e4815ef254
Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
41307
diff
changeset
|
798 | "manage-accounts", NULL); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
799 | } else { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
800 | g_list_free(active_accounts); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
801 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
802 | |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
803 | /* Populate our dynamic menus. */ |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
804 | pidgin_application_populate_dynamic_menus(PIDGIN_APPLICATION(application)); |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
41246
diff
changeset
|
805 | |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
806 | /* GTK clears the notification for us when opening the first window, but we |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
807 | * may have launched with only a status icon, so clear it just in case. |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
808 | */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
809 | gdk_notify_startup_complete(); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
810 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
811 | /* TODO: Use GtkApplicationWindow or add a window instead */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
812 | g_application_hold(application); |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
813 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
814 | /* connect to the online and offline signals in purple connections. This |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
815 | * is used to toggle states of actions that require being online. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
816 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
817 | handle = purple_connections_get_handle(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
818 | purple_signal_connect(handle, "online", application, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41310
diff
changeset
|
819 | G_CALLBACK(pidgin_application_online_cb), |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
820 | application); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
821 | purple_signal_connect(handle, "offline", application, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41310
diff
changeset
|
822 | G_CALLBACK(pidgin_application_offline_cb), |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
823 | application); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
824 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
825 | /* connect to account-signed-on and account-signed-off to toggle actions |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
826 | * that depend on specific interfaces in accounts. |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
827 | */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
828 | handle = purple_accounts_get_handle(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
829 | purple_signal_connect(handle, "account-signed-on", application, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41310
diff
changeset
|
830 | G_CALLBACK(pidgin_application_signed_on_cb), |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
831 | application); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
832 | purple_signal_connect(handle, "account-signed-off", application, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41310
diff
changeset
|
833 | G_CALLBACK(pidgin_application_signed_off_cb), |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
834 | application); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
835 | |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
836 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
837 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
838 | static void |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
839 | pidgin_application_activate(GApplication *application) { |
|
41246
d2a2cc448987
Stop reaching into the PidginBuddyList struct from other files
Gary Kramlich <grim@reaperworld.com>
parents:
41234
diff
changeset
|
840 | GtkWidget *convwin = pidgin_conversation_window_get_default(); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
841 | |
|
41246
d2a2cc448987
Stop reaching into the PidginBuddyList struct from other files
Gary Kramlich <grim@reaperworld.com>
parents:
41234
diff
changeset
|
842 | if(GTK_IS_WINDOW(convwin)) { |
|
d2a2cc448987
Stop reaching into the PidginBuddyList struct from other files
Gary Kramlich <grim@reaperworld.com>
parents:
41234
diff
changeset
|
843 | gtk_window_present(GTK_WINDOW(convwin)); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
844 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
845 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
846 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
847 | static gint |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
848 | pidgin_application_command_line(GApplication *application, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
849 | GApplicationCommandLine *cmdline) |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
850 | { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
851 | gchar **argv = NULL; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
852 | gint argc = 0, i = 0; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
853 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
854 | argv = g_application_command_line_get_arguments(cmdline, &argc); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
855 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
856 | if(argc == 1) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
857 | /* No arguments, just activate */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
858 | g_application_activate(application); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
859 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
860 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
861 | /* Start at 1 to skip the executable name */ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
862 | for (i = 1; i < argc; i++) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
863 | purple_got_protocol_handler_uri(argv[i]); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
864 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
865 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
866 | g_strfreev(argv); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
867 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
868 | return 0; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
869 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
870 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
871 | static gint |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
872 | pidgin_application_handle_local_options(GApplication *application, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
873 | GVariantDict *options) |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
874 | { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
875 | if (g_variant_dict_contains(options, "version")) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
876 | printf("%s %s (libpurple %s)\n", PIDGIN_NAME, DISPLAY_VERSION, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
877 | purple_core_get_version()); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
878 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
879 | return 0; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
880 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
881 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
882 | return -1; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
883 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
884 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
885 | /****************************************************************************** |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
886 | * GObject Implementation |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
887 | *****************************************************************************/ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
888 | static void |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
889 | pidgin_application_dispose(GObject *obj) { |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
890 | PidginApplication *application = PIDGIN_APPLICATION(obj); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
891 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
892 | g_clear_pointer(&application->action_groups, g_hash_table_destroy); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
893 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
894 | G_OBJECT_CLASS(pidgin_application_parent_class)->dispose(obj); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
895 | } |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
896 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
897 | static void |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
898 | pidgin_application_init(PidginApplication *application) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
899 | GApplication *gapp = G_APPLICATION(application); |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
900 | gboolean online = FALSE; |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
901 | gint n_actions = 0; |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
902 | |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
903 | application->action_groups = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
904 | g_free, g_object_unref); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
905 | |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
906 | g_application_add_main_option_entries(gapp, option_entries); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
907 | g_application_add_option_group(gapp, purple_get_option_group()); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
908 | g_application_add_option_group(gapp, gplugin_get_option_group()); |
|
40600
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
909 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
910 | g_action_map_add_action_entries(G_ACTION_MAP(application), app_entries, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
911 | G_N_ELEMENTS(app_entries), application); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
912 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
913 | /* Set the default state for our actions to match our online state. */ |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
914 | online = purple_connections_is_online(); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
915 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
916 | n_actions = G_N_ELEMENTS(pidgin_application_online_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
917 | pidgin_application_actions_set_enabled(application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
918 | pidgin_application_online_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
919 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
920 | online); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
921 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
922 | n_actions = G_N_ELEMENTS(pidgin_application_chat_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
923 | pidgin_application_actions_set_enabled(application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
924 | pidgin_application_chat_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
925 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
926 | online); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
927 | |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
928 | n_actions = G_N_ELEMENTS(pidgin_application_room_list_actions); |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
929 | pidgin_application_actions_set_enabled(application, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
930 | pidgin_application_room_list_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
931 | n_actions, |
|
46d10c72c137
Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
40555
diff
changeset
|
932 | online); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
933 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
934 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
935 | static void |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
936 | pidgin_application_class_init(PidginApplicationClass *klass) { |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
937 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
938 | GApplicationClass *app_class = G_APPLICATION_CLASS(klass); |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
939 | GtkApplicationClass *gtk_app_class = GTK_APPLICATION_CLASS(klass); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
940 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
941 | obj_class->dispose = pidgin_application_dispose; |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
942 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
943 | app_class->startup = pidgin_application_startup; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
944 | app_class->activate = pidgin_application_activate; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
945 | app_class->command_line = pidgin_application_command_line; |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
946 | app_class->handle_local_options = pidgin_application_handle_local_options; |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
947 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
948 | gtk_app_class->window_added = pidgin_application_window_added; |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
949 | } |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
950 | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
951 | /****************************************************************************** |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
952 | * Public API |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
953 | *****************************************************************************/ |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
954 | GApplication * |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
955 | pidgin_application_new(void) { |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
956 | return g_object_new( |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
957 | PIDGIN_TYPE_APPLICATION, |
|
40607
807f0b114d36
Add an application ID to Pidgin.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40600
diff
changeset
|
958 | "application-id", "im.pidgin.Pidgin3", |
|
40553
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
959 | "flags", G_APPLICATION_CAN_OVERRIDE_APP_ID | |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
960 | G_APPLICATION_HANDLES_COMMAND_LINE, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
961 | "register-session", TRUE, |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
962 | NULL); |
|
892459990bb7
Create a proper GtkApplication subclass for Pidgin and use it.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
963 | } |
|
41353
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
964 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
965 | void |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
966 | pidgin_application_add_action_group(PidginApplication *application, |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
967 | const gchar *prefix, |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
968 | GActionGroup *action_group) |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
969 | { |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
970 | GList *windows = NULL; |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
971 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
972 | g_return_if_fail(prefix != NULL); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
973 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
974 | if(G_IS_ACTION_GROUP(action_group)) { |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
975 | /* If action_group is valid, we need to create new references to the |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
976 | * prefix and action_group when inserting them into the hash table. |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
977 | */ |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
978 | g_hash_table_insert(application->action_groups, g_strdup(prefix), |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
979 | g_object_ref(action_group)); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
980 | } else { |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
981 | g_hash_table_remove(application->action_groups, prefix); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
982 | } |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
983 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
984 | /* Now walk through the windows and add/remove the action group. */ |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
985 | windows = gtk_application_get_windows(GTK_APPLICATION(application)); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
986 | while(windows != NULL) { |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
987 | GtkWidget *window = GTK_WIDGET(windows->data); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
988 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
989 | gtk_widget_insert_action_group(window, prefix, action_group); |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
990 | |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
991 | windows = windows->next; |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
992 | } |
|
2b364a6512cc
Make PidginApplication manage action groups for all windows
Gary Kramlich <grim@reaperworld.com>
parents:
41336
diff
changeset
|
993 | } |