Mercurial > pidgin.yaz
comparison src/main.c @ 4978:307c16c4b57e
[gaim-migrate @ 5313]
(08:55:48) Robot101: patch to:
(08:56:07) Robot101: * make online buddies appear black, not grey, when you have 'show offline buddies' turned on
(08:56:21) Robot101: * random cleanup in buddy.c (tooltip/timer freeing)
(08:56:43) Robot101: * stop the add buddy dialog resetting your choice of group when you choose an account
(08:57:03) Robot101: * fix little memleak when loading the default window icon
(08:57:16) Robot101: * make the main window use the default instead of loading the same icon itself
(08:57:42) Robot101: * make the manual browser pref validate and save when the entry widget loses focus, not with a crappy button
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Thu, 03 Apr 2003 14:05:43 +0000 |
parents | 581c73d1c863 |
children | 8e55a4d362a3 |
comparison
equal
deleted
inserted
replaced
4977:503f61301b81 | 4978:307c16c4b57e |
---|---|
284 do_quit(); | 284 do_quit(); |
285 } | 285 } |
286 | 286 |
287 void show_login() | 287 void show_login() |
288 { | 288 { |
289 GdkPixbuf *icon; | |
290 GtkWidget *image; | 289 GtkWidget *image; |
291 GtkWidget *vbox; | 290 GtkWidget *vbox; |
292 GtkWidget *button; | 291 GtkWidget *button; |
293 GtkWidget *hbox; | 292 GtkWidget *hbox; |
294 GtkWidget *label; | 293 GtkWidget *label; |
295 GtkWidget *vbox2; | 294 GtkWidget *vbox2; |
296 GList *tmp; | 295 GList *tmp; |
296 char *filename; | |
297 | 297 |
298 /* Do we already have a main window opened? If so, bring it back, baby... ribs... yeah */ | 298 /* Do we already have a main window opened? If so, bring it back, baby... ribs... yeah */ |
299 if (mainwindow) { | 299 if (mainwindow) { |
300 gtk_window_present(GTK_WINDOW(mainwindow)); | 300 gtk_window_present(GTK_WINDOW(mainwindow)); |
301 return; | 301 return; |
310 gdk_window_set_group(mainwindow->window, mainwindow->window); | 310 gdk_window_set_group(mainwindow->window, mainwindow->window); |
311 gtk_container_set_border_width(GTK_CONTAINER(mainwindow), 5); | 311 gtk_container_set_border_width(GTK_CONTAINER(mainwindow), 5); |
312 g_signal_connect(G_OBJECT(mainwindow), "delete_event", | 312 g_signal_connect(G_OBJECT(mainwindow), "delete_event", |
313 G_CALLBACK(login_window_closed), mainwindow); | 313 G_CALLBACK(login_window_closed), mainwindow); |
314 | 314 |
315 | |
316 icon = gaim_pixbuf(NULL, "gaim.png"); | |
317 if (icon) { | |
318 gtk_window_set_icon(GTK_WINDOW(mainwindow), icon); | |
319 g_object_unref(G_OBJECT(icon)); | |
320 } | |
321 | |
322 vbox = gtk_vbox_new(FALSE, 0); | 315 vbox = gtk_vbox_new(FALSE, 0); |
323 gtk_container_add(GTK_CONTAINER(mainwindow), vbox); | 316 gtk_container_add(GTK_CONTAINER(mainwindow), vbox); |
324 | 317 |
325 image = gaim_pixmap(NULL, "logo.png"); | 318 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "logo.png", NULL); |
319 image = gtk_image_new_from_file(filename); | |
320 g_free(filename); | |
326 gtk_box_pack_start(GTK_BOX(vbox), image, FALSE, FALSE, 0); | 321 gtk_box_pack_start(GTK_BOX(vbox), image, FALSE, FALSE, 0); |
327 | 322 |
328 vbox2 = gtk_vbox_new(FALSE, 0); | 323 vbox2 = gtk_vbox_new(FALSE, 0); |
329 gtk_container_set_border_width(GTK_CONTAINER(vbox2), 5); | 324 gtk_container_set_border_width(GTK_CONTAINER(vbox2), 5); |
330 | 325 |
528 char name[256]; | 523 char name[256]; |
529 GList *icons = NULL; | 524 GList *icons = NULL; |
530 GdkPixbuf *icon = NULL; | 525 GdkPixbuf *icon = NULL; |
531 char *icon_path; | 526 char *icon_path; |
532 #endif | 527 #endif |
528 | |
533 if (current_smiley_theme == NULL) { | 529 if (current_smiley_theme == NULL) { |
534 smiley_theme_probe(); | 530 smiley_theme_probe(); |
535 if (smiley_themes) { | 531 if (smiley_themes) { |
536 struct smiley_theme *smile = smiley_themes->data; | 532 struct smiley_theme *smile = smiley_themes->data; |
537 load_smiley_theme(smile->path, TRUE); | 533 load_smiley_theme(smile->path, TRUE); |
547 g_free(icon_path); | 543 g_free(icon_path); |
548 if (icon) { | 544 if (icon) { |
549 icons = g_list_append(icons,icon); | 545 icons = g_list_append(icons,icon); |
550 gtk_window_set_default_icon_list(icons); | 546 gtk_window_set_default_icon_list(icons); |
551 g_object_unref(G_OBJECT(icon)); | 547 g_object_unref(G_OBJECT(icon)); |
548 g_list_free(icons); | |
552 } else { | 549 } else { |
553 debug_printf("Failed to load icon from %s" G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "gaim.png\n",DATADIR); | 550 debug_printf("Failed to load default window icon!\n"); |
554 } | 551 } |
555 | 552 |
556 g_snprintf(name, sizeof(name), "%s" G_DIR_SEPARATOR_S "gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), gaim_session); | 553 g_snprintf(name, sizeof(name), "%s" G_DIR_SEPARATOR_S "gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), gaim_session); |
557 UI_fd = gaim_connect_to_session(0); | 554 UI_fd = gaim_connect_to_session(0); |
558 if (UI_fd < 0) | 555 if (UI_fd < 0) |
559 return 1; | 556 return 1; |
560 | 557 |
561 channel = g_io_channel_unix_new(UI_fd); | 558 channel = g_io_channel_unix_new(UI_fd); |
562 g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR, socket_readable, NULL); | 559 g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR, socket_readable, NULL); |
563 #endif | 560 #endif |
561 | |
564 return 0; | 562 return 0; |
565 } | 563 } |
566 | 564 |
567 static void set_first_user(char *name) | 565 static void set_first_user(char *name) |
568 { | 566 { |