forked from teamnwah/openmw-tes3coop
Merge remote-tracking branch 'cc9cii/Bug-No-1725'
Conflicts: apps/opencs/model/tools/bodypartcheck.cpp
This commit is contained in:
commit
70ee899691
3 changed files with 53 additions and 24 deletions
|
@ -26,7 +26,6 @@ void CSMTools::BodyPartCheckStage::perform ( int stage, Messages &messages )
|
||||||
CSMWorld::UniversalId id( CSMWorld::UniversalId::Type_BodyPart, bodyPart.mId );
|
CSMWorld::UniversalId id( CSMWorld::UniversalId::Type_BodyPart, bodyPart.mId );
|
||||||
|
|
||||||
// Check BYDT
|
// Check BYDT
|
||||||
|
|
||||||
if (bodyPart.mData.mPart > 14 )
|
if (bodyPart.mData.mPart > 14 )
|
||||||
messages.push_back(std::make_pair( id, bodyPart.mId + " has out of range part value." ));
|
messages.push_back(std::make_pair( id, bodyPart.mId + " has out of range part value." ));
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "adjusterwidget.hpp"
|
#include "adjusterwidget.hpp"
|
||||||
|
|
||||||
CSVDoc::FileDialog::FileDialog(QWidget *parent) :
|
CSVDoc::FileDialog::FileDialog(QWidget *parent) :
|
||||||
QDialog(parent), mSelector (0), mFileWidget (0), mAdjusterWidget (0)
|
QDialog(parent), mSelector (0), mFileWidget (0), mAdjusterWidget (0), mDialogBuilt(false)
|
||||||
{
|
{
|
||||||
ui.setupUi (this);
|
ui.setupUi (this);
|
||||||
resize(400, 400);
|
resize(400, 400);
|
||||||
|
@ -70,11 +70,15 @@ void CSVDoc::FileDialog::showDialog (ContentAction action)
|
||||||
|
|
||||||
mAdjusterWidget->setFilenameCheck (mAction == ContentAction_New);
|
mAdjusterWidget->setFilenameCheck (mAction == ContentAction_New);
|
||||||
|
|
||||||
|
if(!mDialogBuilt)
|
||||||
|
{
|
||||||
//connections common to both dialog view flavors
|
//connections common to both dialog view flavors
|
||||||
connect (mSelector, SIGNAL (signalCurrentGamefileIndexChanged (int)),
|
connect (mSelector, SIGNAL (signalCurrentGamefileIndexChanged (int)),
|
||||||
this, SLOT (slotUpdateAcceptButton (int)));
|
this, SLOT (slotUpdateAcceptButton (int)));
|
||||||
|
|
||||||
connect (ui.projectButtonBox, SIGNAL (rejected()), this, SLOT (slotRejected()));
|
connect (ui.projectButtonBox, SIGNAL (rejected()), this, SLOT (slotRejected()));
|
||||||
|
mDialogBuilt = true;
|
||||||
|
}
|
||||||
|
|
||||||
show();
|
show();
|
||||||
raise();
|
raise();
|
||||||
|
@ -89,19 +93,23 @@ void CSVDoc::FileDialog::buildNewFileView()
|
||||||
createButton->setText ("Create");
|
createButton->setText ("Create");
|
||||||
createButton->setEnabled (false);
|
createButton->setEnabled (false);
|
||||||
|
|
||||||
|
if(!mFileWidget)
|
||||||
|
{
|
||||||
mFileWidget = new FileWidget (this);
|
mFileWidget = new FileWidget (this);
|
||||||
|
|
||||||
mFileWidget->setType (true);
|
mFileWidget->setType (true);
|
||||||
mFileWidget->extensionLabelIsVisible(true);
|
mFileWidget->extensionLabelIsVisible(true);
|
||||||
|
|
||||||
ui.projectGroupBoxLayout->insertWidget (0, mFileWidget);
|
|
||||||
|
|
||||||
connect (mFileWidget, SIGNAL (nameChanged (const QString&, bool)),
|
connect (mFileWidget, SIGNAL (nameChanged (const QString&, bool)),
|
||||||
mAdjusterWidget, SLOT (setName (const QString&, bool)));
|
mAdjusterWidget, SLOT (setName (const QString&, bool)));
|
||||||
|
|
||||||
connect (mFileWidget, SIGNAL (nameChanged(const QString &, bool)),
|
connect (mFileWidget, SIGNAL (nameChanged(const QString &, bool)),
|
||||||
this, SLOT (slotUpdateAcceptButton(const QString &, bool)));
|
this, SLOT (slotUpdateAcceptButton(const QString &, bool)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.projectGroupBoxLayout->insertWidget (0, mFileWidget);
|
||||||
|
|
||||||
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile()));
|
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,12 +117,17 @@ void CSVDoc::FileDialog::buildOpenFileView()
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Open"));
|
setWindowTitle(tr("Open"));
|
||||||
ui.projectGroupBox->setTitle (QString(""));
|
ui.projectGroupBox->setTitle (QString(""));
|
||||||
|
ui.projectButtonBox->button(QDialogButtonBox::Ok)->setText ("Open");
|
||||||
|
if(mSelector->isGamefileSelected())
|
||||||
|
ui.projectButtonBox->button(QDialogButtonBox::Ok)->setEnabled (true);
|
||||||
|
else
|
||||||
ui.projectButtonBox->button(QDialogButtonBox::Ok)->setEnabled (false);
|
ui.projectButtonBox->button(QDialogButtonBox::Ok)->setEnabled (false);
|
||||||
|
|
||||||
|
if(!mDialogBuilt)
|
||||||
|
{
|
||||||
connect (mSelector, SIGNAL (signalAddonFileSelected (int)), this, SLOT (slotUpdateAcceptButton (int)));
|
connect (mSelector, SIGNAL (signalAddonFileSelected (int)), this, SLOT (slotUpdateAcceptButton (int)));
|
||||||
connect (mSelector, SIGNAL (signalAddonFileUnselected (int)), this, SLOT (slotUpdateAcceptButton (int)));
|
connect (mSelector, SIGNAL (signalAddonFileUnselected (int)), this, SLOT (slotUpdateAcceptButton (int)));
|
||||||
|
}
|
||||||
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile()));
|
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,12 +169,26 @@ QString CSVDoc::FileDialog::filename() const
|
||||||
void CSVDoc::FileDialog::slotRejected()
|
void CSVDoc::FileDialog::slotRejected()
|
||||||
{
|
{
|
||||||
emit rejected();
|
emit rejected();
|
||||||
|
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile()));
|
||||||
|
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile()));
|
||||||
|
if(mFileWidget)
|
||||||
|
{
|
||||||
|
delete mFileWidget;
|
||||||
|
mFileWidget = NULL;
|
||||||
|
}
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVDoc::FileDialog::slotNewFile()
|
void CSVDoc::FileDialog::slotNewFile()
|
||||||
{
|
{
|
||||||
emit signalCreateNewFile (mAdjusterWidget->getPath());
|
emit signalCreateNewFile (mAdjusterWidget->getPath());
|
||||||
|
if(mFileWidget)
|
||||||
|
{
|
||||||
|
delete mFileWidget;
|
||||||
|
mFileWidget = NULL;
|
||||||
|
}
|
||||||
|
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile()));
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVDoc::FileDialog::slotOpenFile()
|
void CSVDoc::FileDialog::slotOpenFile()
|
||||||
|
@ -171,4 +198,6 @@ void CSVDoc::FileDialog::slotOpenFile()
|
||||||
mAdjusterWidget->setName (file->filePath(), !file->isGameFile());
|
mAdjusterWidget->setName (file->filePath(), !file->isGameFile());
|
||||||
|
|
||||||
emit signalOpenFiles (mAdjusterWidget->getPath());
|
emit signalOpenFiles (mAdjusterWidget->getPath());
|
||||||
|
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile()));
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace CSVDoc
|
||||||
ContentAction mAction;
|
ContentAction mAction;
|
||||||
FileWidget *mFileWidget;
|
FileWidget *mFileWidget;
|
||||||
AdjusterWidget *mAdjusterWidget;
|
AdjusterWidget *mAdjusterWidget;
|
||||||
|
bool mDialogBuilt;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue