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.4 by cebix, 1999-10-14T11:37:45Z

# 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 526 | Line 526 | static void hide_show_graphics_widgets(v
526          switch (display_type) {
527                  case DISPLAY_WINDOW:
528                          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);
529                          break;
530                  case DISPLAY_SCREEN:
531                          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);
532                          break;
533          }
534   }
# Line 576 | Line 572 | static void parse_graphics_prefs(void)
572          if (str) {
573                  if (sscanf(str, "win/%d/%d", &dis_width, &dis_height) == 2)
574                          display_type = DISPLAY_WINDOW;
575 <                else if (strcmp(str, "dga") == 0)
575 >                else if (sscanf(str, "dga/%d/%d", &dis_width, &dis_height) == 2)
576                          display_type = DISPLAY_SCREEN;
577          }
578   }
# Line 598 | Line 594 | static void read_graphics_settings(void)
594                          sprintf(pref, "win/%d/%d", dis_width, dis_height);
595                          break;
596                  case DISPLAY_SCREEN:
597 <                        strcpy(pref, "dga");
597 >                        sprintf(pref, "dga/%d/%d", dis_width, dis_height);
598                          break;
599                  default:
600                          PrefsRemoveItem("screen");
# Line 610 | Line 606 | static void read_graphics_settings(void)
606   // Create "Graphics/Sound" pane
607   static void create_graphics_pane(GtkWidget *top)
608   {
609 <        GtkWidget *box, *table, *label, *opt, *menu;
609 >        GtkWidget *box, *table, *label, *opt, *menu, *combo;
610          char str[32];
611  
612          parse_graphics_prefs();
# Line 679 | Line 675 | static void create_graphics_pane(GtkWidg
675          gtk_widget_show(l_display_x);
676          gtk_table_attach(GTK_TABLE(table), l_display_x, 0, 1, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
677  
678 <        w_display_x = gtk_entry_new();
679 <        gtk_widget_show(w_display_x);
680 <        sprintf(str, "%d", dis_width);
681 <        gtk_entry_set_text(GTK_ENTRY(w_display_x), str);
682 <        gtk_table_attach(GTK_TABLE(table), w_display_x, 1, 2, 2, 3, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
678 >        combo = gtk_combo_new();
679 >        gtk_widget_show(combo);
680 >        GList *glist1 = NULL;
681 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_512_LAB));
682 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_640_LAB));
683 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_800_LAB));
684 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_1024_LAB));
685 >        glist1 = g_list_append(glist1, (void *)GetString(STR_SIZE_MAX_LAB));
686 >        gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist1);
687 >        if (dis_width)
688 >                sprintf(str, "%d", dis_width);
689 >        else
690 >                strcpy(str, GetString(STR_SIZE_MAX_LAB));
691 >        gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str);
692 >        gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 2, 3, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
693 >        w_display_x = GTK_COMBO(combo)->entry;
694  
695          l_display_y = gtk_label_new(GetString(STR_DISPLAY_Y_CTRL));
696          gtk_widget_show(l_display_y);
697          gtk_table_attach(GTK_TABLE(table), l_display_y, 0, 1, 3, 4, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
698  
699 <        w_display_y = gtk_entry_new();
700 <        gtk_widget_show(w_display_y);
701 <        sprintf(str, "%d", dis_height);
702 <        gtk_entry_set_text(GTK_ENTRY(w_display_y), str);
703 <        gtk_table_attach(GTK_TABLE(table), w_display_y, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
699 >        combo = gtk_combo_new();
700 >        gtk_widget_show(combo);
701 >        GList *glist2 = NULL;
702 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_384_LAB));
703 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_480_LAB));
704 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_600_LAB));
705 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_768_LAB));
706 >        glist2 = g_list_append(glist2, (void *)GetString(STR_SIZE_MAX_LAB));
707 >        gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist2);
708 >        if (dis_height)
709 >                sprintf(str, "%d", dis_height);
710 >        else
711 >                strcpy(str, GetString(STR_SIZE_MAX_LAB));
712 >        gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str);
713 >        gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
714 >        w_display_y = GTK_COMBO(combo)->entry;
715  
716          make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound));
717  
# Line 744 | Line 762 | static GList *add_serial_names(void)
762                          if (strncmp(de->d_name, "ttyS", 4) == 0 || strncmp(de->d_name, "lp", 2) == 0) {
763   #elif defined(__FreeBSD__)
764                          if (strncmp(de->d_name, "cuaa", 4) == 0 || strncmp(de->d_name, "lpt", 3) == 0) {
765 + #elif defined(__NetBSD__)
766 +                        if (strncmp(de->d_name, "tty0", 4) == 0 || strncmp(de->d_name, "lpt", 3) == 0) {
767   #elif defined(sgi)
768                          if (strncmp(de->d_name, "ttyf", 4) == 0 || strncmp(de->d_name, "plp", 3) == 0) {
769   #else
# Line 759 | Line 779 | static GList *add_serial_names(void)
779          if (glist)
780                  g_list_sort(glist, gl_str_cmp);
781          else
782 <                glist = g_list_append(glist, "<none>");
782 >                glist = g_list_append(glist, (void *)GetString(STR_NONE_LAB));
783          return glist;
784   }
785  
# Line 779 | Line 799 | static GList *add_ether_names(void)
799                          struct ifreq req, *ifr = ifc.ifc_req;
800                          for (int i=0; i<ifc.ifc_len; i+=sizeof(ifreq), ifr++) {
801                                  req = *ifr;
802 < #if defined(__FreeBSD__) || defined(sgi)
802 > #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(sgi)
803                                  if (ioctl(s, SIOCGIFADDR, &req) == 0 && (req.ifr_addr.sa_family == ARPHRD_ETHER || req.ifr_addr.sa_family == ARPHRD_ETHER+1)) {
804 < #else
804 > #elif defined(__linux__)
805                                  if (ioctl(s, SIOCGIFHWADDR, &req) == 0 && req.ifr_hwaddr.sa_family == ARPHRD_ETHER) {
806 + #else
807 +                                if (false) {
808   #endif
809                                          char *str = new char[64];
810                                          strncpy(str, ifr->ifr_name, 63);
# Line 795 | Line 817 | static GList *add_ether_names(void)
817          if (glist)
818                  g_list_sort(glist, gl_str_cmp);
819          else
820 <                glist = g_list_append(glist, "<none>");
820 >                glist = g_list_append(glist, (void *)GetString(STR_NONE_LAB));
821          return glist;
822   }
823  
# Line 892 | Line 914 | static void read_memory_settings(void)
914   // Create "Memory/Misc" pane
915   static void create_memory_pane(GtkWidget *top)
916   {
917 <        GtkWidget *box, *vbox, *hbox, *hbox2, *label, *scale, *opt, *menu;
917 >        GtkWidget *box, *vbox, *hbox, *hbox2, *label, *scale, *menu;
918  
919          box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE);
920  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines