ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/BeOS/prefs_editor_beos.cpp
(Generate patch)

Comparing BasiliskII/src/BeOS/prefs_editor_beos.cpp (file contents):
Revision 1.8 by cebix, 2001-01-04T19:50:22Z vs.
Revision 1.13 by cebix, 2004-01-12T15:29:23Z

# Line 1 | Line 1
1   /*
2   *  prefs_editor_beos.cpp - Preferences editor, BeOS implementation
3   *
4 < *  Basilisk II (C) 1997-2000 Christian Bauer
4 > *  Basilisk II (C) 1997-2004 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 33 | Line 33
33   #include "cdrom.h"
34   #include "xpram.h"
35   #include "prefs.h"
36 < #include "version.h"
36 > #include "about_window.h"
37   #include "user_strings.h"
38   #include "prefs_editor.h"
39  
# Line 80 | Line 80 | const uint32 MSG_NOSOUND = 'nosn';
80   const uint32 MSG_SER_A = 'sera';                        // "Serial/Network" pane
81   const uint32 MSG_SER_B = 'serb';
82   const uint32 MSG_ETHER = 'ethr';
83 + const uint32 MSG_UDPTUNNEL = 'udpt';
84  
85   const uint32 MSG_RAMSIZE = 'rmsz';                      // "Memory/Misc" pane
86   const uint32 MSG_MODELID_5 = 'mi05';
# Line 221 | Line 222 | private:
222          void read_volumes_prefs(void);
223          void hide_show_graphics_ctrls(void);
224          void read_graphics_prefs(void);
225 +        void hide_show_serial_ctrls(void);
226 +        void read_serial_prefs(void);
227          void add_serial_names(BPopUpMenu *menu, uint32 msg);
228          void read_memory_prefs(void);
229  
# Line 248 | Line 251 | private:
251          BMenuField *scr_mode_menu;
252          BCheckBox *nosound_checkbox;
253          BCheckBox *ether_checkbox;
254 +        BCheckBox *udptunnel_checkbox;
255 +        NumberControl *udpport_ctrl;
256          RAMSlider *ramsize_slider;
257          PathControl *extfs_control;
258          PathControl *rom_control;
# Line 593 | Line 598 | BView *PrefsWindow::create_graphics_pane
598  
599  
600   /*
601 < *  Create "Serial Ports" pane
601 > *  Create "Serial/Network" pane
602   */
603  
604 + void PrefsWindow::hide_show_serial_ctrls(void)
605 + {
606 +        if (udptunnel_checkbox->Value() == B_CONTROL_ON) {
607 +                ether_checkbox->SetEnabled(false);
608 +                udpport_ctrl->SetEnabled(true);
609 +        } else {
610 +                ether_checkbox->SetEnabled(true);
611 +                udpport_ctrl->SetEnabled(false);
612 +        }
613 + }
614 +
615 + void PrefsWindow::read_serial_prefs(void)
616 + {
617 +        PrefsReplaceInt32("udpport", udpport_ctrl->Value());
618 + }
619 +
620   void PrefsWindow::add_serial_names(BPopUpMenu *menu, uint32 msg)
621   {
622          BSerialPort *port = new BSerialPort;
# Line 655 | Line 676 | BView *PrefsWindow::create_serial_pane(v
676          pane->AddChild(ether_checkbox);
677          ether_checkbox->SetValue(PrefsFindString("ether") ? B_CONTROL_ON : B_CONTROL_OFF);
678  
679 +        udptunnel_checkbox = new BCheckBox(BRect(10, 67, right, 72), "udptunnel", GetString(STR_UDPTUNNEL_CTRL), new BMessage(MSG_UDPTUNNEL));
680 +        pane->AddChild(udptunnel_checkbox);
681 +        udptunnel_checkbox->SetValue(PrefsFindBool("udptunnel") ? B_CONTROL_ON : B_CONTROL_OFF);
682 +
683 +        udpport_ctrl = new NumberControl(BRect(10, 87, right / 2, 105), 118, "udpport", GetString(STR_UDPPORT_CTRL), PrefsFindInt32("udpport"), NULL);
684 +        pane->AddChild(udpport_ctrl);
685 +
686 +        hide_show_serial_ctrls();
687          return pane;
688   }
689  
# Line 767 | Line 796 | void PrefsWindow::MessageReceived(BMessa
796                          break;
797  
798                  case B_ABOUT_REQUESTED: {       // "About" menu item selected
799 <                        char str[256];
771 <                        sprintf(str, GetString(STR_ABOUT_TEXT1), VERSION_MAJOR, VERSION_MINOR);
772 <                        strcat(str, " ");
773 <                        strcat(str, GetString(STR_ABOUT_TEXT2));
774 <                        BAlert *about = new BAlert(GetString(STR_WINDOW_TITLE), str, GetString(STR_OK_BUTTON));
775 <                        about->Go();
799 >                        ShowAboutWindow();
800                          break;
801                  }
802  
# Line 943 | Line 967 | void PrefsWindow::MessageReceived(BMessa
967                                  PrefsRemoveItem("ether");
968                          break;
969  
970 +                case MSG_UDPTUNNEL:
971 +                        PrefsReplaceBool("udptunnel", udptunnel_checkbox->Value() == B_CONTROL_ON);
972 +                        hide_show_serial_ctrls();
973 +                        break;
974 +
975                  case MSG_RAMSIZE:
976                          PrefsReplaceInt32("ramsize", ramsize_slider->Value() * 1024 * 1024);
977                          break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines