From: vsr Date: Thu, 18 Mar 2004 11:32:11 +0000 (+0000) Subject: - update images for PAL X-Git-Tag: PAL_1_4_1~36 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=972b20151fc9d1119aeef80cf80dfd5abb90a272;p=tools%2Finstall.git - update images for PAL - add logos support for InstallWizard - finish prepare fo internationalization - fix bugs with bad check of validity of data entered - improve infos --- diff --git a/src/InstallWizard.cpp b/src/InstallWizard.cpp index c99cc8a..84a80d8 100644 --- a/src/InstallWizard.cpp +++ b/src/InstallWizard.cpp @@ -17,6 +17,8 @@ #include "qptrlist.h" #include "qpainter.h" #include "qaccel.h" +#include "qhbox.h" +#include "qobjectlist.h" class InstallWizardPrivate { @@ -42,6 +44,8 @@ public: QWidgetStack * ws; QPtrList pages; QLabel * title; + QHBox * titleBox; + QHBox * logoBox; QPushButton * backButton; QPushButton * nextButton; QPushButton * finishButton; @@ -80,7 +84,11 @@ InstallWizard::InstallWizard( QWidget *parent, const char *name, bool modal, d->current = 0; // not quite true, but... d->ws = new QWidgetStack( this, "qt_widgetstack" ); d->pages.setAutoDelete( TRUE ); - d->title = new QLabel( this, "title label" ); + d->titleBox = new QHBox( this, "title box" ); + d->title = new QLabel( d->titleBox, "title label" ); + d->logoBox = new QHBox( d->titleBox, "logo box" ); + d->logoBox->setSpacing( 2 ); + d->titleBox->setStretchFactor( d->title, 10 ); // create in nice tab order d->nextButton = new QPushButton( this, "next" ); @@ -698,7 +706,7 @@ time \a title changes. void InstallWizard::layOutTitleRow( QHBoxLayout * layout, const QString & title ) { d->title->setText( title ); - layout->addWidget( d->title, 10 ); + layout->addWidget( d->titleBox, 10 ); } /*! @@ -816,3 +824,32 @@ QWidget* InstallWizard::page( const QString& title ) const } return 0; } + +/*! +Adds logo to be shown at the right of the page title +*/ +void InstallWizard::addLogo( const QPixmap& pm ) +{ + QLabel* logo = new QLabel( d->logoBox, "logo" ); + logo->setPixmap( pm ); + logo->setAlignment( AlignCenter ); + logo->setScaledContents( false ); + logo->show(); +} + +/*! +Remove all logos +*/ +void InstallWizard::removeLogos() +{ + QObjectList* children = d->logoBox->queryList( "QLabel" ); + if ( children ) { + QObjectListIt it( *children ); + QObject *obj; + while ( (obj = it.current()) != 0 ) { + ++it; + delete obj; + } + } + delete children; +} diff --git a/src/InstallWizard.h b/src/InstallWizard.h index bc4f750..47dbd38 100644 --- a/src/InstallWizard.h +++ b/src/InstallWizard.h @@ -46,6 +46,9 @@ public: QWidget* page( const QString& title ) const; int pageCount() const; int indexOf( QWidget* ) const; + + void addLogo( const QPixmap& pm ); + void removeLogos(); virtual bool appropriate( QWidget * ) const; virtual void setAppropriate( QWidget *, bool ); diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx index 53a07e7..a0f3de5 100644 --- a/src/SALOME_InstallWizard.cxx +++ b/src/SALOME_InstallWizard.cxx @@ -191,10 +191,13 @@ SALOME_InstallWizard::SALOME_InstallWizard(QString aXmlFileName) setIcon( QPixmap( ( const char** ) image0_data ) ); // enable sizegrip setSizeGripEnabled( true ); - + + // add logo + addLogo( QPixmap( (const char**)image1_data ) ); + // set defaults setVersion( "1.2" ); - setCaption( tr("PAL/SALOME %1").arg( myVersion ) ); + setCaption( tr( "PAL/SALOME %1" ).arg( myVersion ) ); setCopyright( tr( "Copyright (C) 2004 CEA" ) ); setLicense( tr( "All right reserved" ) ); setOS( "" ); @@ -215,7 +218,7 @@ SALOME_InstallWizard::SALOME_InstallWizard(QString aXmlFileName) } // create instance of class for starting shell install script - shellProcess = new QProcess( this,"shellProcess" ); + shellProcess = new QProcess( this, "shellProcess" ); // create introduction page setupIntroPage(); @@ -295,8 +298,8 @@ void SALOME_InstallWizard::closeEvent( QCloseEvent* ce ) if ( QMessageBox::information( this, tr( "Exit" ), tr( "Do you want to quit %1?" ).arg( getIWName() ), - tr( "Yes" ), - tr( "No" ), + tr( "&Yes" ), + tr( "&No" ), QString::null, 0, 1 ) == 1 ) { @@ -322,7 +325,7 @@ void SALOME_InstallWizard::setupIntroPage() QGridLayout* pageLayout = new QGridLayout( introPage ); pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 ); // create logo picture - QPixmap logo( (const char**)SALOMEPRO_Logo_xpm ); + QPixmap logo( (const char**)SALOME_Logo_xpm ); logoLab = new QLabel( introPage ); logoLab->setPixmap( logo ); logoLab->setScaledContents( false ); @@ -346,7 +349,7 @@ void SALOME_InstallWizard::setupIntroPage() "which are necessary for %2 and setup " "your environment.

Click Cancel button to abort " "installation and quit. Click Next button to continue with the " - "installation program.").arg(myCaption).arg(myCaption) ); + "installation program." ).arg( myCaption ).arg( myCaption ) ); info->setFrameStyle( QLabel::WinPanel | QLabel::Sunken ); info->setMargin( 6 ); info->setAlignment( WordBreak ); @@ -480,13 +483,13 @@ void SALOME_InstallWizard::setupProductsPage() // set first item to be selected if ( productsView->childCount() > 0 ) { productsView->setSelected( productsView->firstChild(), true ); - onSelectionChanged( productsView->firstChild() ); + onSelectionChanged(); } // adding page addPage( productsPage, tr( "Installation settings" ) ); // connecting signals - connect( productsView, SIGNAL( selectionChanged( QListViewItem* ) ), - this, SLOT( onSelectionChanged( QListViewItem* ) ) ); + connect( productsView, SIGNAL( selectionChanged() ), + this, SLOT( onSelectionChanged() ) ); connect( productsView, SIGNAL( itemToggled( QCheckListItem* ) ), this, SLOT( onItemToggled( QCheckListItem* ) ) ); connect( unselectBtn, SIGNAL( clicked() ), this, SLOT( onProdBtn() ) ); @@ -651,21 +654,20 @@ void SALOME_InstallWizard::showChoiceInfo() QString text; if ( !xmlFileName.isEmpty() ) { - text += tr( "Configuration file: " ) + xmlFileName + "
"; + text += tr( "Configuration file" )+ ": " + xmlFileName + "
"; text += "
"; } if ( !myOS.isEmpty() ) { - text += tr( "Target platform: " ) + myOS + "
"; + text += tr( "Target platform" ) + ": " + myOS + "
"; text += "
"; } - text += tr( "Products to be used: