Annotation of previous/src/gui-sdl/dlgEthernet.c, revision 1.1.1.2

1.1       root        1: /*
                      2:   Previous - dlgEthernet.c
                      3: 
                      4:   This file is distributed under the GNU Public License, version 2 or at
                      5:   your option any later version. Read the file gpl.txt for details.
                      6: */
                      7: const char DlgEthernet_fileid[] = "Previous dlgEthernet.c : " __DATE__ " " __TIME__;
                      8: 
                      9: #include "main.h"
                     10: #include "configuration.h"
                     11: #include "dialog.h"
                     12: #include "sdlgui.h"
                     13: #include "file.h"
                     14: #include "paths.h"
                     15: 
                     16: 
                     17: #define DLGENET_ENABLE      3
1.1.1.2 ! root       18: #define DLGENET_THIN        4
        !            19: #define DLGENET_TWISTED     5
1.1       root       20: 
1.1.1.2 ! root       21: #define DLGENET_EXIT        6
1.1       root       22: 
                     23: 
                     24: 
                     25: /* The Boot options dialog: */
                     26: static SGOBJ enetdlg[] =
                     27: {
1.1.1.2 ! root       28:        { SGBOX, 0, 0, 0,0, 40,17, NULL },
        !            29:        { SGTEXT, 0, 0, 12,1, 16,1, "Ethernet options" },
1.1       root       30: 
1.1.1.2 ! root       31:        { SGBOX, 0, 0, 1,3, 38,9, NULL },
1.1       root       32:        { SGCHECKBOX, 0, 0, 4,5, 20,1, "Ethernet connected" },
1.1.1.2 ! root       33:        { SGRADIOBUT, 0, 0, 6,7, 11,1, "Thin wire" },
        !            34:        { SGRADIOBUT, 0, 0, 6,9, 14,1, "Twisted pair" },
1.1       root       35:     
1.1.1.2 ! root       36:        { SGBUTTON, SG_DEFAULT, 0, 10,14, 21,1, "Back to main menu" },
1.1       root       37:        { -1, 0, 0, 0,0, 0,0, NULL }
                     38: };
                     39: 
                     40: 
                     41: 
                     42: /*-----------------------------------------------------------------------*/
                     43: /**
                     44:  * Show and process the Boot options dialog.
                     45:  */
                     46: void DlgEthernet_Main(void)
                     47: {
                     48:        int but;
                     49: 
                     50:        SDLGui_CenterDlg(enetdlg);
                     51: 
                     52:     /* Set up the dialog from actual values */
1.1.1.2 ! root       53:     
        !            54:     enetdlg[DLGENET_ENABLE].state &= ~SG_SELECTED;
        !            55:     enetdlg[DLGENET_THIN].state &= ~SG_SELECTED;
        !            56:     enetdlg[DLGENET_TWISTED].state &= ~SG_SELECTED;
        !            57: 
        !            58:     if (ConfigureParams.Ethernet.bEthernetConnected) {
1.1       root       59:         enetdlg[DLGENET_ENABLE].state |= SG_SELECTED;
1.1.1.2 ! root       60:         if (ConfigureParams.Ethernet.bTwistedPair) {
        !            61:             enetdlg[DLGENET_TWISTED].state |= SG_SELECTED;
        !            62:         } else {
        !            63:             enetdlg[DLGENET_THIN].state |= SG_SELECTED;
        !            64:         }
        !            65:     }
1.1       root       66:     
                     67:     /* Draw and process the dialog */
                     68:     
                     69:        do
                     70:        {
                     71:                but = SDLGui_DoDialog(enetdlg, NULL);
1.1.1.2 ! root       72:                
        !            73:                switch (but) {
        !            74:                        case DLGENET_ENABLE:
        !            75:                                if (enetdlg[DLGENET_ENABLE].state & SG_SELECTED) {
        !            76:                                        if (ConfigureParams.Ethernet.bTwistedPair) {
        !            77:                                                enetdlg[DLGENET_TWISTED].state |= SG_SELECTED;
        !            78:                                        } else {
        !            79:                                                enetdlg[DLGENET_THIN].state |= SG_SELECTED;
        !            80:                                        }
        !            81:                                } else {
        !            82:                                        enetdlg[DLGENET_THIN].state &= ~SG_SELECTED;
        !            83:                                        enetdlg[DLGENET_TWISTED].state &= ~SG_SELECTED;
        !            84:                 }
        !            85:                                break;
        !            86:                        case DLGENET_THIN:
        !            87:                        case DLGENET_TWISTED:
        !            88:                                if (!(enetdlg[DLGENET_ENABLE].state & SG_SELECTED)) {
        !            89:                                        enetdlg[DLGENET_ENABLE].state |= SG_SELECTED;
        !            90:                                }
        !            91:                                break;
        !            92:                                
        !            93:                        default:
        !            94:                                break;
        !            95:                }
        !            96:        }
1.1       root       97:     while (but != DLGENET_EXIT && but != SDLGUI_QUIT
                     98:               && but != SDLGUI_ERROR && !bQuitProgram);
                     99:     
                    100:     
                    101:     /* Read values from dialog */
                    102:     ConfigureParams.Ethernet.bEthernetConnected = enetdlg[DLGENET_ENABLE].state & SG_SELECTED;
1.1.1.2 ! root      103:     ConfigureParams.Ethernet.bTwistedPair = enetdlg[DLGENET_TWISTED].state & SG_SELECTED;
1.1       root      104: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.