Public Member Functions | Private Slots | Private Attributes | List of all members
Step1 Class Reference

#include <wizard.h>

Inheritance diagram for Step1:

Public Member Functions

 Step1 (Wizard *parent, const QHash< QString, Input * > &modelData)
 
void init ()
 

Private Slots

void selectSourceDir ()
 
void selectDestinationDir ()
 
void selectProjectIcon ()
 
void setProjectName (const QString &name)
 
void setProjectBrief (const QString &desc)
 
void setProjectNumber (const QString &num)
 
void setSourceDir (const QString &dir)
 
void setDestinationDir (const QString &dir)
 
void setRecursiveScan (int)
 

Private Attributes

QLineEdit * m_projName
 
QLineEdit * m_projBrief
 
QLineEdit * m_projNumber
 
QLineEdit * m_sourceDir
 
QLineEdit * m_destDir
 
QLabel * m_projIconLab
 
QCheckBox * m_recursive
 
QPushButton * m_srcSelectDir
 
QPushButton * m_dstSelectDir
 
Wizardm_wizard
 
const QHash< QString, Input * > & m_modelData
 

Detailed Description

Definition at line 103 of file wizard.h.

Constructor & Destructor Documentation

Step1::Step1 ( Wizard parent,
const QHash< QString, Input * > &  modelData 
)

Definition at line 462 of file wizard.cpp.

462  : m_wizard(wizard), m_modelData(modelData)
463 {
464  QVBoxLayout *layout = new QVBoxLayout(this);
465  layout->setMargin(4);
466  layout->setSpacing(8);
467  QLabel *l = new QLabel(this);
468  l->setText(tr("Provide some information "
469  "about the project you are documenting"));
470  layout->addWidget(l);
471  QWidget *w = new QWidget( this );
472  QGridLayout *grid = new QGridLayout(w);
473  grid->setSpacing(10);
474 
475  // project name
476  QLabel *projName = new QLabel(this);
477  projName->setText(tr("Project name:"));
478  projName->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
479  // project brief
480  QLabel *projBrief = new QLabel(this);
481  projBrief->setText(tr("Project synopsis:"));
482  projBrief->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
483  // project version
484  QLabel *projVersion = new QLabel(this);
485  projVersion->setText(tr("Project version or id:"));
486  projVersion->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
487  // project icon
488  QLabel *projLogo = new QLabel(this);
489  projLogo->setMinimumSize(1,55);
490  projLogo->setText(tr("Project logo:"));
491  projLogo->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
492 
493  grid->addWidget(projName,0,0);
494  grid->addWidget(projBrief,1,0);
495  grid->addWidget(projVersion,2,0);
496  grid->addWidget(projLogo,3,0);
497 
498  m_projName = new QLineEdit;
499  m_projBrief = new QLineEdit;
500  m_projNumber = new QLineEdit;
501  QPushButton *projIconSel = new QPushButton(this);
502  projIconSel->setText(tr("Select..."));
503  m_projIconLab = new QLabel;
504 
505  grid->addWidget(m_projName,0,1,1,2);
506  grid->addWidget(m_projBrief,1,1,1,2);
507  grid->addWidget(m_projNumber,2,1,1,2);
508  grid->addWidget(projIconSel,3,1);
509  grid->addWidget(m_projIconLab,3,2);
510 
511  grid->setColumnStretch(2,1);
512 
513  w->setLayout(grid);
514 
515  layout->addWidget(w);
516 
517  //---------------------------------------------------
518  QFrame *f = new QFrame( this );
519  f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
520  layout->addWidget(f);
521 
522  l = new QLabel(this);
523  l->setText(tr("Specify the directory to scan for source code"));
524  layout->addWidget(l);
525  QWidget *row = new QWidget;
526  QHBoxLayout *rowLayout = new QHBoxLayout(row);
527  rowLayout->setSpacing(10);
528  l = new QLabel(this);
529  l->setText(tr("Source code directory:"));
530  rowLayout->addWidget(l);
531  m_sourceDir = new QLineEdit;
532  m_srcSelectDir = new QPushButton(this);
533  m_srcSelectDir->setText(tr("Select..."));
534  rowLayout->addWidget(m_sourceDir);
535  rowLayout->addWidget(m_srcSelectDir);
536  layout->addWidget(row);
537 
538  m_recursive = new QCheckBox(this);
539  m_recursive->setText(tr("Scan recursively"));
540  m_recursive->setChecked(true);
541  layout->addWidget(m_recursive);
542 
543  //---------------------------------------------------
544  f = new QFrame( this );
545  f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
546  layout->addWidget(f);
547 
548  l = new QLabel(this);
549  l->setText(tr("Specify the directory where doxygen should "
550  "put the generated documentation"));
551  layout->addWidget(l);
552  row = new QWidget;
553  rowLayout = new QHBoxLayout(row);
554  rowLayout->setSpacing(10);
555  l = new QLabel(this);
556  l->setText(tr("Destination directory:"));
557  rowLayout->addWidget(l);
558  m_destDir = new QLineEdit;
559  m_dstSelectDir = new QPushButton(this);
560  m_dstSelectDir->setText(tr("Select..."));
561  rowLayout->addWidget(m_destDir);
562  rowLayout->addWidget(m_dstSelectDir);
563  layout->addWidget(row);
564  layout->addStretch(1);
565  setLayout(layout);
566 
567  connect(projIconSel,SIGNAL(clicked()),
568  this,SLOT(selectProjectIcon()));
569  connect(m_srcSelectDir,SIGNAL(clicked()),
570  this,SLOT(selectSourceDir()));
571  connect(m_dstSelectDir,SIGNAL(clicked()),
572  this,SLOT(selectDestinationDir()));
573  connect(m_projName,SIGNAL(textChanged(const QString &)),SLOT(setProjectName(const QString &)));
574  connect(m_projBrief,SIGNAL(textChanged(const QString &)),SLOT(setProjectBrief(const QString &)));
575  connect(m_projNumber,SIGNAL(textChanged(const QString &)),SLOT(setProjectNumber(const QString &)));
576  connect(m_sourceDir,SIGNAL(textChanged(const QString &)),SLOT(setSourceDir(const QString &)));
577  connect(m_recursive,SIGNAL(stateChanged(int)),SLOT(setRecursiveScan(int)));
578  connect(m_destDir,SIGNAL(textChanged(const QString &)),SLOT(setDestinationDir(const QString &)));
579 }
void selectProjectIcon()
Definition: wizard.cpp:581
void setDestinationDir(const QString &dir)
Definition: wizard.cpp:682
void setProjectName(const QString &name)
Definition: wizard.cpp:647
void setProjectBrief(const QString &desc)
Definition: wizard.cpp:652
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
QCheckBox * m_recursive
Definition: wizard.h:129
static QStrList * l
Definition: config.cpp:1044
def connect(nxgraph, k1, k2, p1=0, p2=0, kwds)
Definition: graph.py:30
QLineEdit * m_sourceDir
Definition: wizard.h:126
QPushButton * m_dstSelectDir
Definition: wizard.h:131
QLabel * m_projIconLab
Definition: wizard.h:128
QLineEdit * m_projNumber
Definition: wizard.h:125
Wizard * m_wizard
Definition: wizard.h:132
QLineEdit * m_projName
Definition: wizard.h:123
QPushButton * m_srcSelectDir
Definition: wizard.h:130
void setProjectNumber(const QString &num)
Definition: wizard.cpp:657
void setRecursiveScan(int)
Definition: wizard.cpp:687
void selectSourceDir()
Definition: wizard.cpp:613
QLineEdit * m_projBrief
Definition: wizard.h:124
void selectDestinationDir()
Definition: wizard.cpp:630
void setSourceDir(const QString &dir)
Definition: wizard.cpp:662
QLineEdit * m_destDir
Definition: wizard.h:127

Member Function Documentation

void Step1::init ( )

Definition at line 692 of file wizard.cpp.

693 {
694  Input *option;
699  if (!iconName.isEmpty())
700  {
701  QFile Fout(iconName);
702  if(!Fout.exists())
703  {
704  m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromLatin1(");"));
705  }
706  else
707  {
708  QPixmap pm(iconName);
709  if (!pm.isNull())
710  {
711  m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation));
712  }
713  else
714  {
715  m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromLatin1(");"));
716  }
717  }
718  }
719  else
720  {
721  m_projIconLab->setText(tr("No Project logo selected."));
722  }
723  option = m_modelData[STR_INPUT];
724  if (option->value().toStringList().count()>0)
725  {
726  m_sourceDir->setText(option->value().toStringList().first());
727  }
728  m_recursive->setChecked(
729  getBoolOption(m_modelData,STR_RECURSIVE) ? Qt::Checked : Qt::Unchecked);
731 }
bool isEmpty() const
Definition: qstring.h:682
virtual QVariant & value()=0
#define STR_PROJECT_BRIEF
Definition: wizard.cpp:29
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
static QString fromLatin1(const char *, int len=-1)
Definition: qstring.cpp:14539
QCheckBox * m_recursive
Definition: wizard.h:129
QLineEdit * m_sourceDir
Definition: wizard.h:126
QLabel * m_projIconLab
Definition: wizard.h:128
QLineEdit * m_projNumber
Definition: wizard.h:125
#define STR_OUTPUT_DIRECTORY
Definition: wizard.cpp:31
#define STR_PROJECT_LOGO
Definition: wizard.cpp:28
QLineEdit * m_projName
Definition: wizard.h:123
#define STR_PROJECT_NUMBER
Definition: wizard.cpp:32
Definition: input.h:9
#define STR_PROJECT_NAME
Definition: wizard.cpp:27
#define STR_RECURSIVE
Definition: wizard.cpp:33
static QString getStringOption(const QHash< QString, Input * > &model, const QString &name)
Definition: wizard.cpp:116
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
QLineEdit * m_projBrief
Definition: wizard.h:124
QLineEdit * m_destDir
Definition: wizard.h:127
static bool getBoolOption(const QHash< QString, Input * > &model, const QString &name)
Definition: wizard.cpp:100
#define STR_INPUT
Definition: wizard.cpp:30
void Step1::selectDestinationDir ( )
privateslot

Definition at line 630 of file wizard.cpp.

631 {
632  QString path = QFileInfo(MainWindow::instance().configFileName()).path();
633  QString dirName = QFileDialog::getExistingDirectory(this,
634  tr("Select destination directory"),path);
635  QDir dir(path);
636  if (!MainWindow::instance().configFileName().isEmpty() && dir.exists())
637  {
638  dirName = dir.relativeFilePath(dirName);
639  }
640  if (dirName.isEmpty())
641  {
642  dirName=QString::fromLatin1(".");
643  }
644  m_destDir->setText(dirName);
645 }
Traverses directory structures and contents in a platform-independent way.
Definition: qdir.h:52
bool isEmpty() const
Definition: qstring.h:682
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
string dir
static QString fromLatin1(const char *, int len=-1)
Definition: qstring.cpp:14539
QLineEdit * m_destDir
Definition: wizard.h:127
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
static MainWindow & instance()
Definition: doxywizard.cpp:34
void Step1::selectProjectIcon ( )
privateslot

Definition at line 581 of file wizard.cpp.

582 {
583  QString path = QFileInfo(MainWindow::instance().configFileName()).path();
584  QString iconName = QFileDialog::getOpenFileName(this,
585  tr("Select project icon/image"),path);
586  if (iconName.isEmpty())
587  {
588  m_projIconLab->setText(tr("No Project logo selected."));
589  }
590  else
591  {
592  QFile Fout(iconName);
593  if(!Fout.exists())
594  {
595  m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromLatin1(");"));
596  }
597  else
598  {
599  QPixmap pm(iconName);
600  if (!pm.isNull())
601  {
602  m_projIconLab->setPixmap(pm.scaledToHeight(55,Qt::SmoothTransformation));
603  }
604  else
605  {
606  m_projIconLab->setText(tr("Sorry, no preview available (")+iconName+QString::fromLatin1(");"));
607  }
608  }
609  }
611 }
bool isEmpty() const
Definition: qstring.h:682
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
static QString fromLatin1(const char *, int len=-1)
Definition: qstring.cpp:14539
QLabel * m_projIconLab
Definition: wizard.h:128
#define STR_PROJECT_LOGO
Definition: wizard.cpp:28
static void updateStringOption(const QHash< QString, Input * > &model, const QString &name, const QString &s)
Definition: wizard.cpp:151
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
static MainWindow & instance()
Definition: doxywizard.cpp:34
void Step1::selectSourceDir ( )
privateslot

Definition at line 613 of file wizard.cpp.

614 {
615  QString path = QFileInfo(MainWindow::instance().configFileName()).path();
616  QString dirName = QFileDialog::getExistingDirectory(this,
617  tr("Select source directory"),path);
618  QDir dir(path);
619  if (!MainWindow::instance().configFileName().isEmpty() && dir.exists())
620  {
621  dirName = dir.relativeFilePath(dirName);
622  }
623  if (dirName.isEmpty())
624  {
625  dirName=QString::fromLatin1(".");
626  }
627  m_sourceDir->setText(dirName);
628 }
Traverses directory structures and contents in a platform-independent way.
Definition: qdir.h:52
bool isEmpty() const
Definition: qstring.h:682
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
string dir
static QString fromLatin1(const char *, int len=-1)
Definition: qstring.cpp:14539
QLineEdit * m_sourceDir
Definition: wizard.h:126
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
static MainWindow & instance()
Definition: doxywizard.cpp:34
void Step1::setDestinationDir ( const QString dir)
privateslot

Definition at line 682 of file wizard.cpp.

683 {
685 }
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
#define STR_OUTPUT_DIRECTORY
Definition: wizard.cpp:31
static void updateStringOption(const QHash< QString, Input * > &model, const QString &name, const QString &s)
Definition: wizard.cpp:151
void Step1::setProjectBrief ( const QString desc)
privateslot

Definition at line 652 of file wizard.cpp.

653 {
655 }
#define STR_PROJECT_BRIEF
Definition: wizard.cpp:29
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
static void updateStringOption(const QHash< QString, Input * > &model, const QString &name, const QString &s)
Definition: wizard.cpp:151
void Step1::setProjectName ( const QString name)
privateslot

Definition at line 647 of file wizard.cpp.

648 {
650 }
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
#define STR_PROJECT_NAME
Definition: wizard.cpp:27
static void updateStringOption(const QHash< QString, Input * > &model, const QString &name, const QString &s)
Definition: wizard.cpp:151
void Step1::setProjectNumber ( const QString num)
privateslot

Definition at line 657 of file wizard.cpp.

658 {
660 }
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
#define STR_PROJECT_NUMBER
Definition: wizard.cpp:32
static void updateStringOption(const QHash< QString, Input * > &model, const QString &name, const QString &s)
Definition: wizard.cpp:151
void Step1::setRecursiveScan ( int  s)
privateslot

Definition at line 687 of file wizard.cpp.

688 {
690 }
static void updateBoolOption(const QHash< QString, Input * > &model, const QString &name, bool bNew)
Definition: wizard.cpp:124
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
#define STR_RECURSIVE
Definition: wizard.cpp:33
static QCString * s
Definition: config.cpp:1042
void Step1::setSourceDir ( const QString dir)
privateslot

Definition at line 662 of file wizard.cpp.

663 {
664  Input *option = m_modelData[STR_INPUT];
665  if (option->value().toStringList().count()>0)
666  {
667  QStringList sl = option->value().toStringList();
668  if (sl[0]!=dir)
669  {
670  sl[0] = dir;
671  option->value() = sl;
672  option->update();
673  }
674  }
675  else
676  {
677  option->value() = QStringList() << dir;
678  option->update();
679  }
680 }
virtual void update()=0
virtual QVariant & value()=0
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:133
string dir
A list of strings.
Definition: qstringlist.h:51
Definition: input.h:9
#define STR_INPUT
Definition: wizard.cpp:30

Member Data Documentation

QLineEdit* Step1::m_destDir
private

Definition at line 127 of file wizard.h.

QPushButton* Step1::m_dstSelectDir
private

Definition at line 131 of file wizard.h.

const QHash<QString,Input *>& Step1::m_modelData
private

Definition at line 133 of file wizard.h.

QLineEdit* Step1::m_projBrief
private

Definition at line 124 of file wizard.h.

QLabel* Step1::m_projIconLab
private

Definition at line 128 of file wizard.h.

QLineEdit* Step1::m_projName
private

Definition at line 123 of file wizard.h.

QLineEdit* Step1::m_projNumber
private

Definition at line 125 of file wizard.h.

QCheckBox* Step1::m_recursive
private

Definition at line 129 of file wizard.h.

QLineEdit* Step1::m_sourceDir
private

Definition at line 126 of file wizard.h.

QPushButton* Step1::m_srcSelectDir
private

Definition at line 130 of file wizard.h.

Wizard* Step1::m_wizard
private

Definition at line 132 of file wizard.h.


The documentation for this class was generated from the following files: