Changeset 2558 for trunk/jons-gtk-gui
- Timestamp:
- 06/15/01 14:27:17 (7 years ago)
- Location:
- trunk/jons-gtk-gui/src
- Files:
-
- 7 modified
-
extras.cpp (modified) (1 diff)
-
licq_gtk.h (modified) (4 diffs)
-
main.cpp (modified) (1 diff)
-
main_window.cpp (modified) (5 diffs)
-
menu.cpp (modified) (1 diff)
-
option_window.cpp (modified) (7 diffs)
-
register_user.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jons-gtk-gui/src/extras.cpp
r2532 r2558 164 164 { 165 165 wizard_message(5); 166 main_window = main_window_new(title , 445, 200);166 main_window = main_window_new(title); 167 167 main_window_show(); 168 168 system_status_refresh(); -
trunk/jons-gtk-gui/src/licq_gtk.h
r2495 r2558 307 307 GtkWidget *flash_events; 308 308 GtkWidget *chkRecvColors; 309 GtkWidget *chkRememberWindowPos; 309 310 310 311 // Network section … … 506 507 extern bool flash_events; 507 508 extern unsigned long auto_logon; 509 extern bool remember_window_pos; 510 511 /* Globals for window dimensions / location */ 512 extern short int windowX; 513 extern short int windowY; 514 extern short int windowH; 515 extern short int windowW; 508 516 509 517 /* Globals in random_chat.cpp */ … … 673 681 674 682 /* Functions in main_window.cpp */ 675 extern GtkWidget *main_window_new(const gchar * , gint, gint);683 extern GtkWidget *main_window_new(const gchar *); 676 684 extern void main_window_show(); 677 685 … … 704 712 extern void color_dlg_cancel(GtkWidget *, gpointer); 705 713 extern void SOCKSClicked(GtkWidget *, gpointer); 714 extern void save_window_pos (void); 706 715 707 716 -
trunk/jons-gtk-gui/src/main.cpp
r2532 r2558 99 99 else 100 100 { 101 main_window = main_window_new(title , 245, 160);101 main_window = main_window_new(title); 102 102 main_window_show(); 103 103 contact_list_refresh(); -
trunk/jons-gtk-gui/src/main_window.cpp
r2532 r2558 31 31 void main_window_delete_event(GtkWidget *mainwindow, gpointer data) 32 32 { 33 save_window_pos(); 33 34 gtk_main_quit(); 34 35 } 35 36 36 GtkWidget* main_window_new(const gchar* window_title, 37 gint height, 38 gint width) 37 GtkWidget* main_window_new(const gchar* window_title) 39 38 { 40 39 gtk_timeout_add(1000, flash_icons, 0); … … 64 63 /* Create the main window */ 65 64 main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 65 66 /* set the position if that option is enabled */ 67 if (remember_window_pos) 68 gtk_widget_set_uposition (main_window, windowX, windowY); 66 69 67 70 /* Set the title */ … … 95 98 GTK_POLICY_NEVER, 96 99 GTK_POLICY_AUTOMATIC); 97 gtk_widget_set_usize(scroll_bar, wi dth - 77, height - 61);100 gtk_widget_set_usize(scroll_bar, windowW - 77, windowH - 87); 98 101 99 102 /* Add in the contact list */ 100 contact_list = contact_list_new( height - 30, width- 37);103 contact_list = contact_list_new(windowH - 56, windowW - 37); 101 104 102 105 gtk_container_add(GTK_CONTAINER(scroll_bar), contact_list); … … 109 112 110 113 /* Add in the status bar menu */ 111 status_bar = status_bar_new(25, wi dth, 2);114 status_bar = status_bar_new(25, windowW, 2); 112 115 113 116 /* Add the status bar to the event box */ … … 123 126 124 127 /* Add the system status bar */ 125 system_status = system_status_new(25, wi dth, 2);128 system_status = system_status_new(25, windowW, 2); 126 129 127 130 /* Add the system status bar into the event box */ -
trunk/jons-gtk-gui/src/menu.cpp
r2532 r2558 185 185 void menu_system_quit(GtkWidget *blah, gpointer data) 186 186 { 187 save_window_pos(); 187 188 gtk_main_quit(); 188 189 } -
trunk/jons-gtk-gui/src/option_window.cpp
r2532 r2558 34 34 char timestamp_format[50]; 35 35 unsigned long auto_logon; 36 bool remember_window_pos; 37 38 // Global variables for window position and size 39 short int windowX; 40 short int windowY; 41 short int windowH; 42 short int windowW; 36 43 37 44 // The "Options" selection under the menu in the main window … … 106 113 ow->chkRecvColors = gtk_check_button_new_with_label("Receive Colors"); 107 114 gtk_table_attach(GTK_TABLE(table), ow->chkRecvColors, 0, 1, 3, 4, 115 GtkAttachOptions(GTK_FILL | GTK_EXPAND), 116 GTK_FILL, 3, 3); 117 118 // Remember window position 119 ow->chkRememberWindowPos = gtk_check_button_new_with_label("Save Window Size and Position"); 120 gtk_table_attach(GTK_TABLE(table), ow->chkRememberWindowPos, 1, 2, 3, 4, 108 121 GtkAttachOptions(GTK_FILL | GTK_EXPAND), 109 122 GTK_FILL, 3, 3); … … 354 367 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ow->chkRecvColors), 355 368 recv_colors); 369 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ow->chkRememberWindowPos), 370 remember_window_pos); 356 371 357 372 // Clist of servers … … 428 443 recv_colors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( 429 444 ow->chkRecvColors)); 445 remember_window_pos = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( 446 ow->chkRememberWindowPos)); 430 447 431 448 // Save the daemon options … … 496 513 licqConf.WriteBool("RecvColors", recv_colors); 497 514 licqConf.WriteBool("ShowTimestamp", show_convo_timestamp); 515 licqConf.WriteBool("RememberWindowPos", remember_window_pos); 498 516 licqConf.WriteStr("TimestampFormat", timestamp_format); 499 517 … … 506 524 // Refresh contact list 507 525 contact_list_refresh(); 526 } 527 528 void save_window_pos (void) 529 { 530 char filename[MAX_FILENAME_LEN]; 531 sprintf (filename, "%s/licq_jons-gtk-gui.conf", BASE_DIR); 532 CIniFile licqConf(INI_FxERROR | INI_FxALLOWxCREATE); 533 if(!licqConf.LoadFile(filename)) 534 return; 535 gint x, y, w, h; 536 537 gdk_window_get_root_origin(main_window->window, &x, &y); 538 gdk_window_get_size(main_window->window, &w, &h); 539 540 licqConf.SetSection("appearance"); 541 542 licqConf.WriteNum("windowX", (short int)x); 543 licqConf.WriteNum("windowY", (short int)y); 544 licqConf.WriteNum("windowW", (short int)w); 545 licqConf.WriteNum("windowH", (short int)h); 546 547 licqConf.FlushFile(); 548 licqConf.CloseFile(); 508 549 } 509 550 … … 548 589 licqConf.ReadBool("ShowTimestamp", show_convo_timestamp, true); 549 590 licqConf.ReadStr("TimestampFormat", timestamp_format, "%H:%M:%S"); 591 licqConf.ReadBool("RememberWindowPos", remember_window_pos, true); 592 593 // Window size & position 594 licqConf.ReadNum("windowX", windowX, 0); 595 licqConf.ReadNum("windowY", windowY, 0); 596 licqConf.ReadNum("windowH", windowH, 245); 597 licqConf.ReadNum("windowW", windowW, 160); 550 598 551 599 // Auto logon -
trunk/jons-gtk-gui/src/register_user.cpp
r2532 r2558 136 136 wizard_message(6); 137 137 138 main_window = main_window_new(g_strdup_printf("%ld", _uin), 139 445, 200); 138 main_window = main_window_new(g_strdup_printf("%ld", _uin)); 140 139 main_window_show(); 141 140 system_status_refresh();
