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.5 by cebix, 1999-10-19T13:22:11Z

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines