Yattm - unified GTK instant-messaging client | |
[Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003] |
#include "intl.h"
#include <string.h>
#include "status.h"
#include "util.h"
#include "globals.h"
#include "dialog.h"
#include "pixmaps/tb_preferences.xpm"
#include "pixmaps/cancel.xpm"
Include dependency graph for edit_account_window.c:
Go to the source code of this file.
Defines | |
#define | COMBO_TEXT(x) gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(x)->entry)) |
Functions | |
void | destroy (GtkWidget *widget, gpointer data) |
void | ok_callback (GtkWidget *widget, gpointer data) |
gint | strcasecmp_glist (gconstpointer a, gconstpointer b) |
GList * | get_groups () |
GList * | get_contacts (gchar *group) |
void | group_changed (GtkEditable *editable, gpointer user_data) |
void | draw_edit_account_window (eb_account *ea, char *window_title, char *frame_title, char *add_label) |
void | add_unknown_account_window_new (eb_account *ea) |
void | edit_account_window_new (eb_account *ea) |
Variables | |
gint | window_open = 0 |
eb_account * | account |
GtkWidget * | edit_account_window |
GtkWidget * | nick |
GtkWidget * | group |
|
Definition at line 43 of file edit_account_window.c. |
|
Definition at line 313 of file edit_account_window.c. References _, and draw_edit_account_window(). Referenced by add_unknown_callback(), and edit_account_window_new().
00314 { 00315 draw_edit_account_window(ea, _("Add %s to Contact List"), _("Add Unknown Contact"), _("Add")); 00316 } |
|
Definition at line 45 of file edit_account_window.c. References window_open. Referenced by draw_edit_account_window().
00046 { 00047 window_open = 0; 00048 } |
|
Definition at line 134 of file edit_account_window.c. References _, account::account_contact, COMBO_TEXT, destroy(), eb_icon(), edit_account_window, get_contacts(), get_groups(), contact::group, group, group_changed(), account::handle, _grouplist::name, contact::nick, nick, ok_callback(), and window_open. Referenced by add_unknown_account_window_new(), and edit_account_window_new().
00135 { 00136 gchar buff[1024]; 00137 static GtkWidget *frame; 00138 00139 account = ea; 00140 00141 if(!window_open) 00142 { 00143 GtkWidget *vbox; 00144 GtkWidget *hbox; 00145 GtkWidget *hbox2; 00146 GtkWidget *label; 00147 GtkWidget *button; 00148 GtkWidget *iconwid; 00149 GtkWidget *table; 00150 GtkWidget *separator; 00151 GList *list; 00152 GdkPixmap *icon; 00153 GdkBitmap *mask; 00154 00155 edit_account_window = gtk_window_new(GTK_WINDOW_DIALOG); 00156 gtk_window_set_position(GTK_WINDOW(edit_account_window), GTK_WIN_POS_MOUSE); 00157 gtk_widget_realize(edit_account_window); 00158 gtk_container_set_border_width(GTK_CONTAINER(edit_account_window), 5); 00159 00160 table = gtk_table_new(2, 2, FALSE); 00161 gtk_table_set_row_spacings(GTK_TABLE(table), 5); 00162 gtk_table_set_row_spacings(GTK_TABLE(table), 5); 00163 gtk_container_set_border_width(GTK_CONTAINER(table), 5); 00164 hbox = gtk_hbox_new(FALSE, 5); 00165 vbox = gtk_vbox_new(FALSE, 5); 00166 00167 /*Entry for Group Name*/ 00168 00169 label = gtk_label_new(_("Group Name:")); 00170 gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 5); 00171 gtk_widget_show(label); 00172 gtk_table_attach(GTK_TABLE(table), hbox, 0, 1, 0, 1, GTK_EXPAND, GTK_EXPAND, 0, 0); 00173 gtk_widget_show(hbox); 00174 00175 group = gtk_combo_new(); 00176 list = get_groups(); 00177 gtk_combo_set_popdown_strings(GTK_COMBO(group), list); 00178 00179 g_list_free(list); 00180 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(group)->entry), "changed", 00181 GTK_SIGNAL_FUNC(group_changed), NULL); 00182 gtk_table_attach(GTK_TABLE(table), group, 1, 2, 0, 1, GTK_EXPAND, GTK_EXPAND, 0, 0); 00183 gtk_widget_show(group); 00184 00185 /*Entry for Contact Name*/ 00186 00187 hbox = gtk_hbox_new(FALSE, 5); 00188 00189 label = gtk_label_new(_("Contact Name:")); 00190 gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 5); 00191 gtk_widget_show(label); 00192 gtk_table_attach(GTK_TABLE(table), hbox, 0, 1, 1, 2, GTK_EXPAND, GTK_EXPAND, 0, 0); 00193 gtk_widget_show(hbox); 00194 00195 nick = gtk_combo_new(); 00196 list = get_contacts(COMBO_TEXT(group)); 00197 gtk_combo_set_popdown_strings(GTK_COMBO(nick), list); 00198 g_list_free(list); 00199 gtk_table_attach(GTK_TABLE(table), nick, 1, 2, 1, 2, GTK_EXPAND, GTK_EXPAND, 0, 0); 00200 gtk_widget_show(nick); 00201 00202 /*Lets create the frame to put this in*/ 00203 00204 frame = gtk_frame_new(NULL); 00205 00206 gtk_container_add(GTK_CONTAINER(frame), table); 00207 gtk_widget_show(table); 00208 00209 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); 00210 gtk_widget_show(frame); 00211 00212 hbox = gtk_hbox_new(FALSE, 5); 00213 hbox2 = gtk_hbox_new(TRUE, 5); 00214 gtk_widget_set_usize(hbox2, 200,25 ); 00215 00216 /*Lets try adding a seperator*/ 00217 00218 separator = gtk_hseparator_new(); 00219 gtk_box_pack_start(GTK_BOX(vbox), separator, FALSE, FALSE, 5); 00220 gtk_widget_show(separator); 00221 00222 /*Add Button*/ 00223 00224 icon = gdk_pixmap_create_from_xpm_d(edit_account_window->window, &mask, NULL, tb_preferences_xpm); 00225 iconwid = gtk_pixmap_new(icon, mask); 00226 label = gtk_label_new(add_label); 00227 00228 gtk_box_pack_start(GTK_BOX(hbox), iconwid, FALSE, FALSE, 2); 00229 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); 00230 00231 gtk_widget_show(iconwid); 00232 gtk_widget_show(label); 00233 00234 button = gtk_button_new(); 00235 00236 gtk_signal_connect(GTK_OBJECT(button), "clicked", 00237 GTK_SIGNAL_FUNC(ok_callback), NULL); 00238 gtk_widget_show(hbox); 00239 00240 gtk_container_add(GTK_CONTAINER (button), hbox); 00241 00242 gtk_box_pack_start(GTK_BOX(hbox2), button, TRUE, TRUE, 0); 00243 gtk_widget_show(button); 00244 00245 /*Cancel Button*/ 00246 00247 hbox = gtk_hbox_new(FALSE, 5); 00248 icon = gdk_pixmap_create_from_xpm_d(edit_account_window->window, &mask, NULL, cancel_xpm); 00249 iconwid = gtk_pixmap_new(icon, mask); 00250 label = gtk_label_new(_("Cancel")); 00251 00252 gtk_box_pack_start(GTK_BOX(hbox), iconwid, FALSE, FALSE, 2); 00253 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); 00254 00255 gtk_widget_show(iconwid); 00256 gtk_widget_show(label); 00257 00258 button = gtk_button_new(); 00259 00260 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", 00261 GTK_SIGNAL_FUNC(gtk_widget_destroy), 00262 GTK_OBJECT(edit_account_window)); 00263 gtk_widget_show(hbox); 00264 00265 gtk_container_add(GTK_CONTAINER (button), hbox); 00266 00267 gtk_box_pack_start(GTK_BOX(hbox2), button, TRUE, TRUE, 0); 00268 gtk_widget_show(button); 00269 00270 /*Buttons End*/ 00271 00272 hbox = gtk_hbox_new(FALSE, 0); 00273 table = gtk_table_new(1, 1, FALSE); 00274 00275 gtk_box_pack_end(GTK_BOX(hbox), hbox2, FALSE, FALSE, 0); 00276 gtk_widget_show(hbox2); 00277 00278 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 00279 gtk_widget_show(hbox); 00280 00281 gtk_table_attach(GTK_TABLE(table), vbox, 0, 1, 0, 1, GTK_EXPAND, GTK_EXPAND, 0, 0); 00282 gtk_widget_show(vbox); 00283 00284 gtk_container_add(GTK_CONTAINER (edit_account_window), table); 00285 gtk_widget_show(table); 00286 00287 gtk_signal_connect(GTK_OBJECT(edit_account_window), "destroy", 00288 GTK_SIGNAL_FUNC(destroy), NULL); 00289 gtk_widget_show(edit_account_window); 00290 } 00291 00292 if(account->account_contact) { 00293 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(group)->entry), 00294 account->account_contact->group->name); 00295 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(nick)->entry), 00296 account->account_contact->nick); 00297 } else { 00298 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(group)->entry), 00299 _("Unknown")); 00300 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(nick)->entry), 00301 account->handle); 00302 } 00303 00304 gtk_frame_set_label(GTK_FRAME(frame), frame_title); 00305 00306 g_snprintf(buff, 1024, window_title, account->handle); 00307 gtk_window_set_title(GTK_WINDOW(edit_account_window), buff); 00308 eb_icon(edit_account_window->window); 00309 00310 window_open = 1; 00311 } |
|
Definition at line 318 of file edit_account_window.c. References _, account::account_contact, add_unknown_account_window_new(), draw_edit_account_window(), contact::group, and _grouplist::name. Referenced by edit_account_callback().
00319 { 00320 if(!strcmp(ea->account_contact->group->name, _("Unknown"))) 00321 add_unknown_account_window_new(ea); 00322 else 00323 draw_edit_account_window(ea, _("Edit %s"), _("Edit Account"), _("Save")); 00324 } |
|
Definition at line 100 of file edit_account_window.c. References find_grouplist_by_name(), group, _grouplist::members, and strcasecmp_glist(). Referenced by dif_group(), do_invite_window(), draw_edit_account_window(), get_all_contacts(), and group_changed().
00101 { 00102 GList * node = NULL, *newlist = NULL; 00103 grouplist * g; 00104 00105 g = find_grouplist_by_name(group); 00106 00107 if(g) 00108 node = g->members; 00109 00110 while(node) 00111 { 00112 newlist = g_list_insert_sorted(newlist, ((struct contact *)node->data)->nick, strcasecmp_glist); 00113 node = node->next; 00114 } 00115 00116 return newlist; 00117 } |
|
Definition at line 85 of file edit_account_window.c.
00086 { 00087 GList * node = NULL; 00088 GList * newlist = NULL; 00089 node = groups; 00090 00091 while(node) 00092 { 00093 newlist = g_list_append(newlist, ((grouplist *)node->data)->name); 00094 node = node->next; 00095 } 00096 00097 return newlist; 00098 } |
|
Definition at line 120 of file edit_account_window.c. References account::account_contact, COMBO_TEXT, get_contacts(), group, account::handle, contact::nick, and nick. Referenced by draw_edit_account_window().
00121 { 00122 GList * list = get_contacts(COMBO_TEXT(group)); 00123 gtk_combo_set_popdown_strings(GTK_COMBO(nick), list ); 00124 g_list_free(list); 00125 00126 if(account->account_contact) 00127 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(nick)->entry), 00128 account->account_contact->nick); 00129 else 00130 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(nick)->entry), 00131 account->handle); 00132 } |
|
|
Definition at line 80 of file edit_account_window.c. Referenced by get_contacts().
00081 { 00082 return strcasecmp((const char *)a, (const char *)b); 00083 } |
|
Definition at line 38 of file edit_account_window.c. |
|
Definition at line 39 of file edit_account_window.c. Referenced by draw_edit_account_window(), and ok_callback(). |
|
Definition at line 41 of file edit_account_window.c. Referenced by draw_edit_account_window(), get_contacts(), group_changed(), and ok_callback(). |
|
Definition at line 40 of file edit_account_window.c. Referenced by draw_edit_account_window(), group_changed(), and ok_callback(). |
|
Definition at line 37 of file edit_account_window.c. Referenced by destroy(), and draw_edit_account_window(). |