- Replace texpageNr lineEdit, with texturePage spinBox.

- Remove associated error-checking (emptyness), since that is guaranteed by Qt.
- Use Ui::Gui3ds2pie instead of Ui_Gui3ds2pie. (Autodetected by Qt/UIC. make distclean if it complains.)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3466 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2008-01-14 02:26:05 +00:00
parent 716d1796b5
commit 4ac1dfecfd
3 changed files with 29 additions and 28 deletions

View File

@ -28,7 +28,7 @@ extern "C" void dump_pie_file(Lib3dsFile *f, FILE *o, const char *page, bool swa
Gui3ds2pie::Gui3ds2pie( QWidget *parent )
: QDialog(parent, Qt::WindowTitleHint), Ui_Gui3ds2pie()
: QDialog(parent), Ui::Gui3ds2pie()
{
setupUi(this);
@ -60,7 +60,7 @@ void Gui3ds2pie::accept()
{
QString inputFile = inputFile_edit->text();
QString outputFile = outputFile_edit->text();
QString texpageNr = texpageNr_edit->text();
QString texturePage = texturePage_edit->text();
unsigned int baseTexFlags = (twoSidedPolys->isChecked() ? 2200 : 200 );
if (inputFile.isEmpty())
@ -73,11 +73,6 @@ void Gui3ds2pie::accept()
QMessageBox::critical(this, tr("Error"), tr("Please specify an output file"));
return;
}
if (texpageNr.isEmpty())
{
QMessageBox::critical(this, tr("Error"), tr("Please specify a texture page number"));
return;
}
Lib3dsFile *f = lib3ds_file_load(inputFile.toAscii().data());
if (!f)
@ -97,7 +92,7 @@ void Gui3ds2pie::accept()
return;
}
dump_pie_file(f, o, texpageNr.toAscii().data(), swapYZ->isChecked(), invertUV->isChecked(), reverseWinding->isChecked(), baseTexFlags);
dump_pie_file(f, o, texturePage.toAscii().data(), swapYZ->isChecked(), invertUV->isChecked(), reverseWinding->isChecked(), baseTexFlags);
fclose(o);
lib3ds_file_free(f);

View File

@ -23,7 +23,7 @@
/**
@author Dennis Schridde <devurandom@gna.org>
*/
class Gui3ds2pie : public QDialog, private Ui_Gui3ds2pie
class Gui3ds2pie : public QDialog, private Ui::Gui3ds2pie
{
Q_OBJECT
public:

View File

@ -112,9 +112,9 @@
<widget class="QLineEdit" name="inputFile_edit" >
<property name="geometry" >
<rect>
<x>120</x>
<x>100</x>
<y>20</y>
<width>171</width>
<width>191</width>
<height>23</height>
</rect>
</property>
@ -122,19 +122,9 @@
<widget class="QLineEdit" name="outputFile_edit" >
<property name="geometry" >
<rect>
<x>120</x>
<x>100</x>
<y>50</y>
<width>171</width>
<height>23</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="texpageNr_edit" >
<property name="geometry" >
<rect>
<x>120</x>
<y>80</y>
<width>171</width>
<width>191</width>
<height>23</height>
</rect>
</property>
@ -144,7 +134,7 @@
<rect>
<x>10</x>
<y>20</y>
<width>101</width>
<width>81</width>
<height>18</height>
</rect>
</property>
@ -157,7 +147,7 @@
<rect>
<x>10</x>
<y>50</y>
<width>101</width>
<width>81</width>
<height>18</height>
</rect>
</property>
@ -165,17 +155,33 @@
<string>Output file</string>
</property>
</widget>
<widget class="QLabel" name="texpageNr" >
<widget class="QLabel" name="texturePage" >
<property name="geometry" >
<rect>
<x>10</x>
<y>80</y>
<width>99</width>
<width>81</width>
<height>18</height>
</rect>
</property>
<property name="text" >
<string>Texture page Nr.</string>
<string>Texture page</string>
</property>
</widget>
<widget class="QSpinBox" name="texturePage_edit" >
<property name="geometry" >
<rect>
<x>100</x>
<y>80</y>
<width>91</width>
<height>23</height>
</rect>
</property>
<property name="prefix" >
<string>page-</string>
</property>
<property name="minimum" >
<number>1</number>
</property>
</widget>
</widget>