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.36 by gbeauche, 2006-04-18T21:29:01Z vs.
Revision 1.38 by gbeauche, 2006-04-30T21:16:48Z

# Line 1433 | Line 1433 | static void create_serial_pane(GtkWidget
1433   static GtkWidget *w_ramsize;
1434   static GtkWidget *w_rom_file;
1435  
1436 + // Don't use CPU when idle?
1437 + static void tb_idlewait(GtkWidget *widget)
1438 + {
1439 +        PrefsReplaceBool("idlewait", GTK_TOGGLE_BUTTON(widget)->active);
1440 + }
1441 +
1442   // "Ignore SEGV" button toggled
1443   #ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION
1444   static void tb_ignoresegv(GtkWidget *widget)
# Line 1525 | Line 1531 | static void create_memory_pane(GtkWidget
1531  
1532          w_rom_file = table_make_file_entry(table, 4, STR_ROM_FILE_CTRL, "rom");
1533  
1534 +        make_checkbox(box, STR_IDLEWAIT_CTRL, "idlewait", GTK_SIGNAL_FUNC(tb_idlewait));
1535   #ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION
1536          make_checkbox(box, STR_IGNORESEGV_CTRL, "ignoresegv", GTK_SIGNAL_FUNC(tb_ignoresegv));
1537   #endif
# Line 1678 | Line 1685 | static void sigchld_handler(int sig, sig
1685   {
1686          D(bug("Child %d exitted with status = %x\n", sip->si_pid, sip->si_status));
1687  
1688 <        int status = sip->si_status;
1688 >        // XXX perform a new wait because sip->si_status is sometimes not
1689 >        // the exit _value_ on MacOS X but rather the usual status field
1690 >        // from waitpid() -- we could arrange this code in some other way...
1691 >        int status;
1692 >        if (waitpid(sip->si_pid, &status, 0) < 0)
1693 >                status = sip->si_status;
1694 >        if (WIFEXITED(status))
1695 >                status = WEXITSTATUS(status);
1696          if (status & 0x80)
1697                  status |= -1 ^0xff;
1698  
# Line 1741 | Line 1755 | int main(int argc, char *argv[])
1755                  }
1756  
1757                  // Search and run the BasiliskII executable
1758 <                // XXX it can be in a bundle on MacOS X
1758 >                char *p;
1759                  strcpy(g_app_path, argv[0]);
1760 <                char *p = strrchr(g_app_path, '/');
1761 <                p = p ? p + 1 : g_app_path;
1762 <                *p = '\0';
1763 <                strcat(g_app_path, "BasiliskII");
1760 >                if ((p = strstr(g_app_path, "BasiliskIIGUI.app/Contents/MacOS")) != NULL) {
1761 >                    strcpy(p, "BasiliskII.app/Contents/MacOS/BasiliskII");
1762 >                        if (access(g_app_path, X_OK) < 0) {
1763 >                                char str[256];
1764 >                                sprintf(str, GetString(STR_NO_B2_EXE_FOUND), g_app_path, strerror(errno));
1765 >                                WarningAlert(str);
1766 >                                strcpy(g_app_path, "/Applications/BasiliskII.app/Contents/MacOS/BasiliskII");
1767 >                        }
1768 >                } else {
1769 >                        p = strrchr(g_app_path, '/');
1770 >                        p = p ? p + 1 : g_app_path;
1771 >                        strcpy(p, "BasiliskII");
1772 >                }
1773  
1774                  int pid = fork();
1775                  if (pid == 0) {
1776 +                        D(bug("Trying to execute %s\n", g_app_path));
1777                          execlp(g_app_path, g_app_path, "--gui-connection", gui_connection_path, (char *)NULL);
1778   #ifdef _POSIX_PRIORITY_SCHEDULING
1779                          // XXX get a chance to run the parent process so that to not confuse/upset GTK...

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines