| 73 pidgin_conv_window_show(win); |
73 pidgin_conv_window_show(win); |
| 74 } |
74 } |
| 75 } |
75 } |
| 76 } |
76 } |
| 77 |
77 |
| 78 static gboolean |
|
| 79 plugin_load(PurplePlugin *plugin) |
|
| 80 { |
|
| 81 pidgin_conv_placement_add_fnc("number", _("By conversation count"), |
|
| 82 &conv_placement_by_number); |
|
| 83 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement"); |
|
| 84 return TRUE; |
|
| 85 } |
|
| 86 |
|
| 87 static gboolean |
|
| 88 plugin_unload(PurplePlugin *plugin) |
|
| 89 { |
|
| 90 pidgin_conv_placement_remove_fnc("number"); |
|
| 91 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement"); |
|
| 92 return TRUE; |
|
| 93 } |
|
| 94 |
|
| 95 static PurplePluginPrefFrame * |
78 static PurplePluginPrefFrame * |
| 96 get_plugin_pref_frame(PurplePlugin *plugin) { |
79 get_plugin_pref_frame(PurplePlugin *plugin) { |
| 97 PurplePluginPrefFrame *frame; |
80 PurplePluginPrefFrame *frame; |
| 98 PurplePluginPref *ppref; |
81 PurplePluginPref *ppref; |
| 99 |
82 |
| 119 purple_plugin_pref_frame_add(frame, ppref); |
102 purple_plugin_pref_frame_add(frame, ppref); |
| 120 |
103 |
| 121 return frame; |
104 return frame; |
| 122 } |
105 } |
| 123 |
106 |
| 124 static PurplePluginUiInfo prefs_info = { |
107 static PidginPluginInfo * |
| 125 get_plugin_pref_frame, |
108 plugin_query(GError **error) |
| 126 0, /* page_num (Reserved) */ |
109 { |
| 127 NULL, /* frame (Reserved) */ |
110 const gchar * const authors[] = { |
| |
111 "Stu Tomlinson <stu@nosnilmot.com>", |
| |
112 NULL |
| |
113 }; |
| 128 |
114 |
| 129 /* padding */ |
115 return pidgin_plugin_info_new( |
| 130 NULL, |
116 "id", "gtk-extplacement", |
| 131 NULL, |
117 "name", N_("ExtPlacement"), |
| 132 NULL, |
118 "version", DISPLAY_VERSION, |
| 133 NULL |
119 "category", N_("User interface"), |
| 134 }; |
120 "summary", N_("Extra conversation placement options."), |
| |
121 "description", N_("Restrict the number of conversations per " |
| |
122 "windows, optionally separating IMs and " |
| |
123 "Chats"), |
| |
124 "authors", authors, |
| |
125 "website", PURPLE_WEBSITE, |
| |
126 "abi-version", PURPLE_ABI_VERSION, |
| |
127 "preferences-frame", get_plugin_pref_frame, |
| |
128 NULL |
| |
129 ); |
| |
130 } |
| 135 |
131 |
| 136 static PurplePluginInfo info = |
132 static gboolean |
| 137 { |
133 plugin_load(PurplePlugin *plugin, GError **error) |
| 138 PURPLE_PLUGIN_MAGIC, |
|
| 139 PURPLE_MAJOR_VERSION, |
|
| 140 PURPLE_MINOR_VERSION, |
|
| 141 PURPLE_PLUGIN_STANDARD, /**< type */ |
|
| 142 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
| 143 0, /**< flags */ |
|
| 144 NULL, /**< dependencies */ |
|
| 145 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
| 146 "gtk-extplacement", /**< id */ |
|
| 147 N_("ExtPlacement"), /**< name */ |
|
| 148 DISPLAY_VERSION, /**< version */ |
|
| 149 N_("Extra conversation placement options."), /**< summary */ |
|
| 150 /** description */ |
|
| 151 N_("Restrict the number of conversations per windows," |
|
| 152 " optionally separating IMs and Chats"), |
|
| 153 "Stu Tomlinson <stu@nosnilmot.com>", /**< author */ |
|
| 154 PURPLE_WEBSITE, /**< homepage */ |
|
| 155 plugin_load, /**< load */ |
|
| 156 plugin_unload, /**< unload */ |
|
| 157 NULL, /**< destroy */ |
|
| 158 NULL, /**< ui_info */ |
|
| 159 NULL, /**< extra_info */ |
|
| 160 &prefs_info, /**< prefs_info */ |
|
| 161 NULL, /**< actions */ |
|
| 162 |
|
| 163 /* padding */ |
|
| 164 NULL, |
|
| 165 NULL, |
|
| 166 NULL, |
|
| 167 NULL |
|
| 168 }; |
|
| 169 |
|
| 170 static void |
|
| 171 init_plugin(PurplePlugin *plugin) |
|
| 172 { |
134 { |
| 173 purple_prefs_add_none("/plugins/gtk/extplacement"); |
135 purple_prefs_add_none("/plugins/gtk/extplacement"); |
| 174 purple_prefs_add_int("/plugins/gtk/extplacement/placement_number", 4); |
136 purple_prefs_add_int("/plugins/gtk/extplacement/placement_number", 4); |
| 175 purple_prefs_add_bool("/plugins/gtk/extplacement/placement_number_separate", FALSE); |
137 purple_prefs_add_bool("/plugins/gtk/extplacement/placement_number_separate", FALSE); |
| |
138 |
| |
139 pidgin_conv_placement_add_fnc("number", _("By conversation count"), |
| |
140 &conv_placement_by_number); |
| |
141 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement"); |
| |
142 return TRUE; |
| 176 } |
143 } |
| 177 |
144 |
| 178 PURPLE_INIT_PLUGIN(extplacement, init_plugin, info) |
145 static gboolean |
| |
146 plugin_unload(PurplePlugin *plugin, GError **error) |
| |
147 { |
| |
148 pidgin_conv_placement_remove_fnc("number"); |
| |
149 purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement"); |
| |
150 return TRUE; |
| |
151 } |
| |
152 |
| |
153 PURPLE_PLUGIN_INIT(extplacement, plugin_query, plugin_load, plugin_unload); |