Permalink
Browse files

Doxywizard: make the Next button on the last page of the wizard switc…

…h to the run tab
  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed May 3, 2014
1 parent f4f3e38 commit fbc60af2298c2668893e2f7045f66765f8e0c63f
Showing with 31 additions and 11 deletions.
  1. +12 −6 addon/doxywizard/doxywizard.cpp
  2. +3 −0 addon/doxywizard/doxywizard.h
  3. +13 −5 addon/doxywizard/wizard.cpp
  4. +3 −0 addon/doxywizard/wizard.h
@@ -97,15 +97,15 @@ MainWindow::MainWindow()
grid->addLayout(launchLayout,1,0);
runTabLayout->addLayout(grid);
QTabWidget *tabs = new QTabWidget;
tabs->addTab(m_wizard,tr("Wizard"));
tabs->addTab(m_expert,tr("Expert"));
tabs->addTab(runTab,tr("Run"));
m_tabs = new QTabWidget;
m_tabs->addTab(m_wizard,tr("Wizard"));
m_tabs->addTab(m_expert,tr("Expert"));
m_tabs->addTab(runTab,tr("Run"));
rowLayout->addWidget(new QLabel(tr("Step 1: Specify the working directory from which doxygen will run")));
rowLayout->addLayout(dirLayout);
rowLayout->addWidget(new QLabel(tr("Step 2: Configure doxygen using the Wizard and/or Expert tab, then switch to the Run tab to generate the documentation")));
rowLayout->addWidget(tabs);
rowLayout->addWidget(m_tabs);
setCentralWidget(topPart);
statusBar()->showMessage(tr("Welcome to Doxygen"),messageTimeout);
@@ -115,7 +115,7 @@ MainWindow::MainWindow()
m_timer = new QTimer;
// connect signals and slots
connect(tabs,SIGNAL(currentChanged(int)),SLOT(selectTab(int)));
connect(m_tabs,SIGNAL(currentChanged(int)),SLOT(selectTab(int)));
connect(m_selWorkingDir,SIGNAL(clicked()),SLOT(selectWorkingDir()));
connect(m_recentMenu,SIGNAL(triggered(QAction*)),SLOT(openRecent(QAction*)));
connect(m_workingDir,SIGNAL(returnPressed()),SLOT(updateWorkingDir()));
@@ -127,6 +127,7 @@ MainWindow::MainWindow()
connect(m_saveLog,SIGNAL(clicked()),SLOT(saveLog()));
connect(showSettings,SIGNAL(clicked()),SLOT(showSettings()));
connect(m_expert,SIGNAL(changed()),SLOT(configChanged()));
connect(m_wizard,SIGNAL(done()),SLOT(selectRunTab()));
loadSettings();
updateLaunchButtonState();
@@ -373,6 +374,11 @@ void MainWindow::selectTab(int id)
if (id==0) m_wizard->refresh();
}
void MainWindow::selectRunTab()
{
m_tabs->setCurrentIndex(2);
}
void MainWindow::addRecentFile(const QString &fileName)
{
int i=m_recentFiles.indexOf(fileName);
@@ -14,6 +14,7 @@ class QTextEdit;
class QMenu;
class QProcess;
class QTimer;
class QTabWidget;
class MainWindow : public QMainWindow
{
@@ -51,6 +52,7 @@ class MainWindow : public QMainWindow
void showSettings();
void configChanged();
void clearRecent();
void selectRunTab();
private:
MainWindow();
@@ -77,6 +79,7 @@ class MainWindow : public QMainWindow
QStringList m_recentFiles;
QProcess *m_runProcess;
QTimer *m_timer;
QTabWidget *m_tabs;
bool m_running;
bool m_modified;
};
@@ -1292,17 +1292,24 @@ void Wizard::activateTopic(QTreeWidgetItem *item,QTreeWidgetItem *)
{
m_topicStack->setCurrentWidget(m_step4);
m_prev->setEnabled(true);
m_next->setEnabled(false);
m_next->setEnabled(true);
}
}
}
void Wizard::nextTopic()
{
m_topicStack->setCurrentIndex(m_topicStack->currentIndex()+1);
m_next->setEnabled(m_topicStack->count()!=m_topicStack->currentIndex()+1);
m_prev->setEnabled(m_topicStack->currentIndex()!=0);
m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(m_topicStack->currentIndex()));
if (m_topicStack->currentIndex()+1==m_topicStack->count()) // last topic
{
done();
}
else
{
m_topicStack->setCurrentIndex(m_topicStack->currentIndex()+1);
m_next->setEnabled(m_topicStack->count()!=m_topicStack->currentIndex()+1);
m_prev->setEnabled(m_topicStack->currentIndex()!=0);
m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(m_topicStack->currentIndex()));
}
}
void Wizard::prevTopic()
@@ -1315,6 +1322,7 @@ void Wizard::prevTopic()
void Wizard::refresh()
{
m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(0));
m_step1->init();
m_step2->init();
m_step3->init();
@@ -238,6 +238,9 @@ class Wizard : public QSplitter
void nextTopic();
void prevTopic();
signals:
void done();
private:
const QHash<QString,Input *> &m_modelData;
QTreeWidget *m_treeWidget;

0 comments on commit fbc60af

Please sign in to comment.