Mercurial > pidgin.yaz
comparison src/gtkutils.c @ 5943:a4f2aba0848d
[gaim-migrate @ 6384]
This should fix corruption in the blist, accounts, and pounces when some
protocol plugins cannot load. Some parts of gaim now use the new unique
Plugin or Protocol Plugin IDs, while some still use the old protocol
numbers. Accounts kind of used both, and when prpls were missing, it had
trouble finding accounts. It would find the names, even without mapping the
protocol numbers to IDs, and any duplicate accounts would get nuked. That
would then affect pounce saving. Anyhow, long story short (well, it's
already long, too late for that), this should fix all that mess. And
introduce new mess, but hopefully temporary mess.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 23 Jun 2003 02:00:15 +0000 |
parents | 390d32a6b130 |
children | 0a2a32b1917c |
comparison
equal
deleted
inserted
replaced
5942:d0320de18feb | 5943:a4f2aba0848d |
---|---|
807 | 807 |
808 g_object_unref(sg); | 808 g_object_unref(sg); |
809 | 809 |
810 return optmenu; | 810 return optmenu; |
811 } | 811 } |
812 | |
813 char *stylize(const gchar *text, int length) | |
814 { | |
815 gchar *buf; | |
816 char *tmp = g_malloc(length); | |
817 | |
818 buf = g_malloc(length); | |
819 g_snprintf(buf, length, "%s", text); | |
820 | |
821 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_bold")) { | |
822 g_snprintf(tmp, length, "<B>%s</B>", buf); | |
823 strcpy(buf, tmp); | |
824 } | |
825 | |
826 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_italic")) { | |
827 g_snprintf(tmp, length, "<I>%s</I>", buf); | |
828 strcpy(buf, tmp); | |
829 } | |
830 | |
831 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_underline")) { | |
832 g_snprintf(tmp, length, "<U>%s</U>", buf); | |
833 strcpy(buf, tmp); | |
834 } | |
835 | |
836 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_strikethrough")) { | |
837 g_snprintf(tmp, length, "<S>%s</S>", buf); | |
838 strcpy(buf, tmp); | |
839 } | |
840 | |
841 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_font")) { | |
842 const char *fontface; | |
843 | |
844 fontface = gaim_prefs_get_string("/gaim/gtk/conversations/font_face"); | |
845 | |
846 g_snprintf(tmp, length, "<FONT FACE=\"%s\">%s</FONT>", fontface, buf); | |
847 strcpy(buf, tmp); | |
848 } | |
849 | |
850 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_size")) { | |
851 int fontsize = gaim_prefs_get_int("/gaim/gtk/conversations/font_size"); | |
852 | |
853 g_snprintf(tmp, length, "<FONT SIZE=\"%d\">%s</FONT>", fontsize, buf); | |
854 strcpy(buf, tmp); | |
855 } | |
856 | |
857 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) { | |
858 GdkColor fgcolor; | |
859 | |
860 gdk_color_parse( | |
861 gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), | |
862 &fgcolor); | |
863 | |
864 g_snprintf(tmp, length, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", | |
865 fgcolor.red/256, fgcolor.green/256, fgcolor.blue/256, buf); | |
866 strcpy(buf, tmp); | |
867 } | |
868 | |
869 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) { | |
870 GdkColor bgcolor; | |
871 | |
872 gdk_color_parse( | |
873 gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), | |
874 &bgcolor); | |
875 | |
876 g_snprintf(tmp, length, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", | |
877 bgcolor.red/256, bgcolor.green/256, bgcolor.blue/256, buf); | |
878 strcpy(buf, tmp); | |
879 } | |
880 | |
881 g_free(tmp); | |
882 return buf; | |
883 } | |
884 | |
885 void show_usage(int mode, const char *name) | |
886 { | |
887 switch (mode) { | |
888 case 0: /* full help text */ | |
889 printf(_("Gaim %s\n" | |
890 "Usage: %s [OPTION]...\n\n" | |
891 " -a, --acct display account editor window\n" | |
892 " -w, --away[=MESG] make away on signon (optional argument MESG specifies\n" | |
893 " name of away message to use)\n" | |
894 " -l, --login[=NAME] automatically login (optional argument NAME specifies\n" | |
895 " account(s) to use, seperated by commas)\n" | |
896 " -n, --loginwin don't automatically login; show login window\n" | |
897 " -u, --user=NAME use account NAME\n" | |
898 " -f, --file=FILE use FILE as config\n" | |
899 " -d, --debug print debugging messages to stdout\n" | |
900 " -v, --version display the current version and exit\n" | |
901 " -h, --help display this help and exit\n"), VERSION, name); | |
902 break; | |
903 case 1: /* short message */ | |
904 printf(_("Gaim %s. Try `%s -h' for more information.\n"), VERSION, name); | |
905 break; | |
906 } | |
907 } | |
908 | |
909 |