Commit fbc60af2 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Doxywizard: make the Next button on the last page of the wizard switch to the run tab

parent f4f3e381
......@@ -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()
{
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment