annotate pidgin/plugins/timestamp_format.c @ 30137:4e7a9940627e

Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except for a few things that aren't in GTK+ releases yet.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Tue, 13 Apr 2010 23:22:31 +0000
parents 9ec94a37446a
children 446f208e5765
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 #include "internal.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 #include "debug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4 #include "log.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 #include "plugin.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 #include "util.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 #include "version.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 #include "gtkconv.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 #include "gtkplugin.h"
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
11 #include "gtkimhtml.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 #include <time.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
15 static PurplePluginPrefFrame *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
16 get_plugin_pref_frame(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
18 PurplePluginPrefFrame *frame;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
19 PurplePluginPref *ppref;
16012
765cfc73182f more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents: 15878
diff changeset
20 char *tmp;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
22 frame = purple_plugin_pref_frame_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
24 ppref = purple_plugin_pref_new_with_label(_("Timestamp Format Options"));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
25 purple_plugin_pref_frame_add(frame, ppref);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
16931
09f0bb67a87f Traditional Pidgin doesn't make any sense. It was only ever the case for
Richard Laager <rlaager@wiktel.com>
parents: 16819
diff changeset
27 tmp = g_strdup_printf(_("_Force 24-hour time format"));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
28 ppref = purple_plugin_pref_new_with_name_and_label(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 "/plugins/gtk/timestamp_format/force_24hr",
16012
765cfc73182f more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents: 15878
diff changeset
30 tmp);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
31 purple_plugin_pref_frame_add(frame, ppref);
16012
765cfc73182f more help for translators (I removed a few PIDGIN_NAME references
Nathan Walp <nwalp@pidgin.im>
parents: 15878
diff changeset
32 g_free(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
34 ppref = purple_plugin_pref_new_with_label(_("Show dates in..."));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
35 purple_plugin_pref_frame_add(frame, ppref);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
37 ppref = purple_plugin_pref_new_with_name_and_label(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 "/plugins/gtk/timestamp_format/use_dates/conversation",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 _("Co_nversations:"));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
40 purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
41 purple_plugin_pref_add_choice(ppref, _("For delayed messages"), "automatic");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
42 purple_plugin_pref_add_choice(ppref, _("For delayed messages and in chats"), "chats");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
43 purple_plugin_pref_add_choice(ppref, _("Always"), "always");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
44 purple_plugin_pref_frame_add(frame, ppref);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
46 ppref = purple_plugin_pref_new_with_name_and_label(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 "/plugins/gtk/timestamp_format/use_dates/log",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 _("_Message Logs:"));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
49 purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
50 purple_plugin_pref_add_choice(ppref, _("For delayed messages"), "automatic");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
51 purple_plugin_pref_add_choice(ppref, _("For delayed messages and in chats"), "chats");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
52 purple_plugin_pref_add_choice(ppref, _("Always"), "always");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
53 purple_plugin_pref_frame_add(frame, ppref);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 return frame;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
58 static char *timestamp_cb_common(PurpleConversation *conv,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 time_t t,
15519
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
60 gboolean show_date,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 gboolean force,
16819
422bcef3154c Fix ticket #559:
Stu Tomlinson <stu@nosnilmot.com>
parents: 16678
diff changeset
62 const char *dates,
422bcef3154c Fix ticket #559:
Stu Tomlinson <stu@nosnilmot.com>
parents: 16678
diff changeset
63 gboolean parens)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 g_return_val_if_fail(dates != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66
15519
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
67 if (show_date ||
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
68 !strcmp(dates, "always") ||
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
69 (conv != NULL && purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT && !strcmp(dates, "chats")))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 {
15519
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
71 struct tm *tm = localtime(&t);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 if (force)
16819
422bcef3154c Fix ticket #559:
Stu Tomlinson <stu@nosnilmot.com>
parents: 16678
diff changeset
73 return g_strdup_printf("%s%s%s", parens ? "(" : "", purple_utf8_strftime("%Y-%m-%d %H:%M:%S", tm), parens ? ")" : "");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 else
16819
422bcef3154c Fix ticket #559:
Stu Tomlinson <stu@nosnilmot.com>
parents: 16678
diff changeset
75 return g_strdup_printf("%s%s%s", parens ? "(" : "", purple_date_format_long(tm), parens ? ")" : "");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 if (force)
15519
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
79 {
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
80 struct tm *tm = localtime(&t);
16819
422bcef3154c Fix ticket #559:
Stu Tomlinson <stu@nosnilmot.com>
parents: 16678
diff changeset
81 return g_strdup_printf("%s%s%s", parens ? "(" : "", purple_utf8_strftime("%H:%M:%S", tm), parens ? ")" : "");
15519
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
82 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
87 static char *conversation_timestamp_cb(PurpleConversation *conv,
15519
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
88 time_t t, gboolean show_date, gpointer data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
90 gboolean force = purple_prefs_get_bool(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 "/plugins/gtk/timestamp_format/force_24hr");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
92 const char *dates = purple_prefs_get_string(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 "/plugins/gtk/timestamp_format/use_dates/conversation");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96
16819
422bcef3154c Fix ticket #559:
Stu Tomlinson <stu@nosnilmot.com>
parents: 16678
diff changeset
97 return timestamp_cb_common(conv, t, show_date, force, dates, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
100 static char *log_timestamp_cb(PurpleLog *log, time_t t, gboolean show_date, gpointer data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
102 gboolean force = purple_prefs_get_bool(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 "/plugins/gtk/timestamp_format/force_24hr");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
104 const char *dates = purple_prefs_get_string(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 "/plugins/gtk/timestamp_format/use_dates/log");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 g_return_val_if_fail(log != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108
16819
422bcef3154c Fix ticket #559:
Stu Tomlinson <stu@nosnilmot.com>
parents: 16678
diff changeset
109 return timestamp_cb_common(log->conv, t, show_date, force, dates, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
112 static void
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
113 menu_cb(GtkWidget *item, gpointer data)
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
114 {
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
115 PurplePlugin *plugin = data;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
116 GtkWidget *frame = pidgin_plugin_get_config_frame(plugin), *dialog;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
117 if (!frame)
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
118 return;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
119
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
120 dialog = gtk_dialog_new_with_buttons(PIDGIN_ALERT_TITLE, NULL,
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
121 GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT,
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
122 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
123 NULL);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
124 g_signal_connect_after(G_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), dialog);
30137
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
125 #if GTK_CHECK_VERSION(2,14,0)
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
126 gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), frame);
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
127 #else
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
128 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), frame);
30137
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
129 #endif
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
130 gtk_window_set_role(GTK_WINDOW(dialog), "plugin_config");
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
131 gtk_window_set_title(GTK_WINDOW(dialog), _(purple_plugin_get_name(plugin)));
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
132 gtk_widget_show_all(dialog);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
133 }
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
134
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
135 static gboolean
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
136 textview_emission_hook(GSignalInvocationHint *hint, guint n_params,
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
137 const GValue *pvalues, gpointer data)
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
138 {
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
139 GtkTextView *view = GTK_TEXT_VIEW(g_value_get_object(pvalues));
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
140 GtkWidget *menu, *item;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
141 GtkTextBuffer *buffer;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
142 GtkTextIter cursor;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
143 int cx, cy, bx, by;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
144
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
145 if (!GTK_IS_IMHTML(view))
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
146 return TRUE;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
147
30137
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
148 #if GTK_CHECK_VERSION(2,14,0)
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
149 if (!gdk_window_get_pointer(gtk_widget_get_window(GTK_WIDGET(view)), &cx, &cy, NULL))
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
150 return TRUE;
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
151 #else
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
152 if (!gdk_window_get_pointer(GTK_WIDGET(view)->window, &cx, &cy, NULL))
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
153 return TRUE;
30137
4e7a9940627e Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30128
diff changeset
154 #endif
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
155
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
156 buffer = gtk_text_view_get_buffer(view);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
157
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
158 gtk_text_view_window_to_buffer_coords(view, GTK_TEXT_WINDOW_TEXT, cx, cy, &bx, &by);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
159 gtk_text_view_get_iter_at_location(view, &cursor, bx, by);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
160 if (!gtk_text_iter_has_tag(&cursor,
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
161 gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "comment")))
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
162 return TRUE;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
163
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
164 menu = g_value_get_object(&pvalues[1]);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
165
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
166 item = gtk_menu_item_new_with_label(_("Timestamp Format Options"));
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
167 gtk_widget_show_all(item);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
168 g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(menu_cb), data);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
169 gtk_menu_shell_insert(GTK_MENU_SHELL(menu), item, 0);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
170
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
171 item = gtk_separator_menu_item_new();
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
172 gtk_widget_show(item);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
173 gtk_menu_shell_insert(GTK_MENU_SHELL(menu), item, 1);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
174
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
175 return TRUE;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
176 }
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
177
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
178 static guint signal_id;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
179 static gulong hook_id;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
180
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
182 plugin_load(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 {
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
184 gpointer klass = NULL;
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
185
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
186 purple_signal_connect(pidgin_conversations_get_handle(), "conversation-timestamp",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
187 plugin, PURPLE_CALLBACK(conversation_timestamp_cb), NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
188 purple_signal_connect(purple_log_get_handle(), "log-timestamp",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
189 plugin, PURPLE_CALLBACK(log_timestamp_cb), NULL);
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
190
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
191 klass = g_type_class_ref(GTK_TYPE_TEXT_VIEW);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
192
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
193 /* In 3.0.0, use purple_g_signal_connect_flags */
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
194 g_signal_parse_name("populate_popup", GTK_TYPE_TEXT_VIEW, &signal_id, NULL, FALSE);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
195 hook_id = g_signal_add_emission_hook(signal_id, 0, textview_emission_hook,
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
196 plugin, NULL);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
197
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
198 g_type_class_unref(klass);
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
199
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
204 plugin_unload(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 {
30128
9ec94a37446a Add a context option for the timestamps in the conversation log.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21030
diff changeset
206 g_signal_remove_emission_hook(signal_id, hook_id);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
210 static PurplePluginUiInfo prefs_info = {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211 get_plugin_pref_frame,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212 0, /* page num (Reserved) */
16678
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
213 NULL,/* frame (Reserved) */
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
214
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
215 /* padding */
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
216 NULL,
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
217 NULL,
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
218 NULL,
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
219 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
222 static PurplePluginInfo info =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
224 PURPLE_PLUGIN_MAGIC,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
225 PURPLE_MAJOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
226 PURPLE_MINOR_VERSION,
15878
fde34f782314 The Message Timestamp Formats plugin lacked an ID before.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
227 PURPLE_PLUGIN_STANDARD, /**< type */
15519
b15cc37605c4 In Pidgin, display a full date on the timestamp of the first message to
Richard Laager <rlaager@wiktel.com>
parents: 15501
diff changeset
228 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229 0, /**< flags */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 NULL, /**< dependencies */
15878
fde34f782314 The Message Timestamp Formats plugin lacked an ID before.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
231 PURPLE_PRIORITY_DEFAULT, /**< priority */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232
15878
fde34f782314 The Message Timestamp Formats plugin lacked an ID before.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
233 "core-timestamp_format", /**< id */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 N_("Message Timestamp Formats"), /**< name */
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 16931
diff changeset
235 DISPLAY_VERSION, /**< version */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 /** summary */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 N_("Customizes the message timestamp formats."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 /** description */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 N_("This plugin allows the user to customize "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 "conversation and logging message timestamp "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 "formats."),
15567
b6615958d87c Switching to my pidgin.im e-mail address, which I think fits nicely and seems professional.
Richard Laager <rlaager@wiktel.com>
parents: 15565
diff changeset
242 "Richard Laager <rlaager@pidgin.im>", /**< author */
15878
fde34f782314 The Message Timestamp Formats plugin lacked an ID before.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
243 PURPLE_WEBSITE, /**< homepage */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245 plugin_load, /**< load */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246 plugin_unload, /**< unload */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 NULL, /**< destroy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 NULL, /**< ui_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 NULL, /**< extra_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 &prefs_info, /**< prefs_info */
16678
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
252 NULL, /**< actions */
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
253
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
254 /* padding */
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
255 NULL,
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
256 NULL,
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
257 NULL,
3d41d0d7fb9b Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 16012
diff changeset
258 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
262 init_plugin(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
264 purple_prefs_add_none("/plugins/gtk");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
265 purple_prefs_add_none("/plugins/gtk/timestamp_format");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
267 purple_prefs_add_bool("/plugins/gtk/timestamp_format/force_24hr", TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
269 purple_prefs_add_none("/plugins/gtk/timestamp_format/use_dates");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
270 purple_prefs_add_string("/plugins/gtk/timestamp_format/use_dates/conversation", "automatic");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
271 purple_prefs_add_string("/plugins/gtk/timestamp_format/use_dates/log", "automatic");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15567
diff changeset
274 PURPLE_INIT_PLUGIN(timestamp_format, init_plugin, info)