Пример #1
0
void ThemeManagementDialog::packTheme()
{
	KviPointerList<KviThemeInfo> dl;
	dl.setAutoDelete(false);
	QList<QListWidgetItem*> itemsSelected = m_pListWidget->selectedItems ();
	for(int i=0;i<itemsSelected.count();i++)
		dl.append(((ThemeListWidgetItem *)itemsSelected.at(i))->themeInfo());
	if(dl.isEmpty())return;

	PackThemeDialog * pDialog = new PackThemeDialog(this,&dl);
	pDialog->exec();
	pDialog->deleteLater();
}
Пример #2
0
void ActionEditor::deleteActions()
{
	KviPointerList<ActionEditorTreeWidgetItem> l;
	l.setAutoDelete(false);

	for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++)
	{
		if(m_pTreeWidget->topLevelItem(i)->isSelected())
		l.append((ActionEditorTreeWidgetItem * )m_pTreeWidget->topLevelItem(i));
	}

	if(l.isEmpty())return;

	//if(QMessageBox::question(this,__tr2qs_ctx("Confirm Deletion","editor"),__tr2qs_ctx("Do you really want to delete the selected actions ?","editor"),__tr2qs_ctx("Yes","editor"),__tr2qs_ctx("No","editor")) != 0)
	//	return;

	for(ActionEditorTreeWidgetItem * i = l.first();i;i = l.next())
	{
		if(m_pSingleActionEditor->actionData() == i->actionData())
			m_pSingleActionEditor->setActionData(0);
		delete i;
	}
}