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

Comparing SheepShaver/src/Unix/prefs_editor_gtk.cpp (file contents):
Revision 1.17 by gbeauche, 2006-05-01T22:33:34Z vs.
Revision 1.18 by gbeauche, 2006-05-01T23:01:53Z

# Line 120 | Line 120 | static GtkWidget *make_pane(GtkWidget *n
120          GtkWidget *frame, *label, *box;
121  
122          frame = gtk_frame_new(NULL);
123        gtk_widget_show(frame);
123          gtk_container_border_width(GTK_CONTAINER(frame), 4);
124  
126        label = gtk_label_new(GetString(title_id));
127        gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label);
128
125          box = gtk_vbox_new(FALSE, 4);
130        gtk_widget_show(box);
126          gtk_container_set_border_width(GTK_CONTAINER(box), 4);
127          gtk_container_add(GTK_CONTAINER(frame), box);
128 +
129 +        gtk_widget_show_all(frame);
130 +
131 +        label = gtk_label_new(GetString(title_id));
132 +        gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label);
133          return box;
134   }
135  
# Line 448 | Line 448 | bool PrefsEditor(void)
448          gtk_box_pack_start(GTK_BOX(box), menu_bar, FALSE, TRUE, 0);
449  
450          GtkWidget *notebook = gtk_notebook_new();
451        gtk_widget_show(notebook);
451          gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
452          gtk_notebook_set_scrollable(GTK_NOTEBOOK(notebook), FALSE);
453          gtk_box_pack_start(GTK_BOX(box), notebook, TRUE, TRUE, 0);
454 +        gtk_widget_realize(notebook);
455  
456          create_volumes_pane(notebook);
457          create_graphics_pane(notebook);
# Line 459 | Line 459 | bool PrefsEditor(void)
459          create_serial_pane(notebook);
460          create_memory_pane(notebook);
461          create_jit_pane(notebook);
462 +        gtk_widget_show(notebook);
463  
464          static const opt_desc buttons[] = {
465                  {STR_START_BUTTON, GTK_SIGNAL_FUNC(cb_start)},
# Line 633 | Line 634 | static void create_volumes_pane(GtkWidge
634   *  "JIT Compiler" pane
635   */
636  
637 + // Are we running a JIT capable CPU?
638 + static bool is_jit_capable(void)
639 + {
640 + #if USE_JIT
641 +        return true;
642 + #elif defined __APPLE__ && defined __MACH__
643 +        // XXX run-time detect so that we can use a PPC GUI prefs editor
644 +        static char cpu[10];
645 +        if (cpu[0] == 0) {
646 +                FILE *fp = popen("uname -p", "r");
647 +                if (fp == NULL)
648 +                        return false;
649 +                fgets(cpu, sizeof(cpu) - 1, fp);
650 +                fclose(fp);
651 +        }
652 +        if (cpu[0] == 'i' && cpu[2] == '8' && cpu[3] == '6') // XXX assuming i?86
653 +                return true;
654 + #endif
655 +        return false;
656 + }
657 +
658   // Set sensitivity of widgets
659   static void set_jit_sensitive(void)
660   {
# Line 649 | Line 671 | static void tb_jit(GtkWidget *widget)
671   // Read settings from widgets and set preferences
672   static void read_jit_settings(void)
673   {
674 < #if USE_JIT
653 <        bool jit_enabled = PrefsFindBool("jit");
654 < #endif
674 >        bool jit_enabled = is_jit_capable() && PrefsFindBool("jit");
675   }
676  
677   // "Use built-in 68k DR emulator" button toggled
# Line 667 | Line 687 | static void create_jit_pane(GtkWidget *t
687          char str[32];
688          
689          box = make_pane(top, STR_JIT_PANE_TITLE);
690 < #if USE_JIT
691 <        make_checkbox(box, STR_JIT_CTRL, "jit", GTK_SIGNAL_FUNC(tb_jit));
692 <        set_jit_sensitive();
693 < #endif
690 >
691 >        if (is_jit_capable()) {
692 >                make_checkbox(box, STR_JIT_CTRL, "jit", GTK_SIGNAL_FUNC(tb_jit));
693 >                set_jit_sensitive();
694 >        }
695 >
696          make_checkbox(box, STR_JIT_68K_CTRL, "jit68k", GTK_SIGNAL_FUNC(tb_jit_68k));
697   }
698  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines