Skip to content

Commit

Permalink
Doxywizard: make the Next button on the last page of the wizard switc…
Browse files Browse the repository at this point in the history
…h to the run tab
  • Loading branch information
Dimitri van Heesch committed May 3, 2014
1 parent f4f3e38 commit fbc60af
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
18 changes: 12 additions & 6 deletions addon/doxywizard/doxywizard.cpp
Expand Up @@ -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);
Expand All @@ -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()));
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions addon/doxywizard/doxywizard.h
Expand Up @@ -14,6 +14,7 @@ class QTextEdit;
class QMenu;
class QProcess;
class QTimer;
class QTabWidget;

class MainWindow : public QMainWindow
{
Expand Down Expand Up @@ -51,6 +52,7 @@ class MainWindow : public QMainWindow
void showSettings();
void configChanged();
void clearRecent();
void selectRunTab();

private:
MainWindow();
Expand All @@ -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;
};
Expand Down
18 changes: 13 additions & 5 deletions addon/doxywizard/wizard.cpp
Expand Up @@ -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()
Expand All @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions addon/doxywizard/wizard.h
Expand Up @@ -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;
Expand Down

0 comments on commit fbc60af

Please sign in to comment.