<document>
- <config version="1.2d"
- caption="SALOME Professional v%1 Installation Wizard"
- copyright="Copyright (C) 2003 CEA/DEN, EDF R&D"
+ <config version="1.4.1"
+ caption="PAL/SALOME v%1"
+ copyright="Copyright (C) 2004 CEA"
license="All right reserved"
os="RedHat8.0"/>
<path targetdir="/tmp/salome"
installdiskspace="193905"
temporarydiskspace="659468"
script="gcc-3.2.sh"/>
+ <product name="boost"
+ version="1.30.2"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc"
+ installdiskspace="38069"
+ temporarydiskspace="44797"
+ script="BOOST-1.30.2.sh"/>
<product name="tcltk"
version="8.3.3"
install="use native"
supported="install sources,install binaries"
disable="false"
dependancies="gcc,tcltk,Python"
- installdiskspace="37480"
- temporarydiskspace="130489"
+ installdiskspace="34156"
+ temporarydiskspace="168044"
script="VTK-4.2.2.sh"/>
+ <product name="netgen"
+ version="4.3"
+ install="install binaries"
+ supported="install sources,install binaries"
+ disable="false"
+ dependancies="gcc"
+ installdiskspace="2936"
+ temporarydiskspace="8252"
+ script="netgen4.3.sh"/>
<product name="OmniORB"
version="3.0.5"
install="install binaries"
installdiskspace="17724"
temporarydiskspace="61528"
script="graphviz-1.9.sh"/>
- <product name="SalomePro-Src"
- version="1.2d"
+ <product name="Salome/KERNEL-Src"
+ version="1.4.1"
install="install sources"
supported="install sources"
disable="false"
- dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
- installdiskspace="432954,39336"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
+ installdiskspace="000,000"
temporarydiskspace="0"
- script="SALOME_ROOT_1.2.sh"/>
- <product name="SalomePro-Bin"
- version="1.2d"
+ script="KERNEL_SRC_1.4.1.sh"/>
+ <product name="Salome/KERNEL-Bin"
+ version="1.4.1"
install="install binaries"
supported="install binaries"
disable="false"
- dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
- installdiskspace="432954,39336"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
+ installdiskspace="000,000"
temporarydiskspace="0"
- script="SalomePro-1.2.sh"/>
- <product name="SalomePro-Doc"
- version="1.2d"
+ script="KERNEL_BIN_1.4.1.sh"/>
+ <product name="Salome/GEOM-Src"
+ version="1.4.1"
install="install sources"
supported="install sources"
disable="false"
- dependancies=""
- installdiskspace="6798"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="GEOM_SRC_1.4.1.sh"/>
+ <product name="Salome/GEOM-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="GEOM_BIN_1.4.1.sh"/>
+ <product name="Salome/MED-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="MED_SRC_1.4.1.sh"/>
+ <product name="Salome/MED-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="MED_BIN_1.4.1.sh"/>
+ <product name="Salome/SMESH-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src,Salome/GEOM-Src,Salome/MED-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="SMESH_SRC_1.4.1.sh"/>
+ <product name="Salome/SMESH-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin,Salome/GEOM-Bin,Salome/MED-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="SMESH_BIN_1.4.1.sh"/>
+ <product name="Salome/VISU-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src,Salome/MED-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="VISU_SRC_1.4.1.sh"/>
+ <product name="Salome/VISU-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin,Salome/MED-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="VISU_BIN_1.4.1.sh"/>
+ <product name="Salome/SUPERV-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="SUPERV_SRC_1.4.1.sh"/>
+ <product name="Salome/SUPERV-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="SUPERV_BIN_1.4.1.sh"/>
+ <product name="NETGENplugin-SRC"
+ version="1.0"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,netgen,Salome/SMESH-Src"
+ installdiskspace="5692"
+ temporarydiskspace="16452"
+ script="netgenplugin_src_1.0.sh"/>
+ <product name="NETGENplugin-BIN"
+ version="1.0"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,netgen,Salome/SMESH-Bin"
+ installdiskspace="5692"
temporarydiskspace="0"
- script="SalomeDoc-1.2.sh"/>
+ script="netgenplugin_bin_1.0.sh"/>
</document>
<document>
<config version="1.4.1"
- caption="SALOME Professional v%1 Installation Wizard"
- copyright="Copyright (C) 2003 CEA/DEN, EDF R&D"
+ caption="PAL/SALOME v%1"
+ copyright="Copyright (C) 2004 CEA"
license="All right reserved"
os="RedHat8.0"/>
<path targetdir="/tmp/salome"
installdiskspace="2936"
temporarydiskspace="8252"
script="netgen4.3.sh"/>
- <product name="netgenplugin"
- version="1.0"
- install="install binaries"
- supported="install sources,install binaries"
- disable="false"
- dependancies="gcc,netgen"
- installdiskspace="5692"
- temporarydiskspace="16452"
- script="netgenplugin1.0.sh"/>
<product name="OmniORB"
version="3.0.5"
install="install binaries"
installdiskspace="17724"
temporarydiskspace="61528"
script="graphviz-1.9.sh"/>
- <product name="SalomePro-Src"
+ <product name="Salome/KERNEL-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="KERNEL_SRC_1.4.1.sh"/>
+ <product name="Salome/KERNEL-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="KERNEL_BIN_1.4.1.sh"/>
+ <product name="Salome/GEOM-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="GEOM_SRC_1.4.1.sh"/>
+ <product name="Salome/GEOM-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="GEOM_BIN_1.4.1.sh"/>
+ <product name="Salome/MED-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="MED_SRC_1.4.1.sh"/>
+ <product name="Salome/MED-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="MED_BIN_1.4.1.sh"/>
+ <product name="Salome/SMESH-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src,Salome/GEOM-Src,Salome/MED-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="SMESH_SRC_1.4.1.sh"/>
+ <product name="Salome/SMESH-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,boost,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin,Salome/GEOM-Bin,Salome/MED-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="SMESH_BIN_1.4.1.sh"/>
+ <product name="Salome/VISU-Src"
+ version="1.4.1"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src,Salome/MED-Src"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="VISU_SRC_1.4.1.sh"/>
+ <product name="Salome/VISU-Bin"
+ version="1.4.1"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin,Salome/MED-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="VISU_BIN_1.4.1.sh"/>
+ <product name="Salome/SUPERV-Src"
version="1.4.1"
install="install sources"
supported="install sources"
disable="false"
- dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
- installdiskspace="432954,39336"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Src"
+ installdiskspace="000,000"
temporarydiskspace="0"
- script="SALOME_ROOT_1.4.1.sh"/>
- <product name="SalomePro-Bin"
+ script="SUPERV_SRC_1.4.1.sh"/>
+ <product name="Salome/SUPERV-Bin"
version="1.4.1"
install="install binaries"
supported="install binaries"
disable="false"
- dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Qwt,Hdf,Med,Vtk,OmniORB,Sip,PyQt,Doxygen,Graphviz,HappyDoc"
- installdiskspace="432954,39336"
+ dependancies="gcc,tcltk,OpenCascade,Python,Numeric,Swig,Qt,Hdf,Med,Vtk,OmniORB,Doxygen,Graphviz,HappyDoc,Salome/KERNEL-Bin"
+ installdiskspace="000,000"
+ temporarydiskspace="0"
+ script="SUPERV_BIN_1.4.1.sh"/>
+ <product name="NETGENplugin-SRC"
+ version="1.0"
+ install="install sources"
+ supported="install sources"
+ disable="false"
+ dependancies="gcc,netgen,Salome/SMESH-Src"
+ installdiskspace="5692"
+ temporarydiskspace="16452"
+ script="netgenplugin_src_1.0.sh"/>
+ <product name="NETGENplugin-BIN"
+ version="1.0"
+ install="install binaries"
+ supported="install binaries"
+ disable="false"
+ dependancies="gcc,netgen,Salome/SMESH-Bin"
+ installdiskspace="5692"
temporarydiskspace="0"
- script="SalomePro-1.4.1.sh"/>
+ script="netgenplugin_bin_1.0.sh"/>
</document>
# get_help_info
#==============================================================
def get_help_info() :
- str = "\nSALOME Professional Installation Wizard\n\n"
+ str = "\nPAL/SALOME Installation Wizard\n\n"
str = str + "\tUsage : \n\tInstall [-g|b] [-f <xml-file>] [-t <target-dir>] [-tmp <tmp-dir>]\n"
str = str + "\n"
str = str + " -g Runs the Installation Wizard in the GUI mode.\n"
env["LD_LIBRARY_PATH"] = ".:" + env["LD_LIBRARY_PATH"]
env["PATH"] = ".:"+ env["PATH"]
- sys.exit(os.system("cd " + cur_dir + "; ./bin/SALOMEPRO_InstallWizard " + xml_file +"&"))
+ sys.exit(os.system("cd " + cur_dir + "; ./bin/SALOME_InstallWizard " + xml_file +"&"))
// File : InstallWizard.cpp
// Created : Thu Mar 27 12:01:00 2003
// Author : Vadim SANDLER
-// Project : SALOME Professional
+// Project : PAL/SALOME
// Module : InstallWizard
-// Copyright : 2003 CEA/DEN, EDF R&D
+// Copyright : 2004 CEA
// $Header$
#include "InstallWizard.h"
// File : InstallWizard.h
// Created : Thu Mar 27 12:01:00 2003
// Author : Vadim SANDLER
-// Project : SALOME Professional
+// Project : PAL/SALOME
// Module : InstallWizard
-// Copyright : 2003 CEA/DEN, EDF R&D
+// Copyright : 2004 CEA
// $Header$
#ifndef InstallWizard_h
#############################################################################
-# Makefile for building: ../bin/SALOMEPRO_InstallWizard
-# Generated by qmake (1.03a) on: Fri Jul 25 09:43:22 2003
-# Project: SALOMEPRO_INSTALL.pro
+# Makefile for building: ../bin/SALOME_InstallWizard
+# Generated by qmake (1.03a) on: Wed Mar 17 17:34:01 2004
+# Project: SALOME_INSTALL.pro
# Template: app
-# Command: $(QMAKE) SALOMEPRO_INSTALL.pro
+# Command: $(QMAKE) SALOME_INSTALL.pro
#############################################################################
####### Compiler, tools and options
CXX = g++
LEX = flex
YACC = yacc
-CFLAGS = -pipe -Wall -W -O2 -DQT_NO_DEBUG
-CXXFLAGS = -pipe -Wall -W -O2 -DQT_NO_DEBUG
+CFLAGS = -pipe -Wall -W -I/usr/include/fontconfig -I/usr/include/Xft2 -O2 -march=i386 -mcpu=i686 -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG
+CXXFLAGS = -pipe -Wall -W -I/usr/include/fontconfig -I/usr/include/Xft2 -O2 -march=i386 -mcpu=i686 -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG
LEXFLAGS =
YACCFLAGS= -d
INCPATH = -I$(QTDIR)/include -I$(QTDIR)/mkspecs/default
LINK = g++
LFLAGS =
-LIBS = $(SUBLIBS) -Wl,-rpath,$(QTDIR)/lib -L$(QTDIR)/lib -L/usr/X11R6/lib -lqt -ldl -lXinerama -lXft -lSM -lqt -lXext -lX11 -lm
+LIBS = $(SUBLIBS) -L$(QTDIR)/lib -L/usr/X11R6/lib -lqt -ldl -lXinerama -lSM -lqt-mt -lXext -lX11 -lm
AR = ar cqs
RANLIB =
MOC = $(QTDIR)/bin/moc
####### Files
HEADERS = SALOME_InstallWizard.hxx \
- helpwindow.h \
+ SALOME_ProductsView.hxx \
+ SALOME_ProgressView.hxx \
+ SALOME_XmlHandler.hxx \
+ SALOME_HelpWindow.hxx \
icons.h \
InstallWizard.h
-SOURCES = SALOME_InstallWizard.cxx \
- helpwindow.cpp \
+SOURCES = main.cxx \
+ SALOME_InstallWizard.cxx \
+ SALOME_ProductsView.cxx \
+ SALOME_ProgressView.cxx \
+ SALOME_XmlHandler.cxx \
+ SALOME_HelpWindow.cxx \
InstallWizard.cpp
-OBJECTS = SALOME_InstallWizard.o \
- helpwindow.o \
+OBJECTS = main.o \
+ SALOME_InstallWizard.o \
+ SALOME_ProductsView.o \
+ SALOME_ProgressView.o \
+ SALOME_XmlHandler.o \
+ SALOME_HelpWindow.o \
InstallWizard.o
FORMS =
UICDECLS =
UICIMPLS =
SRCMOC = moc_SALOME_InstallWizard.cpp \
- moc_helpwindow.cpp \
+ moc_SALOME_ProductsView.cpp \
+ moc_SALOME_HelpWindow.cpp \
moc_InstallWizard.cpp
OBJMOC = moc_SALOME_InstallWizard.o \
- moc_helpwindow.o \
+ moc_SALOME_ProductsView.o \
+ moc_SALOME_HelpWindow.o \
moc_InstallWizard.o
-DIST = SALOMEPRO_INSTALL.pro
-QMAKE_TARGET = ../bin/SALOMEPRO_InstallWizard
+DIST = SALOME_INSTALL.pro
+QMAKE_TARGET = ../bin/SALOME_InstallWizard
DESTDIR =
-TARGET = ../bin/SALOMEPRO_InstallWizard
+TARGET = ../bin/SALOME_InstallWizard
first: all
####### Implicit rules
$(MOC):
( cd $(QTDIR)/src/moc ; $(MAKE) )
-Makefile: SALOMEPRO_INSTALL.pro $(QTDIR)/mkspecs/default/qmake.conf
- $(QMAKE) SALOMEPRO_INSTALL.pro
+Makefile: SALOME_INSTALL.pro $(QTDIR)/mkspecs/default/qmake.conf
+ $(QMAKE) SALOME_INSTALL.pro
qmake:
- @$(QMAKE) SALOMEPRO_INSTALL.pro
+ @$(QMAKE) SALOME_INSTALL.pro
dist:
- @mkdir -p bin/SALOMEPRO_InstallWizard && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) bin/SALOMEPRO_InstallWizard/ && ( cd `dirname bin/SALOMEPRO_InstallWizard` && $(TAR) ../bin/SALOMEPRO_InstallWizard.tar ../bin/SALOMEPRO_InstallWizard && $(GZIP) ../bin/SALOMEPRO_InstallWizard.tar ) && $(MOVE) `dirname bin/SALOMEPRO_InstallWizard`/../bin/SALOMEPRO_InstallWizard.tar.gz . && $(DEL_DIR) bin/SALOMEPRO_InstallWizard
+ @mkdir -p bin/SALOME_InstallWizard && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) bin/SALOME_InstallWizard/ && ( cd `dirname bin/SALOME_InstallWizard` && $(TAR) ../bin/SALOME_InstallWizard.tar ../bin/SALOME_InstallWizard && $(GZIP) ../bin/SALOME_InstallWizard.tar ) && $(MOVE) `dirname bin/SALOME_InstallWizard`/../bin/SALOME_InstallWizard.tar.gz . && $(DEL_DIR) bin/SALOME_InstallWizard
mocclean:
-$(DEL_FILE) $(OBJMOC)
####### Compile
+main.o: main.cxx SALOME_InstallWizard.hxx \
+ InstallWizard.h
+
SALOME_InstallWizard.o: SALOME_InstallWizard.cxx SALOME_InstallWizard.hxx \
+ SALOME_ProductsView.hxx \
+ SALOME_ProgressView.hxx \
+ SALOME_XmlHandler.hxx \
+ SALOME_HelpWindow.hxx \
icons.h \
- InstallWizard.h \
- helpwindow.h
+ InstallWizard.h
-helpwindow.o: helpwindow.cpp helpwindow.h \
- icons.h
+SALOME_ProductsView.o: SALOME_ProductsView.cxx SALOME_ProductsView.hxx
+
+SALOME_ProgressView.o: SALOME_ProgressView.cxx SALOME_ProgressView.hxx
+
+SALOME_XmlHandler.o: SALOME_XmlHandler.cxx SALOME_XmlHandler.hxx \
+ SALOME_ProductsView.hxx \
+ SALOME_InstallWizard.hxx \
+ InstallWizard.h
+
+SALOME_HelpWindow.o: SALOME_HelpWindow.cxx SALOME_HelpWindow.hxx \
+ SALOME_InstallWizard.hxx \
+ icons.h \
+ InstallWizard.h
InstallWizard.o: InstallWizard.cpp InstallWizard.h
-moc_SALOME_InstallWizard.o: moc_SALOME_InstallWizard.cpp SALOME_InstallWizard.hxx InstallWizard.h \
- helpwindow.h
+moc_SALOME_InstallWizard.o: moc_SALOME_InstallWizard.cpp SALOME_InstallWizard.hxx InstallWizard.h
-moc_helpwindow.o: moc_helpwindow.cpp helpwindow.h
+moc_SALOME_ProductsView.o: moc_SALOME_ProductsView.cpp SALOME_ProductsView.hxx
+
+moc_SALOME_HelpWindow.o: moc_SALOME_HelpWindow.cpp SALOME_HelpWindow.hxx
moc_InstallWizard.o: moc_InstallWizard.cpp InstallWizard.h
moc_SALOME_InstallWizard.cpp: $(MOC) SALOME_InstallWizard.hxx
$(MOC) SALOME_InstallWizard.hxx -o moc_SALOME_InstallWizard.cpp
-moc_helpwindow.cpp: $(MOC) helpwindow.h
- $(MOC) helpwindow.h -o moc_helpwindow.cpp
+moc_SALOME_ProductsView.cpp: $(MOC) SALOME_ProductsView.hxx
+ $(MOC) SALOME_ProductsView.hxx -o moc_SALOME_ProductsView.cpp
+
+moc_SALOME_HelpWindow.cpp: $(MOC) SALOME_HelpWindow.hxx
+ $(MOC) SALOME_HelpWindow.hxx -o moc_SALOME_HelpWindow.cpp
moc_InstallWizard.cpp: $(MOC) InstallWizard.h
$(MOC) InstallWizard.h -o moc_InstallWizard.cpp
-Notes on building SALOME Professional v1.1 InstallWizard.
+---------------------------------------------------------
+Notes on building SALOME Installation Wizard.
---------------------------------------------------------
You must have precompiled gcc and qt static libraries.
+++ /dev/null
-TEMPLATE = app
-CONFIG += qt warn_on release
-HEADERS = SALOME_InstallWizard.hxx
-HEADERS += helpwindow.h
-HEADERS += icons.h
-HEADERS += InstallWizard.h
-SOURCES = SALOME_InstallWizard.cxx
-SOURCES += helpwindow.cpp
-SOURCES += InstallWizard.cpp
-TARGET = ../bin/SALOMEPRO_InstallWizard
-unix:LIBS += -lqt -ldl -lXinerama -lXft -lSM
--- /dev/null
+// File : SALOME_HelpWindow.cxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#include "SALOME_HelpWindow.hxx"
+#include "SALOME_InstallWizard.hxx"
+
+#include <qstatusbar.h>
+#include <qtoolbar.h>
+#include <qtoolbutton.h>
+#include <qiconset.h>
+#include <qlabel.h>
+#include <qtextbrowser.h>
+#include <qapplication.h>
+#include <qdir.h>
+#include <qfile.h>
+
+#include "icons.h"
+
+#define DEFAULT_WIDTH 800
+#define DEFAULT_HEIGHT 700
+
+// ================================================================
+/*!
+ * HelpWindow::HelpWindow
+ * Constructor
+ */
+// ================================================================
+HelpWindow::HelpWindow( SALOME_InstallWizard* wizard ) : QMainWindow( 0, "SalomeProHelpWindow", WDestructiveClose )
+{
+ QString hlpFile = QDir::currentDirPath() + "/doc/readme.html";
+ QString hlpDir = ".";
+ // caption
+ setCaption( wizard->getCaption() + " " + wizard->getIWName() + " " + tr( "Help" ) );
+ // icon
+ setIcon( QPixmap( (const char**)image0_data ) );
+ // create browser
+ browser = new QTextBrowser( this );
+ browser->mimeSourceFactory()->setFilePath( hlpDir );
+ browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ setCentralWidget( browser );
+ // set source directory
+ if ( !hlpFile.isEmpty() )
+ browser->setSource( hlpFile );
+ // toolbar
+ QToolBar* toolbar = new QToolBar( this );
+ addToolBar( toolbar, "Toolbar" );
+ QToolButton* button;
+ // --> back
+ button = new QToolButton( QIconSet( (const char**)back ),
+ tr( "Backward" ),
+ "",
+ browser,
+ SLOT( backward() ),
+ toolbar );
+ button->setEnabled( FALSE );
+ connect( browser, SIGNAL( backwardAvailable( bool ) ), button, SLOT( setEnabled( bool ) ) );
+ // --> forward
+ button = new QToolButton( QIconSet( (const char**)forward ),
+ tr( "Forward" ),
+ "",
+ browser,
+ SLOT( forward() ),
+ toolbar );
+ button->setEnabled( FALSE );
+ connect( browser, SIGNAL( forwardAvailable( bool ) ), button, SLOT( setEnabled( bool ) ) );
+ // --> home
+ button = new QToolButton( QIconSet( (const char**)home ),
+ tr( "Home" ),
+ "",
+ browser,
+ SLOT( home() ),
+ toolbar );
+ toolbar->addSeparator();
+ // --> logo
+ QLabel* logo = new QLabel( toolbar, "logo" );
+ logo->setPixmap( QPixmap( (const char**)image1_data ) );
+ logo->setAlignment( AlignRight | AlignVCenter );
+ logo->setScaledContents( false );
+ toolbar->setStretchableWidget( logo );
+ setRightJustification( TRUE );
+ // disable docking of toolbar
+ setDockEnabled( Qt::DockLeft, FALSE );
+ setDockEnabled( Qt::DockRight, FALSE );
+ setDockEnabled( Qt::DockBottom, FALSE );
+ setDockEnabled( Qt::DockTornOff, FALSE );
+ // disable dock menu
+ setDockMenuEnabled ( FALSE ) ;
+ // connect signals
+ connect( browser, SIGNAL( highlighted( const QString&) ), statusBar(), SLOT( message( const QString&)) );
+ // set focus
+ browser->setFocus();
+ // initial size
+ QSize sz = qApp->desktop()->size();
+ int x = ( sz.width() - DEFAULT_WIDTH ) / 2;
+ int y = ( sz.height() - DEFAULT_HEIGHT ) / 2;
+ setGeometry( x, y, DEFAULT_WIDTH, DEFAULT_HEIGHT );
+}
+// ================================================================
+/*!
+ * HelpWindow::~HelpWindow
+ * Destructor
+ */
+// ================================================================
+HelpWindow::~HelpWindow()
+{
+}
+// ================================================================
+/*!
+ * HelpWindow::openHelp [ static ]
+ * Creates Help window ane return pointer to it if help file exists,
+ * otherwise returns 0
+ */
+// ================================================================
+HelpWindow* HelpWindow::openHelp( SALOME_InstallWizard* wizard )
+{
+ if ( QFile::exists( QDir::currentDirPath() + "/doc/readme.html" ) )
+ return new HelpWindow( wizard );
+ else
+ return 0;
+}
--- /dev/null
+// File : SALOME_HelpWindow.hxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadin SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#ifndef __SALOME_HelpWindow
+#define __SALOME_HelpWindow
+
+#include <qmainwindow.h>
+
+/*!
+ Install Wizard's help window class
+*/
+class QTextBrowser;
+class SALOME_InstallWizard;
+class HelpWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ // constructor
+ HelpWindow( SALOME_InstallWizard* wizard );
+ // destructor
+ ~HelpWindow();
+
+ // opens/raises Help window
+ static HelpWindow* openHelp( SALOME_InstallWizard* wizard );
+
+private:
+ QTextBrowser* browser; // help window browser
+};
+
+#endif
+
--- /dev/null
+# File : SALOME_INSTALL.pro
+# Created : Thu Dec 18 12:01:00 2002
+# Author : Vadim SANDLER
+# Project : PAL/SALOME
+# Module : InstallWizard
+# Copyright : 2004 CEA
+# $Header$
+
+TEMPLATE = app
+CONFIG += qt warn_on release
+HEADERS = SALOME_InstallWizard.hxx
+HEADERS += SALOME_ProductsView.hxx
+HEADERS += SALOME_ProgressView.hxx
+HEADERS += SALOME_XmlHandler.hxx
+HEADERS += SALOME_HelpWindow.hxx
+HEADERS += icons.h
+HEADERS += InstallWizard.h
+SOURCES = main.cxx
+SOURCES += SALOME_InstallWizard.cxx
+SOURCES += SALOME_ProductsView.cxx
+SOURCES += SALOME_ProgressView.cxx
+SOURCES += SALOME_XmlHandler.cxx
+SOURCES += SALOME_HelpWindow.cxx
+SOURCES += InstallWizard.cpp
+TARGET = ../bin/SALOME_InstallWizard
+unix:LIBS += -lqt -ldl -lXinerama -lXft -lSM
// File : SALOME_InstallWizard.cxx
// Created : Thu Dec 18 12:01:00 2002
// Author : Vadim SANDLER
-// Project : SALOME Professional
+// Project : PAL/SALOME
// Module : InstallWizard
-// Copyright : 2003 CEA/DEN, EDF R&D
+// Copyright : 2004 CEA
// $Header$
#include "SALOME_InstallWizard.hxx"
+#include "SALOME_ProductsView.hxx"
+#include "SALOME_ProgressView.hxx"
+#include "SALOME_XmlHandler.hxx"
+#include "SALOME_HelpWindow.hxx"
+
#include "icons.h"
-#include <qbuttongroup.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlistview.h>
+#include <qlabel.h>
+#include <qtextedit.h>
+#include <qtextbrowser.h>
+#include <qprocess.h>
+#include <qcheckbox.h>
+#include <qsplitter.h>
#include <qlayout.h>
#include <qfiledialog.h>
#include <qapplication.h>
-#include <qtextbrowser.h>
-#include <qdesktopwidget.h>
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qtimer.h>
-#include <qhbuttongroup.h>
-#include <qradiobutton.h>
#include <qvbox.h>
#include <qwhatsthis.h>
#include <qtooltip.h>
#include <qfile.h>
-#include <qxml.h>
#ifdef WNT
#include <iostream.h>
#define max( x, y ) ( x ) > ( y ) ? ( x ) : ( y )
#endif
-// ######################################## Globals ##############################################
-
-QString myVersion = "1.2";
-QString myCaption = QString("SALOME Professional %1 Installation Wizard").arg(myVersion);
-QString myCopyright = "Copyright (C) 2003 CEA/DEN, EDF R&D";
-QString myLicense = "All right reserved";
-QString myOS = "";
-
#define TEMPDIRNAME ( "/INSTALLWORK" + QString::number( getpid() ) )
+
+// ================================================================
/*!
- Defines list of dependancies as string separated by space symbols
-*/
+ * DefineDependeces [ static ]
+ * Defines list of dependancies as string separated by space symbols
+ */
+// ================================================================
static QString DefineDependeces(MapProducts& theProductsMap) {
QStringList aProducts;
for ( MapProducts::Iterator mapIter = theProductsMap.begin(); mapIter != theProductsMap.end(); ++mapIter ) {
}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
+// ================================================================
/*!
- Makes directory recursively, returns false if not succedes [ static ]
-*/
+ * makeDir [ static ]
+ * Makes directory recursively, returns false if not succedes
+ */
+// ================================================================
static bool makeDir( const QString& theDir, QString& theCreated )
{
theCreated = QString::null;
}
return true;
}
+// ================================================================
/*!
- Reads the file, returns false if can't open it
-*/
+ * readFile [ static ]
+ * Reads the file, returns false if can't open it
+ */
+// ================================================================
static bool readFile( const QString& fileName, QString& text )
{
if ( QFile::exists( fileName ) ) {
}
return false;
}
-// ###################################### Progress View ###########################################
-
-/*!
- Constructor of progress view's item
- <parent> - parent progress view
- <productName> - full name of the product
- <smbName> - alias for he product used by the script
- <status> - initial status of the product, default is 'Waiting'
-*/
-ProgressViewItem::ProgressViewItem( ProgressView* parent, QString productName, const QString installType, const QString scriptName, Status status )
- : QListViewItem( parent, productName, installType ), myScript( scriptName )
-{
- setStatus( status );
-}
-/*!
- Sets new status for the item
-*/
-void ProgressViewItem::setStatus( Status status )
-{
- myStatus = status;
- switch ( myStatus ) {
- case Waiting:
- setText( 2, "Waiting" ); break;
- case Processing:
- setText( 2, "Processing" ); break;
- case Completed:
- setText( 2, "Completed" ); break;
- case Aborted:
- setText( 2, "Aborted" ); break;
- default:
- break;
- }
- repaint();
-}
-/*!
- Paints the cell of the list view item
-*/
-void ProgressViewItem::paintCell( QPainter* painter, const QColorGroup& cg, int column, int width, int align )
-{
- QColorGroup acg( cg );
- if ( column == 2 ) {
- switch ( myStatus ) {
- case Waiting:
- acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getWaitingColor() ); break;
- case Processing:
- acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getProcessingColor() ); break;
- case Completed:
- acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getCompletedColor() ); break;
- case Aborted:
- acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getWaitingColor() ); break;
- default:
- break;
- }
- }
- QListViewItem::paintCell( painter, acg, column, width, align );
-}
+// ================================================================
/*!
- Progress view's constructor
-*/
-ProgressView::ProgressView( QWidget* parent ) : QListView( parent )
+ * hasSpace [ static ]
+ * Checks if string contains spaces; used to check directory paths
+ */
+// ================================================================
+static bool hasSpace( const QString& dir )
{
- addColumn( tr( "Product" ) ); addColumn( tr( "Type" ) ); addColumn( tr( "Status" ) );
- header()->hide();
- setSelectionMode( QListView::NoSelection );
- setSorting( -1 );
- setResizeMode( QListView::AllColumns );
- setFocusPolicy( QWidget::NoFocus );
- setColors( QColor( "red" ), QColor( "orange" ), QColor( "green" ) );
-}
-/*!
- Sets status colors
-*/
-void ProgressView::setColors( QColor wColor, QColor pColor, QColor cColor ) {
- myWaitingColor = wColor;
- myProcessingColor = pColor;
- myCompletedColor = cColor;
- repaint();
-}
-/*!
- Adds product item
-*/
-void ProgressView::addProduct( const QString product, const QString type, const QString script ) {
- QListViewItem* lastItem = this->lastItem();
- ProgressViewItem* newItem = new ProgressViewItem( this, product, type, script );
- if ( lastItem )
- newItem->moveItem( lastItem );
-}
-/*!
- Finds the first item with given status
-*/
-QString ProgressView::findStatus( Status status ) {
- ProgressViewItem* item = ( ProgressViewItem* )firstChild();
- while( item ) {
- if ( item->getStatus() == status )
- return item->getProduct();
- item = ( ProgressViewItem* )( item->nextSibling() );
- }
- return QString::null;
-}
-/*!
- Sets new status for the product item
-*/
-void ProgressView::setStatus( const QString product, Status status ) {
- ProgressViewItem* item = findItem( product );
- if ( item ) {
- item->setStatus( status );
- repaint();
- }
-}
-/*!
- Scrolls the view to make item visible if necessary
-*/
-void ProgressView::ensureVisible( const QString product ) {
- ProgressViewItem* item = findItem( product );
- if ( item ) {
- ensureItemVisible( item );
- }
-}
-/*!
- Finds the item by the product name
-*/
-ProgressViewItem* ProgressView::findItem( const QString product ) {
- ProgressViewItem* item = ( ProgressViewItem* )firstChild();
- while( item ) {
- if ( item->getProduct() == product )
- return item;
- item = ( ProgressViewItem* )( item->nextSibling() );
- }
- return 0;
-}
-/*!
- Gets the product script
-*/
-QString ProgressView::getScript( const QString product ) {
- ProgressViewItem* item = ( ProgressViewItem* )firstChild();
- while( item ) {
- if ( item->getProduct() == product )
- return item->getScript();
- item = ( ProgressViewItem* )( item->nextSibling() );
+ for ( int i = 0; i < (int)dir.length(); i++ ) {
+ if ( dir[ i ].isSpace() )
+ return true;
}
- return QString::null;
+ return false;
}
-// ###################################### Install Wizard ###########################################
-
+// ================================================================
/*!
- Constructor
-*/
+ * SALOME_InstallWizard::SALOME_InstallWizard
+ * Constructor
+ */
+// ================================================================
SALOME_InstallWizard::SALOME_InstallWizard(QString aXmlFileName)
- : InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ), helpWindow( NULL ), moreMode( false ), previousPage( 0 ), exitConfirmed( false )
+ : InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ),
+ helpWindow( NULL ),
+ moreMode( false ),
+ previousPage( 0 ),
+ exitConfirmed( false )
{
+ myIWName = tr( "Installation Wizard" );
tmpCreated = QString::null;
- // set xml file
xmlFileName = aXmlFileName;
QFont fnt = font(); fnt.setPointSize( 14 ); fnt.setBold( true );
setTitleFont( fnt );
+ // set icon
+ setIcon( QPixmap( ( const char** ) image0_data ) );
+ // enable sizegrip
+ setSizeGripEnabled( true );
+
+ // set defaults
+ setVersion( "1.2" );
+ setCaption( tr("PAL/SALOME %1").arg( myVersion ) );
+ setCopyright( tr( "Copyright (C) 2004 CEA" ) );
+ setLicense( tr( "All right reserved" ) );
+ setOS( "" );
+
#ifdef DEBUG
cout << "Config. file : " << xmlFileName << endl;
#endif
QXmlInputSource source( &xmlfile );
QXmlSimpleReader reader;
- StructureParser * handler = new StructureParser();
+ StructureParser* handler = new StructureParser( this );
reader.setContentHandler( handler );
reader.parse( source );
}
- // set caption
- setCaption( myCaption );
- // set icon
- setIcon( QPixmap( ( const char** ) image0_data ) );
- // enable sizegrip
- setSizeGripEnabled( true );
// create instance of class for starting shell install script
- shellProcess = new QProcess(this,"shellProcess");
+ shellProcess = new QProcess( this,"shellProcess" );
// create introduction page
setupIntroPage();
connect(shellProcess, SIGNAL( processExited() ), this, SLOT( productInstalled() ) );
connect(shellProcess, SIGNAL( wroteToStdin() ), this, SLOT( wroteToStdin() ) );
}
+// ================================================================
/*!
- Destructor
-*/
+ * SALOME_InstallWizard::~SALOME_InstallWizard
+ * Destructor
+ */
+// ================================================================
SALOME_InstallWizard::~SALOME_InstallWizard()
{
shellProcess->kill(); // kill it for sure
}
}
}
+// ================================================================
/*!
- Event filter, spies for Help window closing
-*/
+ * SALOME_InstallWizard::eventFilter
+ * Event filter, spies for Help window closing
+ */
+// ================================================================
bool SALOME_InstallWizard::eventFilter( QObject* object, QEvent* event )
{
if ( object && object == helpWindow && event->type() == QEvent::Close )
helpWindow = NULL;
return InstallWizard::eventFilter( object, event );
}
-/*!
- Close event handler
-*/
+// ================================================================
+/*!
+ * SALOME_InstallWizard::closeEvent
+ * Close event handler
+ */
+// ================================================================
void SALOME_InstallWizard::closeEvent( QCloseEvent* ce )
{
if ( !exitConfirmed ) {
if ( QMessageBox::information( this,
tr( "Exit" ),
- tr( "Do you want to quit Installation Wizard?" ),
+ tr( "Do you want to quit %1?" ).arg( getIWName() ),
tr( "Yes" ),
tr( "No" ),
QString::null,
}
}
}
+// ================================================================
/*!
- Creates introduction page
-*/
+ * SALOME_InstallWizard::setupIntroPage
+ * Creates introduction page
+ */
+// ================================================================
void SALOME_InstallWizard::setupIntroPage()
{
// create page
logoLab->setAlignment( AlignCenter );
// create version box
QVBox* versionBox = new QVBox( introPage ); versionBox->setSpacing( 6 );
- versionBox->setFrameStyle( QGroupBox::Panel | QGroupBox::Sunken );
+ versionBox->setFrameStyle( QVBox::Panel | QVBox::Sunken );
QWidget* stretch1 = new QWidget( versionBox ); versionBox->setStretchFactor( stretch1, 5 );
- versionLab = new QLabel( QString("Version %1").arg(myVersion), versionBox );
+ versionLab = new QLabel( QString("%1 %2").arg( tr( "Version" ) ).arg(myVersion), versionBox );
versionLab->setAlignment( AlignCenter );
copyrightLab = new QLabel( myCopyright, versionBox );
copyrightLab->setAlignment( AlignCenter );
QWidget* stretch2 = new QWidget( versionBox ); versionBox->setStretchFactor( stretch2, 5 );
// create info box
info = new QLabel( introPage );
- info->setText( tr( "This program will install <b>SALOME Professional Version %1</b>."
+ info->setText( tr( "This program will install <b>%1</b>."
"<br><br>The wizard will also help you to install all products "
- "which are necessary for <b>SALOME PRO</b> platform and setup "
+ "which are necessary for <b>%2</b> and setup "
"your environment.<br><br>Click <code>Cancel</code> button to abort "
"installation and quit. Click <code>Next</code> button to continue with the "
- "installation program.").arg(myVersion) );
- info->setFrameStyle( QGroupBox::WinPanel | QGroupBox::Sunken );
+ "installation program.").arg(myCaption).arg(myCaption) );
+ info->setFrameStyle( QLabel::WinPanel | QLabel::Sunken );
info->setMargin( 6 );
info->setAlignment( WordBreak );
- info->setMinimumSize( 250, 250 );
+ info->setMinimumWidth( 250 );
QPalette pal = info->palette();
pal.setColor( QColorGroup::Background, QApplication::palette().active().base() );
info->setPalette( pal );
// adding page
addPage( introPage, tr( "Introduction" ) );
}
+// ================================================================
/*!
- Creates products page
-*/
+ * SALOME_InstallWizard::setupProductsPage
+ * Creates products page
+ */
+// ================================================================
void SALOME_InstallWizard::setupProductsPage()
{
// create page
QWhatsThis::add( tempBtn, tr( "Click this to browse temporary directory" ) );
QToolTip::add ( tempBtn, tr( "Click this to browse temporary directory" ) );
// create products list
- productsView = new MyListView( moreBox );
+ productsView = new ProductsView( moreBox );
productsView->setMinimumSize( 200, 180 );
QWhatsThis::add( productsView, tr( "This view lists the products you wish to be installed" ) );
QToolTip::add ( productsView, tr( "This view lists the products you wish to be installed" ) );
QXmlInputSource source( &xmlfile );
QXmlSimpleReader reader;
- StructureParser * handler = new StructureParser();
- handler->setWizard( this );
- handler->setListView(productsView);
+ StructureParser* handler = new StructureParser( this );
+ handler->setProductsList(productsView);
handler->setTargetDir(targetFolder);
handler->setTempDir(tempFolder);
reader.setContentHandler( handler );
// start on default - non-advanced - mode
moreBox->hide();
}
+// ================================================================
/*!
- Creates prestart page
-*/
+ * SALOME_InstallWizard::setupCheckPage
+ * Creates prestart page
+ */
+// ================================================================
void SALOME_InstallWizard::setupCheckPage()
{
// create page
// adding page
addPage( prestartPage, tr( "Check your choice" ) );
}
+// ================================================================
/*!
- Creates progress page
-*/
+ * SALOME_InstallWizard::setupProgressPage
+ * Creates progress page
+ */
+// ================================================================
void SALOME_InstallWizard::setupProgressPage()
{
// create page
// connect signals
connect( passedParams, SIGNAL( returnPressed() ), this, SLOT( onReturnPressed() ) ) ;
}
+// ================================================================
/*!
- Creates readme page
-*/
+ * SALOME_InstallWizard::setupReadmePage
+ * Creates readme page
+ */
+// ================================================================
void SALOME_InstallWizard::setupReadmePage()
{
// create page
- readmePage = new QWidget( this, "RedamePage" );
+ readmePage = new QWidget( this, "ReadmePage" );
QVBoxLayout* pageLayout = new QVBoxLayout( readmePage );
pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
// README info text box
if ( readFile( readmeFile, text ) )
readme->setText( text );
else
- readme->setText( "README file has not been found" );
+ readme->setText( tr( "README file has not been found" ) );
// adding page
addPage( readmePage, tr( "Finish installation" ) );
}
+// ================================================================
/*!
- Displays choice info
-*/
+ * SALOME_InstallWizard::showChoiceInfo
+ * Displays choice info
+ */
+// ================================================================
void SALOME_InstallWizard::showChoiceInfo()
{
choices->clear();
text += "<br>";
choices->setText( text );
}
+// ================================================================
/*!
- Checks if string contains spaces; used to check directory paths [ static ]
-*/
-static bool hasSpace( const QString& dir )
-{
- for ( int i = 0; i < (int)dir.length(); i++ ) {
- if ( dir[ i ].isSpace() )
- return true;
- }
- return false;
-}
-/*!
- Validates page when <Next> button is clicked
-*/
+ * SALOME_InstallWizard::acceptData
+ * Validates page when <Next> button is clicked
+ */
+// ================================================================
bool SALOME_InstallWizard::acceptData( const QString& pageTitle )
{
QString tmpstr;
if ( item->text(2).isEmpty() || item->text(2).isNull() ) {
QMessageBox::warning( this,
tr( "Warning" ),
- tr( QString("You don't have a defined script for %1").arg(item->text(0))),
+ tr( "You don't have a defined script for %1").arg(item->text(0)),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
if ( !fi.exists() ) {
QMessageBox::warning( this,
tr( "Warning" ),
- tr( QString("%1 required for %2 doesn't exist.").arg("./config_files/" + item->text(2)).arg(item->text(0))),
+ tr( "%1 required for %2 doesn't exist.").arg("./config_files/" + item->text(2)).arg(item->text(0)),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
else {
QMessageBox::warning( this,
tr( "Warning" ),
- tr( QString("%1 is required for %2 %3 installation.\n"
- "Please, add this product in config.xml file.").arg(dependOn[ i ]).arg(item->text(0)).arg(item->text(1))),
+ tr( "%1 is required for %2 %3 installation.\n"
+ "Please, add this product in config.xml file.").arg(dependOn[ i ]).arg(item->text(0)).arg(item->text(1)),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
if ( system( script ) ) {
QMessageBox::warning( this,
tr( "Warning" ),
- tr( QString("You don't have native %1 %2 installed").arg(item->text(0)).arg(item->text(1)) ),
+ tr( "You don't have native %1 %2 installed").arg(item->text(0)).arg(item->text(1)),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
else {
QMessageBox::warning( this,
tr( "Warning" ),
- tr( QString("%The product %1 %2 required for installation.\n"
- "Please, add this product in config.xml file.").arg(item->text(0)).arg(item->text(1)) ),
+ tr( "%The product %1 %2 required for installation.\n"
+ "Please, add this product in config.xml file.").arg(item->text(0)).arg(item->text(1)),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
}
return InstallWizard::acceptData( pageTitle );
}
+// ================================================================
/*!
- Calculates disk space required for the installation
-*/
+ * SALOME_InstallWizard::checkSize
+ * Calculates disk space required for the installation
+ */
+// ================================================================
void SALOME_InstallWizard::checkSize( long* totSize, long* tempSize )
{
long tots = 0, temps = 0;
*tempSize = temps;
setNextEnabled( productsPage, (tots > 0) || (nativeProd > 0));
}
+// ================================================================
/*!
- Enabled/disables "Next" button for the directory page
-*/
+ * SALOME_InstallWizard::checkDirs
+ * Enabled/disables "Next" button for the directory page
+ */
+// ================================================================
void SALOME_InstallWizard::checkDirs()
{
// VSR: Temporary folder is used always now and it is not necessary to disable it -->
// enable/disable "Next" button
setNextEnabled( productsPage, !targetDir.isEmpty() );
}
+// ================================================================
/*!
- Sets the product and all products this one depends on to be checked ( recursively )
-*/
+ * SALOME_InstallWizard::setProductOn
+ * Sets the product and all products this one depends on to be checked ( recursively )
+ */
+// ================================================================
void SALOME_InstallWizard::setProductOn( QCheckListItem* item, int install )
{
if ( !productsMap.contains( item ) )
}
}
}
+// ================================================================
/*!
- Runs installation script
-*/
+ * SALOME_InstallWizard::launchScript
+ * Runs installation script
+ */
+// ================================================================
void SALOME_InstallWizard::launchScript()
{
// try to find product being processed now
showNormal();
raise();
}
+// ================================================================
/*!
- <More...> button slot
-*/
+ * SALOME_InstallWizard::onMoreBtn
+ * <More...> button slot
+ */
+// ================================================================
void SALOME_InstallWizard::onMoreBtn()
{
if ( moreMode ) {
qApp->processEvents();
}
}
+// ================================================================
/*!
- <Launch Salome> button slot
-*/
+ * SALOME_InstallWizard::onLaunchSalome
+ * <Launch Salome> button slot
+ */
+// ================================================================
void SALOME_InstallWizard::onLaunchSalome()
{
QCheckListItem* item = 0;
QMessageBox::NoButton,
QMessageBox::NoButton );
}
+// ================================================================
/*!
- Searches product listview item with given symbolic name
-*/
+ * SALOME_InstallWizard::findItem
+ * Searches product listview item with given symbolic name
+ */
+// ================================================================
QCheckListItem* SALOME_InstallWizard::findItem( const QString& sName )
{
MapProducts::Iterator mapIter;
}
return 0;
}
+// ================================================================
/*!
- Sets progress state to Aborted
-*/
+ * SALOME_InstallWizard::abort
+ * Sets progress state to Aborted
+ */
+// ================================================================
void SALOME_InstallWizard::abort()
{
QString prod = progressView->findStatus( Processing );
prod = progressView->findStatus( Waiting );
}
}
+// ================================================================
/*!
- Reject slot, clears temporary directory and closes application
-*/
+ * SALOME_InstallWizard::reject
+ * Reject slot, clears temporary directory and closes application
+ */
+// ================================================================
void SALOME_InstallWizard::reject()
{
#ifdef DEBUG
if ( !exitConfirmed ) {
if ( QMessageBox::information( this,
tr( "Exit" ),
- tr( "Do you want to quit Installation Wizard?" ),
+ tr( "Do you want to quit %1?" ).arg( getIWName() ),
tr( "Yes" ),
tr( "No" ),
QString::null,
clean();
InstallWizard::reject();
}
+// ================================================================
/*!
- Accept slot, clears temporary directory and closes application
-*/
+ * SALOME_InstallWizard::accept
+ * Accept slot, clears temporary directory and closes application
+ */
+// ================================================================
void SALOME_InstallWizard::accept()
{
#ifdef DEBUG
clean();
InstallWizard::accept();
}
+// ================================================================
/*!
- Clears and removes temporary directory
-*/
+ * SALOME_InstallWizard::clean
+ * Clears and removes temporary directory
+ */
+// ================================================================
void SALOME_InstallWizard::clean()
{
// VSR: first remove temporary files
#endif
}
}
+// ================================================================
/*!
- Called when user moves from page to page
-*/
+ * SALOME_InstallWizard::pageChanged
+ * Called when user moves from page to page
+ */
+// ================================================================
void SALOME_InstallWizard::pageChanged( const QString & mytitle)
{
nextButton()->setText( tr( "&Next >" ) );
QWidget* aPage = InstallWizard::page( mytitle );
if ( !aPage )
return;
- setCaption( tr( myCaption ) + tr( " - Step ") +
- QString::number( this->indexOf( aPage )+1 ) +
- " of " +
- QString::number( this->pageCount() ) );
+ updateCaption();
if ( aPage == productsPage ) {
// products page
checkSize();
cout << "previousPage = " << previousPage << endl;
#endif
}
+// ================================================================
/*!
- Shows help window
-*/
+ * SALOME_InstallWizard::helpClicked
+ * Shows help window
+ */
+// ================================================================
void SALOME_InstallWizard::helpClicked()
{
if ( helpWindow == NULL ) {
- helpWindow = HelpWindow::openHelp();
+ helpWindow = HelpWindow::openHelp( this );
if ( helpWindow ) {
helpWindow->show();
helpWindow->installEventFilter( this );
helpWindow->setActiveWindow();
}
}
+// ================================================================
/*!
- Shows directory selection dialog
-*/
+ * SALOME_InstallWizard::browseDirectory
+ * Shows directory selection dialog
+ */
+// ================================================================
void SALOME_InstallWizard::browseDirectory()
{
const QObject* theSender = sender();
}
checkDirs();
}
+// ================================================================
/*!
- Called when directory path (target or temp) is changed
-*/
+ * SALOME_InstallWizard::directoryChanged
+ * Called when directory path (target or temp) is changed
+ */
+// ================================================================
void SALOME_InstallWizard::directoryChanged( const QString& /*text*/ )
{
checkDirs();
}
+// ================================================================
/*!
- <Start> button's slot - runs installation
-*/
+ * SALOME_InstallWizard::onStart
+ * <Start> button's slot - runs installation
+ */
+// ================================================================
void SALOME_InstallWizard::onStart()
{
// clear list of products to install ...
launchScript();
}
}
+// ================================================================
/*!
- Called when users tries to pass parameters for the script
-*/
+ * SALOME_InstallWizard::onReturnPressed
+ * Called when users tries to pass parameters for the script
+ */
+// ================================================================
void SALOME_InstallWizard::onReturnPressed()
{
QString txt = passedParams->text();
backButton()->setEnabled( true );
}
}
+// ================================================================
/*!
- Slot, called when <Cancel> button is clicked during installation script running
-*/
+ * SALOME_InstallWizard::tryTerminate
+ * Slot, called when <Cancel> button is clicked during installation script running
+ */
+// ================================================================
void SALOME_InstallWizard::tryTerminate()
{
if ( shellProcess->isRunning() ) {
if ( QMessageBox::information( this,
tr( "Exit" ),
- tr( "Do you want to quit Installation Wizard?" ),
+ tr( "Do you want to quit %1?" ).arg( getIWName() ),
tr( "Yes" ),
tr( "No" ),
QString::null,
reject();
}
}
+// ================================================================
/*!
- Kills installation process and quits application
-*/
+ * SALOME_InstallWizard::onCancel
+ * Kills installation process and quits application
+ */
+// ================================================================
void SALOME_InstallWizard::onCancel()
{
shellProcess->kill();
reject();
}
+// ================================================================
/*!
- Called when selection is changed in the products list view
-*/
+ * SALOME_InstallWizard::onSelectionChanged
+ * Called when selection is changed in the products list view
+ */
+// ================================================================
void SALOME_InstallWizard::onSelectionChanged( QListViewItem* item )
{
productsInfo->clear();
text += "Prerequisites: " + req;
productsInfo->setText( text );
}
+// ================================================================
/*!
- Called when user checks/unchecks any product item
- Recursively sets all prerequisites and updates "Next" button state
-*/
+ * SALOME_InstallWizard::onItemToggled
+ * Called when user checks/unchecks any product item
+ * Recursively sets all prerequisites and updates "Next" button state
+ */
+// ================================================================
void SALOME_InstallWizard::onItemToggled( QCheckListItem* item )
{
if ( prerequisites->isChecked() ) {
}
checkSize();
}
+// ================================================================
/*!
- This slot is called when user clicks one of <Select Sources>,
- <Select Binaries>, <Unselect All> buttons ( products page )
-*/
+ * SALOME_InstallWizard::onProdBtn
+ * This slot is called when user clicks one of <Select Sources>,
+ * <Select Binaries>, <Unselect All> buttons ( products page )
+ */
+// ================================================================
void SALOME_InstallWizard::onProdBtn()
{
const QObject* snd = sender();
productsView->blockSignals( false );
checkSize();
}
+// ================================================================
/*!
- QProcess slot: -->something was written to stdin
-*/
+ * SALOME_InstallWizard::wroteToStdin
+ * QProcess slot: -->something was written to stdin
+ */
+// ================================================================
void SALOME_InstallWizard::wroteToStdin( )
{
#ifdef DEBUG
cout << "Something was sent to stdin" << endl;
#endif
}
+// ================================================================
/*!
- QProcess slot: -->something was written to stdout
-*/
+ * SALOME_InstallWizard::readFromStdout
+ * QProcess slot: -->something was written to stdout
+ */
+// ================================================================
void SALOME_InstallWizard::readFromStdout( )
{
#ifdef DEBUG
installInfo->scrollToBottom();
}
}
+// ================================================================
/*!
- QProcess slot: -->something was written to stderr
-*/
+ * SALOME_InstallWizard::readFromStderr
+ * QProcess slot: -->something was written to stderr
+ */
+// ================================================================
void SALOME_InstallWizard::readFromStderr( )
{
#ifdef DEBUG
passedParams->setFocus();
QFont f = parametersLab->font(); f.setBold( true ); parametersLab->setFont( f );
}
+// ================================================================
/*!
- Sets dependancies for the product item
-*/
+ * SALOME_InstallWizard::setDependancies
+ * Sets dependancies for the product item
+ */
+// ================================================================
void SALOME_InstallWizard::setDependancies( QCheckListItem* item, Dependancies dep)
{
productsMap[item] = dep;
}
+// ================================================================
/*!
- Polishing of the widget - to set right initial size
-*/
+ * SALOME_InstallWizard::polish
+ * Polishing of the widget - to set right initial size
+ */
+// ================================================================
void SALOME_InstallWizard::polish()
{
resize( 0, 0 );
InstallWizard::polish();
}
-
-// ###################################### Structure Parser ###########################################
-
-/*!
- Constructor
-*/
-StructureParser::StructureParser()
- : QXmlDefaultHandler()
-{
- wizard = NULL;
- tree = NULL;
-}
-/*!
- Sets install wizard's main window
-*/
-void StructureParser::setWizard( SALOME_InstallWizard* awizard )
-{
- wizard = awizard;
-}
+// ================================================================
/*!
- Sets products list view
-*/
-void StructureParser::setListView( MyListView * t )
-{
- tree = t;
-}
-/*!
- Sets temp directory widget
-*/
-void StructureParser::setTempDir( QLineEdit * dir )
-{
- tempdir = dir;
-}
-/*!
- Sets target directory widget
-*/
-void StructureParser::setTargetDir( QLineEdit * dir )
-{
- targetdir = dir;
-}
-/*!
- Begins parsing of the xml dom-element
-*/
-bool StructureParser::startElement( const QString& ,
- const QString& ,
- const QString& qName,
- const QXmlAttributes& attributes)
-{
-#ifdef DEBUG
- cout << qName << endl;
- cout << attributes.length() << endl;
-#endif
- QCheckListItem * element;
- if (( qName == "config" ) && ( attributes.length() > 0 ) ) {
- if ( attributes.value( "version" ) )
- myVersion = attributes.value( "version" ).stripWhiteSpace();
- if ( attributes.value( "caption" ) && !myCaption.isEmpty() )
- myCaption = QString(attributes.value( "caption" )).arg(myVersion).stripWhiteSpace();
- if ( attributes.value( "copyright" ) )
- myCopyright = attributes.value( "copyright" ).stripWhiteSpace();
- if ( attributes.value( "license" ) )
- myLicense = attributes.value( "license" ).stripWhiteSpace();
- if ( attributes.value( "os" ) )
- myOS = attributes.value( "os" ).stripWhiteSpace();
-
-#ifdef DEBUG
- cout << myCaption << endl;
- cout << myVersion << endl;
- cout << myCopyright << endl;
- cout << myLicense << endl;
-#endif
- } else if (( qName == "product" ) && ( attributes.length() > 0 ) && tree && wizard ) {
- if (attributes.value("disable") == "true" )
- return true;
-
- QString install = attributes.value( "install" );
- QStringList supported = QStringList::split(",", attributes.value("supported") );
- QString script = attributes.value( "script" );
- element = tree->addItem( attributes.value("name"), attributes.value("version"), install, supported, script );
- if ( attributes.value("dependancies") == "" ) {
- QStringList diskspace = QStringList::split(",",attributes.value("installdiskspace"));
- if (diskspace.count() == 2)
- wizard->setDependancies( element,
- Dependancies( attributes.value("name"), QStringList(),
- diskspace[0].toInt(),
- diskspace[1].toInt(),
- attributes.value("temporarydiskspace").toInt()) );
- else
- wizard->setDependancies( element,
- Dependancies( attributes.value("name"), QStringList(),
- diskspace[0].toInt(),
- diskspace[0].toInt(),
- attributes.value("temporarydiskspace").toInt()) );
-
- } else {
- QStringList diskspace = QStringList::split(",",attributes.value("installdiskspace"));
- if (diskspace.count() == 2)
- wizard->setDependancies( element,
- Dependancies( attributes.value("name"),
- QStringList::split(",", attributes.value("dependancies") ),
- diskspace[0].toInt(),
- diskspace[1].toInt(),
- attributes.value("temporarydiskspace").toInt()) );
- else
- wizard->setDependancies( element,
- Dependancies( attributes.value("name"),
- QStringList::split(",", attributes.value("dependancies") ),
- diskspace[0].toInt(),
- diskspace[0].toInt(),
- attributes.value("temporarydiskspace").toInt()) );
- }
- } else if (( qName == "path" ) && ( attributes.length() > 0 ) && wizard ) {
- targetdir->setText( attributes.value("targetdir") );
-
- if ( attributes.value("tempdir") == "" )
- tempdir->setText( "/tmp" );
- else
- tempdir->setText( attributes.value("tempdir") );
- }
- return true;
-}
-/*!
- Finishes parsing of the xml dom-element
-*/
-bool StructureParser::endElement( const QString&, const QString&,
- const QString& )
+ * SALOME_InstallWizard::updateCaption
+ * Updates caption according to the current page number
+ */
+// ================================================================
+void SALOME_InstallWizard::updateCaption()
{
- return true;
-}
-
-// ###################################### Main ###########################################
-
-/*!
- Program starts here
-*/
-int main( int argc, char **argv )
-{
- QApplication a( argc, argv );
- QString xmlFileName( argc == 2 ? argv[1] : "config.xml" );
-
- int result = -1;
- QFile xmlfile(xmlFileName);
- if ( xmlfile.exists() ) {
- SALOME_InstallWizard wizard(xmlFileName);
- a.setMainWidget( &wizard );
- wizard.show();
- result = a.exec();
- }
- else {
- QMessageBox::critical( 0,
- QObject::tr( "Error" ),
- QObject::tr( "Can't open config file:\n%1\n\nQuitting...").arg( xmlFileName ),
- QMessageBox::Ok,
- QMessageBox::NoButton,
- QMessageBox::NoButton );
- }
- return result;
+ QWidget* aPage = InstallWizard::currentPage();
+ if ( !aPage )
+ return;
+ InstallWizard::setCaption( tr( myCaption ) + " " +
+ tr( getIWName() ) + " - " +
+ tr( "Step %1 of %2").arg( QString::number( this->indexOf( aPage )+1 ) ).arg( QString::number( this->pageCount() ) ) );
}
-
-// File : SALOME_InstallWizard.h
+// File : SALOME_InstallWizard.hxx
// Created : Thu Dec 18 12:01:00 2002
// Author : Vadim SANDLER
-// Project : SALOME Professional
+// Project : PAL/SALOME
// Module : InstallWizard
-// Copyright : 2003 CEA/DEN, EDF R&D
+// Copyright : 2004 CEA
// $Header$
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qwidget.h>
-#include <qlistview.h>
-#include <qlabel.h>
-#include <qtextedit.h>
-#include <qprocess.h>
-#include <qlineedit.h>
-#include <qcheckbox.h>
-#include <qheader.h>
-#include <qsplitter.h>
+#ifndef __SALOME_InstallWizard
+#define __SALOME_InstallWizard
+
+#include "InstallWizard.h"
#include <qmap.h>
#include <qstringlist.h>
-#include <qxml.h>
-
-#include "InstallWizard.h"
-#include "helpwindow.h"
/*!
Class Dependancies : Products info
long sizeBinaryTotal; // disk space required
long sizeTemp; // disk space for temporary files required
};
-typedef QMap<QCheckListItem*, Dependancies> MapProducts;
-class MyListView;
+class QLineEdit;
+class QPushButton;
+class QListViewItem;
+class QCheckListItem;
+class QLabel;
+class QTextEdit;
+class QTextBrowser;
+class QProcess;
+class QCheckBox;
+class QSplitter;
+
+class ProductsView;
class ProgressView;
+class HelpWindow;
+
+typedef QMap<QCheckListItem*, Dependancies> MapProducts;
+
/*!
Class SALOME_InstallWizard : Installation Wizard's main window
*/
public slots:
// polishing of the widget
void polish();
+
+ // set version
+ void setVersion( const QString& version ) { myVersion = version; }
+ // set caption
+ void setCaption( const QString& caption ) { myCaption = caption; updateCaption(); }
+ // set copyright
+ void setCopyright( const QString& copyright ) { myCopyright = copyright; }
+ // set license
+ void setLicense( const QString& license ) { myLicense = license; }
+ // set OS
+ void setOS( const QString& OS ) { myOS = OS; }
+
+ // get version
+ QString getVersion() { return myVersion; }
+ // get caption
+ QString getCaption() { return myCaption; }
+ // get copyright
+ QString getCopyright() { return myCopyright; }
+ // get license
+ QString getLicense() { return myLicense; }
+ // get OS
+ QString getOS() { return myOS; }
+ // get InstallWizard's name
+ QString getIWName() { return myIWName; }
protected:
+ // updates caption according to the current page number
+ void updateCaption();
// close event handler
void closeEvent( QCloseEvent* ce );
// creates introduction page
void readFromStderr();
private:
+ QString myIWName; // Installation Wizard's name
+ QString myVersion; // version info
+ QString myCaption; // application name
+ QString myCopyright; // copyright info
+ QString myLicense; // license info
+ QString myOS; // operation system
+
HelpWindow* helpWindow; // help window
QProcess* shellProcess; // shell process (install script)
MapProducts productsMap; // products info (name, dependancies, disk space )
// Widgets
// --> introduction page
QWidget* introPage; // page itself
- QLabel* logoLab; // SALOME PRO logo
+ QLabel* logoLab; // logo pixmap
QLabel* versionLab; // vesrsion info
QLabel* copyrightLab; // copyright info
QLabel* licenseLab; // license info
QLabel* requiredTemp; // <Space required for temporary files> label
QPushButton* moreBtn; // <More...> button
QWidget* moreBox; // container for the <More...> mode widgets
- MyListView* productsView; // products list view
+ ProductsView* productsView; // products list view
QTextBrowser* productsInfo; // products info box
QCheckBox* prerequisites; // <Auto check prerequisites products> checkbox
QPushButton* selectSrcBtn; // <Select Sources> button - NOT USED CURRENTLY
QPushButton* runSalomeBtn; // <Launch Salome> buttnon
};
-/*!
- Class MyListView : Products list view
-*/
-class MyListView : public QListView
-{
- Q_OBJECT
-
- // Class MyListViewItem: to define custom products list view item
- class MyListViewItem : public QCheckListItem
- {
- public:
- // constructor
- MyListViewItem( MyListView* parent, const QString& text, Type tt ) : QCheckListItem( parent, text, tt ) {}
- // other constructor
- MyListViewItem( QCheckListItem* parent, const QString& text, Type tt ) : QCheckListItem( parent, text, tt ) {}
- protected:
- // called when users switches item on/off
- void stateChange( bool on ) {
- QCheckListItem::stateChange( on );
- ((MyListView*)listView())->itemActivated( (QCheckListItem*)this );
- }
- };
-
-public:
- // constructor
- MyListView( QWidget* parent ) : QListView( parent )
- {
- setRootIsDecorated( false );
- addColumn( "Products" );
- addColumn( "Version" );
- setResizeMode( LastColumn );
- setSorting( -1, false );
- }
- // adds product item(s) into the list
- QCheckListItem* addItem( const QString& name,
- const QString& version,
- const QString& install,
- const QStringList& supported,
- const QString& script )
- {
- QCheckListItem* item = 0;
- QListViewItem* lItem = this->firstChild();
- while( lItem && lItem->nextSibling() )
- lItem = lItem->nextSibling();
-
- if ( install.isNull() || install.isEmpty() ) {
- item = new MyListViewItem( this, name, QCheckListItem::CheckBox );
- item->setText( 1, version );
- item->setText( 2, script );
- item->moveItem( lItem );
- } else {
- item = new MyListViewItem( this, name, QCheckListItem::Controller );
- item->setText( 1, version );
- item->setText( 2, script );
-
- QCheckListItem* subitem = 0;
- subitem = new MyListViewItem( item, tr( "not install" ), QCheckListItem::RadioButton );
- subitem->setOn( true );
- QCheckListItem* previtem = subitem;
- subitem->moveItem( previtem );
- for ( int i = 0; i < (int)supported.count(); i++ ) {
- subitem = new MyListViewItem( item, supported[ i ], QCheckListItem::RadioButton );
- if ( supported[i] == install )
- subitem->setOn( true );
- subitem->moveItem( previtem );
- previtem = subitem;
- }
- item->moveItem( lItem );
- item->setOpen( true );
- }
- return item;
- }
- // event filter - prevents collapsing/expanding of items
- bool eventFilter( QObject* o, QEvent* e )
- {
- if ( o == viewport() && e->type() == QEvent::MouseButtonDblClick )
- return true;
- return QListView::eventFilter(o, e);
- }
- // emits signal when checkbox or radiobutton is switched
- void itemActivated( QCheckListItem* item ) {
- emit itemToggled( item );
- }
- // returns true if "install binaries" is on for the item
- bool isBinaries( QCheckListItem* item )
- {
- if ( item->childCount() > 0 ) {
- // not SALOME sources, binaries or docs
- QCheckListItem* subItem = (QCheckListItem*)(item->firstChild());
- while( subItem ) {
- if ( subItem->isOn() )
- return subItem->text() == tr( "install binaries" );
- subItem = (QCheckListItem*)(subItem->nextSibling());
- }
- }
- // for SALOME sources, binaries and docs return false
- return false;
- }
- // returns true if "install sources" is on for the item
- bool isSources( QCheckListItem* item )
- {
- if ( item->childCount() > 0 ) {
- // not SALOME sources, binaries or docs item
- QCheckListItem* subItem = (QCheckListItem*)(item->firstChild());
- while( subItem ) {
- if ( subItem->isOn() )
- return subItem->text() == tr( "install sources" );
- subItem = (QCheckListItem*)(subItem->nextSibling());
- }
- }
- else {
- // for SALOME sources, binaries or docs item return true if checked
- return item->isOn();
- }
- return false;
- }
- // returns true if "use native" is on for the item
- bool isNative( QCheckListItem* item )
- {
- if ( item->childCount() > 0 ) {
- // not SALOME sources, binaries or docs item
- QCheckListItem* subItem = (QCheckListItem*)(item->firstChild());
- while( subItem ) {
- if ( subItem->isOn() )
- return subItem->text() == tr( "use native" );
- subItem = (QCheckListItem*)(subItem->nextSibling());
- }
- }
- return false;
- }
- // returns true if "not install" is on for the item
- bool isNone( QCheckListItem* item )
- {
- return !isBinaries( item ) && !isSources( item ) && !isNative( item );
- }
- // sets "install binaries" on for the item; if "binaries" item is absent, set "install sources" on if it is present
- void setBinaries( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- // not SALOME sources, binaries or docs item
- QCheckListItem* subItem = (QCheckListItem*)(item->firstChild());
- QCheckListItem* srcItem = 0;
- QCheckListItem* nativeItem = 0;
- while( subItem ) {
- if ( subItem->text() == tr( "install sources" ) )
- srcItem = subItem;
- if ( subItem->text() == tr( "use native" ) )
- nativeItem = subItem;
- if ( subItem->text() == tr( "install binaries" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)(subItem->nextSibling());
- }
- if ( srcItem )
- srcItem->setOn( true );
- if ( nativeItem )
- nativeItem->setOn( true );
- }
- else {
- // for SALOME sources, binaries and docs items set true
- item->setOn( true );
- }
- }
- // sets "install sources" on for the item; if "sources" item is absent, set "install binaries" on if it is present
- void setSources( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- // not SALOME sources, binaries or docs item
- QCheckListItem* subItem = (QCheckListItem*)(item->firstChild());
- QCheckListItem* binItem = 0;
- while( subItem ) {
- if ( subItem->text() == tr( "install binaries" ) )
- binItem = binItem;
- if ( subItem->text() == tr( "install sources" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)(subItem->nextSibling());
- }
- if ( binItem )
- binItem->setOn( true );
- }
- else {
- // for SALOME sources, binaries and docs items set true
- item->setOn( true );
- }
- }
- // sets "use native" on for the item; if "sources" item is absent, set "install binaries" on if it is present
- void setNative( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- // not SALOME sources, binaries or docs item
- QCheckListItem* subItem = (QCheckListItem*)(item->firstChild());
- QCheckListItem* binItem = 0;
- while( subItem ) {
- if ( subItem->text() == tr( "install binaries" ) )
- binItem = binItem;
- if ( subItem->text() == tr( "use native" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)(subItem->nextSibling());
- }
- if ( binItem )
- binItem->setOn( true );
- }
- else {
- // for SALOME sources, binaries and docs items set true
- item->setOn( true );
- }
- }
- // sets "not install" on for the item
- void setNone( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- // not SALOME sources, binaries or docs item
- QCheckListItem* subItem = (QCheckListItem*)(item->firstChild());
- while( subItem ) {
- if ( subItem->text() == tr( "not install" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)(subItem->nextSibling());
- }
- }
- else {
- // for SALOME sources, binaries and docs items set false
- item->setOn( false );
- }
- }
-signals:
- // emitted when checkbox or radiobutton is switched
- void itemToggled( QCheckListItem* item );
-};
-
-/*!
- Class ProgressViewItem: Progress list view item
-*/
-enum Status { Waiting, Processing, Completed, Aborted };
-class ProgressView;
-class ProgressViewItem : public QListViewItem
-{
-public:
- // constructor
- ProgressViewItem( ProgressView* parent,
- QString productName,
- const QString installType,
- const QString scriptName,
- Status status = Waiting );
-
- // sets product status
- void setStatus( Status status );
- // gets product status
- Status getStatus() const { return myStatus; }
- // gets product name
- QString getProduct() const { return text( 0 ); }
- // gets product script
- QString getScript() const { return myScript; }
- // gets type of the installation: 'binaries', 'source', 'native' or 'not install'
- QString getInstallType() const { return text( 1 ); }
-
-protected:
- // paints cell of the item
- void paintCell( QPainter* painter, const QColorGroup& cg, int column, int width, int align );
-
-private:
- Status myStatus; // status
- QString myScript; // alias
-};
-
-/*!
- Class ProgressView: Progress list view
-*/
-class ProgressView : public QListView
-{
-public:
- // constructor
- ProgressView( QWidget* parent );
-
- // sets/gets status colors
- void setColors( QColor wColor, QColor pColor, QColor cColor );
- QColor getWaitingColor() { return myWaitingColor; }
- QColor getProcessingColor() { return myProcessingColor; }
- QColor getCompletedColor() { return myCompletedColor; }
-
- // adds product item
- void addProduct( const QString smbName, const QString type, const QString product );
- // finds the first item with given status
- QString findStatus( Status status );
- // sets new status for the product item
- void setStatus( const QString product, Status status );
- // scrolls the view to make item visible if necessary
- void ensureVisible( const QString product );
- // gets the product script
- QString getScript( const QString product );
-
-protected:
- // finds the item by the product name
- ProgressViewItem* findItem( const QString product );
-
-private:
- QColor myWaitingColor; // 'Waiting' color
- QColor myProcessingColor; // 'Processing' color
- QColor myCompletedColor; // 'Completed' color
-};
-
-/*!
- Class StructureParser: parses xml-description file and populates the list of the products
-*/
-class StructureParser: public QXmlDefaultHandler
-{
-public:
- // constructor
- StructureParser();
- // begins parsing of the xml dom-element
- bool startElement( const QString&, const QString&, const QString& ,
- const QXmlAttributes& );
- // finishes parsing of the xml dom-element of the xml dom-element
- bool endElement( const QString&, const QString&, const QString& );
- // set control widgets
- void setListView ( MyListView* view );
- void setWizard ( SALOME_InstallWizard* wiz );
- void setTargetDir( QLineEdit* dir );
- void setTempDir ( QLineEdit* dir );
-
-private:
- MyListView* tree; // products list view
- SALOME_InstallWizard* wizard; // Salome Pro installation wizard's main window
- QLineEdit* targetdir; // target directory widget
- QLineEdit* tempdir; // temp directory widget
-};
+#endif
--- /dev/null
+// File : SALOME_ProductsView.cxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#include "SALOME_ProductsView.hxx"
+#include <qstringlist.h>
+
+// ================================================================
+/*!
+ * ProductsViewItem::ProductsViewItem
+ * Constructor
+ */
+// ================================================================
+ProductsViewItem::ProductsViewItem( ProductsView* parent, const QString& text, Type tt )
+ : QCheckListItem( parent, text, tt )
+{
+}
+// ================================================================
+/*!
+ * ProductsViewItem::ProductsViewItem
+ * Constructor
+ */
+// ================================================================
+ProductsViewItem::ProductsViewItem( QCheckListItem* parent, const QString& text, Type tt )
+ : QCheckListItem( parent, text, tt )
+{
+}
+// ================================================================
+/*!
+ * ProductsViewItem::stateChange
+ * Called when users switches item on/off
+ */
+// ================================================================
+void ProductsViewItem::stateChange( bool on ) {
+ QCheckListItem::stateChange( on );
+ ((ProductsView*)listView())->itemActivated( (QCheckListItem*)this );
+}
+
+
+// ================================================================
+/*!
+ * ProductsView::ProductsView
+ * Constructor
+ */
+// ================================================================
+ProductsView::ProductsView( QWidget* parent ) : QListView( parent )
+{
+ setRootIsDecorated( false );
+ addColumn( tr( "Product" ) );
+ addColumn( tr( "Version" ) );
+ setResizeMode( LastColumn );
+ setSorting( -1, false );
+}
+// ================================================================
+/*!
+ * ProductsView::addItem
+ * Adds product item(s) into the list
+ */
+// ================================================================
+QCheckListItem* ProductsView::addItem( const QString& name,
+ const QString& version,
+ const QString& install,
+ const QStringList& supported,
+ const QString& script )
+{
+ QCheckListItem* item = 0;
+ QListViewItem* lItem = this->firstChild();
+ while( lItem && lItem->nextSibling() )
+ lItem = lItem->nextSibling();
+
+ if ( install.isNull() || install.isEmpty() ) {
+ item = new ProductsViewItem( this, name, QCheckListItem::CheckBox );
+ item->setText( 1, version );
+ item->setText( 2, script );
+ item->moveItem( lItem );
+ }
+ else {
+ item = new ProductsViewItem( this, name, QCheckListItem::Controller );
+ item->setText( 1, version );
+ item->setText( 2, script );
+
+ QCheckListItem* subitem = 0;
+ subitem = new ProductsViewItem( item, tr( "not install" ), QCheckListItem::RadioButton );
+ subitem->setOn( true );
+ QCheckListItem* previtem = subitem;
+ subitem->moveItem( previtem );
+ for ( int i = 0; i < (int)supported.count(); i++ ) {
+ subitem = new ProductsViewItem( item, supported[ i ], QCheckListItem::RadioButton );
+ if ( supported[i] == install )
+ subitem->setOn( true );
+ subitem->moveItem( previtem );
+ previtem = subitem;
+ }
+ item->moveItem( lItem );
+ item->setOpen( true );
+ }
+ return item;
+}
+// ================================================================
+/*!
+ * ProductsView::eventFilter
+ * Event filter - prevents collapsing/expanding of items
+ */
+// ================================================================
+bool ProductsView::eventFilter( QObject* o, QEvent* e )
+{
+ if ( o == viewport() && e->type() == QEvent::MouseButtonDblClick )
+ return true;
+ return QListView::eventFilter( o, e );
+}
+// ================================================================
+/*!
+ * ProductsView::itemActivated
+ * Emits signal when checkbox or radiobutton is switched
+ */
+// ================================================================
+void ProductsView::itemActivated( QCheckListItem* item ) {
+ emit itemToggled( item );
+}
+// ================================================================
+/*!
+ * ProductsView::isBinaries
+ * Returns true if "install binaries" is on for the item
+ */
+// ================================================================
+bool ProductsView::isBinaries( QCheckListItem* item )
+{
+ if ( item->childCount() > 0 ) {
+ // not SALOME sources, binaries or docs
+ QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
+ while( subItem ) {
+ if ( subItem->isOn() )
+ return subItem->text() == tr( "install binaries" );
+ subItem = (QCheckListItem*)( subItem->nextSibling() );
+ }
+ }
+ // for SALOME sources, binaries and docs return false
+ return false;
+}
+// ================================================================
+/*!
+ * ProductsView::isSources
+ * Returns true if "install sources" is on for the item
+ */
+// ================================================================
+bool ProductsView::isSources( QCheckListItem* item )
+{
+ if ( item->childCount() > 0 ) {
+ // not SALOME sources, binaries or docs item
+ QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
+ while( subItem ) {
+ if ( subItem->isOn() )
+ return subItem->text() == tr( "install sources" );
+ subItem = (QCheckListItem*)( subItem->nextSibling() );
+ }
+ }
+ else {
+ // for SALOME sources, binaries or docs item return true if checked
+ return item->isOn();
+ }
+ return false;
+}
+// ================================================================
+/*!
+ * ProductsView::isNative
+ * Returns true if "use native" is on for the item
+ */
+// ================================================================
+bool ProductsView::isNative( QCheckListItem* item )
+{
+ if ( item->childCount() > 0 ) {
+ // not SALOME sources, binaries or docs item
+ QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
+ while( subItem ) {
+ if ( subItem->isOn() )
+ return subItem->text() == tr( "use native" );
+ subItem = (QCheckListItem*)( subItem->nextSibling() );
+ }
+ }
+ return false;
+}
+// ================================================================
+/*!
+ * ProductsView::isNone
+ * Returns true if "not install" is on for the item
+ */
+// ================================================================
+bool ProductsView::isNone( QCheckListItem* item )
+{
+ return !isBinaries( item ) && !isSources( item ) && !isNative( item );
+}
+// ================================================================
+/*!
+ * ProductsView::setBinaries
+ * Sets "install binaries" on for the item; if "binaries" item
+ * is absent, set "install sources" on if it is present
+ */
+// ================================================================
+void ProductsView::setBinaries( QCheckListItem* item ) {
+ if ( item->childCount() > 0 ) {
+ // not SALOME sources, binaries or docs item
+ QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
+ QCheckListItem* srcItem = 0;
+ QCheckListItem* nativeItem = 0;
+ while( subItem ) {
+ if ( subItem->text() == tr( "install sources" ) )
+ srcItem = subItem;
+ if ( subItem->text() == tr( "use native" ) )
+ nativeItem = subItem;
+ if ( subItem->text() == tr( "install binaries" ) ) {
+ subItem->setOn( true );
+ return;
+ }
+ subItem = (QCheckListItem*)( subItem->nextSibling() );
+ }
+ if ( srcItem )
+ srcItem->setOn( true );
+ if ( nativeItem )
+ nativeItem->setOn( true );
+ }
+ else {
+ // for SALOME sources, binaries and docs items set true
+ item->setOn( true );
+ }
+}
+// ================================================================
+/*!
+ * ProductsView::setSources
+ * Sets "install sources" on for the item; if "sources" item
+ * is absent, set "install binaries" on if it is present
+ */
+// ================================================================
+void ProductsView::setSources( QCheckListItem* item ) {
+ if ( item->childCount() > 0 ) {
+ // not SALOME sources, binaries or docs item
+ QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
+ QCheckListItem* binItem = 0;
+ while( subItem ) {
+ if ( subItem->text() == tr( "install binaries" ) )
+ binItem = binItem;
+ if ( subItem->text() == tr( "install sources" ) ) {
+ subItem->setOn( true );
+ return;
+ }
+ subItem = (QCheckListItem*)( subItem->nextSibling() );
+ }
+ if ( binItem )
+ binItem->setOn( true );
+ }
+ else {
+ // for SALOME sources, binaries and docs items set true
+ item->setOn( true );
+ }
+}
+// ================================================================
+/*!
+ * ProductsView::setNative
+ * Sets "use native" on for the item; if "sources" item
+ * is absent, set "install binaries" on if it is present
+ */
+// ================================================================
+void ProductsView::setNative( QCheckListItem* item ) {
+ if ( item->childCount() > 0 ) {
+ // not SALOME sources, binaries or docs item
+ QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
+ QCheckListItem* binItem = 0;
+ while( subItem ) {
+ if ( subItem->text() == tr( "install binaries" ) )
+ binItem = binItem;
+ if ( subItem->text() == tr( "use native" ) ) {
+ subItem->setOn( true );
+ return;
+ }
+ subItem = (QCheckListItem*)( subItem->nextSibling() );
+ }
+ if ( binItem )
+ binItem->setOn( true );
+ }
+ else {
+ // for SALOME sources, binaries and docs items set true
+ item->setOn( true );
+ }
+}
+// ================================================================
+/*!
+ * ProductsView::setNone
+ * Sets "not install" on for the item
+ */
+// ================================================================
+void ProductsView::setNone( QCheckListItem* item ) {
+ if ( item->childCount() > 0 ) {
+ // not SALOME sources, binaries or docs item
+ QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
+ while( subItem ) {
+ if ( subItem->text() == tr( "not install" ) ) {
+ subItem->setOn( true );
+ return;
+ }
+ subItem = (QCheckListItem*)( subItem->nextSibling() );
+ }
+ }
+ else {
+ // for SALOME sources, binaries and docs items set false
+ item->setOn( false );
+ }
+}
--- /dev/null
+// File : SALOME_ProductsView.hxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#ifndef __SALOME_ProductsView
+#define __SALOME_ProductsView
+
+#include <qlistview.h>
+
+/*!
+ Class ProductsViewItem: to define custom products list view item
+*/
+class ProductsView;
+class ProductsViewItem : public QCheckListItem
+{
+ public:
+ // constructor
+ ProductsViewItem( ProductsView* parent, const QString& text, Type tt );
+ // other constructor
+ ProductsViewItem( QCheckListItem* parent, const QString& text, Type tt );
+
+ protected:
+ // called when users switches item on/off
+ void stateChange( bool on );
+};
+
+/*!
+ Class ProductsView : Products list view
+*/
+class ProductsView : public QListView
+{
+ Q_OBJECT
+
+public:
+ // constructor
+ ProductsView( QWidget* parent );
+
+ // event filter - prevents collapsing/expanding of items
+ bool eventFilter( QObject* o, QEvent* e );
+
+ // adds product item(s) into the list
+ QCheckListItem* addItem( const QString& name,
+ const QString& version,
+ const QString& install,
+ const QStringList& supported,
+ const QString& script );
+
+ // emits signal when checkbox or radiobutton is switched
+ void itemActivated( QCheckListItem* item );
+
+ // returns true if "install binaries" is on for the item
+ bool isBinaries( QCheckListItem* item );
+ // returns true if "install sources" is on for the item
+ bool isSources( QCheckListItem* item );
+ // returns true if "use native" is on for the item
+ bool isNative( QCheckListItem* item );
+ // returns true if "not install" is on for the item
+ bool isNone( QCheckListItem* item );
+
+ // sets "install binaries" on for the item; if "binaries" item is absent, set "install sources" on if it is present
+ void setBinaries( QCheckListItem* item );
+ // sets "install sources" on for the item; if "sources" item is absent, set "install binaries" on if it is present
+ void setSources( QCheckListItem* item );
+ // sets "use native" on for the item; if "sources" item is absent, set "install binaries" on if it is present
+ void setNative( QCheckListItem* item );
+ // sets "not install" on for the item
+ void setNone( QCheckListItem* item );
+
+signals:
+ // emitted when checkbox or radiobutton is switched
+ void itemToggled( QCheckListItem* item );
+};
+
+#endif
--- /dev/null
+// File : SALOME_ProgressView.cxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#include "SALOME_ProgressView.hxx"
+
+#include <qheader.h>
+
+// ================================================================
+/*!
+ * ProgressViewItem::ProgressViewItem
+ * Constructor
+ * <parent> - parent progress view
+ * <productName> - full name of the product
+ * <smbName> - alias for he product used by the script
+ * <status> - initial status of the product, default is 'Waiting'
+*/
+// ================================================================
+ProgressViewItem::ProgressViewItem( ProgressView* parent,
+ QString productName,
+ const QString installType,
+ const QString scriptName,
+ Status status )
+ : QListViewItem( parent, productName, installType ), myScript( scriptName )
+{
+ setStatus( status );
+}
+// ================================================================
+/*!
+ * ProgressViewItem::setStatus
+ * Sets new status for the item
+ */
+// ================================================================
+void ProgressViewItem::setStatus( Status status )
+{
+ myStatus = status;
+ switch ( myStatus ) {
+ case Waiting:
+ setText( 2, ProgressView::tr( "Waiting" ) ); break;
+ case Processing:
+ setText( 2, ProgressView::tr( "Processing" ) ); break;
+ case Completed:
+ setText( 2, ProgressView::tr( "Completed" ) ); break;
+ case Aborted:
+ setText( 2, ProgressView::tr( "Aborted" ) ); break;
+ default:
+ break;
+ }
+ repaint();
+}
+// ================================================================
+/*!
+ * ProgressViewItem::paintCell
+ * Paints the cell of the list view item
+ */
+// ================================================================
+void ProgressViewItem::paintCell( QPainter* painter,
+ const QColorGroup& cg,
+ int column,
+ int width,
+ int align )
+{
+ QColorGroup acg( cg );
+ if ( column == 2 ) {
+ switch ( myStatus ) {
+ case Waiting:
+ acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getWaitingColor() ); break;
+ case Processing:
+ acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getProcessingColor() ); break;
+ case Completed:
+ acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getCompletedColor() ); break;
+ case Aborted:
+ acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getWaitingColor() ); break;
+ default:
+ break;
+ }
+ }
+ QListViewItem::paintCell( painter, acg, column, width, align );
+}
+
+
+// ================================================================
+/*!
+ * ProgressView::ProgressView
+ * Constructor
+ */
+// ================================================================
+ProgressView::ProgressView( QWidget* parent ) : QListView( parent )
+{
+ addColumn( tr( "Product" ) ); addColumn( tr( "Type" ) ); addColumn( tr( "Status" ) );
+ header()->hide();
+ setSelectionMode( QListView::NoSelection );
+ setSorting( -1 );
+ setResizeMode( QListView::AllColumns );
+ setFocusPolicy( QWidget::NoFocus );
+ setColors( QColor( "red" ), QColor( "orange" ), QColor( "green" ) );
+}
+// ================================================================
+/*!
+ * ProgressView::setColors
+ * Sets status colors
+ */
+// ================================================================
+void ProgressView::setColors( QColor wColor, QColor pColor, QColor cColor ) {
+ myWaitingColor = wColor;
+ myProcessingColor = pColor;
+ myCompletedColor = cColor;
+ repaint();
+}
+// ================================================================
+/*!
+ * ProgressView::addProduct
+ * Adds product item
+ */
+// ================================================================
+void ProgressView::addProduct( const QString product, const QString type, const QString script ) {
+ QListViewItem* lastItem = this->lastItem();
+ ProgressViewItem* newItem = new ProgressViewItem( this, product, type, script );
+ if ( lastItem )
+ newItem->moveItem( lastItem );
+}
+// ================================================================
+/*!
+ * ProgressView::findStatus
+ * Finds the first item with given status
+ */
+// ================================================================
+QString ProgressView::findStatus( Status status ) {
+ ProgressViewItem* item = ( ProgressViewItem* )firstChild();
+ while( item ) {
+ if ( item->getStatus() == status )
+ return item->getProduct();
+ item = ( ProgressViewItem* )( item->nextSibling() );
+ }
+ return QString::null;
+}
+// ================================================================
+/*!
+ * ProgressView::findStatus
+ * Sets new status for the product item
+ */
+// ================================================================
+void ProgressView::setStatus( const QString product, Status status ) {
+ ProgressViewItem* item = findItem( product );
+ if ( item ) {
+ item->setStatus( status );
+ repaint();
+ }
+}
+/*!
+ Scrolls the view to make item visible if necessary
+*/
+void ProgressView::ensureVisible( const QString product ) {
+ ProgressViewItem* item = findItem( product );
+ if ( item ) {
+ ensureItemVisible( item );
+ }
+}
+/*!
+ Finds the item by the product name
+*/
+ProgressViewItem* ProgressView::findItem( const QString product ) {
+ ProgressViewItem* item = ( ProgressViewItem* )firstChild();
+ while( item ) {
+ if ( item->getProduct() == product )
+ return item;
+ item = ( ProgressViewItem* )( item->nextSibling() );
+ }
+ return 0;
+}
+/*!
+ Gets the product script
+*/
+QString ProgressView::getScript( const QString product ) {
+ ProgressViewItem* item = ( ProgressViewItem* )firstChild();
+ while( item ) {
+ if ( item->getProduct() == product )
+ return item->getScript();
+ item = ( ProgressViewItem* )( item->nextSibling() );
+ }
+ return QString::null;
+}
+
--- /dev/null
+// File : SALOME_ProgressView.hxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#ifndef __SALOME_ProgressView
+#define __SALOME_ProgressView
+
+#include <qlistview.h>
+
+/*!
+ Class ProgressViewItem: Progress list view item
+*/
+enum Status { Waiting, Processing, Completed, Aborted };
+class ProgressView;
+class ProgressViewItem : public QListViewItem
+{
+public:
+ // constructor
+ ProgressViewItem( ProgressView* parent,
+ QString productName,
+ const QString installType,
+ const QString scriptName,
+ Status status = Waiting );
+
+ // sets product status
+ void setStatus( Status status );
+ // gets product status
+ Status getStatus() const { return myStatus; }
+ // gets product name
+ QString getProduct() const { return text( 0 ); }
+ // gets product script
+ QString getScript() const { return myScript; }
+ // gets type of the installation: 'binaries', 'source', 'native' or 'not install'
+ QString getInstallType() const { return text( 1 ); }
+
+protected:
+ // paints cell of the item
+ void paintCell( QPainter* painter, const QColorGroup& cg, int column, int width, int align );
+
+private:
+ Status myStatus; // status
+ QString myScript; // alias
+};
+
+/*!
+ Class ProgressView: Progress list view
+*/
+class ProgressView : public QListView
+{
+public:
+ // constructor
+ ProgressView( QWidget* parent );
+
+ // sets/gets status colors
+ void setColors( QColor wColor, QColor pColor, QColor cColor );
+ QColor getWaitingColor() { return myWaitingColor; }
+ QColor getProcessingColor() { return myProcessingColor; }
+ QColor getCompletedColor() { return myCompletedColor; }
+
+ // adds product item
+ void addProduct( const QString smbName, const QString type, const QString product );
+ // finds the first item with given status
+ QString findStatus( Status status );
+ // sets new status for the product item
+ void setStatus( const QString product, Status status );
+ // scrolls the view to make item visible if necessary
+ void ensureVisible( const QString product );
+ // gets the product script
+ QString getScript( const QString product );
+
+protected:
+ // finds the item by the product name
+ ProgressViewItem* findItem( const QString product );
+
+private:
+ QColor myWaitingColor; // 'Waiting' color
+ QColor myProcessingColor; // 'Processing' color
+ QColor myCompletedColor; // 'Completed' color
+};
+
+#endif
--- /dev/null
+// File : SALOME_XmlHandler.cxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#include "SALOME_XmlHandler.hxx"
+#include "SALOME_ProductsView.hxx"
+#include "SALOME_InstallWizard.hxx"
+
+#include <qlineedit.h>
+
+// ================================================================
+/*!
+ * StructureParser::StructureParser
+ * Constructor
+ */
+// ================================================================
+StructureParser::StructureParser( SALOME_InstallWizard* wizard )
+ : QXmlDefaultHandler(),
+ myWizard( wizard ),
+ myTree( 0 ),
+ myTargetDir( 0 ),
+ myTempDir( 0 )
+{
+}
+// ================================================================
+/*!
+ * StructureParser::setProductsList
+ * Sets products list view
+ */
+// ================================================================
+void StructureParser::setProductsList( ProductsView* tree )
+{
+ myTree = tree;
+}
+// ================================================================
+/*!
+ * StructureParser::setTargetDir
+ * Sets target directory widget
+ */
+// ================================================================
+void StructureParser::setTargetDir( QLineEdit* dir )
+{
+ myTargetDir = dir;
+}
+// ================================================================
+/*!
+ * StructureParser::setTempDir
+ * Sets temp directory widget
+ */
+// ================================================================
+void StructureParser::setTempDir( QLineEdit* dir )
+{
+ myTempDir = dir;
+}
+// ================================================================
+/*!
+ * StructureParser::startElement
+ * Begins parsing of the xml dom-element
+ */
+// ================================================================
+bool StructureParser::startElement( const QString& /*namespaceURI*/,
+ const QString& /*localName*/,
+ const QString& qName,
+ const QXmlAttributes& attributes)
+{
+#ifdef DEBUG
+ cout << qName << endl;
+ cout << attributes.length() << endl;
+#endif
+ QCheckListItem* element;
+ if (( qName == "config" ) && ( attributes.length() > 0 ) ) {
+ QString myVersion, myCaption, myCopyright, myLicense, myOS;
+ if ( attributes.value( "version" ) ) {
+ myVersion = attributes.value( "version" ).stripWhiteSpace();
+ if ( myWizard && !myVersion.isEmpty() )
+ myWizard->setVersion( myVersion );
+ }
+ if ( attributes.value( "caption" ) ) {
+ myCaption = attributes.value( "caption" ).arg( myVersion ).stripWhiteSpace();
+ if ( myWizard && !myCaption.isEmpty() )
+ myWizard->setCaption( myCaption );
+ }
+ if ( attributes.value( "copyright" ) ) {
+ myCopyright = attributes.value( "copyright" ).stripWhiteSpace();
+ if ( myWizard && !myCopyright.isEmpty() )
+ myWizard->setCopyright( myCopyright );
+ }
+ if ( attributes.value( "license" ) ) {
+ myLicense = attributes.value( "license" ).stripWhiteSpace();
+ if ( myWizard && !myLicense.isEmpty() )
+ myWizard->setLicense( myLicense );
+ }
+ if ( attributes.value( "os" ) ) {
+ myOS = attributes.value( "os" ).stripWhiteSpace();
+ if ( myWizard && !myOS.isEmpty() )
+ myWizard->setOS( myOS );
+ }
+ }
+ else if (( qName == "product" ) && ( attributes.length() > 0 ) && myTree && myWizard ) {
+ if (attributes.value( "disable" ) == "true" )
+ return true;
+
+ QString install = attributes.value( "install" );
+ QStringList supported = QStringList::split( ",", attributes.value( "supported" ) );
+ QString script = attributes.value( "script" );
+ element = myTree->addItem( attributes.value( "name" ), attributes.value( "version" ), install, supported, script );
+ if ( attributes.value( "dependancies" ) == "" ) {
+ QStringList diskspace = QStringList::split( ",",attributes.value( "installdiskspace" ) );
+ if (diskspace.count() == 2)
+ myWizard->setDependancies( element,
+ Dependancies( attributes.value( "name" ), QStringList(),
+ diskspace[0].toInt(),
+ diskspace[1].toInt(),
+ attributes.value( "temporarydiskspace" ).toInt() ) );
+ else
+ myWizard->setDependancies( element,
+ Dependancies( attributes.value( "name" ), QStringList(),
+ diskspace[0].toInt(),
+ diskspace[0].toInt(),
+ attributes.value( "temporarydiskspace" ).toInt() ) );
+
+ }
+ else {
+ QStringList diskspace = QStringList::split(",",attributes.value( "installdiskspace" ) );
+ if (diskspace.count() == 2)
+ myWizard->setDependancies( element,
+ Dependancies( attributes.value( "name" ),
+ QStringList::split( ",", attributes.value( "dependancies" ) ),
+ diskspace[0].toInt(),
+ diskspace[1].toInt(),
+ attributes.value( "temporarydiskspace" ).toInt() ) );
+ else
+ myWizard->setDependancies( element,
+ Dependancies( attributes.value( "name" ),
+ QStringList::split( ",", attributes.value( "dependancies" ) ),
+ diskspace[0].toInt(),
+ diskspace[0].toInt(),
+ attributes.value( "temporarydiskspace" ).toInt() ) );
+ }
+ }
+ else if (( qName == "path" ) && ( attributes.length() > 0 ) && myWizard ) {
+ if ( myTargetDir )
+ myTargetDir->setText( attributes.value( "targetdir" ) );
+
+ if ( myTempDir ) {
+ if ( attributes.value( "tempdir" ) == "" )
+ myTempDir->setText( "/tmp" );
+ else
+ myTempDir->setText( attributes.value( "tempdir" ) );
+ }
+ }
+ return true;
+}
+// ================================================================
+/*!
+ * StructureParser::endElement
+ * Finishes parsing of the xml dom-element
+ */
+// ================================================================
+bool StructureParser::endElement( const QString&,
+ const QString&,
+ const QString& )
+{
+ return true;
+}
+
--- /dev/null
+// File : SALOME_XmlHandler.hxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#ifndef __SALOME_XmlHandler
+#define __SALOME_XmlHandler
+
+#include <qxml.h>
+
+/*!
+ Class StructureParser: parses xml-description file and populates the list of the products
+*/
+class ProductsView;
+class SALOME_InstallWizard;
+class QLineEdit;
+
+class StructureParser: public QXmlDefaultHandler
+{
+public:
+ // constructor
+ StructureParser( SALOME_InstallWizard* wizard = 0 );
+
+ // set control widgets
+ void setProductsList( ProductsView* view );
+ void setTargetDir( QLineEdit* dir );
+ void setTempDir( QLineEdit* dir );
+
+ // begins parsing of the xml dom-element
+ bool startElement( const QString&,
+ const QString&,
+ const QString& ,
+ const QXmlAttributes& );
+ // finishes parsing of the xml dom-element of the xml dom-element
+ bool endElement( const QString&,
+ const QString&,
+ const QString& );
+
+private:
+ SALOME_InstallWizard* myWizard; // Salome Pro installation wizard's main window
+ ProductsView* myTree; // products list view
+ QLineEdit* myTargetDir; // target directory widget
+ QLineEdit* myTempDir; // temp directory widget
+};
+
+#endif
+++ /dev/null
-// File : HelpWindow.cpp
-// Created : Thu Dec 18 12:01:00 2002
-// Author : Vasily Rusyaev
-// Project : SALOME Professional
-// Module : InstallWizard
-// Copyright : 2003 CEA/DEN, EDF R&D
-// $Header$
-
-#include "helpwindow.h"
-#include <qstatusbar.h>
-#include <qtoolbar.h>
-#include <qtoolbutton.h>
-#include <qiconset.h>
-#include <qlabel.h>
-#include <qstringlist.h>
-#include <qapplication.h>
-#include <qdesktopwidget.h>
-#include <qdir.h>
-#include <qfile.h>
-
-#include "icons.h"
-
-#define DEFAULT_WIDTH 800
-#define DEFAULT_HEIGHT 700
-
-extern QString myVersion;
-/*!
- Constructor
-*/
-HelpWindow::HelpWindow() : QMainWindow( 0, "SalomeProHelpWindow", WDestructiveClose )
-{
- QString hlpFile = QDir::currentDirPath() + "/doc/readme.html";
- QString hlpDir = ".";
- // caption
- setCaption( tr("SALOME Professional %1 Installation Wizard Help").arg(myVersion) );
- // icon
- setIcon( QPixmap( (const char**)image0_data ) );
- // create browser
- browser = new QTextBrowser( this );
- browser->mimeSourceFactory()->setFilePath( hlpDir );
- browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
- setCentralWidget( browser );
- // set source directory
- if ( !hlpFile.isEmpty() )
- browser->setSource( hlpFile );
- // toolbar
- QToolBar* toolbar = new QToolBar( this );
- addToolBar( toolbar, "Toolbar" );
- QToolButton* button;
- // --> back
- button = new QToolButton( QIconSet( (const char**)back ),
- tr( "Backward" ),
- "",
- browser,
- SLOT( backward() ),
- toolbar );
- button->setEnabled( FALSE );
- connect( browser, SIGNAL( backwardAvailable( bool ) ), button, SLOT( setEnabled( bool ) ) );
- // --> forward
- button = new QToolButton( QIconSet( (const char**)forward ),
- tr( "Forward" ),
- "",
- browser,
- SLOT( forward() ),
- toolbar );
- button->setEnabled( FALSE );
- connect( browser, SIGNAL( forwardAvailable( bool ) ), button, SLOT( setEnabled( bool ) ) );
- // --> home
- button = new QToolButton( QIconSet( (const char**)home ),
- tr( "Home" ),
- "",
- browser,
- SLOT( home() ),
- toolbar );
- toolbar->addSeparator();
- // --> logo
- QLabel* logo = new QLabel( toolbar, "logo" );
- logo->setPixmap( QPixmap( (const char**)image1_data ) );
- logo->setAlignment( AlignRight | AlignVCenter );
- logo->setScaledContents( false );
- toolbar->setStretchableWidget( logo );
- setRightJustification( TRUE );
- // disable docking of toolbar
- setDockEnabled( Qt::DockLeft, FALSE );
- setDockEnabled( Qt::DockRight, FALSE );
- setDockEnabled( Qt::DockBottom, FALSE );
- setDockEnabled( Qt::DockTornOff, FALSE );
- // disable dock menu
- setDockMenuEnabled ( FALSE ) ;
- // connect signals
- connect( browser, SIGNAL( highlighted( const QString&) ), statusBar(), SLOT( message( const QString&)) );
- // set focus
- browser->setFocus();
- // initial size
- QSize sz = qApp->desktop()->size();
- int x = ( sz.width() - DEFAULT_WIDTH ) / 2;
- int y = ( sz.height() - DEFAULT_HEIGHT ) / 2;
- setGeometry( x, y, DEFAULT_WIDTH, DEFAULT_HEIGHT );
-}
-
-/*!
- Destructor
-*/
-HelpWindow::~HelpWindow()
-{}
-
-/*!
- Creates Help window ane return pointer to it if help file exists,
- otherwise returns 0 [ static ]
-*/
-HelpWindow* HelpWindow::openHelp()
-{
- if ( QFile::exists( QDir::currentDirPath() + "/doc/readme.html" ) )
- return new HelpWindow();
- else
- return 0;
-}
+++ /dev/null
-// File : HelpWindow.h
-// Created : Thu Dec 18 12:01:00 2002
-// Author : Vasily Rusyaev
-// Project : SALOME Professional
-// Module : InstallWizard
-// Copyright : 2003 CEA/DEN, EDF R&D
-// $Header$
-
-#ifndef __HelpWindow_h
-#define __HelpWindow_h
-
-#include <qmainwindow.h>
-#include <qtextbrowser.h>
-
-/*!
- Install Wizard's help window
-*/
-class HelpWindow : public QMainWindow
-{
- Q_OBJECT
-public:
- // constructor
- HelpWindow();
- // destructor
- ~HelpWindow();
-
- static HelpWindow* openHelp();
-
-private:
- QTextBrowser* browser; // browser
-};
-
-#endif // __HelpWindow_h
-
--- /dev/null
+// File : main.cxx
+// Created : Thu Dec 18 12:01:00 2002
+// Author : Vadim SANDLER
+// Project : PAL/SALOME
+// Module : InstallWizard
+// Copyright : 2004 CEA
+// $Header$
+
+#include "SALOME_InstallWizard.hxx"
+#include <qapplication.h>
+#include <qfile.h>
+#include <qmessagebox.h>
+
+// ================================================================
+/*!
+ * main
+ * Program starts here
+ */
+// ================================================================
+int main( int argc, char **argv )
+{
+ QApplication a( argc, argv );
+ QString xmlFileName( argc == 2 ? argv[1] : "config.xml" );
+
+ int result = -1;
+ QFile xmlfile(xmlFileName);
+ if ( xmlfile.exists() ) {
+ SALOME_InstallWizard wizard(xmlFileName);
+ a.setMainWidget( &wizard );
+ wizard.show();
+ result = a.exec();
+ }
+ else {
+ QMessageBox::critical( 0,
+ QObject::tr( "Error" ),
+ QObject::tr( "Can't open config file:\n%1\n\nQuitting...").arg( xmlFileName ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
+ QMessageBox::NoButton );
+ }
+ return result;
+}
+