Exemple #1
0
void ProjucerApplication::timerCallback()
{
    stopTimer();

    if (! ProjucerLicences::getInstance()->isLoggedIn())
        showLoginForm();
}
Exemple #2
0
//==============================================================================
void ProjucerApplication::loginOrLogout()
{
    ProjucerLicences& status = *ProjucerLicences::getInstance();

    if (status.isLoggedIn())
        status.logout();
    else
        showLoginForm();

    updateAllBuildTabs();
}
MainWindow::MainWindow(int screen, QWidget *parent) :
    QWidget(parent),
    m_Screen(screen)
{
    setObjectName(QString("MainWindow_%1").arg(screen));
    
    
    QRect screenRect = QApplication::desktop()->screenGeometry(screen);
    setGeometry(screenRect);

    setBackground();

    // display login dialog only in the main screen
    
    if (showLoginForm()) {
        m_LoginForm = new LoginForm(this);

        int maxX = screenRect.width() - m_LoginForm->width();
        int maxY = screenRect.height() - m_LoginForm->height();
        int defaultX = 10*maxX/100;
        int defaultY = 50*maxY/100;
        int offsetX = getOffset(Settings().offsetX(), maxX, defaultX);
        int offsetY = getOffset(Settings().offsetY(), maxY, defaultY);
        
        m_LoginForm->move(offsetX, offsetY);
        m_LoginForm->show();

        // This hack ensures that the primary screen will have focus
        // if there are more screens (move the mouse cursor in the center
        // of primary screen - not in the center of all X area). It
        // won't affect single-screen environments.
        int centerX = screenRect.width()/2 + screenRect.x();
        int centerY = screenRect.height()/2 + screenRect.y();
        QCursor::setPos(centerX, centerY);
    }
}