-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding file selection dialog for project generation.
- Loading branch information
Showing
6 changed files
with
209 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#include "doxygenfilesdialog.h" | ||
#include "ui_doxygenfilesdialog.h" | ||
|
||
#include <QListWidget> | ||
#include <QListWidgetItem> | ||
|
||
DoxygenFilesDialog::DoxygenFilesDialog(const QStringList &in, QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::DoxygenFilesDialog) | ||
{ | ||
ui->setupUi(this); | ||
|
||
QStringListIterator it(in); | ||
|
||
while (it.hasNext()) | ||
{ | ||
QListWidgetItem *listItem = new QListWidgetItem(it.next()); | ||
listItem->setCheckState(Qt::Checked); | ||
ui->listWidget->addItem(listItem); | ||
} | ||
|
||
connect(ui->b_all, SIGNAL(clicked(bool)), this, SLOT(checkAll())); | ||
connect(ui->b_none, SIGNAL(clicked(bool)), this, SLOT(checkNone())); | ||
connect(ui->b_cancel, SIGNAL(clicked(bool)), this, SLOT(reject())); | ||
connect(ui->b_ok, SIGNAL(clicked(bool)), this, SLOT(accept())); | ||
|
||
this->exec(); | ||
} | ||
|
||
DoxygenFilesDialog::~DoxygenFilesDialog() | ||
{ | ||
delete ui; | ||
} | ||
|
||
uint DoxygenFilesDialog::getFilesList(QStringList *out) | ||
{ | ||
uint count = 0; | ||
for (int i=0; i< ui->listWidget->count(); i++) | ||
{ | ||
if (ui->listWidget->item(i)->checkState() == Qt::Checked) | ||
{ | ||
out->append(ui->listWidget->item(i)->text()); | ||
count++; | ||
} | ||
} | ||
return count; | ||
} | ||
|
||
void DoxygenFilesDialog::checkAll() | ||
{ | ||
for (int i=0; i< ui->listWidget->count(); i++) | ||
{ | ||
if (ui->listWidget->item(i)->checkState() == Qt::Unchecked) | ||
ui->listWidget->item(i)->setCheckState(Qt::Checked); | ||
} | ||
} | ||
|
||
void DoxygenFilesDialog::checkNone() | ||
{ | ||
for (int i=0; i< ui->listWidget->count(); i++) | ||
{ | ||
if (ui->listWidget->item(i)->checkState() == Qt::Checked) | ||
ui->listWidget->item(i)->setCheckState(Qt::Unchecked); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef DOXYGENFILESDIALOG_H | ||
#define DOXYGENFILESDIALOG_H | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class DoxygenFilesDialog; | ||
} | ||
|
||
class DoxygenFilesDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit DoxygenFilesDialog(const QStringList &in, QWidget *parent = 0); | ||
~DoxygenFilesDialog(); | ||
uint getFilesList(QStringList *out); | ||
|
||
private: | ||
Ui::DoxygenFilesDialog *ui; | ||
|
||
private slots: | ||
void checkAll(); | ||
void checkNone(); | ||
}; | ||
|
||
#endif // DOXYGENFILESDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>DoxygenFilesDialog</class> | ||
<widget class="QDialog" name="DoxygenFilesDialog"> | ||
<property name="windowModality"> | ||
<enum>Qt::ApplicationModal</enum> | ||
</property> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Select files to document</string> | ||
</property> | ||
<property name="modal"> | ||
<bool>true</bool> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QListWidget" name="listWidget"> | ||
<property name="sortingEnabled"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QFrame" name="frame"> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>0</width> | ||
<height>50</height> | ||
</size> | ||
</property> | ||
<property name="frameShape"> | ||
<enum>QFrame::StyledPanel</enum> | ||
</property> | ||
<property name="frameShadow"> | ||
<enum>QFrame::Raised</enum> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QPushButton" name="b_all"> | ||
<property name="text"> | ||
<string>Select All</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="b_none"> | ||
<property name="text"> | ||
<string>Select None</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="b_ok"> | ||
<property name="text"> | ||
<string>Ok</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="b_cancel"> | ||
<property name="text"> | ||
<string>Cancel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters