Exemplo n.º 1
0
void HostListsDialog::showMenu( const QPoint & pos, const Record &, RecordList list )
{
	QMenu * menu = new QMenu( this );
	QAction * del = menu->addAction( "Delete" );
	QAction * result = menu->exec( pos );
	if( result ) {
		if( result == del ) {
			list.remove();
		}
	}
	delete menu;
}
Exemplo n.º 2
0
void RecordUndoOperation::undo()
{
	if( mType == INSERT || mType == DELETE ) {
		RecordList temp = mRecords.reversed();
		if( mType == INSERT ) {
			temp.remove();
		} else {
			// Clear the DELETED state
			st_foreach( RecordIter, it, temp )
				it.imp()->mState = RecordImp::NEWRECORD | RecordImp::COMMIT_ALL_FIELDS;
			temp.commit( false );
		}
	} else if( mType ==  UPDATE ) {
		RecordList list = mRecords;
		Record oldvals( mRecords[0].imp()->copy(), false );
		mRecords[1].commit();
		mRecords[1] = oldvals;
	}
}
void NotificationRouteDialog::slotRemoveRoute()
{
	RecordList sel = mNotificationRouteView->selection();
	sel.remove();
	mNotificationRouteView->model()->remove(sel);
}