Changeset 2128 for trunk/jons-gtk-gui

Show
Ignore:
Timestamp:
07/11/00 13:48:45 (8 years ago)
Author:
emojon
Message:

Added checking for GTK+ >= 1.2.0 in the configure script

Fixed a *lot* of things

Added in the Secure Channel stuff

Location:
trunk/jons-gtk-gui
Files:
1 added
13 modified

Legend:

Unmodified
Added
Removed
  • trunk/jons-gtk-gui/configure.in

    r2120 r2128  
    33AM_CONFIG_HEADER(config.h) 
    44 
    5 AM_INIT_AUTOMAKE(GtkPlugin, 0.10) 
     5AM_INIT_AUTOMAKE(JonsGtkPlugin, 0.10) 
    66 
    77AC_PROG_CC 
     
    1717AC_LIBTOOL_CXX 
    1818 
     19dnl Check for libraries 
     20AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(JonsGtkPlugin 0.10 needs GTK)) 
     21 
    1922dnl Check for header files 
    2023LICQ_CHECK_LICQ 
  • trunk/jons-gtk-gui/src/about_window.cpp

    r2120 r2128  
    4343    gtk_window_set_position(GTK_WINDOW(about_window), GTK_WIN_POS_CENTER); 
    4444    gtk_window_set_title(GTK_WINDOW(about_window), "About Licq"); 
    45     gtk_widget_set_usize(about_window, 225, 180); 
    4645 
    4746    // Window delete event 
     
    6261             "Jon's GTK+ GUI Plugin Version: %s\n" 
    6362             "GTK+ Version: %d.%d.%d\nCompiled On: %s\n" 
    64              "Currently Running On: %s %s [%s]\n\n" 
     63             "    Currently Running On: %s %s [%s]    \n\n" 
    6564             "Author: Jon Keating <jon@licq.org>\n" 
    6665             "http://jons-gtk-gui.sourceforge.net\n\n" 
  • trunk/jons-gtk-gui/src/chat_window.cpp

    r2097 r2128  
    6868    gtk_window_set_position(GTK_WINDOW(rc->window), GTK_WIN_POS_CENTER); 
    6969    gtk_container_add(GTK_CONTAINER(rc->window), table); 
     70    gtk_signal_connect(GTK_OBJECT(rc->window), "destroy", 
     71        GTK_SIGNAL_FUNC(cancel_request_chat), (gpointer)rc); 
    7072 
    7173    /*Create the scrolled window with text and attach it to the window */ 
  • trunk/jons-gtk-gui/src/contact_list.cpp

    r2117 r2128  
    6969    gtk_clist_freeze(GTK_CLIST(contact_list)); 
    7070 
    71     do_colors();    /* Make the colors */ 
    72     do_pixmaps();   /* Make the pixmap */ 
     71//  do_colors();    /* Make the colors */ 
     72//  do_pixmaps();   /* Make the pixmap */ 
    7373 
    7474    blah[0] = ""; 
     
    337337                 GTK_SIGNAL_FUNC(list_send_url), user); 
    338338 
    339         /* Only show chat and file requests if the user is not offline */ 
    340         if(user->Status() != ICQ_STATUS_OFFLINE) 
    341         { 
    342             add_to_popup("Send Chat Request", _menu, 
    343                          GTK_SIGNAL_FUNC(list_request_chat), user); 
    344  
    345             add_to_popup("Send File Request", _menu, 
    346                          GTK_SIGNAL_FUNC(list_request_file), user); 
    347         } 
     339        add_to_popup("Send Chat Request", _menu, 
     340                     GTK_SIGNAL_FUNC(list_request_chat), user); 
     341 
     342        add_to_popup("Send File Request", _menu, 
     343                     GTK_SIGNAL_FUNC(list_request_file), user); 
     344     
     345        if(user->Secure()) 
     346            add_to_popup("Close Secure Channel", _menu, 
     347                GTK_SIGNAL_FUNC(create_key_request_window), 
     348                user); 
     349        else     
     350            add_to_popup("Request Secure Channel", _menu, 
     351                GTK_SIGNAL_FUNC(create_key_request_window), 
     352                user); 
    348353 
    349354        /* A separator */ 
  • trunk/jons-gtk-gui/src/convo.cpp

    r2095 r2128  
    105105 
    106106    /* Set cancel to grayed out at first */ 
    107 //  gtk_widget_set_sensitive(c->cancel, FALSE); 
     107    //gtk_widget_set_sensitive(c->cancel, FALSE); 
    108108 
    109109    /* Make the boxes */ 
     
    142142               GTK_SIGNAL_FUNC(convo_cancel), c); 
    143143    gtk_signal_connect(GTK_OBJECT(c->send), "clicked", 
    144                GTK_SIGNAL_FUNC(convo_send), c); 
     144               GTK_SIGNAL_FUNC(convo_send), (gpointer)c); 
    145145 
    146146    gtk_box_pack_start(GTK_BOX(button_box), close, TRUE, TRUE, 5); 
     
    227227        if(enter_sends && !(eventkey->state & GDK_SHIFT_MASK)) 
    228228        { 
    229             convo_send(NULL, c); 
     229            convo_send(NULL, (gpointer)c); 
    230230        } 
    231231        else if(enter_sends) 
     
    242242} 
    243243 
    244 void convo_send(GtkWidget *widget, struct conversation *c) 
    245 { 
     244void convo_send(GtkWidget *widget, gpointer _c) 
     245{ 
     246    struct conversation *c = (struct conversation *)_c; 
     247 
    246248    /* Set the 2 button widgets */ 
    247 //  gtk_widget_set_sensitive(c->send, FALSE); 
    248 //  gtk_widget_set_sensitive(c->cancel, TRUE); 
     249    if(GTK_WIDGET_IS_SENSITIVE(c->send)) 
     250        gtk_widget_set_sensitive(c->send, false); 
     251    gtk_widget_set_sensitive(c->cancel, true); 
    249252 
    250253    gchar *buf; 
     
    315318    g_strreverse(temp); 
    316319 
    317     if(strncmp(temp, "en", 2) == 0) 
     320    if(strncmp(temp, " ...", 4) == 0) 
    318321        return; 
    319322 
    320323    else 
    321324    { 
    322 //      gtk_widget_set_sensitive(c->send, TRUE); 
    323 //      gtk_widget_set_sensitive(c->cancel, FALSE); 
     325        gtk_widget_set_sensitive(c->send, TRUE); 
     326        gtk_widget_set_sensitive(c->cancel, FALSE); 
    324327    } 
    325328} 
     
    328331{ 
    329332    /* Set the buttons sensitivity accordingly */ 
    330 //  gtk_widget_set_sensitive(c->send, TRUE); 
    331 //  gtk_widget_set_sensitive(c->cancel, FALSE); 
     333    gtk_widget_set_sensitive(c->send, TRUE); 
     334    gtk_widget_set_sensitive(c->cancel, FALSE); 
    332335 
    333336    /* Actually cancel this event */ 
  • trunk/jons-gtk-gui/src/extras.cpp

    r2117 r2128  
    215215    } 
    216216 
     217    else if(event->SubCommand() == ICQ_CMDxSUB_SECURExOPEN || 
     218        event->SubCommand() == ICQ_CMDxSUB_SECURExCLOSE) 
     219    { 
     220        catcher = g_slist_remove(catcher, etd); 
     221        finish_secure(event); 
     222        return; 
     223    } 
     224     
    217225    else 
    218226    { 
     
    366374} 
    367375 
     376void finish_secure(ICQEvent *event) 
     377{ 
     378    struct key_request *kr = kr_find(event->Uin()); 
     379 
     380    // Window isn't open.. cya 
     381    if(kr == NULL) 
     382        return; 
     383 
     384    char result[41]; 
     385     
     386    switch(event->Result()) 
     387    { 
     388        case EVENT_FAILED: 
     389            strncpy(result, 
     390                "Remote client does not support OpenSSL.", 41); 
     391            break; 
     392 
     393        case EVENT_ERROR: 
     394            strncpy(result, "Could not connect to remote client.", 
     395                41); 
     396            break; 
     397 
     398        case EVENT_SUCCESS: 
     399            if(kr->open) 
     400                strncpy(result, "Secure channel established.", 
     401                    41); 
     402            else 
     403                strncpy(result, "Secure channel closed.", 41); 
     404            break; 
     405        case EVENT_ACKED: 
     406        case EVENT_TIMEDOUT: 
     407        case EVENT_CANCELLED: 
     408        default: 
     409            break; 
     410    } 
     411 
     412    gtk_label_set_text(GTK_LABEL(kr->label_status), result); 
     413} 
     414 
     415             
    368416/*************** Finishing Signals *****************************/ 
    369417 
  • trunk/jons-gtk-gui/src/licq_gtk.h

    r2120 r2128  
    354354}; 
    355355 
     356struct key_request 
     357{ 
     358    GtkWidget *window; 
     359    GtkWidget *label_status; 
     360    gboolean open; 
     361    ICQUser *user; 
     362    struct e_tag_data *etag; 
     363}; 
     364 
    356365struct e_tag_data 
    357366{ 
     
    385394/* Globals in history_window.cpp */ 
    386395extern const gchar *line; 
     396 
     397/* Globals in key_requst.cpp */ 
     398extern GSList *kr_list; 
    387399 
    388400/* Globals in main.cpp */ 
     
    488500extern struct conversation *convo_find(unsigned long); 
    489501extern void convo_show(struct conversation *); 
    490 extern void convo_send(GtkWidget *, struct conversation *); 
     502extern void convo_send(GtkWidget *, gpointer); 
    491503extern gboolean key_press_convo(GtkWidget *, GdkEventKey *, gpointer); 
    492504extern void verify_convo_send(GtkWidget *, guint, gchar *, 
     
    511523extern void finish_away(ICQEvent *); 
    512524extern void finish_random(ICQEvent *); 
     525extern void finish_secure(ICQEvent *); 
    513526extern void finish_info(CICQSignal *); 
    514527 
     
    540553 
    541554 
     555/* Functions in key_request.cpp */ 
     556extern void create_key_request_window(GtkWidget *, ICQUser *); 
     557extern struct key_request *kr_find(gulong); 
     558extern struct key_request *kr_new(ICQUser *); 
     559extern void send_key_request(GtkWidget *, gpointer); 
     560extern void close_key_request(GtkWidget *, gpointer); 
     561 
     562 
    542563/* Functions in log_window.cpp */ 
    543564extern void new_log_window(); 
  • trunk/jons-gtk-gui/src/main.cpp

    r2057 r2128  
    8989    else 
    9090    { 
    91         main_window = main_window_new(title, 445, 200);  
     91        main_window = main_window_new(title, 245, 160);  
    9292        main_window_show(); 
    9393        contact_list_refresh(); 
  • trunk/jons-gtk-gui/src/main_window.cpp

    r2072 r2128  
    7272    gtk_signal_connect(GTK_OBJECT(main_window), "delete_event", 
    7373               GTK_SIGNAL_FUNC(main_window_delete_event), NULL); 
     74 
     75    // After the main window has been created, but before the contact 
     76    // list or anything is shown, we need to make the colors and pixmaps 
     77    do_colors(); 
     78    do_pixmaps(); 
    7479 
    7580    /* Add the vertical box in */ 
  • trunk/jons-gtk-gui/src/Makefile.am

    r2120 r2128  
    2121                file_window.cpp \ 
    2222                history_window.cpp \ 
     23                key_request.cpp \ 
    2324                log_window.cpp \ 
    2425                main.cpp \ 
  • trunk/jons-gtk-gui/src/option_window.cpp

    r2092 r2128  
    199199    licqConf.FlushFile(); 
    200200    licqConf.CloseFile(); 
     201 
     202    // Refresh the colors 
     203    do_colors(); 
    201204} 
    202205 
  • trunk/jons-gtk-gui/src/pipe.cpp

    r2097 r2128  
    115115      } 
    116116 
     117      case SIGNAL_LOGOFF:  break; 
     118 
    117119      default: 
    118120        g_print("Error: Unknown signal type: %ld.", sig->Signal()); 
  • trunk/jons-gtk-gui/src/register_user.cpp

    r2092 r2128  
    2020 
    2121    /* Create the window */ 
    22     register_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 
     22    register_window = gtk_window_new(GTK_WINDOW_DIALOG); 
    2323    gtk_window_set_title(GTK_WINDOW(register_window), 
    2424                 "Licq - Registration Wizard"); 
     
    135135 
    136136        wizard_message(6); 
     137 
     138        main_window = main_window_new(g_strdup_printf("%ld", _uin), 
     139            445, 200); 
     140        main_window_show(); 
     141        system_status_refresh(); 
     142        dialog_close(NULL, register_window); 
    137143    } 
    138144