Changeset 2159 for trunk/jons-gtk-gui
- Timestamp:
- 07/18/00 16:07:02 (8 years ago)
- Location:
- trunk/jons-gtk-gui/src
- Files:
-
- 5 modified
-
extras.cpp (modified) (6 diffs)
-
licq_gtk.h (modified) (5 diffs)
-
status.cpp (modified) (2 diffs)
-
system_message.cpp (modified) (1 diff)
-
user_info_window.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jons-gtk-gui/src/extras.cpp
r2130 r2159 438 438 return; 439 439 440 const gchar *name = g_strdup_printf("%s %s", iu->user->GetFirstName(),441 iu->user->GetLastName());442 440 const SCountry *country = GetCountryByCode(iu->user->GetCountryCode()); 443 const SLanguage *l1 = GetLanguageByCode(iu->user->GetLanguage(0));444 const SLanguage *l2 = GetLanguageByCode(iu->user->GetLanguage(1));445 const SLanguage *l3 = GetLanguageByCode(iu->user->GetLanguage(2));446 447 gchar *bday;448 gchar *age;441 // const SLanguage *l1 = GetLanguageByCode(iu->user->GetLanguage(0)); 442 // const SLanguage *l2 = GetLanguageByCode(iu->user->GetLanguage(1)); 443 // const SLanguage *l3 = GetLanguageByCode(iu->user->GetLanguage(2)); 444 445 gchar bday[11]; 446 gchar age[6]; 449 447 450 448 if(iu->user->GetAge() != 65535) 451 age = g_strdup_printf("%hd", iu->user->GetAge());449 sprintf(age, "%hd", iu->user->GetAge()); 452 450 else 453 age = "N/A";451 strcpy(age, "N/A"); 454 452 455 453 if(iu->user->GetBirthMonth() == 0 || iu->user->GetBirthDay() == 0) 456 bday = "N/A";454 strcpy(bday, "N/A"); 457 455 else 458 bday = g_strdup_printf("%d/%d/%d", iu->user->GetBirthMonth(),456 sprintf(bday, "%d/%d/%d", iu->user->GetBirthMonth(), 459 457 iu->user->GetBirthDay(), iu->user->GetBirthYear()); 460 458 … … 465 463 case USER_EXT: 466 464 gtk_entry_set_text(GTK_ENTRY(iu->alias), iu->user->GetAlias()); 467 gtk_entry_set_text(GTK_ENTRY(iu->name), name); 465 gtk_entry_set_text(GTK_ENTRY(iu->fname), 466 iu->user->GetFirstName()); 467 gtk_entry_set_text(GTK_ENTRY(iu->lname), 468 iu->user->GetLastName()); 468 469 gtk_entry_set_text(GTK_ENTRY(iu->email1), 469 470 iu->user->GetEmailPrimary()); 470 471 gtk_entry_set_text(GTK_ENTRY(iu->email2), 471 472 iu->user->GetEmailSecondary()); 473 gtk_entry_set_text(GTK_ENTRY(iu->oldemail), 474 iu->user->GetEmailOld()); 472 475 gtk_entry_set_text(GTK_ENTRY(iu->address), 473 476 iu->user->GetAddress()); … … 478 481 if(country == NULL) 479 482 gtk_entry_set_text(GTK_ENTRY(iu->country), 480 "Un known");483 "Unspecified"); 481 484 else 482 485 gtk_entry_set_text(GTK_ENTRY(iu->country), 483 486 country->szName); 484 487 485 486 488 gtk_entry_set_text(GTK_ENTRY(iu->phone), 487 489 iu->user->GetPhoneNumber()); 490 gtk_entry_set_text(GTK_ENTRY(iu->cellphone), 491 iu->user->GetCellularNumber()); 492 gtk_entry_set_text(GTK_ENTRY(iu->faxnumber), 493 iu->user->GetFaxNumber()); 488 494 break; 489 495 case USER_MORE: … … 501 507 gtk_entry_set_text(GTK_ENTRY(iu->homepage), 502 508 iu->user->GetHomepage()); 503 if(l1 == NULL) 504 gtk_entry_set_text(GTK_ENTRY(iu->lang1), "Unknown"); 509 510 for(unsigned short i = 0; i < 3; i++) { 511 const SLanguage *l = GetLanguageByCode(iu->user->GetLanguage(i)); 512 if(l == NULL) 513 gtk_entry_set_text(GTK_ENTRY(iu->lang[i]), "Unknown"); 505 514 else 506 gtk_entry_set_text(GTK_ENTRY(iu->lang1), l1->szName); 507 515 gtk_entry_set_text(GTK_ENTRY(iu->lang[i]), l->szName); 516 } 517 /* 508 518 if(l2 == NULL) 509 519 gtk_entry_set_text(GTK_ENTRY(iu->lang2), "Unknown"); … … 515 525 else 516 526 gtk_entry_set_text(GTK_ENTRY(iu->lang3), l3->szName); 517 break;527 */ break; 518 528 case USER_WORK: 519 529 gtk_entry_set_text(GTK_ENTRY(iu->company), … … 529 539 gtk_entry_set_text(GTK_ENTRY(iu->co_phone), 530 540 iu->user->GetCompanyPhoneNumber()); 541 gtk_entry_set_text(GTK_ENTRY(iu->co_fax), 542 iu->user->GetCompanyFaxNumber()); 531 543 gtk_entry_set_text(GTK_ENTRY(iu->co_city), 532 544 iu->user->GetCompanyCity()); -
trunk/jons-gtk-gui/src/licq_gtk.h
r2139 r2159 81 81 { 82 82 GtkWidget *window; 83 GtkWidget *notebook; 83 84 GtkWidget *alias; 84 GtkWidget *name; 85 GtkWidget *fname; 86 GtkWidget *lname; 85 87 GtkWidget *email1; 86 88 GtkWidget *email2; 89 GtkWidget *oldemail; 87 90 GtkWidget *address; 88 91 GtkWidget *city; … … 90 93 GtkWidget *zip; 91 94 GtkWidget *country; 95 GtkWidget *o_country; 92 96 GtkWidget *phone; 97 GtkWidget *cellphone; 98 GtkWidget *faxnumber; 99 GtkWidget *need_auth; 100 GtkWidget *hide_email; 93 101 GtkWidget *age; 94 102 GtkWidget *gender; 103 GtkWidget *o_gender; 95 104 GtkWidget *homepage; 96 105 GtkWidget *bday; 97 GtkWidget *lang1; 98 GtkWidget *lang2; 99 GtkWidget *lang3; 106 GtkWidget *o_bday; 107 GtkWidget *o_bmonth; 108 GtkWidget *o_byear; 109 GtkWidget *lang[3]; 110 GtkWidget *o_lang[3]; 100 111 GtkWidget *company; 101 112 GtkWidget *dept; … … 106 117 GtkWidget *co_city; 107 118 GtkWidget *co_state; 119 GtkWidget *co_fax; 108 120 GtkWidget *about; 109 121 GtkWidget *update; … … 578 590 /* Functions in menu.cpp */ 579 591 extern GtkWidget *menu_new_item(GtkWidget *, const char *, GtkSignalFunc); 592 extern GtkWidget *menu_new_item_with_pixmap(GtkWidget *, const char *, 593 GtkSignalFunc, struct status_icon *); 580 594 extern void menu_separator(GtkWidget *); 581 595 extern void menu_create(); … … 683 697 extern struct info_user *iu_new(ICQUser *); 684 698 extern struct info_user *iu_find(unsigned long); 685 extern void do_entry(GtkWidget *&, GtkWidget *&, const gchar *,686 const gchar *, gboolean); 687 extern void pack_hbox(GtkWidget *&, GtkWidget *, GtkWidget *);699 extern void do_entry(GtkWidget *&, const gchar *, gboolean); 700 extern void do_label_and_entry(GtkWidget *&, const gchar *, 701 const gchar *, GtkWidget *&, gint, gint, gboolean); 688 702 689 703 -
trunk/jons-gtk-gui/src/status.cpp
r2093 r2159 74 74 75 75 _menu_item = 76 menu_new_item(_menu, "Free For Chat", 77 GTK_SIGNAL_FUNC(status_ffc)); 78 _menu_item = 79 menu_new_item(_menu, "Online", GTK_SIGNAL_FUNC(status_online)); 80 81 _menu_item = 82 menu_new_item(_menu, "Away", GTK_SIGNAL_FUNC(status_away)); 83 84 _menu_item = 85 menu_new_item(_menu, "Not Available", 86 GTK_SIGNAL_FUNC(status_na)); 87 88 _menu_item = 89 menu_new_item(_menu, "Occupied", GTK_SIGNAL_FUNC(status_occ)); 90 91 _menu_item = 92 menu_new_item(_menu, "Do Not Disturb", 93 GTK_SIGNAL_FUNC(status_dnd)); 94 95 _menu_item = 96 menu_new_item(_menu, "Offline", GTK_SIGNAL_FUNC(status_off)); 97 98 /* The invisible selection */ 99 _menu_item = gtk_check_menu_item_new_with_label("Invisible"); 76 menu_new_item_with_pixmap(_menu, "Free For Chat", 77 GTK_SIGNAL_FUNC(status_ffc), ffc); 78 _menu_item = 79 menu_new_item_with_pixmap(_menu, "Online", 80 GTK_SIGNAL_FUNC(status_online), online); 81 82 _menu_item = 83 menu_new_item_with_pixmap(_menu, "Away", 84 GTK_SIGNAL_FUNC(status_away), away); 85 86 _menu_item = 87 menu_new_item_with_pixmap(_menu, "Not Available", 88 GTK_SIGNAL_FUNC(status_na), na); 89 90 _menu_item = 91 menu_new_item_with_pixmap(_menu, "Occupied", 92 GTK_SIGNAL_FUNC(status_occ), occ); 93 94 _menu_item = 95 menu_new_item_with_pixmap(_menu, "Do Not Disturb", 96 GTK_SIGNAL_FUNC(status_dnd), dnd); 97 98 _menu_item = 99 menu_new_item_with_pixmap(_menu, "Offline", 100 GTK_SIGNAL_FUNC(status_off), offline); 101 102 // Separator 103 GtkWidget *separator = gtk_hseparator_new(); 104 _menu_item = gtk_menu_item_new(); 100 105 gtk_menu_append(GTK_MENU(_menu), _menu_item); 101 gtk_signal_connect(GTK_OBJECT(_menu_item), "toggled", 102 GTK_SIGNAL_FUNC(status_invisible), _menu_item); 103 gtk_widget_show(_menu_item); 104 105 /* Set the state for the invisible checkmark */ 106 ICQOwner *owner = gUserManager.FetchOwner(LOCK_R); 107 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_item), 108 owner->StatusInvisible()); 109 gUserManager.DropOwner(); 110 106 gtk_container_add(GTK_CONTAINER(_menu_item), separator); 107 gtk_widget_set_sensitive(_menu_item, false); 108 gtk_widget_show_all(_menu_item); 109 110 _menu_item = 111 menu_new_item_with_pixmap(_menu, "Invisible", 112 GTK_SIGNAL_FUNC(status_invisible), invisible); 111 113 _root_menu = 112 114 menu_new_item(NULL, "", NULL); … … 172 174 ICQOwner *owner = gUserManager.FetchOwner(LOCK_R); 173 175 174 if( GTK_CHECK_MENU_ITEM(invisible_check)->active)176 if(!(owner->StatusFull() & ICQ_STATUS_FxPRIVATE)) 175 177 { 176 178 icq_daemon->icqSetStatus(owner->StatusFull() | ICQ_STATUS_FxPRIVATE); -
trunk/jons-gtk-gui/src/system_message.cpp
r2057 r2159 90 90 break; 91 91 92 case ICQ_CMDxSUB_CONTACTxLIST:93 gtk_text_insert(GTK_TEXT(sm->text), 0, 0, 0,94 "Contact\n-------\n\n", -1);95 break;96 97 92 default: 98 93 g_print("Unknown system message type\n"); -
trunk/jons-gtk-gui/src/user_info_window.cpp
r2060 r2159 27 27 28 28 #include <gtk/gtk.h> 29 #include <stdlib.h> 29 30 30 31 GSList *iu_list; … … 34 35 gboolean is_o = FALSE; 35 36 36 / * Check to see if it's for the owner */37 // Check to see if it's for the owner 37 38 if(user == NULL) 38 39 { … … 54 55 GtkWidget *label; 55 56 GtkWidget *entry; 56 GtkWidget *h_box;57 57 GtkWidget *v_box; 58 58 GtkWidget *v_scroll; 59 GtkWidget *general_box;60 GtkWidget *address_box;61 GtkWidget *more_box;62 GtkWidget *work_box;63 GtkWidget *about_box;64 59 GtkWidget *save; 65 60 GtkWidget *close; 66 GtkWidget *notebook;67 61 GtkWidget *statusbar; 68 62 const gchar *title = g_strdup_printf("Info for %s", user->GetAlias()); 69 const gchar *name = g_strdup_printf("%s %s", user->GetFirstName(),70 user->GetLastName());71 63 const gchar *uin = g_strdup_printf("%ld", user->Uin()); 72 gchar *online; 64 gchar real_ip[32]; 65 const gulong _realip = user->RealIp(); 73 66 gchar buf[32]; 67 strcpy(real_ip, inet_ntoa_r(*(struct in_addr *)&_realip, buf)); 74 68 75 69 /* Take care of the e_tag_data stuff */ … … 85 79 /* Make the scroll window for the about box */ 86 80 v_scroll = gtk_scrolled_window_new(NULL, NULL); 87 gtk_widget_set_usize(v_scroll, 250, 135);81 gtk_widget_set_usize(v_scroll, 175, 115); 88 82 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(v_scroll), 89 83 GTK_POLICY_NEVER, … … 91 85 92 86 /* Create new boxes */ 93 h_box = gtk_hbox_new(FALSE, 5);94 87 v_box = gtk_vbox_new(FALSE, 5); 95 general_box = gtk_vbox_new(FALSE, 5);96 address_box = gtk_vbox_new(FALSE, 5);97 more_box = gtk_vbox_new(FALSE, 5);98 work_box = gtk_vbox_new(FALSE, 5);99 about_box = gtk_vbox_new(FALSE, 5);100 88 101 89 /* The notebook */ 102 notebook = gtk_notebook_new(); 103 104 /* START THE GENERAL TAB */ 105 106 /* The Alias entry and label */ 107 do_entry(iu->alias, label, "Nick: ", user->GetAlias(), is_o); 108 gtk_entry_set_editable(GTK_ENTRY(iu->alias), TRUE); 109 110 /* Pack the alias */ 111 gtk_box_pack_start(GTK_BOX(h_box), label, FALSE, FALSE, 5); 112 gtk_box_pack_start(GTK_BOX(h_box), iu->alias, FALSE, FALSE, 0); 113 114 /* The Name box and label */ 115 do_entry(iu->name, label, "Name: ", name, is_o); 116 117 /* Pack the name */ 118 gtk_box_pack_start(GTK_BOX(h_box), label, FALSE, FALSE, 5); 119 gtk_box_pack_start(GTK_BOX(h_box), iu->name, FALSE, FALSE, 0); 120 121 /* Pack the Alias and Name E&L's in a horizontal line */ 122 gtk_box_pack_start(GTK_BOX(general_box), h_box, FALSE, FALSE, 5); 123 124 h_box = gtk_hbox_new(FALSE, 5); 125 126 /* The UIN box and label */ 127 do_entry(entry, label, "UIN: ", uin, FALSE); 128 129 /* Pack the UIN */ 130 gtk_box_pack_start(GTK_BOX(h_box), label, FALSE, FALSE, 5); 131 gtk_box_pack_start(GTK_BOX(h_box), entry , FALSE, FALSE, 0); 132 133 /* The IP box and label */ 134 do_entry(entry, label, "IP: ", user->IpPortStr(buf), 135 FALSE); 136 137 /* Pack the IP */ 138 gtk_box_pack_start(GTK_BOX(h_box), label, FALSE, FALSE, 5); 139 gtk_box_pack_start(GTK_BOX(h_box), entry, FALSE, FALSE, 0); 140 141 /* Pack the UIN and IP in a horizontal line */ 142 gtk_box_pack_start(GTK_BOX(general_box), h_box, FALSE, FALSE, 5); 143 144 h_box = gtk_hbox_new(FALSE, 5); 145 146 /* The primary e-mails */ 147 do_entry(iu->email1, label, "E-mail 1:", user->GetEmailPrimary(), is_o); 148 149 /* Pack the email1 */ 150 gtk_box_pack_start(GTK_BOX(h_box), label, FALSE, FALSE, 5); 151 gtk_box_pack_start(GTK_BOX(h_box), iu->email1, FALSE, FALSE, 0); 152 153 /* The secondary e-mail */ 154 do_entry(iu->email2, label, "E-mail 2:", user->GetEmailSecondary(), is_o); 155 156 /* Pack the email2 */ 157 gtk_box_pack_start(GTK_BOX(h_box), label, FALSE, FALSE, 5); 158 gtk_box_pack_start(GTK_BOX(h_box), iu->email2, FALSE, FALSE, 0); 159 160 /* Pack e-mail1 and e-mail2 in a horizontal line */ 161 gtk_box_pack_start(GTK_BOX(general_box), h_box, FALSE, FALSE, 5); 162 163 h_box = gtk_hbox_new(FALSE, 0); 164 90 iu->notebook = gtk_notebook_new(); 91 92 //------ START THE GENERAL TAB --------------------------- 93 94 GtkWidget *general_table = gtk_table_new(6, 4, false); 95 96 // Alias (always editable) 97 do_label_and_entry(iu->alias, user->GetAlias(), "Alias:", 98 general_table, 0, 0, true); 99 100 // UIN (never editable) 101 do_label_and_entry(entry, uin, "UIN:", general_table, 102 2, 0, false); 103 104 // Full Name 105 do_label_and_entry(iu->fname, user->GetFirstName(), "First Name:", 106 general_table, 0, 1, is_o); 107 108 // Last Name 109 do_label_and_entry(iu->lname, user->GetLastName(), "Last Name:", 110 general_table, 2, 1, is_o); 111 112 // IP (never editable) 113 do_label_and_entry(entry, user->IpPortStr(buf), "IP:", 114 general_table, 0, 2, false); 115 116 // Real IP (never editable) 117 do_label_and_entry(entry, real_ip, "Real IP:", general_table, 118 2, 2, false); 119 120 // Primary e-mail 121 do_label_and_entry(iu->email1, user->GetEmailPrimary(), 122 "Primary E-Mail:", general_table, 0, 3, is_o); 123 124 // Secondary e-mail 125 do_label_and_entry(iu->email2, user->GetEmailSecondary(), 126 "Secondary E-mail:", general_table, 2, 3, is_o); 127 128 // Old e-mail 129 do_label_and_entry(iu->oldemail, user->GetEmailOld(), 130 "Old E-mail:", general_table, 0, 4, is_o); 131 132 // Hide e-mail is needed anyways.. use an if statement to decide 133 // where it goes.. 134 iu->hide_email = gtk_check_button_new_with_label( 135 "Hide E-mail Address"); 136 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(iu->hide_email), 137 user->GetHideEmail()); 138 139 // If it's not the owner, show last seen 165 140 if(!is_o) 166 141 { 142 gchar online[28]; 143 167 144 if(!iu->user->StatusOffline()) 168 online = "Now";145 strcpy(online, "Now"); 169 146 else if(iu->user->LastOnline() == 0) 170 online = "Unknown";147 strcpy(online, "Unknown"); 171 148 else 172 149 { 173 150 time_t last = iu->user->LastOnline(); 174 online = ctime(&last);151 strcpy(online, ctime(&last)); 175 152 } 176 153 177 do_entry(entry, label, "Last Seen:", online, FALSE); 178 pack_hbox(h_box, label, entry); 154 do_label_and_entry(entry, online, "Last Seen:", general_table, 155 2, 4, FALSE); 156 157 iu->need_auth = gtk_check_button_new_with_label( 158 "Need Authorization To Add"); 159 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( 160 iu->need_auth), iu->user->GetAuthorization()); 161 gtk_widget_set_sensitive(iu->need_auth, false); 162 gtk_table_attach(GTK_TABLE(general_table), iu->need_auth, 0, 2, 163 5, 6, GTK_FILL, GTK_FILL, 3, 1); 164 165 gtk_widget_set_sensitive(iu->hide_email, false); 166 gtk_table_attach(GTK_TABLE(general_table), iu->hide_email, 2, 4, 167 5, 6, 168 GtkAttachOptions(0), 169 GtkAttachOptions(0), 3, 1); 170 } 171 // It's the owner 172 else 173 { 174 gtk_table_attach(GTK_TABLE(general_table), iu->hide_email, 175 0, 2, 5, 6, GTK_FILL, GTK_FILL, 3, 1); 176 } 177 178 //------- END GENERAL TAB ---------------------------------- 179 180 //------- START ADDRESS TAB -------------------------------- 181 182 // Address info table 183 GtkWidget *address_table = gtk_table_new(4, 2, false); 184 185 // Address 186 do_label_and_entry(iu->address, user->GetAddress(), "Address:", 187 address_table, 0, 0, is_o); 188 189 // City 190 do_label_and_entry(iu->city, user->GetCity(), "City:", 191 address_table, 2, 0, is_o); 192 193 // State 194 do_label_and_entry(iu->state, user->GetState(), "State:", 195 address_table, 0, 1, is_o); 196 197 // Zip 198 do_label_and_entry(iu->zip, user->GetZipCode(), "Zip:", 199 address_table, 2, 1, is_o); 200 201 // Country 202 SCountry *sc = (SCountry *)GetCountryByCode(user->GetCountryCode()); 203 gchar country[32]; 204 205 if(sc == NULL) 206 strcpy(country, "Unspecified"); 207 208 else 209 strcpy(country, sc->szName); 210 211 if(!is_o) 212 { 213 do_label_and_entry(iu->country, country, "Country:", 214 address_table, 0, 2, FALSE); 215 } 216 else 217 { 218 iu->o_country = gtk_combo_new(); 219 GList *country_strings = NULL; 220 221 country_strings = g_list_append(country_strings, 222 "Unspecified"); 223 for(unsigned short j = 0; j < NUM_COUNTRIES; j++) 224 country_strings = g_list_append(country_strings, 225 GetCountryByIndex(j)->szName); 226 227 gtk_combo_set_popdown_strings(GTK_COMBO(iu->o_country), 228 country_strings); 229 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(iu->o_country)->entry), 230 false); 231 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(iu->o_country)->entry), 232 country); 233 234 label = gtk_label_new("Country:"); 235 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); 236 237 gtk_table_attach(GTK_TABLE(address_table), label, 0, 1, 2, 3, 238 GtkAttachOptions(GTK_EXPAND | GTK_FILL), 239 GTK_FILL, 3, 1); 240 gtk_table_attach(GTK_TABLE(address_table), iu->o_country, 241 1, 2, 2, 3, 242 GtkAttachOptions(GTK_EXPAND | GTK_FILL), 243 GTK_FILL, 3, 1); 244 } 245 246 // Phone number 247 do_label_and_entry(iu->phone, user->GetPhoneNumber(), "Phone Number:", 248 address_table, 2, 2, is_o); 249 250 // Cellular number 251 do_label_and_entry(iu->cellphone, user->GetCellularNumber(), 252 "Cellular Number:", address_table, 0, 3, is_o); 253 254 // Fax number 255 do_label_and_entry(iu->faxnumber, user->GetFaxNumber(), "Fax Number:", 256 address_table, 2, 3, is_o); 257 258 //------- END ADDRESS TAB ---------------------------------------- 259 260 //------- START MORE TAB ----------------------------------------- 261 262 GtkWidget *more_table = gtk_table_new(3, 2, false); 263 264 // Age 265 gchar age[6]; 266 if(user->GetAge() != 65535) 267 sprintf(age, "%hd", user->GetAge()); 268 else 269 strcpy(age, "N/A"); 179 270 271 do_label_and_entry(iu->age, age, "Age:", more_table, 272 0, 0, is_o); 273 274 // Gender 275 if(!is_o) 276 { 277 gchar gender[12]; 278 if(user->GetGender() == 1) 279 strcpy(gender, "Female"); 280 else if(user->GetGender() == 2) 281 strcpy(gender, "Male"); 282 else 283 strcpy(gender, "Unspecified"); 284 285 do_label_and_entry(iu->gender, gender, "Gender:", more_table, 286 2, 0, FALSE); 287 } 288 else 289 { 290 iu->o_gender = gtk_combo_new(); 291 GList *gender_strings = NULL; 292 gender_strings = g_list_append(gender_strings, "(None)"); 293 gender_strings = g_list_append(gender_strings, "Female"); 294 gender_strings = g_list_append(gender_strings, "Male"); 295 gtk_combo_set_popdown_strings(GTK_COMBO(iu->o_gender), 296 gender_strings); 297 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(iu->o_gender)->entry), 298 false); 299 300 label = gtk_label_new("Gender:"); 301 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); 302 303 gtk_table_attach(GTK_TABLE(more_table), label, 2, 3, 0, 1, 304 GtkAttachOptions(GTK_EXPAND | GTK_FILL), 305 GTK_FILL, 3, 1); 306 gtk_table_attach(GTK_TABLE(more_table), iu->o_gender, 307 3, 4, 0, 1, 308 GtkAttachOptions(GTK_EXPAND | GTK_FILL), 309 GTK_FILL, 3, 1); 310 } 311 312 // Homepage 313 do_label_and_entry(iu->homepage, user->GetHomepage(), "Homepage:", 314 more_table, 0, 1, is_o); 315 316 // Birthday 317 if(!is_o) 318 { 319 gchar bday[11]; 320 321 if(user->GetBirthMonth() == 0 || user->GetBirthDay() == 0) 322 strcpy(bday, "N/A"); 323 324 else 325 sprintf(bday, "%d/%d/%d", user->GetBirthMonth(), 326 user->GetBirthDay(), user->GetBirthYear()); 327 328 do_label_and_entry(iu->bday, bday, "Birthday:", more_table, 329 2, 1, FALSE); 330 } 331 else 332 { 333 label = gtk_label_new("Birthday:"); 334 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); 335 gtk_table_attach(GTK_TABLE(more_table), label, 2, 3, 1, 2, 336 GtkAttachOptions(GTK_EXPAND | GTK_FILL), 337 GTK_FILL, 3, 1); 338 339 GtkWidget *h_box = gtk_hbox_new(false, 0); 340 341 label = gtk_label_new("Month:"); 342 GtkAdjustment *month_adj = 343 (GtkAdjustment *)gtk_adjustment_new( 344 user->GetBirthMonth(), 1.0, 12.0, 345 1.0, 3.0, 3.0); 346 iu->o_bmonth = gtk_spin_button_new(month_adj, 1.0, 0); 347 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(iu->o_bmonth), 348 GTK_UPDATE_IF_VALID); 349 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(iu->o_bmonth), 350 true); 351 352 gtk_box_pack_start(GTK_BOX(h_box), label, false, false, 3); 353 gtk_box_pack_start(GTK_BOX(h_box), iu->o_bmonth, false, false, 354 3); 355 356 label = gtk_label_new("Day:"); 357 GtkAdjustment *day_adj = 358 (GtkAdjustment *)gtk_adjustment_new( 359 user->GetBirthDay(), 1.0, 31.0, 1.0, 5.0, 5.0); 360 iu->o_bday = gtk_spin_button_new(day_adj, 1.0, 0); 361 gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(iu->o_bday), 362 GTK_UPDATE_IF_VALID);
