Example #1
0
void LoginComponent::initialize(const QString msg)
{
    ui->usernameEdit->setText(emptyString());
    ui->passwordEdit->setText(emptyString());

    if (msg == "") {
        setInfoColor(Qt::white);
        ui->infoLabel->setText("Login with uSpace or OtaSizzle account.");
    }
    else {
        setInfoColor(Qt::red);
        ui->infoLabel->setText(msg);
    }
    ui->usernameEdit->setFocus();
}
Example #2
0
void MainWindow::loadSettings(){
    setFullScreen(false);
    setHideMenu(false);

    QSettings settingsNative;

    resize(settingsNative.value("size", QSize(320, 480 + ui.menuBar->height())).toSize());
    move(settingsNative.value("pos",    QPoint(0, 0)).toPoint());

    int red = settingsNative.value("backgroundRed",     240).toInt();
    int green = settingsNative.value("backgroundGreen", 240).toInt();
    int blue = settingsNative.value("backgroundBlue",   240).toInt();
    QColor backgroundColor = QColor(red, green, blue);

    red = settingsNative.value("canvasRed",     255).toInt();
    green = settingsNative.value("canvasGreen", 255).toInt();
    blue = settingsNative.value("canvasBlue",   255).toInt();
    QColor canvasColor = QColor(red, green, blue);

    red = settingsNative.value("infoRed",     0).toInt();
    green = settingsNative.value("infoGreen", 0).toInt();
    blue = settingsNative.value("infoBlue",   0).toInt();
    QColor infoColor = QColor(red, green, blue);

    setBackgroundColor(backgroundColor);
    setCanvasColor(canvasColor);
    setInfoColor(infoColor);

    updateBackgroundColor();
    updateCanvasColor();
    updateInfoColor();

    QSettings settings(Constants::SETTINGS_FOLDER + "/" + Constants::PLAYER_SETTINGS_FILE, QSettings::IniFormat);

    setWidth(settings.value("width",             320).toInt());
    setHeight(settings.value("height",           480).toInt());
    setScale(settings.value("scale",             100).toInt());
    setFps(settings.value("fps",                 60).toInt());
    setOrientation(static_cast<Orientation>(settings.value("orientation", ePortrait).toInt()));
    setDrawInfos(settings.value("drawInfos",     false).toBool());
    setAutoScale(settings.value("autoScale",     false).toBool());
    setAlwaysOnTop(settings.value("alwaysOnTop", false).toBool());

    checkLoadedSettings();

    updateFps();
    updateDrawInfos();
    updateAlwaysOnTop();
    updateAutoScale();
    updateOrientation();
    updateResolution();
}