pidgin: 16d81758: Add support for setting the multiple ins...
datallah at pidgin.im
datallah at pidgin.im
Mon Sep 21 22:15:42 EDT 2009
-----------------------------------------------------------------
Revision: 16d8175863cc4377639b973817caa1ca4391087c
Ancestor: 1cb02c0ee6acec6884c42679e9e3203e3968b6f7
Author: datallah at pidgin.im
Date: 2009-09-22T02:12:42
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/16d8175863cc4377639b973817caa1ca4391087c
Modified files:
pidgin/plugins/win32/winprefs/winprefs.c
ChangeLog:
Add support for setting the multiple instances flag in the Windows Preferences plugin.
-------------- next part --------------
============================================================
--- pidgin/plugins/win32/winprefs/winprefs.c 7068ddae2a4497d44ee729d46fe5d660ecc8b3fc
+++ pidgin/plugins/win32/winprefs/winprefs.c 60d5f0696286ee271a94a3371773db69463209e4
@@ -101,10 +101,7 @@ static void blist_dock_cb(gboolean val)
blist_set_ontop(TRUE);
} else {
purple_debug_info(WINPREFS_PLUGIN_ID, "Blist Undocking...\n");
- if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS)
- blist_set_ontop(TRUE);
- else
- blist_set_ontop(FALSE);
+ blist_set_ontop(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS);
}
}
@@ -120,10 +117,7 @@ static void blist_set_dockable(gboolean
blist_ab = NULL;
}
- if(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS)
- blist_set_ontop(TRUE);
- else
- blist_set_ontop(FALSE);
+ blist_set_ontop(purple_prefs_get_int(PREF_BLIST_ON_TOP) == BLIST_TOP_ALWAYS);
}
}
@@ -210,6 +204,12 @@ static void
}
static void
+winprefs_set_multiple_instances(GtkWidget *w) {
+ wpurple_write_reg_string(HKEY_CURRENT_USER, "Environment", "PIDGIN_MULTI_INST",
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) ? "1" : NULL);
+}
+
+static void
winprefs_set_blist_dockable(const char *pref, PurplePrefType type,
gconstpointer value, gpointer user_data)
{
@@ -270,34 +270,18 @@ static GtkWidget* get_config_frame(Purpl
GtkWidget *ret;
GtkWidget *vbox;
GtkWidget *button;
- char *gtk_version = NULL;
char *run_key_val;
char *tmp;
ret = gtk_vbox_new(FALSE, 18);
gtk_container_set_border_width(GTK_CONTAINER(ret), 12);
- gtk_version = g_strdup_printf("GTK+\t%u.%u.%u\nGlib\t%u.%u.%u",
- gtk_major_version, gtk_minor_version, gtk_micro_version,
- glib_major_version, glib_minor_version, glib_micro_version);
-
- /* Display Installed GTK+ Runtime Version */
- if(gtk_version) {
- GtkWidget *label;
- vbox = pidgin_make_frame(ret, _("GTK+ Runtime Version"));
- label = gtk_label_new(gtk_version);
- gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- gtk_widget_show(label);
- g_free(gtk_version);
- }
-
/* Autostart */
vbox = pidgin_make_frame(ret, _("Startup"));
tmp = g_strdup_printf(_("_Start %s on Windows startup"), PIDGIN_NAME);
button = gtk_check_button_new_with_mnemonic(tmp);
g_free(tmp);
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
-
if ((run_key_val = wpurple_read_reg_string(HKEY_CURRENT_USER, RUNKEY, "Pidgin"))
|| (run_key_val = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin"))) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
@@ -306,6 +290,15 @@ static GtkWidget* get_config_frame(Purpl
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_autostart), NULL);
gtk_widget_show(button);
+ button = gtk_check_button_new_with_mnemonic(_("Allow multiple instances"));
+ gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
+ if ((run_key_val = wpurple_read_reg_string(HKEY_CURRENT_USER, "Environment", "PIDGIN_MULTI_INST"))) {
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+ g_free(run_key_val);
+ }
+ g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(winprefs_set_multiple_instances), NULL);
+ gtk_widget_show(button);
+
/* Buddy List */
vbox = pidgin_make_frame(ret, _("Buddy List"));
pidgin_prefs_checkbox(_("_Dockable Buddy List"),
More information about the Commits
mailing list