Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/qvfb/qvfb.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4242#include "qvfb.h"
    4343#include "qvfbview.h"
     44#include "qvfbhdr.h"
    4445#ifdef Q_WS_X11
    4546#include "qvfbx11view.h"
     
    135136static bool copyButtonConfiguration(const QString &prefix, int displayId)
    136137{
    137     const QString destDir = QString(QLatin1String("/tmp/qtembedded-%1/")).arg(displayId);
     138    const QString destDir = QT_VFB_DATADIR(displayId).append("/");
    138139    const QFileInfo src(prefix + QLatin1String("defaultbuttons.conf"));
    139140    const QFileInfo dst(destDir + QLatin1String("defaultbuttons.conf"));
     
    218219    rateDlg = 0;
    219220    refreshRate = 30;
    220 #if QT_VERSION >= 0x030000
    221     // When compiling with Qt 3 we need to create the menu first to
    222     // avoid scroll bars in the main window
     221    // Create the menu first to avoid scroll bars in the main window
    223222    createMenu( menuBar() );
    224223    init( display_id, w, h, d, r, skin );
    225224    enableCursor( true );
    226 #else
    227     init( display_id, w, h, d, r, skin );
    228     createMenu( menuBar() );
    229 #endif
    230225}
    231226
     
    355350        view->setContentsMargins( 0, 0, 0, 0 );
    356351        setCentralWidget(scroller);
    357 #if QT_VERSION >= 0x030000
    358352        ph += 2;                                        // avoid scrollbar
    359 #endif
    360353        scroller->show();
    361354        // delete defaultbuttons.conf if it was left behind...
    362         unlink(QFileInfo(QString("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId())).absoluteFilePath().toLatin1().constData());
     355        unlink(QFileInfo(QT_VFB_DATADIR(view->displayId()).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData());
    363356        if (secondaryView)
    364             unlink(QFileInfo(QString("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId()+1)).absoluteFilePath().toLatin1().constData());
     357            unlink(QFileInfo(QT_VFB_DATADIR(view->displayId() + 1).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData());
    365358    }
    366359    view->setRate(refreshRate);
     
    644637    config->lcdScreen->setChecked(view->lcdScreenEmulation());
    645638    chooseDepth(view->displayDepth(), view->displayFormat());
     639    config->rgbSwapped->setChecked(view->rgbSwapped());
    646640    connect(config->skin, SIGNAL(activated(int)), this, SLOT(skinConfigChosen(int)));
    647641    if ( view->gammaRed() == view->gammaGreen() && view->gammaGreen() == view->gammaBlue() ) {
     
    676670        } else if ( config->size_640_480->isChecked() ) {
    677671            w=640; h=480;
     672        } else if ( config->size_800_480->isChecked() ) {
     673            w=800; h=480;
    678674        } else if ( config->size_800_600->isChecked() ) {
    679675            w=800; h=600;
     
    687683        if ( config->depth_1->isChecked() )
    688684            d=1;
     685        else if ( config->depth_2gray->isChecked() )
     686            d=2;
    689687        else if ( config->depth_4gray->isChecked() )
    690688            d=4;
     
    717715        view->setViewFormat(displayFormat);
    718716        view->setTouchscreenEmulation( config->touchScreen->isChecked() );
     717        if (view->rgbSwapped() != config->rgbSwapped->isChecked()) {
     718            //### the windowTitle logic is inside init(), and init isn't always invoked
     719            QString caption = windowTitle();
     720            if (!config->rgbSwapped->isChecked())
     721                caption.replace(QLatin1String(" BGR"), QString());
     722            else
     723                caption.append(QLatin1String(" BGR"));
     724            setWindowTitle(caption);
     725            view->setRgbSwapped(config->rgbSwapped->isChecked());
     726        }
    719727        bool lcdEmulation = config->lcdScreen->isChecked();
    720728        view->setLcdScreenEmulation( lcdEmulation );
     
    743751    config->size_320_240->setChecked(sz == QSize(320,240));
    744752    config->size_640_480->setChecked(sz == QSize(640,480));
     753    config->size_800_480->setChecked(sz == QSize(800,480));
    745754    config->size_800_600->setChecked(sz == QSize(800,600));
    746755    config->size_1024_768->setChecked(sz == QSize(1024,768));
     
    750759{
    751760    config->depth_1->setChecked(depth==1);
     761    config->depth_2gray->setChecked(depth==2);
    752762    config->depth_4gray->setChecked(depth==4);
    753763    config->depth_8->setChecked(depth==8);
Note: See TracChangeset for help on using the changeset viewer.