mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-24 08:06:13 +00:00
Implemented tile image deletion.
This commit is contained in:
parent
93fa8d3e3b
commit
10f757286b
2 changed files with 22 additions and 1 deletions
|
@ -130,7 +130,7 @@ TileEditorMainWindow::TileEditorMainWindow(QWidget *parent)
|
||||||
connect(m_ui->actionAddTile, SIGNAL(triggered(bool)), this, SLOT(onActionAddTile(bool)));
|
connect(m_ui->actionAddTile, SIGNAL(triggered(bool)), this, SLOT(onActionAddTile(bool)));
|
||||||
connect(m_ui->actionDeleteTile, SIGNAL(triggered(bool)), this, SLOT(onActionDeleteTile(bool)));
|
connect(m_ui->actionDeleteTile, SIGNAL(triggered(bool)), this, SLOT(onActionDeleteTile(bool)));
|
||||||
connect(m_ui->actionReplaceImage, SIGNAL(triggered(bool)), this, SLOT(onActionReplaceImage(bool)));
|
connect(m_ui->actionReplaceImage, SIGNAL(triggered(bool)), this, SLOT(onActionReplaceImage(bool)));
|
||||||
connect(m_ui->actionDeleteImage, SIGNAL(triggered(bool)), this, SLOT(onActioneleteImage(bool)));
|
connect(m_ui->actionDeleteImage, SIGNAL(triggered(bool)), this, SLOT(onActionDeleteImage(bool)));
|
||||||
|
|
||||||
//connect(m_ui->tileViewTabWidget, SIGNAL(currentChanged(int)), m_tileItemDelegate, SLOT(currentTab(int)));
|
//connect(m_ui->tileViewTabWidget, SIGNAL(currentChanged(int)), m_tileItemDelegate, SLOT(currentTab(int)));
|
||||||
|
|
||||||
|
@ -224,6 +224,7 @@ void TileEditorMainWindow::onActionReplaceImage(bool triggered)
|
||||||
|
|
||||||
void TileEditorMainWindow::onActionDeleteImage(bool triggered)
|
void TileEditorMainWindow::onActionDeleteImage(bool triggered)
|
||||||
{
|
{
|
||||||
|
onActionDeleteImage(m_ui->tileViewTabWidget->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileEditorMainWindow::onTileSetAdd()
|
void TileEditorMainWindow::onTileSetAdd()
|
||||||
|
@ -601,6 +602,23 @@ void TileEditorMainWindow::onActionDeleteTile( int tabId )
|
||||||
//lv->reset();
|
//lv->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TileEditorMainWindow::onActionDeleteImage( int tabId )
|
||||||
|
{
|
||||||
|
QListView *lv = getListViewByTab( tabId );
|
||||||
|
|
||||||
|
QModelIndex idx = lv->currentIndex();
|
||||||
|
if( !idx.isValid() )
|
||||||
|
{
|
||||||
|
QMessageBox::information( this,
|
||||||
|
tr( "Deleting tile image" ),
|
||||||
|
tr( "No tile selected!" ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TileItemNode *n = reinterpret_cast< TileItemNode* >( idx.internalPointer() );
|
||||||
|
n->setTileFilename( TileModel::TileDiffuse, "" );
|
||||||
|
}
|
||||||
|
|
||||||
TileModel* TileEditorMainWindow::createTileModel()
|
TileModel* TileEditorMainWindow::createTileModel()
|
||||||
{
|
{
|
||||||
QStringList headers;
|
QStringList headers;
|
||||||
|
|
|
@ -70,6 +70,9 @@ private Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
void onActionAddTile(int tabId);
|
void onActionAddTile(int tabId);
|
||||||
void onActionDeleteTile(int tabId);
|
void onActionDeleteTile(int tabId);
|
||||||
|
void onActionDeleteImage(int tabId);
|
||||||
|
|
||||||
|
|
||||||
TileModel* createTileModel();
|
TileModel* createTileModel();
|
||||||
QListView* getListViewByTab( int tab ) const;
|
QListView* getListViewByTab( int tab ) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue