comparison src/gnome_applet_mgr.c @ 342:f4fba304b236

[gaim-migrate @ 352] More changes to the applet: tooltips are set different, and choosing "Signon" from the right-click menu actually tries to sign you on, as opposed to just bringing up the login window. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 07 Jun 2000 01:50:55 +0000
parents 0d9cfc3579a5
children b402a23f35df
comparison
equal deleted inserted replaced
341:df984d56efb4 342:f4fba304b236
140 case offline: 140 case offline:
141 gtk_pixmap_set( GTK_PIXMAP(icon), 141 gtk_pixmap_set( GTK_PIXMAP(icon),
142 icon_offline_pm, 142 icon_offline_pm,
143 icon_offline_bm ); 143 icon_offline_bm );
144 gtk_label_set( GTK_LABEL(status_label), _MSG_OFFLINE_ ); 144 gtk_label_set( GTK_LABEL(status_label), _MSG_OFFLINE_ );
145 applet_set_tooltips("Offilne. Click to bring up login box.");
145 break; 146 break;
146 case signing_on: 147 case signing_on:
147 gtk_pixmap_set( GTK_PIXMAP(icon), 148 gtk_pixmap_set( GTK_PIXMAP(icon),
148 icon_connect_pm, 149 icon_connect_pm,
149 icon_connect_bm ); 150 icon_connect_bm );
150 gtk_label_set( GTK_LABEL(status_label), _MSG_CONNECT_ ); 151 gtk_label_set( GTK_LABEL(status_label), _MSG_CONNECT_ );
152 applet_set_tooltips("Attempting to sign on....");
151 break; 153 break;
152 case online: 154 case online:
153 gtk_pixmap_set( GTK_PIXMAP(icon), 155 gtk_pixmap_set( GTK_PIXMAP(icon),
154 icon_online_pm, 156 icon_online_pm,
155 icon_online_bm ); 157 icon_online_bm );
236 GtkAllocation a = get_applet_pos(FALSE); 238 GtkAllocation a = get_applet_pos(FALSE);
237 gtk_widget_set_uposition(mainwindow, a.x, a.y); 239 gtk_widget_set_uposition(mainwindow, a.x, a.y);
238 } 240 }
239 } 241 }
240 242
243 void applet_do_signon(AppletWidget *widget, gpointer data) {
244 show_login();
245 if (general_options & OPT_GEN_REMEMBER_PASS)
246 dologin();
247 }
248
241 void insert_applet_away() { 249 void insert_applet_away() {
242 GList *awy = away_messages; 250 GList *awy = away_messages;
243 struct away_message *a; 251 struct away_message *a;
244 char *awayname; 252 char *awayname;
245 253
333 void AppletCancelLogon(){ 341 void AppletCancelLogon(){
334 applet_widget_unregister_callback(APPLET_WIDGET(applet),"signoff"); 342 applet_widget_unregister_callback(APPLET_WIDGET(applet),"signoff");
335 applet_widget_register_callback(APPLET_WIDGET(applet), 343 applet_widget_register_callback(APPLET_WIDGET(applet),
336 "signon", 344 "signon",
337 _("Signon"), 345 _("Signon"),
338 applet_show_login, 346 applet_do_signon,
339 NULL); 347 NULL);
340 } 348 }
341 349
342 /*************************************************************** 350 /***************************************************************
343 ** 351 **
510 518
511 /*init imlib for graphics*/ 519 /*init imlib for graphics*/
512 gdk_imlib_init(); 520 gdk_imlib_init();
513 gtk_widget_push_visual(gdk_imlib_get_visual()); 521 gtk_widget_push_visual(gdk_imlib_get_visual());
514 gtk_widget_push_colormap(gdk_imlib_get_colormap()); 522 gtk_widget_push_colormap(gdk_imlib_get_colormap());
515 523
516 applet=applet_widget_new("gaim_applet"); 524 applet=applet_widget_new("gaim_applet");
517 if(!applet) g_error(_("Can't create GAIM applet!")); 525 if(!applet) g_error(_("Can't create GAIM applet!"));
518 gtk_widget_set_events(applet, gtk_widget_get_events(applet) | 526 gtk_widget_set_events(applet, gtk_widget_get_events(applet) |
519 GDK_BUTTON_PRESS_MASK); 527 GDK_BUTTON_PRESS_MASK);
520 528
537 545
538 /*icon_away and icon_msg_pennding need to be implemented*/ 546 /*icon_away and icon_msg_pennding need to be implemented*/
539 547
540 icon=gtk_pixmap_new(icon_offline_pm,icon_offline_bm); 548 icon=gtk_pixmap_new(icon_offline_pm,icon_offline_bm);
541 549
550 update_applet(NULL);
542 gtk_timeout_add( 1500, (GtkFunction)update_applet, NULL ); 551 gtk_timeout_add( 1500, (GtkFunction)update_applet, NULL );
543 552
544 vbox = gtk_vbox_new(FALSE,0); 553 vbox = gtk_vbox_new(FALSE,0);
545 554
546 gtk_box_pack_start(GTK_BOX(vbox), icon, FALSE, TRUE, 0); 555 gtk_box_pack_start(GTK_BOX(vbox), icon, FALSE, TRUE, 0);
567 576
568 gtk_widget_show( status_label ); 577 gtk_widget_show( status_label );
569 gtk_widget_show( vbox ); 578 gtk_widget_show( vbox );
570 gtk_widget_show( appletframe ); 579 gtk_widget_show( appletframe );
571 580
572 applet_widget_set_tooltip(APPLET_WIDGET(applet),"GAIM");
573
574 applet_widget_register_stock_callback(APPLET_WIDGET(applet), 581 applet_widget_register_stock_callback(APPLET_WIDGET(applet),
575 "about", 582 "about",
576 GNOME_STOCK_MENU_ABOUT, 583 GNOME_STOCK_MENU_ABOUT,
577 _("About..."), 584 _("About..."),
578 applet_show_about, 585 applet_show_about,
600 607
601 void set_applet_draw_closed(){ 608 void set_applet_draw_closed(){
602 applet_draw_open = FALSE; 609 applet_draw_open = FALSE;
603 } 610 }
604 611
612 void applet_set_tooltips(char *msg) {
613 applet_widget_set_tooltip(APPLET_WIDGET(applet), msg);
614 }
615
605 #endif /*USE_APPLET*/ 616 #endif /*USE_APPLET*/