Пример #1
0
void CInstaller::NextScreen()
{
    if (m_InstallScreens[m_CurrentScreen]->SubNext())
    {
        UpdateButtons();
        
        if (CanFocusChilds(m_pScreenBox))
            m_pScreenBox->ReqFocus();

        return;
    }
    
    if (!m_InstallScreens[m_CurrentScreen]->Next())
        return;

    TScreenList::iterator it = m_InstallScreens.begin() + m_CurrentScreen;
    
    while (*it != m_InstallScreens.back())
    {
        it++;

        if ((*it)->CanActivate())
        {
            m_InstallScreens[m_CurrentScreen]->Enable(false);
            ActivateScreen(*it);
            UpdateButtons();
            return;
        }
    }
    
    // No screens left
    NNCurses::TUI.Quit();
}
Пример #2
0
void CInstaller::Back()
{
    CInstallScreen *screen = GetScreen(m_pWizard->value());
    
    if (!screen)
        return;
    
    if (screen->SubBack())
    {
        UpdateButtons();
        return;
    }
    
    if (!screen->Back())
        return;
    
    for (int start = m_pWizard->find(m_pWizard->value())-1; (start>=0); start--)
    {
        screen = GetScreen(m_pWizard->child(start));
        
        if (screen)
        {
            if (screen->CanActivate())
            {
                m_pWizard->value(m_pWizard->child(start));
                ActivateScreen(screen);
                screen->SubLast();
                UpdateButtons();
                return;
            }
        }
        else
            return;
    }
}
Пример #3
0
void CInstaller::PrevScreen()
{
    if (m_InstallScreens[m_CurrentScreen]->SubBack())
    {
        UpdateButtons();
        
        if (CanFocusChilds(m_pScreenBox))
            m_pScreenBox->ReqFocus();
        
        return;
    }
    
    if (!m_InstallScreens[m_CurrentScreen]->Back())
        return;
    
    TScreenList::iterator it = m_InstallScreens.begin() + m_CurrentScreen;
    
    while (it != m_InstallScreens.begin())
    {
        it--;
        
        if ((*it)->CanActivate())
        {
            m_InstallScreens[m_CurrentScreen]->Enable(false);
            ActivateScreen(*it, true);
            UpdateButtons();
            break;
        }
    }
}
Пример #4
0
void WriteStdErr( char *str, int len )
{
    ActivateScreen( systemConsoleScreen );
    while( --len >= 0 ) {
        OutputToScreen( systemConsoleScreen, "%c", *str );
        ++str;
    }
}
Пример #5
0
void CLCDOutput::Update(DWORD dwTimestamp)
{
    if (m_pActiveScreen)
    {
        m_pActiveScreen->Update(dwTimestamp);
    }

    // check for expiration
    if (m_pActiveScreen && m_pActiveScreen->HasExpired())
    {
        m_pActiveScreen = NULL;
        //m_nPriority = LGLCD_PRIORITY_FYI; -> needs to go so that if a 
		// program sets priority to LGLCD_PRIORITY_BACKGROUND, that 
		// priority sticks.

        OnScreenExpired(m_pActiveScreen);

        // Clear the bitmap
        ClearBitmap(m_pLastBitmap);

        // find the next active screen
        LCD_MGR_LIST::iterator it = m_LCDMgrList.begin();
        while(it != m_LCDMgrList.end())
        {
            CLCDManager *pMgr = *it;
            LCDUIASSERT(NULL != pMgr);

            if (!pMgr->HasExpired())
            {
                ActivateScreen(pMgr);
                //m_nPriority = LGLCD_PRIORITY_FYI;  -> needs to go so that if a 
				// program sets priority to LGLCD_PRIORITY_BACKGROUND, that 
				// priority sticks.
                break;
            }

            ++it;
        }

        // if no screen found, empty the screen at idle priority
        if (NULL == m_pActiveScreen)
        {
            if (LGLCD_INVALID_DEVICE != m_hDevice)
            {
                lgLcdUpdateBitmap(m_hDevice, &CLCDManager::GetLCDScreen()->hdr,
                    LGLCD_ASYNC_UPDATE(LGLCD_PRIORITY_IDLE_NO_SHOW));
            }
        }
    }

    // check for lcd devices
    if (LGLCD_INVALID_DEVICE == m_hDevice)
    {
        EnumerateDevices();
    }
}
Пример #6
0
/******************************************************************************

  mysql_stop()

  Stop the mysql servers.

******************************************************************************/
void mysql_stop()
{
  log_info("Stopping the MySQL server(s)...");
  stop_master();

  stop_slave();

  // activate the test screen
  ActivateScreen(getscreenhandle());
}
Пример #7
0
/******************************************************************************

  mysql_start()
  
  Start the mysql servers.

******************************************************************************/
void mysql_start()
{
  log_info("Starting the MySQL server(s): %u", ++restarts);
  start_master();

  start_slave();

  // activate the test screen
  ActivateScreen(getscreenhandle());
}
Пример #8
0
void ConsolePrintf( char *format, ... )
{
    if( DebugMode ){
        ActivateScreen( debugScreen );
        OutputToScreenWithPointer(
            debugScreen,
            format,
            (BYTE *)&format + sizeof( char * )
            );
         SetInputToOutputCursorPosition( screenID );
      }
   }
Пример #9
0
void CInstaller::Init(int argc, char **argv)
{
    CBaseInstall::Init(argc, argv);
    
    UpdateButtons();

    for (TScreenList::iterator it=m_InstallScreens.begin(); it!=m_InstallScreens.end(); it++)
    {
        if ((*it)->CanActivate())
        {
            ActivateScreen(*it);
            break;
        }
    }
}
Пример #10
0
void CLCDOutput::Update(DWORD dwTimestamp)
{
    if (m_pActiveScreen)
    {
        m_pActiveScreen->Update(dwTimestamp);
    }

    // check for expiration
    if (m_pActiveScreen && m_pActiveScreen->HasExpired(dwTimestamp))
    {
        m_pActiveScreen = NULL;
        //m_nPriority = LGLCD_PRIORITY_FYI; -> needs to go so that if a 
		// program sets priority to LGLCD_PRIORITY_BACKGROUND, that 
		// priority sticks.

        OnScreenExpired(m_pActiveScreen);

        // find the next active screen
        LCD_MGR_LIST::iterator it = m_LCDMgrList.begin();
        while(it != m_LCDMgrList.end())
        {
            CLCDManager *pMgr = *it;
            LOGIASSERT(NULL != pMgr);

            if (!pMgr->HasExpired(dwTimestamp))
            {
                ActivateScreen(pMgr);
                //m_nPriority = LGLCD_PRIORITY_FYI;  -> needs to go so that if a 
				// program sets priority to LGLCD_PRIORITY_BACKGROUND, that 
				// priority sticks.
                break;
            }

            ++it;
        }
    }

    // check for lcd devices
    if (LGLCD_INVALID_DEVICE == m_hDevice)
    {
        EnumerateDevices();
    }
}
Пример #11
0
void CInstaller::Next()
{
    CInstallScreen *screen = GetScreen(m_pWizard->value());
    
    if (!screen)
        return;
    
    if (screen->SubNext())
    {
        UpdateButtons();
        return;
    }
    
    if (!screen->Next())
        return;
    
    const int size = m_pWizard->children();
    for (int start = m_pWizard->find(m_pWizard->value())+1; (start<size); start++)
    {
        screen = GetScreen(m_pWizard->child(start));
        
        if (screen)
        {
            if (screen->CanActivate())
            {
                m_pWizard->value(m_pWizard->child(start));
                ActivateScreen(screen);
                UpdateButtons();
                return;
            }
        }
        else
            break;
    }
    
    // No screens left
    m_pMainWindow->hide(); // Close main window, will shutdown the rest
}
Пример #12
0
void CInstaller::Init(int argc, char **argv)
{
    const int buttonsy = WindowH()-ButtonHeight()-ButtonHSpacing();
    
    m_pMainWindow = new Fl_Double_Window(WindowW(), WindowH(), "Nixstaller");
    m_pMainWindow->callback(CancelCB, this);

    Fl_Group *maingroup = new Fl_Group(0, 0, WindowW(), WindowH());
    maingroup->resizable(NULL);
    maingroup->box(FL_FLAT_BOX);
    maingroup->color(fl_lighter(FL_BACKGROUND_COLOR));

    Fl_Pack *mainpack = new Fl_Pack(0, 0, WindowW(), WindowH()-90);
    mainpack->resizable(NULL);
    mainpack->type(Fl_Pack::VERTICAL);
    
    CreateHeader();
    
    m_pWizard = new Fl_Wizard(0, m_pHeaderGroup->h(), WindowW(),
                              (buttonsy-m_pHeaderGroup->h()-ButtonHSpacing()));
    m_pWizard->box(FL_ENGRAVED_BOX);
    m_pWizard->end();

    mainpack->end();

    m_pCancelButton = new Fl_Button(ButtonWOffset(), buttonsy, 0, ButtonHeight(), GetTranslation("Cancel"));
    SetButtonWidth(m_pCancelButton);
    m_pCancelButton->callback(CancelCB, this);
    
    m_pButtonPack = new Fl_Pack(0, buttonsy, 0, ButtonHeight());
    m_pButtonPack->type(Fl_Pack::HORIZONTAL);
    m_pButtonPack->spacing(ButtonWSpacing());
    
    m_pBackButton = new Fl_Button(0, buttonsy, 0, ButtonHeight(),
                                  CreateText("@<-    %s", GetTranslation("Back")));
    SetButtonWidth(m_pBackButton);
    m_pBackButton->callback(BackCB, this);
    
    m_pNextButton = new Fl_Button(0, buttonsy, 0, ButtonHeight(),
                                  CreateText("%s    @->", GetTranslation("Next")));
    SetButtonWidth(m_pNextButton);
    m_pNextButton->callback(NextCB, this);
    
    m_pButtonPack->end();
    UpdateButtonPack();
    
    maingroup->end();
    
    CBaseInstall::Init(argc, argv);
    
    Fl_Shared_Image *img = Fl_Shared_Image::get(GetLogoFName());
    if (img)
    {
        m_pLogoBox = new Fl_Box(HeaderSpacing(), HeaderSpacing(), img->w()+HeaderSpacing(), img->h());
        m_pLogoBox->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE);
        m_pLogoBox->image(img);
        m_pHeaderGroup->add(m_pLogoBox);
    }

    int size = m_pWizard->children();
    for (int i=0; i<size; i++)
    {
        CInstallScreen *screen = GetScreen(m_pWizard->child(i));
        if (screen->CanActivate())
        {
            ActivateScreen(screen);
            break;
        }
    }
    
    m_pMainWindow->end();
    m_pMainWindow->show(argc, argv);
}
Пример #13
0
static int CommandLineInterpreter(scr_t screenID, const char *commandLine)
{
    char *szCommand = "APACHE2 ";
    int iCommandLen = 8;
    char szcommandLine[256];
    char *pID;
    screenID = screenID;


    if (commandLine == NULL)
        return NOTMYCOMMAND;
    if (strlen(commandLine) <= strlen(szCommand))
        return NOTMYCOMMAND;

    apr_cpystrn(szcommandLine, commandLine, sizeof(szcommandLine));

    /*  All added commands begin with "APACHE2 " */

    if (!strnicmp(szCommand, szcommandLine, iCommandLen)) {
        ActivateScreen (getscreenhandle());

        /* If an instance id was not given but the nlm is loaded in
            protected space, then the the command belongs to the
            OS address space instance to pass it on. */
        pID = strstr (szcommandLine, "-p");
        if ((pID == NULL) && nlmisloadedprotected())
            return NOTMYCOMMAND;

        /* If we got an instance id but it doesn't match this
            instance of the nlm, pass it on. */
        if (pID) {
            pID = &pID[2];
            while (*pID && (*pID == ' '))
                pID++;
        }
        if (pID && ap_my_addrspace && strnicmp(pID, ap_my_addrspace, strlen(ap_my_addrspace)))
            return NOTMYCOMMAND;

        /* If we have determined that this command belongs to this
            instance of the nlm, then handle it. */
        if (!strnicmp("RESTART",&szcommandLine[iCommandLen],3)) {
            printf("Restart Requested...\n");
            restart();
        }
        else if (!strnicmp("VERSION",&szcommandLine[iCommandLen],3)) {
            printf("Server version: %s\n", ap_get_server_description());
            printf("Server built:   %s\n", ap_get_server_built());
        }
        else if (!strnicmp("MODULES",&szcommandLine[iCommandLen],3)) {
            ap_show_modules();
        }
        else if (!strnicmp("DIRECTIVES",&szcommandLine[iCommandLen],3)) {
                ap_show_directives();
        }
        else if (!strnicmp("SHUTDOWN",&szcommandLine[iCommandLen],3)) {
            printf("Shutdown Requested...\n");
            shutdown_pending = 1;
        }
        else if (!strnicmp("SETTINGS",&szcommandLine[iCommandLen],3)) {
            if (show_settings) {
                show_settings = 0;
                ClearScreen (getscreenhandle());
                show_server_data();
            }
            else {
                show_settings = 1;
                display_settings();
            }
        }
        else {
            show_settings = 0;
            if (strnicmp("HELP",&szcommandLine[iCommandLen],3))
                printf("Unknown APACHE2 command %s\n", &szcommandLine[iCommandLen]);
            printf("Usage: APACHE2 [command] [-p <instance ID>]\n");
            printf("Commands:\n");
            printf("\tDIRECTIVES - Show directives\n");
            printf("\tHELP       - Display this help information\n");
            printf("\tMODULES    - Show a list of the loaded modules\n");
            printf("\tRESTART    - Reread the configuration file and restart Apache\n");
            printf("\tSETTINGS   - Show current thread status\n");
            printf("\tSHUTDOWN   - Shutdown Apache\n");
            printf("\tVERSION    - Display the server version information\n");
        }

        /*  Tell NetWare we handled the command */
        return HANDLEDCOMMAND;
    }

    /*  Tell NetWare that the command isn't mine */
    return NOTMYCOMMAND;
}