From: <kev...@us...> - 2003-05-23 06:19:32
|
Update of /cvsroot/bidwatcher/bidwatcher In directory sc8-pr-cvs1:/tmp/cvs-serv2458 Modified Files: bidwatcher.cpp bidwatcher.h Log Message: Fixed some constant return values. Rearranged config window to look a little less hacky. Index: bidwatcher.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/bidwatcher.cpp,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- bidwatcher.cpp 21 May 2003 05:18:50 -0000 1.152 +++ bidwatcher.cpp 23 May 2003 06:19:29 -0000 1.153 @@ -470,7 +470,7 @@ GetUserListings(); UpdateList(); break; - case 2: + case GUA_BADUSER: showError("Update failed: Invalid username"); break; default: @@ -1110,25 +1110,24 @@ ConfigWindow::ConfigWindow() { window = gtk_dialog_new(); + gtk_window_set_title(GTK_WINDOW(window), "Bidwatcher Configuration"); + gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); notebook = gtk_notebook_new(); bookbox[CONFIG_MAIN] = gtk_vbox_new(FALSE, 0); bookbox[CONFIG_COLOR] = gtk_vbox_new(FALSE, 0); gtk_notebook_set_scrollable(GTK_NOTEBOOK(notebook), TRUE); - // gtk_container_set_border_width(GTK_CONTAINER(window),10); - /* CONFIG_MAIN */ + user_frame = gtk_frame_new("User Information"); + sys_frame = gtk_frame_new("System Information"); + toggle_frame = gtk_frame_new("Auction Options"); + useridlabel = gtk_label_new("Enter user ID:"); passwordlabel = gtk_label_new("Enter password:"); browserlabel = gtk_label_new("Path to web browser:"); mailclientlabel = gtk_label_new("Path to email client:"); - proxylabel = gtk_label_new("Proxy server: (ex: foo.bar.com:8080)"); - - /* - fontfixlabel = gtk_label_new("FixedFont string:"); - fontcleanlabel = gtk_label_new("CleanFont string:"); - */ + proxylabel = gtk_label_new("Proxy server:"); useridtext = gtk_entry_new(); passwordtext = gtk_entry_new(); @@ -1137,11 +1136,6 @@ mailclienttext = gtk_entry_new(); proxytext = gtk_entry_new(); - /* - fontfixtext = gtk_entry_new(); - fontcleantext = gtk_entry_new(); - */ - listingcheck = gtk_check_button_new_with_label("Track my eBay listings"); bidcheck = gtk_check_button_new_with_label("Track current bids"); @@ -1171,7 +1165,7 @@ update_prio1_adj = gtk_adjustment_new(update_prio1_interval, 1, 1000, 1, 10, 10); update_prio1_spin = gtk_spin_button_new(GTK_ADJUSTMENT(update_prio1_adj), 1.0, 0); - update_prio1_label = gtk_label_new("Update interval (@ <3mins) in secs"); + update_prio1_label = gtk_label_new("Update interval (<3mins)"); update_prio1_box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(update_prio1_box), update_prio1_spin, FALSE, FALSE, 0); @@ -1179,7 +1173,7 @@ update_prio2_adj = gtk_adjustment_new(update_prio2_interval, 1, 1000, 1, 10, 10); update_prio2_spin = gtk_spin_button_new(GTK_ADJUSTMENT(update_prio2_adj), 1.0, 0); - update_prio2_label = gtk_label_new("Update interval (@ <15mins) in secs"); + update_prio2_label = gtk_label_new("Update interval (<15mins)"); update_prio2_box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(update_prio2_box), update_prio2_spin, FALSE, FALSE, 0); @@ -1187,7 +1181,7 @@ update_prio3_adj = gtk_adjustment_new(update_prio3_interval, 1, 1000, 1, 10, 10); update_prio3_spin = gtk_spin_button_new(GTK_ADJUSTMENT(update_prio3_adj), 1.0, 0); - update_prio3_label = gtk_label_new("Update interval (@ <120mins) in secs"); + update_prio3_label = gtk_label_new("Update interval (<120mins)"); update_prio3_box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(update_prio3_box), update_prio3_spin, FALSE, FALSE, 0); @@ -1195,115 +1189,117 @@ update_prio4_adj = gtk_adjustment_new(update_prio4_interval, 1, 1000, 1, 10, 10); update_prio4_spin = gtk_spin_button_new(GTK_ADJUSTMENT(update_prio4_adj), 1.0, 0); - update_prio4_label = gtk_label_new("Update interval (@ >120mins) in secs"); + update_prio4_label = gtk_label_new("Update interval (>120mins)"); update_prio4_box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(update_prio4_box), update_prio4_spin, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(update_prio4_box), update_prio4_label, FALSE, FALSE, 0); - useridbox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(useridbox), - useridlabel, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(useridbox), - useridtext, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - useridbox, FALSE, FALSE, 0); - - passwordbox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(passwordbox), - passwordlabel, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(passwordbox), - passwordtext, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - passwordbox, FALSE, FALSE, 0); - - browserbox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(browserbox), - browserlabel, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(browserbox), - browsertext, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - browserbox, FALSE, FALSE, 0); - - - emailbox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(emailbox), - mailclientlabel, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(emailbox), - mailclienttext, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - emailbox, FALSE, FALSE, 0); - - - proxybox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(proxybox), - proxylabel, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(proxybox), - proxytext, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - proxybox, FALSE, FALSE, 0); - - /* - fontfixbox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(fontfixbox), - fontfixlabel, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(fontfixbox), - fontfixtext, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - fontfixbox, FALSE, FALSE, 0); - - fontcleanbox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(fontcleanbox), - fontcleanlabel, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(fontcleanbox), - fontcleantext, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - fontcleanbox, FALSE, FALSE, 0); - */ + usertable = gtk_table_new(2, 2, FALSE); + gtk_container_set_border_width(GTK_CONTAINER(usertable), 3); + gtk_table_set_col_spacings(GTK_TABLE(usertable), 17); + gtk_table_attach(GTK_TABLE(usertable), useridlabel, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment(GTK_MISC(useridlabel), 0, 0.5); + gtk_table_attach(GTK_TABLE(usertable), useridtext, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(usertable), passwordlabel, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment(GTK_MISC(passwordlabel), 0, 0.5); + gtk_table_attach(GTK_TABLE(usertable), passwordtext, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_add(GTK_CONTAINER(user_frame), usertable); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - listingcheck, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - bidcheck, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - startupcheck, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - deletecheck, FALSE, FALSE, 0); + systable = gtk_table_new(3, 2, FALSE); + gtk_container_set_border_width(GTK_CONTAINER(systable), 3); + gtk_table_set_col_spacings(GTK_TABLE(systable), 3); + gtk_table_attach(GTK_TABLE(systable), browserlabel, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment(GTK_MISC(browserlabel), 0, 0.5); + gtk_table_attach(GTK_TABLE(systable), browsertext, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(systable), mailclientlabel, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment(GTK_MISC(mailclientlabel), 0, 0.5); + gtk_table_attach(GTK_TABLE(systable), mailclienttext, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(systable), proxylabel, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment(GTK_MISC(proxylabel), 0, 0.5); + gtk_table_attach(GTK_TABLE(systable), proxytext, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_add(GTK_CONTAINER(sys_frame), systable); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - size_check, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - location_check, FALSE, FALSE, 0); + toggletable = gtk_table_new(7, 2, FALSE); + gtk_container_set_border_width(GTK_CONTAINER(toggletable), 3); + gtk_table_set_col_spacings(GTK_TABLE(toggletable), 3); + gtk_table_attach(GTK_TABLE(toggletable), listingcheck, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), bidcheck, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), startupcheck, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), deletecheck, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), size_check, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), location_check, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), label_security, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); security_box = gtk_hbox_new(FALSE, FALSE); - // gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), label_security, - // FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(security_box), label_security, - FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(security_box), radio_sec_low, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(security_box), radio_sec_medium, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(security_box), radio_sec_high, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - security_box, FALSE, FALSE, 0); - + gtk_table_attach(GTK_TABLE(toggletable), security_box, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - snipebox, FALSE, FALSE, 0); + gtk_table_attach(GTK_TABLE(toggletable), snipebox, 0, 1, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), update_prio1_box, 1, 2, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), update_prio2_box, 0, 1, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), update_prio3_box, 1, 2, 5, 6, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach(GTK_TABLE(toggletable), update_prio4_box, 0, 1, 6, 7, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_container_add(GTK_CONTAINER(toggle_frame), toggletable); - gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - update_prio1_box, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - update_prio2_box, FALSE, FALSE, 0); - + user_frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - update_prio3_box, FALSE, FALSE, 0); - + sys_frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(bookbox[CONFIG_MAIN]), - update_prio4_box, FALSE, FALSE, 0); + toggle_frame, FALSE, FALSE, 0); configOpen = TRUE; @@ -3195,7 +3191,7 @@ TimeSync(); if (doStartup) { - if (strlen(authID)>2 && GetUserBids() == 1) { + if (strlen(authID)>2 && GetUserBids() == GUA_SUCCESS) { GetUserListings(); UpdateList(); } @@ -3325,7 +3321,7 @@ return TRUE; updateInProgress=TRUE; - if (GetUserBids() == 1) { + if (GetUserBids() == GUA_SUCCESS) { updateInProgress=FALSE; if (timeToNextEnd() < 5*60) return TRUE; Index: bidwatcher.h =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/bidwatcher.h,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- bidwatcher.h 2 May 2003 05:43:06 -0000 1.65 +++ bidwatcher.h 23 May 2003 06:19:29 -0000 1.66 @@ -297,8 +297,8 @@ *deletecheck, *snipebox, *snipespin, *snipelabel, *okbutton, *cancelbutton, *label_security, *radio_sec_low, *radio_sec_medium, *radio_sec_high, *security_box, *location_check, *size_check, - *fontfixbox, *fontfixlabel, *fontfixtext, - *fontcleanbox, *fontcleanlabel, *fontcleantext; + *user_frame, *sys_frame, *toggle_frame, *usertable, *systable, + *toggletable; GtkObject *snipeadj; |