[Cmake-commits] [cmake-commits] hoffman committed CMake.desktop 1.1 1.1.2.1 CMakeLists.txt 1.16.2.2 1.16.2.3 CMakeSetupDialog.cxx 1.40.2.7 1.40.2.8 Compilers.h NONE 1.1.2.2 Compilers.ui NONE 1.1.2.2 CrossCompiler.ui NONE 1.1.2.2 FirstConfigure.cxx NONE 1.1.2.2 FirstConfigure.h NONE 1.1.2.2 QCMakeWidgets.cxx 1.1.2.2 1.1.2.3

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Dec 31 10:14:32 EST 2008


Update of /cvsroot/CMake/CMake/Source/QtDialog
In directory public:/mounts/ram/cvs-serv19604/Source/QtDialog

Modified Files:
      Tag: CMake-2-6
	CMake.desktop CMakeLists.txt CMakeSetupDialog.cxx 
	QCMakeWidgets.cxx 
Added Files:
      Tag: CMake-2-6
	Compilers.h Compilers.ui CrossCompiler.ui FirstConfigure.cxx 
	FirstConfigure.h 
Log Message:
ENH: merge fixes for RC 6


Index: QCMakeWidgets.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QCMakeWidgets.cxx,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C 2 -d -r1.1.2.2 -r1.1.2.3
*** QCMakeWidgets.cxx	23 May 2008 20:09:44 -0000	1.1.2.2
--- QCMakeWidgets.cxx	31 Dec 2008 15:14:30 -0000	1.1.2.3
***************
*** 105,117 ****
  }
  
! QCMakeFileCompleter::QCMakeFileCompleter(QObject* o, bool dirs)
!   : QCompleter(o)
  {
!   QDirModel* model = new QDirModel(this);
!   if(dirs)
      {
!     model->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot);
      }
!   this->setModel(model);
  }
  
--- 105,134 ----
  }
  
! // use same QDirModel for all completers
! static QDirModel* fileDirModel()
  {
!   static QDirModel* m = NULL;
!   if(!m)
      {
!     m = new QDirModel();
      }
!   return m;
! }
! static QDirModel* pathDirModel()
! {
!   static QDirModel* m = NULL;
!   if(!m)
!     {
!     m = new QDirModel();
!     m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot);
!     }
!   return m;
! }
! 
! QCMakeFileCompleter::QCMakeFileCompleter(QObject* o, bool dirs)
!   : QCompleter(o)
! {
!   QDirModel* m = dirs ? pathDirModel() : fileDirModel();
!   this->setModel(m);
  }
  

Index: CMake.desktop
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMake.desktop,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C 2 -d -r1.1 -r1.1.2.1
*** CMake.desktop	11 Mar 2008 21:27:41 -0000	1.1
--- CMake.desktop	31 Dec 2008 15:14:30 -0000	1.1.2.1
***************
*** 9,13 ****
  X-MultipleArgs=false
  Type=Application
! Categories=Application;Development;
  StartupNotify=true
  MimeType=application/x-cmakecache;
--- 9,13 ----
  X-MultipleArgs=false
  Type=Application
! Categories=Development;
  StartupNotify=true
  MimeType=application/x-cmakecache;

--- NEW FILE: Compilers.h ---


#ifndef COMPILERS_HPP
#define COMPILERS_HPP

#include <QWidget>
#include <ui_Compilers.h>

class Compilers : public QWidget, public Ui::Compilers
{
  Q_OBJECT
public:
  Compilers(QWidget* p=NULL) : 
    QWidget(p)
  {
    this->setupUi(this);
  }
};

#endif


Index: CMakeSetupDialog.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeSetupDialog.cxx,v
retrieving revision 1.40.2.7
retrieving revision 1.40.2.8
diff -C 2 -d -r1.40.2.7 -r1.40.2.8
*** CMakeSetupDialog.cxx	13 Jul 2008 21:55:25 -0000	1.40.2.7
--- CMakeSetupDialog.cxx	31 Dec 2008 15:14:30 -0000	1.40.2.8
***************
*** 37,41 ****
  #include "QCMakeCacheView.h"
  #include "AddCacheEntry.h"
! #include "CMakeFirstConfigure.h"
  
  QCMakeThread::QCMakeThread(QObject* p) 
--- 37,41 ----
  #include "QCMakeCacheView.h"
  #include "AddCacheEntry.h"
! #include "FirstConfigure.h"
  
  QCMakeThread::QCMakeThread(QObject* p) 
***************
*** 553,557 ****
  bool CMakeSetupDialog::setupFirstConfigure()
  {
!   CMakeFirstConfigure dialog;
  
    // initialize dialog and restore saved settings
--- 553,557 ----
  bool CMakeSetupDialog::setupFirstConfigure()
  {
!   FirstConfigure dialog;
  
    // initialize dialog and restore saved settings
***************
*** 562,566 ****
    // restore from settings
    dialog.loadFromSettings();
!   
    if(dialog.exec() == QDialog::Accepted)
      {
--- 562,566 ----
    // restore from settings
    dialog.loadFromSettings();
! 
    if(dialog.exec() == QDialog::Accepted)
      {
***************
*** 594,636 ****
      else if(dialog.crossCompilerSetup())
        {
!       QString toolchainFile = dialog.crossCompilerToolChainFile();
!       if(!toolchainFile.isEmpty())
          {
!         m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE", 
!                           "Cross Compile ToolChain File", toolchainFile, false);
          }
-       else
-         {
-         QString fortranCompiler = dialog.getFortranCompiler();
-         if(!fortranCompiler.isEmpty())
-           {
-           m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER", 
-                             "Fortran compiler.", fortranCompiler, false);
-           }
  
!         QString mode = dialog.getCrossIncludeMode();
!         m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", 
!                           "CMake Find Include Mode", mode, false);
!         mode = dialog.getCrossLibraryMode();
!         m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", 
!                           "CMake Find Library Mode", mode, false);
!         mode = dialog.getCrossProgramMode();
!         m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", 
!                           "CMake Find Program Mode", mode, false);
!         
!         QString rootPath = dialog.getCrossRoot();
!         m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH", 
!                           "CMake Find Root Path", rootPath, false);
  
!         QString systemName = dialog.getSystemName();
!         m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME", 
!                           "CMake System Name", systemName, false);
!         QString cxxCompiler = dialog.getCXXCompiler();
!         m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", 
!                           "CXX compiler.", cxxCompiler, false);
!         QString cCompiler = dialog.getCCompiler();
!         m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", 
!                           "C compiler.", cCompiler, false);
!         }
        }
      return true;
--- 594,633 ----
      else if(dialog.crossCompilerSetup())
        {
!       QString fortranCompiler = dialog.getFortranCompiler();
!       if(!fortranCompiler.isEmpty())
          {
!         m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER", 
!                           "Fortran compiler.", fortranCompiler, false);
          }
  
!       QString mode = dialog.getCrossIncludeMode();
!       m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", 
!                         "CMake Find Include Mode", mode, false);
!       mode = dialog.getCrossLibraryMode();
!       m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", 
!                         "CMake Find Library Mode", mode, false);
!       mode = dialog.getCrossProgramMode();
!       m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", 
!                         "CMake Find Program Mode", mode, false);
!       
!       QString rootPath = dialog.getCrossRoot();
!       m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH", 
!                         "CMake Find Root Path", rootPath, false);
  
!       QString systemName = dialog.getSystemName();
!       m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME", 
!                         "CMake System Name", systemName, false);
!       QString cxxCompiler = dialog.getCXXCompiler();
!       m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", 
!                         "CXX compiler.", cxxCompiler, false);
!       QString cCompiler = dialog.getCCompiler();
!       m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", 
!                         "C compiler.", cCompiler, false);
!       }
!     else if(dialog.crossCompilerToolChainFile())
!       {
!       QString toolchainFile = dialog.getCrossCompilerToolChainFile();
!       m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE", 
!                         "Cross Compile ToolChain File", toolchainFile, false);
        }
      return true;

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeLists.txt,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -C 2 -d -r1.16.2.2 -r1.16.2.3
*** CMakeLists.txt	23 May 2008 20:09:43 -0000	1.16.2.2
--- CMakeLists.txt	31 Dec 2008 15:14:30 -0000	1.16.2.3
***************
*** 17,25 ****
      AddCacheEntry.cxx
      AddCacheEntry.h
-     CMakeFirstConfigure.cxx
-     CMakeFirstConfigure.h
      CMakeSetup.cxx
      CMakeSetupDialog.cxx
      CMakeSetupDialog.h
      QCMake.cxx
      QCMake.h
--- 17,25 ----
      AddCacheEntry.cxx
      AddCacheEntry.h
      CMakeSetup.cxx
      CMakeSetupDialog.cxx
      CMakeSetupDialog.h
+     FirstConfigure.cxx
+     FirstConfigure.h
      QCMake.cxx
      QCMake.h
***************
*** 32,37 ****
      )
    QT4_WRAP_UI(UI_SRCS 
-     CMakeFirstConfigure.ui
      CMakeSetupDialog.ui
      AddCacheEntry.ui
      MacInstallDialog.ui
--- 32,38 ----
      )
    QT4_WRAP_UI(UI_SRCS 
      CMakeSetupDialog.ui
+     Compilers.ui
+     CrossCompiler.ui
      AddCacheEntry.ui
      MacInstallDialog.ui
***************
*** 39,44 ****
    QT4_WRAP_CPP(MOC_SRCS 
      AddCacheEntry.h
!     CMakeFirstConfigure.h
      CMakeSetupDialog.h
      QCMake.h
      QCMakeCacheView.h
--- 40,46 ----
    QT4_WRAP_CPP(MOC_SRCS 
      AddCacheEntry.h
!     Compilers.h
      CMakeSetupDialog.h
+     FirstConfigure.h
      QCMake.h
      QCMakeCacheView.h

--- NEW FILE: Compilers.ui ---
<ui version="4.0" >
 <class>Compilers</class>
 <widget class="QWidget" name="Compilers" >
  <property name="geometry" >
   <rect>
    <x>0</x>
    <y>0</y>
    <width>506</width>
    <height>115</height>
   </rect>
  </property>
  <property name="windowTitle" >
   <string>Form</string>
  </property>
  <layout class="QGridLayout" >
   <property name="leftMargin" >
    <number>0</number>
   </property>
   <property name="topMargin" >
    <number>0</number>
   </property>
   <property name="rightMargin" >
    <number>0</number>
   </property>
   <property name="bottomMargin" >
    <number>0</number>
   </property>
   <item row="0" column="0" >
    <widget class="QGroupBox" name="groupBox_4" >
     <property name="title" >
      <string>Compilers</string>
     </property>
     <layout class="QGridLayout" >
      <property name="leftMargin" >
       <number>4</number>
      </property>
      <property name="topMargin" >
       <number>4</number>
      </property>
      <property name="rightMargin" >
       <number>4</number>
      </property>
      <item row="0" column="0" >
       <widget class="QLabel" name="label_16" >
        <property name="text" >
         <string>C</string>
        </property>
       </widget>
      </item>
      <item row="0" column="1" >
       <widget class="QCMakeFilePathEditor" name="CCompiler" />
      </item>
      <item row="0" column="2" >
       <widget class="QLabel" name="label_17" >
        <property name="text" >
         <string>C++</string>
        </property>
       </widget>
      </item>
      <item row="0" column="3" >
       <widget class="QCMakeFilePathEditor" name="CXXCompiler" />
      </item>
      <item row="1" column="0" >
       <widget class="QLabel" name="label_18" >
        <property name="text" >
         <string>Fortran</string>
        </property>
       </widget>
      </item>
      <item row="1" column="1" >
       <widget class="QCMakeFilePathEditor" name="FortranCompiler" />
      </item>
     </layout>
    </widget>
   </item>
  </layout>
 </widget>
 <customwidgets>
  <customwidget>
   <class>QCMakeFilePathEditor</class>
   <extends>QLineEdit</extends>
   <header>QCMakeWidgets.h</header>
  </customwidget>
 </customwidgets>
 <resources/>
 <connections/>
</ui>

--- NEW FILE: FirstConfigure.h ---

#ifndef FirstConfigure_h
#define FirstConfigure_h

#include <QWizard>
#include <QWizardPage>
#include "ui_Compilers.h"
#include "ui_CrossCompiler.h"

class QRadioButton;
class QComboBox;

//! the wizard pages we'll use for the first configure of a build
enum FirstConfigurePages
{
  Start,
  NativeSetup,
  ToolchainSetup,
  CrossSetup,
  Done
};

//! the first page that gives basic options for what compilers setup to choose from
class StartCompilerSetup : public QWizardPage
{
  Q_OBJECT
  public:
    StartCompilerSetup(QWidget* p);
    ~StartCompilerSetup();
    void setGenerators(const QStringList& gens);
    void setCurrentGenerator(const QString& gen);
    QString getGenerator() const;
    
    bool defaultSetup() const;
    bool compilerSetup() const;
    bool crossCompilerSetup() const;
    bool crossCompilerToolChainFile() const;

    int nextId() const;
  
  signals:
    void selectionChanged();

  protected slots:
    void onSelectionChanged(bool);

  protected:
    QComboBox* GeneratorOptions;
    QRadioButton* CompilerSetupOptions[4];
};

//! the page that gives basic options for native compilers
class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
{
  Q_OBJECT
  public:
    NativeCompilerSetup(QWidget* p);
    ~NativeCompilerSetup();
    
    QString getCCompiler() const;
    void setCCompiler(const QString&);

    QString getCXXCompiler() const;
    void setCXXCompiler(const QString&);

    QString getFortranCompiler() const;
    void setFortranCompiler(const QString&);
    
    int nextId() const { return -1; }
};

//! the page that gives options for cross compilers
class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
{
  Q_OBJECT
  public:
    CrossCompilerSetup(QWidget* p);
    ~CrossCompilerSetup();
    
    QString getSystem() const;
    void setSystem(const QString&);
    
    QString getVersion() const;
    void setVersion(const QString&);
    
    QString getProcessor() const;
    void setProcessor(const QString&);

    QString getCCompiler() const;
    void setCCompiler(const QString&);

    QString getCXXCompiler() const;
    void setCXXCompiler(const QString&);

    QString getFortranCompiler() const;
    void setFortranCompiler(const QString&);
    
    QString getFindRoot() const;
    void setFindRoot(const QString&);

    enum CrossMode
      {
        BOTH,
        ONLY,
        NEVER
      };
  
    int getProgramMode() const;
    void setProgramMode(int);
    int getLibraryMode() const;
    void setLibraryMode(int);
    int getIncludeMode() const;
    void setIncludeMode(int);
    
    int nextId() const { return -1; }
};

//! the page that gives options for a toolchain file
class ToolchainCompilerSetup : public QWizardPage
{
  Q_OBJECT
  public:
    ToolchainCompilerSetup(QWidget* p);
    ~ToolchainCompilerSetup();

    QString toolchainFile() const;
    void setToolchainFile(const QString&);

    int nextId() const { return -1; }
    
  protected:
    QCMakeFilePathEditor* ToolchainFile;
};

//! the wizard with the pages
class FirstConfigure : public QWizard
{
  Q_OBJECT
public:
  FirstConfigure();
  ~FirstConfigure();

  void setGenerators(const QStringList& gens);
  QString getGenerator() const;

  bool defaultSetup() const;
  bool compilerSetup() const;
  bool crossCompilerSetup() const;
  bool crossCompilerToolChainFile() const;

  QString getCCompiler() const;
  QString getCXXCompiler() const;
  QString getFortranCompiler() const;
  
  QString getSystemName() const;
  QString getSystemVersion() const;
  QString getSystemProcessor() const;
  QString getCrossRoot() const;
  QString getCrossProgramMode() const;
  QString getCrossLibraryMode() const;
  QString getCrossIncludeMode() const;
  
  QString getCrossCompilerToolChainFile() const;

  void loadFromSettings();
  void saveToSettings();

protected:
  StartCompilerSetup* mStartCompilerSetupPage;
  NativeCompilerSetup* mNativeCompilerSetupPage;
  CrossCompilerSetup* mCrossCompilerSetupPage;
  ToolchainCompilerSetup* mToolchainCompilerSetupPage;

};

#endif // FirstConfigure_h


--- NEW FILE: FirstConfigure.cxx ---

#include "FirstConfigure.h"
#include "Compilers.h"

#include <QSettings>
#include <QRadioButton>
#include <QComboBox>
#include <QVBoxLayout>


StartCompilerSetup::StartCompilerSetup(QWidget* p)
  : QWizardPage(p)
{
  QVBoxLayout* l = new QVBoxLayout(this);
  l->addWidget(new QLabel(tr("Specify the generator for this project")));
  this->GeneratorOptions = new QComboBox(this);
  l->addWidget(this->GeneratorOptions);
  l->addSpacing(6);

  this->CompilerSetupOptions[0] = new QRadioButton("Use default native compilers", this);
  this->CompilerSetupOptions[1] = new QRadioButton("Specify native compilers", this);
  this->CompilerSetupOptions[2] = new QRadioButton("Specify toolchain file for cross-compiling", this);
  this->CompilerSetupOptions[3] = new QRadioButton("Specify options for cross-compiling", this);
  l->addWidget(this->CompilerSetupOptions[0]);
  l->addWidget(this->CompilerSetupOptions[1]);
  l->addWidget(this->CompilerSetupOptions[2]);
  l->addWidget(this->CompilerSetupOptions[3]);
  
  this->CompilerSetupOptions[0]->setChecked(true);

  QObject::connect(this->CompilerSetupOptions[0], SIGNAL(toggled(bool)),
                   this, SLOT(onSelectionChanged(bool)));
  QObject::connect(this->CompilerSetupOptions[1], SIGNAL(toggled(bool)),
                   this, SLOT(onSelectionChanged(bool)));
  QObject::connect(this->CompilerSetupOptions[2], SIGNAL(toggled(bool)),
                   this, SLOT(onSelectionChanged(bool)));
  QObject::connect(this->CompilerSetupOptions[3], SIGNAL(toggled(bool)),
                   this, SLOT(onSelectionChanged(bool)));
}

StartCompilerSetup::~StartCompilerSetup()
{
}

void StartCompilerSetup::setGenerators(const QStringList& gens)
{
  this->GeneratorOptions->clear();
  this->GeneratorOptions->addItems(gens);
};
    
void StartCompilerSetup::setCurrentGenerator(const QString& gen)
{
  int idx = this->GeneratorOptions->findText(gen);
  if(idx != -1)
  {
    this->GeneratorOptions->setCurrentIndex(idx);
  }
}

QString StartCompilerSetup::getGenerator() const
{
  return this->GeneratorOptions->currentText();
};

bool StartCompilerSetup::defaultSetup() const
{
  return this->CompilerSetupOptions[0]->isChecked();
}

bool StartCompilerSetup::compilerSetup() const
{
  return this->CompilerSetupOptions[1]->isChecked();
}

bool StartCompilerSetup::crossCompilerToolChainFile() const
{
  return this->CompilerSetupOptions[2]->isChecked();
}

bool StartCompilerSetup::crossCompilerSetup() const
{
  return this->CompilerSetupOptions[3]->isChecked();
}

void StartCompilerSetup::onSelectionChanged(bool on)
{
  if(on)
    selectionChanged();
}

int StartCompilerSetup::nextId() const
{
  if(compilerSetup())
    return NativeSetup;
  if(crossCompilerSetup())
    return CrossSetup;
  if(crossCompilerToolChainFile())
    return ToolchainSetup;
  return -1;
}

NativeCompilerSetup::NativeCompilerSetup(QWidget* p)
  : QWizardPage(p)
{
  QVBoxLayout* l = new QVBoxLayout(this);
  QWidget* c = new QWidget(this);
  l->addWidget(c);
  this->setupUi(c);
}

NativeCompilerSetup::~NativeCompilerSetup()
{
}

QString NativeCompilerSetup::getCCompiler() const
{
  return this->CCompiler->text();
}

void NativeCompilerSetup::setCCompiler(const QString& s)
{
  this->CCompiler->setText(s);
}

QString NativeCompilerSetup::getCXXCompiler() const
{
  return this->CXXCompiler->text();
}

void NativeCompilerSetup::setCXXCompiler(const QString& s)
{
  this->CXXCompiler->setText(s);
}

QString NativeCompilerSetup::getFortranCompiler() const
{
  return this->FortranCompiler->text();
}

void NativeCompilerSetup::setFortranCompiler(const QString& s)
{
  this->FortranCompiler->setText(s);
}


CrossCompilerSetup::CrossCompilerSetup(QWidget* p)
  : QWizardPage(p)
{
  this->setupUi(this);
  QWidget::setTabOrder(systemName, systemVersion);
  QWidget::setTabOrder(systemVersion, systemProcessor);
  QWidget::setTabOrder(systemProcessor, CrossCompilers->CCompiler);
  QWidget::setTabOrder(CrossCompilers->CCompiler, CrossCompilers->CXXCompiler);
  QWidget::setTabOrder(CrossCompilers->CXXCompiler, CrossCompilers->FortranCompiler);
  QWidget::setTabOrder(CrossCompilers->FortranCompiler, crossFindRoot);
  QWidget::setTabOrder(crossFindRoot, crossProgramMode);
  QWidget::setTabOrder(crossProgramMode, crossLibraryMode);
  QWidget::setTabOrder(crossLibraryMode, crossIncludeMode);

  // fill in combo boxes
  QStringList modes;
  modes << "Search in Target Root, then native system";
  modes << "Search only in Target Root";
  modes << "Search only in native system";
  crossProgramMode->addItems(modes);
  crossLibraryMode->addItems(modes);
  crossIncludeMode->addItems(modes);
  crossProgramMode->setCurrentIndex(2);
  crossLibraryMode->setCurrentIndex(1);
  crossIncludeMode->setCurrentIndex(1);

  this->registerField("systemName*", this->systemName);
}

CrossCompilerSetup::~CrossCompilerSetup()
{
}

QString CrossCompilerSetup::getCCompiler() const
{
  return this->CrossCompilers->CCompiler->text();
}

void CrossCompilerSetup::setCCompiler(const QString& s)
{
  this->CrossCompilers->CCompiler->setText(s);
}

QString CrossCompilerSetup::getCXXCompiler() const
{
  return this->CrossCompilers->CXXCompiler->text();
}

void CrossCompilerSetup::setCXXCompiler(const QString& s)
{
  this->CrossCompilers->CXXCompiler->setText(s);
}

QString CrossCompilerSetup::getFortranCompiler() const
{
  return this->CrossCompilers->FortranCompiler->text();
}

void CrossCompilerSetup::setFortranCompiler(const QString& s)
{
  this->CrossCompilers->FortranCompiler->setText(s);
}

QString CrossCompilerSetup::getSystem() const
{
  return this->systemName->text();
}

void CrossCompilerSetup::setSystem(const QString& t)
{
  this->systemName->setText(t);
}


QString CrossCompilerSetup::getVersion() const
{
  return this->systemVersion->text();
}

void CrossCompilerSetup::setVersion(const QString& t)
{
  this->systemVersion->setText(t);
}


QString CrossCompilerSetup::getProcessor() const
{
  return this->systemProcessor->text();
}

void CrossCompilerSetup::setProcessor(const QString& t)
{
  this->systemProcessor->setText(t);
}
    
QString CrossCompilerSetup::getFindRoot() const
{
  return this->crossFindRoot->text();
}

void CrossCompilerSetup::setFindRoot(const QString& t)
{
  return this->crossFindRoot->setText(t);
}

int CrossCompilerSetup::getProgramMode() const
{
  return this->crossProgramMode->currentIndex();
}

int CrossCompilerSetup::getLibraryMode() const
{
  return this->crossLibraryMode->currentIndex();
}

int CrossCompilerSetup::getIncludeMode() const
{
  return this->crossIncludeMode->currentIndex();
}

void CrossCompilerSetup::setProgramMode(int m)
{
  this->crossProgramMode->setCurrentIndex(m);
}

void CrossCompilerSetup::setLibraryMode(int m)
{
  this->crossLibraryMode->setCurrentIndex(m);
}

void CrossCompilerSetup::setIncludeMode(int m)
{
  this->crossIncludeMode->setCurrentIndex(m);
}

ToolchainCompilerSetup::ToolchainCompilerSetup(QWidget* p)
  : QWizardPage(p)
{
  QVBoxLayout* l = new QVBoxLayout(this);
  l->addWidget(new QLabel(tr("Specify the Toolchain file")));
  this->ToolchainFile = new QCMakeFilePathEditor(this);
  l->addWidget(this->ToolchainFile);
}

ToolchainCompilerSetup::~ToolchainCompilerSetup()
{
}

QString ToolchainCompilerSetup::toolchainFile() const
{
  return this->ToolchainFile->text();
}

void ToolchainCompilerSetup::setToolchainFile(const QString& t)
{
  this->ToolchainFile->setText(t);
}



FirstConfigure::FirstConfigure()
{
  //this->setOption(QWizard::HaveFinishButtonOnEarlyPages, true);
  this->mStartCompilerSetupPage = new StartCompilerSetup(this);
  this->setPage(Start, this->mStartCompilerSetupPage);
  QObject::connect(this->mStartCompilerSetupPage, SIGNAL(selectionChanged()),
                   this, SLOT(restart()));

  this->mNativeCompilerSetupPage = new NativeCompilerSetup(this);
  this->setPage(NativeSetup, this->mNativeCompilerSetupPage);
  
  this->mCrossCompilerSetupPage = new CrossCompilerSetup(this);
  this->setPage(CrossSetup, this->mCrossCompilerSetupPage);
  
  this->mToolchainCompilerSetupPage = new ToolchainCompilerSetup(this);
  this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
}

FirstConfigure::~FirstConfigure()
{
}

void FirstConfigure::setGenerators(const QStringList& gens)
{
  this->mStartCompilerSetupPage->setGenerators(gens);
}

QString FirstConfigure::getGenerator() const
{
  return this->mStartCompilerSetupPage->getGenerator();
}

void FirstConfigure::loadFromSettings()
{
  QSettings settings;
  // restore generator
  settings.beginGroup("Settings/StartPath");
  QString lastGen = settings.value("LastGenerator").toString();
  this->mStartCompilerSetupPage->setCurrentGenerator(lastGen);
  settings.endGroup();

  // restore compiler setup
  settings.beginGroup("Settings/Compiler");
  this->mNativeCompilerSetupPage->setCCompiler(settings.value("CCompiler").toString());
  this->mNativeCompilerSetupPage->setCXXCompiler(settings.value("CXXCompiler").toString());
  this->mNativeCompilerSetupPage->setFortranCompiler(settings.value("FortranCompiler").toString());
  settings.endGroup();

  // restore cross compiler setup
  settings.beginGroup("Settings/CrossCompiler");
  this->mCrossCompilerSetupPage->setCCompiler(settings.value("CCompiler").toString());
  this->mCrossCompilerSetupPage->setCXXCompiler(settings.value("CXXCompiler").toString());
  this->mCrossCompilerSetupPage->setFortranCompiler(settings.value("FortranCompiler").toString());
  this->mToolchainCompilerSetupPage->setToolchainFile(settings.value("ToolChainFile").toString());
  this->mCrossCompilerSetupPage->setSystem(settings.value("SystemName").toString());
  this->mCrossCompilerSetupPage->setVersion(settings.value("SystemVersion").toString());
  this->mCrossCompilerSetupPage->setProcessor(settings.value("SystemProcessor").toString());
  this->mCrossCompilerSetupPage->setFindRoot(settings.value("FindRoot").toString());
  this->mCrossCompilerSetupPage->setProgramMode(settings.value("ProgramMode", 0).toInt());
  this->mCrossCompilerSetupPage->setLibraryMode(settings.value("LibraryMode", 0).toInt());
  this->mCrossCompilerSetupPage->setIncludeMode(settings.value("IncludeMode", 0).toInt());
  settings.endGroup();
}

void FirstConfigure::saveToSettings()
{
  QSettings settings;
  
  // save generator
  settings.beginGroup("Settings/StartPath");
  QString lastGen = this->mStartCompilerSetupPage->getGenerator();
  settings.setValue("LastGenerator", lastGen);
  settings.endGroup();

  // save compiler setup 
  settings.beginGroup("Settings/Compiler");
  settings.setValue("CCompiler", this->mNativeCompilerSetupPage->getCCompiler());
  settings.setValue("CXXCompiler", this->mNativeCompilerSetupPage->getCXXCompiler());
  settings.setValue("FortranCompiler", this->mNativeCompilerSetupPage->getFortranCompiler());
  settings.endGroup();

  // save cross compiler setup
  settings.beginGroup("Settings/CrossCompiler");
  settings.setValue("CCompiler", this->mCrossCompilerSetupPage->getCCompiler());
  settings.setValue("CXXCompiler", this->mCrossCompilerSetupPage->getCXXCompiler());
  settings.setValue("FortranCompiler", this->mCrossCompilerSetupPage->getFortranCompiler());
  settings.setValue("ToolChainFile", this->getCrossCompilerToolChainFile());
  settings.setValue("SystemName", this->mCrossCompilerSetupPage->getSystem());
  settings.setValue("SystemVersion", this->mCrossCompilerSetupPage->getVersion());
  settings.setValue("SystemProcessor", this->mCrossCompilerSetupPage->getProcessor());
  settings.setValue("FindRoot", this->mCrossCompilerSetupPage->getFindRoot());
  settings.setValue("ProgramMode", this->mCrossCompilerSetupPage->getProgramMode());
  settings.setValue("LibraryMode", this->mCrossCompilerSetupPage->getLibraryMode());
  settings.setValue("IncludeMode", this->mCrossCompilerSetupPage->getIncludeMode());
  settings.endGroup();
}

bool FirstConfigure::defaultSetup() const
{
  return this->mStartCompilerSetupPage->defaultSetup();
}

bool FirstConfigure::compilerSetup() const
{
  return this->mStartCompilerSetupPage->compilerSetup();
}

bool FirstConfigure::crossCompilerSetup() const
{
  return this->mStartCompilerSetupPage->crossCompilerSetup();
}

bool FirstConfigure::crossCompilerToolChainFile() const
{
  return this->mStartCompilerSetupPage->crossCompilerToolChainFile();
}
  
QString FirstConfigure::getCrossCompilerToolChainFile() const
{
  return this->mToolchainCompilerSetupPage->toolchainFile();
}

QString FirstConfigure::getSystemName() const
{
  return this->mCrossCompilerSetupPage->getSystem();
}

QString FirstConfigure::getCCompiler() const
{
  if(this->compilerSetup())
    {
    return this->mNativeCompilerSetupPage->getCCompiler();
    }
  else if(this->crossCompilerSetup())
    {
    return this->mCrossCompilerSetupPage->getCCompiler();
    }
  return QString();
}

QString FirstConfigure::getCXXCompiler() const
{
  if(this->compilerSetup())
    {
    return this->mNativeCompilerSetupPage->getCXXCompiler();
    }
  else if(this->crossCompilerSetup())
    {
    return this->mCrossCompilerSetupPage->getCXXCompiler();
    }
  return QString();
}

QString FirstConfigure::getFortranCompiler() const
{
  if(this->compilerSetup())
    {
    return this->mNativeCompilerSetupPage->getFortranCompiler();
    }
  else if(this->crossCompilerSetup())
    {
    return this->mCrossCompilerSetupPage->getFortranCompiler();
    }
  return QString();
}


QString FirstConfigure::getSystemVersion() const
{
  return this->mCrossCompilerSetupPage->getVersion();
}

QString FirstConfigure::getSystemProcessor() const
{
  return this->mCrossCompilerSetupPage->getProcessor();
}

QString FirstConfigure::getCrossRoot() const
{
  return this->mCrossCompilerSetupPage->getFindRoot();
}

const QString CrossModes[] =
{
  "BOTH",
  "ONLY",
  "NEVER"
};

QString FirstConfigure::getCrossProgramMode() const
{
  return CrossModes[this->mCrossCompilerSetupPage->getProgramMode()];
}

QString FirstConfigure::getCrossLibraryMode() const
{
  return CrossModes[this->mCrossCompilerSetupPage->getLibraryMode()];
}

QString FirstConfigure::getCrossIncludeMode() const
{
  return CrossModes[this->mCrossCompilerSetupPage->getIncludeMode()];
}


--- NEW FILE: CrossCompiler.ui ---
<ui version="4.0" >
 <class>CrossCompiler</class>
 <widget class="QWidget" name="CrossCompiler" >
  <property name="geometry" >
   <rect>
    <x>0</x>
    <y>0</y>
    <width>433</width>
    <height>319</height>
   </rect>
  </property>
  <property name="windowTitle" >
   <string>CrossCompiler</string>
  </property>
  <layout class="QGridLayout" >
   <item row="0" column="0" >
    <widget class="QGroupBox" name="groupBox" >
     <property name="sizePolicy" >
      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
       <horstretch>0</horstretch>
       <verstretch>0</verstretch>
      </sizepolicy>
     </property>
     <property name="title" >
      <string>Target System</string>
     </property>
     <layout class="QGridLayout" >
      <item row="0" column="0" >
       <widget class="QLabel" name="label_6" >
        <property name="sizePolicy" >
         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text" >
         <string>Operating System</string>
        </property>
       </widget>
      </item>
      <item row="0" column="1" >
       <widget class="QCMakeFilePathEditor" name="systemName" />
      </item>
      <item row="0" column="2" colspan="2" >
       <spacer>
        <property name="orientation" >
         <enum>Qt::Horizontal</enum>
        </property>
        <property name="sizeHint" >
         <size>
          <width>40</width>
          <height>20</height>
         </size>
        </property>
       </spacer>
      </item>
      <item row="1" column="0" >
       <widget class="QLabel" name="label_10" >
        <property name="sizePolicy" >
         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text" >
         <string>Version</string>
        </property>
        <property name="wordWrap" >
         <bool>true</bool>
        </property>
       </widget>
      </item>
      <item row="1" column="1" >
       <widget class="QLineEdit" name="systemVersion" />
      </item>
      <item row="1" column="2" >
       <widget class="QLabel" name="label_11" >
        <property name="sizePolicy" >
         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text" >
         <string>Processor</string>
        </property>
        <property name="wordWrap" >
         <bool>true</bool>
        </property>
       </widget>
      </item>
      <item row="1" column="3" >
       <widget class="QLineEdit" name="systemProcessor" />
      </item>
     </layout>
    </widget>
   </item>
   <item row="2" column="0" >
    <widget class="QGroupBox" name="groupBox_2" >
     <property name="sizePolicy" >
      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
       <horstretch>0</horstretch>
       <verstretch>0</verstretch>
      </sizepolicy>
     </property>
     <property name="title" >
      <string>Find Program/Library/Include</string>
     </property>
     <layout class="QGridLayout" >
      <item row="0" column="0" >
       <widget class="QLabel" name="label_9" >
        <property name="sizePolicy" >
         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text" >
         <string>Target Root</string>
        </property>
        <property name="wordWrap" >
         <bool>true</bool>
        </property>
       </widget>
      </item>
      <item row="0" column="1" >
       <widget class="QCMakePathEditor" name="crossFindRoot" />
      </item>
      <item row="0" column="2" >
       <widget class="QLabel" name="label_12" >
        <property name="sizePolicy" >
         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text" >
         <string>Program Mode</string>
        </property>
       </widget>
      </item>
      <item row="0" column="3" >
       <widget class="QComboBox" name="crossProgramMode" />
      </item>
      <item row="1" column="0" >
       <widget class="QLabel" name="label_13" >
        <property name="sizePolicy" >
         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text" >
         <string>Library Mode</string>
        </property>
       </widget>
      </item>
      <item row="1" column="1" >
       <widget class="QComboBox" name="crossLibraryMode" />
      </item>
      <item row="1" column="2" >
       <widget class="QLabel" name="label_14" >
        <property name="sizePolicy" >
         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
        <property name="text" >
         <string>Include Mode</string>
        </property>
       </widget>
      </item>
      <item row="1" column="3" >
       <widget class="QComboBox" name="crossIncludeMode" />
      </item>
     </layout>
    </widget>
   </item>
   <item row="1" column="0" >
    <widget class="Compilers" native="1" name="CrossCompilers" >
     <property name="focusPolicy" >
      <enum>Qt::TabFocus</enum>
     </property>
    </widget>
   </item>
  </layout>
 </widget>
 <customwidgets>
  <customwidget>
   <class>QCMakePathEditor</class>
   <extends>QLineEdit</extends>
   <header>QCMakeWidgets.h</header>
  </customwidget>
  <customwidget>
   <class>Compilers</class>
   <extends>QWidget</extends>
   <header>Compilers.h</header>
   <container>1</container>
  </customwidget>
  <customwidget>
   <class>QCMakeFilePathEditor</class>
   <extends>QLineEdit</extends>
   <header>QCMakeWidgets.h</header>
  </customwidget>
 </customwidgets>
 <tabstops>
  <tabstop>systemVersion</tabstop>
  <tabstop>systemProcessor</tabstop>
  <tabstop>CrossCompilers</tabstop>
  <tabstop>crossFindRoot</tabstop>
  <tabstop>crossProgramMode</tabstop>
  <tabstop>crossLibraryMode</tabstop>
  <tabstop>crossIncludeMode</tabstop>
 </tabstops>
 <resources/>
 <connections/>
</ui>



More information about the Cmake-commits mailing list