ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/prefs_editor_gtk.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/prefs_editor_gtk.cpp (file contents):
Revision 1.1 by cebix, 1999-10-03T14:16:25Z vs.
Revision 1.6 by cebix, 1999-10-19T17:41:36Z

# Line 258 | Line 258 | static void mn_zap_pram(...)
258  
259   // Menu item descriptions
260   static GtkItemFactoryEntry menu_items[] = {
261 <        {GetString(STR_PREFS_MENU_FILE_GTK),            NULL,                   NULL,                                                   0, "<Branch>"},
262 <        {GetString(STR_PREFS_ITEM_START_GTK),           NULL,                   GTK_SIGNAL_FUNC(cb_start),              0, NULL},
263 <        {GetString(STR_PREFS_ITEM_ZAP_PRAM_GTK),        NULL,                   GTK_SIGNAL_FUNC(mn_zap_pram),   0, NULL},
264 <        {GetString(STR_PREFS_ITEM_SEPL_GTK),            NULL,                   NULL,                                                   0, "<Separator>"},
265 <        {GetString(STR_PREFS_ITEM_QUIT_GTK),            "<control>Q",   GTK_SIGNAL_FUNC(cb_quit),               0, NULL},
266 <        {GetString(STR_HELP_MENU_GTK),                          NULL,                   NULL,                                                   0, "<LastBranch>"},
267 <        {GetString(STR_HELP_ITEM_ABOUT_GTK),            NULL,                   GTK_SIGNAL_FUNC(mn_about),              0, NULL}
261 >        {(gchar *)GetString(STR_PREFS_MENU_FILE_GTK),           NULL,                   NULL,                                                   0, "<Branch>"},
262 >        {(gchar *)GetString(STR_PREFS_ITEM_START_GTK),          NULL,                   GTK_SIGNAL_FUNC(cb_start),              0, NULL},
263 >        {(gchar *)GetString(STR_PREFS_ITEM_ZAP_PRAM_GTK),       NULL,                   GTK_SIGNAL_FUNC(mn_zap_pram),   0, NULL},
264 >        {(gchar *)GetString(STR_PREFS_ITEM_SEPL_GTK),           NULL,                   NULL,                                                   0, "<Separator>"},
265 >        {(gchar *)GetString(STR_PREFS_ITEM_QUIT_GTK),           "<control>Q",   GTK_SIGNAL_FUNC(cb_quit),               0, NULL},
266 >        {(gchar *)GetString(STR_HELP_MENU_GTK),                         NULL,                   NULL,                                                   0, "<LastBranch>"},
267 >        {(gchar *)GetString(STR_HELP_ITEM_ABOUT_GTK),           NULL,                   GTK_SIGNAL_FUNC(mn_about),              0, NULL}
268   };
269  
270   bool PrefsEditor(void)
# Line 318 | Line 318 | bool PrefsEditor(void)
318   *  "Volumes" pane
319   */
320  
321 < static GtkWidget *volume_list;
321 > static GtkWidget *volume_list, *w_extfs;
322   static int selected_volume;
323  
324   // Volume in list selected
# Line 420 | Line 420 | static void read_volumes_settings(void)
420                  gtk_clist_get_text(GTK_CLIST(volume_list), i, 0, &str);
421                  PrefsAddString("disk", str);
422          }
423 +
424 +        PrefsReplaceString("extfs", gtk_entry_get_text(GTK_ENTRY(w_extfs)));
425   }
426  
427   // Create "Volumes" pane
# Line 436 | Line 438 | static void create_volumes_pane(GtkWidge
438          gtk_widget_show(volume_list);
439          gtk_clist_set_selection_mode(GTK_CLIST(volume_list), GTK_SELECTION_SINGLE);
440          gtk_clist_set_shadow_type(GTK_CLIST(volume_list), GTK_SHADOW_NONE);
441 +        gtk_clist_set_reorderable(GTK_CLIST(volume_list), true);
442          gtk_signal_connect(GTK_OBJECT(volume_list), "select_row", GTK_SIGNAL_FUNC(cl_selected), NULL);
443          char *str;
444          int32 index = 0;
# Line 454 | Line 457 | static void create_volumes_pane(GtkWidge
457          make_button_box(box, 0, buttons);
458          make_separator(box);
459  
460 +        w_extfs = make_entry(box, STR_EXTFS_CTRL, "extfs");
461 +
462          static const opt_desc options[] = {
463                  {STR_BOOT_ANY_LAB, GTK_SIGNAL_FUNC(mn_boot_any)},
464                  {STR_BOOT_CDROM_LAB, GTK_SIGNAL_FUNC(mn_boot_cdrom)},
# Line 526 | Line 531 | static void hide_show_graphics_widgets(v
531          switch (display_type) {
532                  case DISPLAY_WINDOW:
533                          gtk_widget_show(w_frameskip); gtk_widget_show(l_frameskip);
529                        gtk_widget_show(w_display_x); gtk_widget_show(l_display_x);
530                        gtk_widget_show(w_display_y); gtk_widget_show(l_display_y);
534                          break;
535                  case DISPLAY_SCREEN:
536                          gtk_widget_hide(w_frameskip); gtk_widget_hide(l_frameskip);
534                        gtk_widget_hide(w_display_x); gtk_widget_hide(l_display_x);
535                        gtk_widget_hide(w_display_y); gtk_widget_hide(l_display_y);
537                          break;
538          }
539   }
# Line 576 | Line 577 | static void parse_graphics_prefs(void)
577          if (str) {
578                  if (sscanf(str, "win/%d/%d", &dis_width, &dis_height) == 2)
579                          display_type = DISPLAY_WINDOW;
580 <                else if (strcmp(str, "dga") == 0)
580 >                else if (sscanf(str, "dga/%d/%d", &dis_width, &dis_height) == 2)
581                          display_type = DISPLAY_SCREEN;
582          }
583   }
# Line 598 | Line 599 | static void read_graphics_settings(void)
599                          sprintf(pref, "win/%d/%d", dis_width, dis_height);
600                          break;
601                  case DISPLAY_SCREEN:
602 <                        strcpy(pref, "dga");
602 >                        sprintf(pref, "dga/%d/%d", dis_width, dis_height);
603                          break;
604                  default:
605                          PrefsRemoveItem("screen");
# Line 610 | Line 611 | static void read_graphics_settings(void)
611   // Create "Graphics/Sound" pane
612   static void create_graphics_pane(GtkWidget *top)
613   {
614 <        GtkWidget *box, *table, *label, *opt, *menu;
614 >        GtkWidget *box, *table, *label, *opt, *menu, *combo;
615          char str[32];
616  
617          parse_graphics_prefs();
# Line 679 | Line 680 | static void create_graphics_pane(GtkWidg
680          gtk_widget_show(l_display_x);
681          gtk_table_attach(GTK_TABLE(table), l_display_x, 0, 1, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
682  
683 <        w_display_x = gtk_entry_new();
684 <        gtk_widget_show(w_display_x);
685 <        sprintf(str, "%d", dis_width);
686 <        gtk_entry_set_text(GTK_ENTRY(w_display_x), str);
687 <        gtk_table_attach(GTK_TABLE(table), w_display_x, 1, 2, 2, 3, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
683 >        combo = gtk_combo_new();
684 >        gtk_widget_show(combo);
685 >        GList *glist1 = NULL;
686 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_512_LAB));
687 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_640_LAB));
688 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_800_LAB));
689 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_1024_LAB));
690 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_MAX_LAB));
691 >        gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist1);
692 >        if (dis_width)
693 >                sprintf(str, "%d", dis_width);
694 >        else
695 >                strcpy(str, GetString(STR_SIZE_MAX_LAB));
696 >        gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str);
697 >        gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 2, 3, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
698 >        w_display_x = GTK_COMBO(combo)->entry;
699  
700          l_display_y = gtk_label_new(GetString(STR_DISPLAY_Y_CTRL));
701          gtk_widget_show(l_display_y);
702          gtk_table_attach(GTK_TABLE(table), l_display_y, 0, 1, 3, 4, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
703  
704 <        w_display_y = gtk_entry_new();
705 <        gtk_widget_show(w_display_y);
706 <        sprintf(str, "%d", dis_height);
707 <        gtk_entry_set_text(GTK_ENTRY(w_display_y), str);
708 <        gtk_table_attach(GTK_TABLE(table), w_display_y, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
704 >        combo = gtk_combo_new();
705 >        gtk_widget_show(combo);
706 >        GList *glist2 = NULL;
707 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_384_LAB));
708 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_480_LAB));
709 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_600_LAB));
710 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_768_LAB));
711 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_MAX_LAB));
712 >        gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist2);
713 >        if (dis_height)
714 >                sprintf(str, "%d", dis_height);
715 >        else
716 >                strcpy(str, GetString(STR_SIZE_MAX_LAB));
717 >        gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str);
718 >        gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
719 >        w_display_y = GTK_COMBO(combo)->entry;
720  
721          make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound));
722  
# Line 744 | Line 767 | static GList *add_serial_names(void)
767                          if (strncmp(de->d_name, "ttyS", 4) == 0 || strncmp(de->d_name, "lp", 2) == 0) {
768   #elif defined(__FreeBSD__)
769                          if (strncmp(de->d_name, "cuaa", 4) == 0 || strncmp(de->d_name, "lpt", 3) == 0) {
770 + #elif defined(__NetBSD__)
771 +                        if (strncmp(de->d_name, "tty0", 4) == 0 || strncmp(de->d_name, "lpt", 3) == 0) {
772   #elif defined(sgi)
773                          if (strncmp(de->d_name, "ttyf", 4) == 0 || strncmp(de->d_name, "plp", 3) == 0) {
774   #else
# Line 759 | Line 784 | static GList *add_serial_names(void)
784          if (glist)
785                  g_list_sort(glist, gl_str_cmp);
786          else
787 <                glist = g_list_append(glist, "<none>");
787 >                glist = g_list_append(glist, (void *)GetString(STR_NONE_LAB));
788          return glist;
789   }
790  
# Line 779 | Line 804 | static GList *add_ether_names(void)
804                          struct ifreq req, *ifr = ifc.ifc_req;
805                          for (int i=0; i<ifc.ifc_len; i+=sizeof(ifreq), ifr++) {
806                                  req = *ifr;
807 < #if defined(__FreeBSD__) || defined(sgi)
807 > #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(sgi)
808                                  if (ioctl(s, SIOCGIFADDR, &req) == 0 && (req.ifr_addr.sa_family == ARPHRD_ETHER || req.ifr_addr.sa_family == ARPHRD_ETHER+1)) {
809 < #else
809 > #elif defined(__linux__)
810                                  if (ioctl(s, SIOCGIFHWADDR, &req) == 0 && req.ifr_hwaddr.sa_family == ARPHRD_ETHER) {
811 + #else
812 +                                if (false) {
813   #endif
814                                          char *str = new char[64];
815                                          strncpy(str, ifr->ifr_name, 63);
# Line 795 | Line 822 | static GList *add_ether_names(void)
822          if (glist)
823                  g_list_sort(glist, gl_str_cmp);
824          else
825 <                glist = g_list_append(glist, "<none>");
825 >                glist = g_list_append(glist, (void *)GetString(STR_NONE_LAB));
826          return glist;
827   }
828  
# Line 892 | Line 919 | static void read_memory_settings(void)
919   // Create "Memory/Misc" pane
920   static void create_memory_pane(GtkWidget *top)
921   {
922 <        GtkWidget *box, *vbox, *hbox, *hbox2, *label, *scale, *opt, *menu;
922 >        GtkWidget *box, *vbox, *hbox, *hbox2, *label, *scale, *menu;
923  
924          box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE);
925  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines