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.40 by gbeauche, 2008-01-01T09:40:33Z

# Line 1 | Line 1
1   /*
2   *  prefs_editor_gtk.cpp - Preferences editor, Unix implementation using GTK+
3   *
4 < *  Basilisk II (C) 1997-2005 Christian Bauer
4 > *  Basilisk II (C) 1997-2008 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 428 | Line 428 | static void mn_about(...)
428          dialog = gnome_about_new(
429                  "Basilisk II",
430                  version,
431 <                "Copyright (C) 1997-2005 Christian Bauer",
431 >                "Copyright (C) 1997-2008 Christian Bauer",
432                  authors,
433                  "Basilisk II comes with ABSOLUTELY NO WARRANTY."
434                  "This is free software, and you are welcome to redistribute it"
# Line 444 | Line 444 | static void mn_about(...)
444          char str[512];
445          sprintf(str,
446                  "Basilisk II\nVersion %d.%d\n\n"
447 <                "Copyright (C) 1997-2005 Christian Bauer et al.\n"
447 >                "Copyright (C) 1997-2008 Christian Bauer et al.\n"
448                  "E-mail: Christian.Bauer@uni-mainz.de\n"
449                  "http://www.uni-mainz.de/~bauec002/B2Main.html\n\n"
450                  "Basilisk II comes with ABSOLUTELY NO\n"
# 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 1561 | Line 1568 | void MountVolume(void *fh) { }
1568   void FileDiskLayout(loff_t size, uint8 *data, loff_t &start_byte, loff_t &real_size) { }
1569  
1570   #if defined __APPLE__ && defined __MACH__
1571 < void DarwinAddCDROMPrefs(void) { }
1571 > void DarwinSysInit(void) { }
1572 > void DarwinSysExit(void) { }
1573   void DarwinAddFloppyPrefs(void) { }
1574   void DarwinAddSerialPrefs(void) { }
1575   bool DarwinCDReadTOC(char *, uint8 *) { }
# Line 1678 | Line 1686 | static void sigchld_handler(int sig, sig
1686   {
1687          D(bug("Child %d exitted with status = %x\n", sip->si_pid, sip->si_status));
1688  
1689 <        int status = sip->si_status;
1689 >        // XXX perform a new wait because sip->si_status is sometimes not
1690 >        // the exit _value_ on MacOS X but rather the usual status field
1691 >        // from waitpid() -- we could arrange this code in some other way...
1692 >        int status;
1693 >        if (waitpid(sip->si_pid, &status, 0) < 0)
1694 >                status = sip->si_status;
1695 >        if (WIFEXITED(status))
1696 >                status = WEXITSTATUS(status);
1697          if (status & 0x80)
1698                  status |= -1 ^0xff;
1699  
# Line 1741 | Line 1756 | int main(int argc, char *argv[])
1756                  }
1757  
1758                  // Search and run the BasiliskII executable
1759 <                // XXX it can be in a bundle on MacOS X
1759 >                char *p;
1760                  strcpy(g_app_path, argv[0]);
1761 <                char *p = strrchr(g_app_path, '/');
1762 <                p = p ? p + 1 : g_app_path;
1763 <                *p = '\0';
1764 <                strcat(g_app_path, "BasiliskII");
1761 >                if ((p = strstr(g_app_path, "BasiliskIIGUI.app/Contents/MacOS")) != NULL) {
1762 >                    strcpy(p, "BasiliskII.app/Contents/MacOS/BasiliskII");
1763 >                        if (access(g_app_path, X_OK) < 0) {
1764 >                                char str[256];
1765 >                                sprintf(str, GetString(STR_NO_B2_EXE_FOUND), g_app_path, strerror(errno));
1766 >                                WarningAlert(str);
1767 >                                strcpy(g_app_path, "/Applications/BasiliskII.app/Contents/MacOS/BasiliskII");
1768 >                        }
1769 >                } else {
1770 >                        p = strrchr(g_app_path, '/');
1771 >                        p = p ? p + 1 : g_app_path;
1772 >                        strcpy(p, "BasiliskII");
1773 >                }
1774  
1775                  int pid = fork();
1776                  if (pid == 0) {
1777 +                        D(bug("Trying to execute %s\n", g_app_path));
1778                          execlp(g_app_path, g_app_path, "--gui-connection", gui_connection_path, (char *)NULL);
1779   #ifdef _POSIX_PRIORITY_SCHEDULING
1780                          // 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