mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:29:55 +00:00
Merge remote-tracking branch 'scrawl/contentselector'
This commit is contained in:
commit
fa4718283d
5 changed files with 16 additions and 16 deletions
|
@ -125,12 +125,16 @@ void CSVDoc::FileDialog::buildOpenFileView()
|
|||
|
||||
if(!mDialogBuilt)
|
||||
{
|
||||
connect (mSelector, SIGNAL (signalAddonFileSelected (int)), this, SLOT (slotUpdateAcceptButton (int)));
|
||||
connect (mSelector, SIGNAL (signalAddonFileUnselected (int)), this, SLOT (slotUpdateAcceptButton (int)));
|
||||
connect (mSelector, SIGNAL (signalAddonDataChanged (const QModelIndex&, const QModelIndex&)), this, SLOT (slotAddonDataChanged(const QModelIndex&, const QModelIndex&)));
|
||||
}
|
||||
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile()));
|
||||
}
|
||||
|
||||
void CSVDoc::FileDialog::slotAddonDataChanged(const QModelIndex &topleft, const QModelIndex &bottomright)
|
||||
{
|
||||
slotUpdateAcceptButton(0);
|
||||
}
|
||||
|
||||
void CSVDoc::FileDialog::slotUpdateAcceptButton(int)
|
||||
{
|
||||
QString name = "";
|
||||
|
|
|
@ -70,6 +70,7 @@ namespace CSVDoc
|
|||
void slotUpdateAcceptButton (int);
|
||||
void slotUpdateAcceptButton (const QString &, bool);
|
||||
void slotRejected();
|
||||
void slotAddonDataChanged(const QModelIndex& topleft, const QModelIndex& bottomright);
|
||||
};
|
||||
}
|
||||
#endif // FILEDIALOG_HPP
|
||||
|
|
|
@ -113,7 +113,7 @@ Qt::ItemFlags ContentSelectorModel::ContentModel::flags(const QModelIndex &index
|
|||
|
||||
//game files can always be checked
|
||||
if (file->isGameFile())
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
|
||||
|
||||
Qt::ItemFlags returnFlags;
|
||||
bool allDependenciesFound = true;
|
||||
|
@ -152,7 +152,7 @@ Qt::ItemFlags ContentSelectorModel::ContentModel::flags(const QModelIndex &index
|
|||
if (gamefileChecked)
|
||||
{
|
||||
if (allDependenciesFound)
|
||||
returnFlags = returnFlags | Qt::ItemIsEnabled | Qt::ItemIsSelectable | mDragDropFlags;
|
||||
returnFlags = returnFlags | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | mDragDropFlags;
|
||||
else
|
||||
returnFlags = Qt::ItemIsSelectable;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,8 @@ void ContentSelectorView::ContentSelector::buildAddonView()
|
|||
|
||||
ui.addonView->setModel(mAddonProxyModel);
|
||||
|
||||
connect(ui.addonView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(slotAddonTableItemClicked(const QModelIndex &)));
|
||||
connect(ui.addonView, SIGNAL(activated(const QModelIndex&)), this, SLOT(slotAddonTableItemActivated(const QModelIndex&)));
|
||||
connect(mContentModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SIGNAL(signalAddonDataChanged(QModelIndex,QModelIndex)));
|
||||
}
|
||||
|
||||
void ContentSelectorView::ContentSelector::setProfileContent(const QStringList &fileList)
|
||||
|
@ -171,7 +172,7 @@ void ContentSelectorView::ContentSelector::slotCurrentGameFileIndexChanged(int i
|
|||
emit signalCurrentGamefileIndexChanged (index);
|
||||
}
|
||||
|
||||
void ContentSelectorView::ContentSelector::slotAddonTableItemClicked(const QModelIndex &index)
|
||||
void ContentSelectorView::ContentSelector::slotAddonTableItemActivated(const QModelIndex &index)
|
||||
{
|
||||
QModelIndex sourceIndex = mAddonProxyModel->mapToSource (index);
|
||||
|
||||
|
@ -184,10 +185,4 @@ void ContentSelectorView::ContentSelector::slotAddonTableItemClicked(const QMode
|
|||
checkState = Qt::Checked;
|
||||
|
||||
mContentModel->setData(sourceIndex, checkState, Qt::CheckStateRole);
|
||||
|
||||
if (checkState == Qt::Checked)
|
||||
emit signalAddonFileSelected (index.row());
|
||||
else
|
||||
emit signalAddonFileUnselected (index.row());
|
||||
|
||||
}
|
||||
|
|
|
@ -55,13 +55,13 @@ namespace ContentSelectorView
|
|||
|
||||
signals:
|
||||
void signalCurrentGamefileIndexChanged (int);
|
||||
void signalAddonFileSelected (int);
|
||||
void signalAddonFileUnselected (int);
|
||||
|
||||
void signalAddonDataChanged (const QModelIndex& topleft, const QModelIndex& bottomright);
|
||||
|
||||
private slots:
|
||||
|
||||
void slotCurrentGameFileIndexChanged(int index);
|
||||
void slotAddonTableItemClicked(const QModelIndex &index);
|
||||
void slotAddonTableItemActivated(const QModelIndex& index);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue