Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
8,382 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,92 @@ | ||
/* | ||
Copyright 2010 Warzone 2100 Project | ||
This file is part of WMIT. | ||
WMIT is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
WMIT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with WMIT. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "ConfigDialog.hpp" | ||
#include "ui_ConfigDialog.h" | ||
|
||
#include <QFileDialog> | ||
|
||
ConfigDialog::ConfigDialog(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::ConfigDialog) | ||
{ | ||
ui->setupUi(this); | ||
ui->lw_dirs->setSelectionMode(QAbstractItemView::MultiSelection); | ||
} | ||
|
||
ConfigDialog::~ConfigDialog() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void ConfigDialog::changeEvent(QEvent *e) | ||
{ | ||
QDialog::changeEvent(e); | ||
switch (e->type()) { | ||
case QEvent::LanguageChange: | ||
ui->retranslateUi(this); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
void ConfigDialog::setTextureSearchDirs(QStringList dirs) | ||
{ | ||
ui->lw_dirs->clear(); | ||
ui->lw_dirs->addItems(dirs); | ||
} | ||
|
||
void ConfigDialog::on_pb_add_clicked() | ||
{ | ||
QFileDialog* fileDialog = new QFileDialog(this); | ||
fileDialog->setWindowTitle(tr("Select texture search directory.")); | ||
fileDialog->setFileMode(QFileDialog::Directory); | ||
fileDialog->setFilter("*.png"); | ||
fileDialog->exec(); | ||
if (fileDialog->result() == QDialog::Accepted) | ||
{ | ||
foreach (QString dir, fileDialog->selectedFiles()) | ||
{ | ||
searchDirChanges.append(qMakePair(true, dir)); | ||
ui->lw_dirs->addItem(dir); | ||
} | ||
} | ||
delete fileDialog; | ||
} | ||
|
||
void ConfigDialog::on_pb_remove_clicked() | ||
{ | ||
foreach(QListWidgetItem* item, ui->lw_dirs->selectedItems()) | ||
{ | ||
searchDirChanges.append(qMakePair(false, item->text())); | ||
delete ui->lw_dirs->takeItem(ui->lw_dirs->row(item)); | ||
} | ||
} | ||
|
||
void ConfigDialog::on_buttonBox_accepted() | ||
{ | ||
emit updateTextureSearchDirs(searchDirChanges); | ||
searchDirChanges.clear(); | ||
} | ||
|
||
void ConfigDialog::on_buttonBox_rejected() | ||
{ | ||
searchDirChanges.clear(); | ||
} |
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,57 @@ | ||
/* | ||
Copyright 2010 Warzone 2100 Project | ||
This file is part of WMIT. | ||
WMIT is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
WMIT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with WMIT. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef CONFIGDIALOG_HPP | ||
#define CONFIGDIALOG_HPP | ||
|
||
#include <QDialog> | ||
|
||
#include <QList> | ||
#include <QPair> | ||
#include <QString> | ||
|
||
namespace Ui { | ||
class ConfigDialog; | ||
} | ||
|
||
class ConfigDialog : public QDialog { | ||
Q_OBJECT | ||
public: | ||
ConfigDialog(QWidget *parent = 0); | ||
~ConfigDialog(); | ||
|
||
protected: | ||
void changeEvent(QEvent *e); | ||
|
||
private: | ||
Ui::ConfigDialog *ui; | ||
QList<QPair<bool,QString> > searchDirChanges; | ||
signals: | ||
void updateTextureSearchDirs(QList<QPair<bool,QString> >); | ||
|
||
public slots: | ||
void setTextureSearchDirs(QStringList); | ||
|
||
private slots: | ||
void on_buttonBox_rejected(); | ||
void on_buttonBox_accepted(); | ||
void on_pb_remove_clicked(); | ||
void on_pb_add_clicked(); | ||
}; | ||
|
||
#endif // CONFIGDIALOG_HPP |
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,120 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ConfigDialog</class> | ||
<widget class="QDialog" name="ConfigDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>398</width> | ||
<height>301</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Config</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<item> | ||
<widget class="QGroupBox" name="groupBox"> | ||
<property name="title"> | ||
<string>Texture search directories</string> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout_2"> | ||
<item row="0" column="0"> | ||
<widget class="QListWidget" name="lw_dirs"/> | ||
</item> | ||
<item row="0" column="1"> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<spacer name="verticalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pb_add"> | ||
<property name="text"> | ||
<string>Add</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pb_remove"> | ||
<property name="text"> | ||
<string>Remove</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>accepted()</signal> | ||
<receiver>ConfigDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>248</x> | ||
<y>254</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>157</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>ConfigDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>316</x> | ||
<y>260</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
Copyright 2010 Warzone 2100 Project | ||
This file is part of WMIT. | ||
WMIT is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
WMIT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with WMIT. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "ExportDialog.hpp" | ||
#include "ui_ExportDialog.h" | ||
|
||
ExportDialog::ExportDialog(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::ExportDialog) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
ExportDialog::~ExportDialog() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void ExportDialog::changeEvent(QEvent *e) | ||
{ | ||
QDialog::changeEvent(e); | ||
switch (e->type()) { | ||
case QEvent::LanguageChange: | ||
ui->retranslateUi(this); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
int ExportDialog::optimisationSelected() const | ||
{ | ||
return ui->comboBox->currentIndex(); | ||
} | ||
|
||
PieExportDialog::PieExportDialog(QWidget* parent) | ||
: ExportDialog(parent) | ||
{ | ||
} |
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,51 @@ | ||
/* | ||
Copyright 2010 Warzone 2100 Project | ||
This file is part of WMIT. | ||
WMIT is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
WMIT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with WMIT. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef EXPORTDIALOG_HPP | ||
#define EXPORTDIALOG_HPP | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class ExportDialog; | ||
} | ||
|
||
class ExportDialog : public QDialog { | ||
Q_OBJECT | ||
public: | ||
ExportDialog(QWidget *parent = 0); | ||
~ExportDialog(); | ||
|
||
int optimisationSelected() const; | ||
protected: | ||
void changeEvent(QEvent *e); | ||
|
||
private: | ||
Ui::ExportDialog *ui; | ||
}; | ||
|
||
class PieExportDialog : public ExportDialog | ||
{ | ||
Q_OBJECT | ||
public: | ||
PieExportDialog(QWidget* parent = NULL); | ||
private: | ||
}; | ||
|
||
#endif // EXPORTDIALOG_HPP |
Oops, something went wrong.