void QmmpFileDialogImpl::on_addPushButton_clicked() { QModelIndexList ml = fileListView->selectionModel()->selectedIndexes(); QStringList l; foreach(QModelIndex i,ml) l << m_model->filePath(i); emit filesAdded(l); }
PICComponent::PICComponent( ICNDocument *icnDocument, bool newItem, const char *id ) : Component( icnDocument, newItem, id ? id : "pic" ) { m_name = i18n("PIC Micro"); if ( _def_PICComponent_fileName.isEmpty() ) _def_PICComponent_fileName = i18n("<Enter location of PIC Program>"); m_bCreatedInitialPackage = false; m_bLoadingProgram = false; m_pGpsim = 0L; addButton( "run", QRect(), KIcon( "media-playback-start" ) ); addButton( "pause", QRect(), KIcon( "media-playback-pause" ) ); addButton( "reset", QRect(), KIcon( "process-stop" ) ); addButton( "reload", QRect(), KIcon( "view-refresh" ) ); connect( KTechlab::self(), SIGNAL(recentFileAdded(const KUrl &)), this, SLOT(slotUpdateFileList()) ); connect( ProjectManager::self(), SIGNAL(projectOpened()), this, SLOT(slotUpdateFileList()) ); connect( ProjectManager::self(), SIGNAL(projectClosed()), this, SLOT(slotUpdateFileList()) ); connect( ProjectManager::self(), SIGNAL(projectCreated()), this, SLOT(slotUpdateFileList()) ); connect( ProjectManager::self(), SIGNAL(subprojectCreated()), this, SLOT(slotUpdateFileList()) ); connect( ProjectManager::self(), SIGNAL(filesAdded()), this, SLOT(slotUpdateFileList()) ); connect( ProjectManager::self(), SIGNAL(filesRemoved()), this, SLOT(slotUpdateFileList()) ); createProperty( "program", Variant::Type::FileName ); property("program")->setCaption( i18n("Program") ); QString filter; filter = QString("*.flowcode *.cod *.asm *.basic *.c|%1").arg(i18n("All Supported Files")); filter += QString("\n*.flowcode|FlowCode (*.flowcode)"); filter += QString("\n*.cod|%1 (*.cod)").arg(i18n("Symbol File")); filter += QString("\n*.asm|%1 (*.asm)").arg(i18n("Assembly Code")); filter += QString("\n*.basic *.microbe|Microbe (*.basic, *.microbe)"); filter += QString("\n*.c|C (*.c)"); filter += QString("\n*|%1").arg(i18n("All Files")); property("program")->setFilter( filter ); // Used for restoring the pins on file loading before we have had a change // to compile the PIC program createProperty( "lastPackage", Variant::Type::String ); property("lastPackage")->setHidden( true ); // //HACK This is to enable loading with pre-0.3 files (which didn't set a "lastPackage" // // property). This will allow a P16F84 PIC to be initialized (which agrees with pre-0.3 // // behaviour), but it will also load it if // This to allow loading of the PIC component from pre-0.3 files (which didn't set a // "lastPackage" property). if ( !newItem ) property("lastPackage")->setValue("P16F84"); slotUpdateFileList(); slotUpdateBtns(); initPackage( 0 ); }
void FSTableView::dropEvent(QDropEvent *event) { QStringList list; foreach (QUrl url, event->mimeData()->urls()) list.append(url.toLocalFile()); qDebug()<<list; emit filesAdded(list); viewport()->setStyleSheet(QString()); showColumn(0); showColumn(1); showColumn(2); }
void QmmpFileDialogImpl::on_fileListView_doubleClicked(const QModelIndex& ind) { if(ind.isValid()) { QFileInfo info = m_model->fileInfo(ind); if(info.isDir()) { fileListView->setRootIndex(ind); lookInComboBox->setEditText(m_model->filePath(ind)); } else { QStringList l; l << m_model->filePath(ind); emit filesAdded(l); } } }
// ----------------------------------------------------------------------------- // CCapInfo::CapabilityDocumentL(CBufFlat* aBuf) // Creates capability xml document end places it in aBuf // ----------------------------------------------------------------------------- // void CCapInfo::CapabilityDocumentL(CBufFlat* aBuf) { TRACE_FUNC_ENTRY; TInt err( KErrNone ); // set buffer where capability document is written SetCapabilityBuf( aBuf ); WriteL( KXmlVersion ); WriteL( KComment1 ); WriteL( KDocType ); WriteL( KRootBegin ); // // general // TRAP( err, GeneralInfoL() ); if ( err != KErrNone ) { LOGGER_WRITE_1( "GeneralInfoL failed : %d", err ); User::Leave( err ); } // // services // // Search service files first from C-drive, and then from Z // Do not add same files twice. RArray<TFileName> excludeList( KDefaultArrayGranularity ); CleanupClosePushL( excludeList ); RArray<TFileName> filesAdded( KDefaultArrayGranularity ); CleanupClosePushL( filesAdded ); //read service files from C Import folder TRAP( err, ServiceInfoL( KCapabilityDirCImport, excludeList, filesAdded ) ); LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirCImport) returned : %d", err ); for ( TInt i=0; i<filesAdded.Count(); i++ ) { excludeList.Append( filesAdded[i] ); } filesAdded.Reset(); // read service files from C Capability folder TRAP( err, ServiceInfoL( KCapabilityDirC, excludeList, filesAdded ) ); LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirC) returned : %d", err ); for ( TInt i=0; i<filesAdded.Count(); i++ ) { excludeList.Append( filesAdded[i] ); } filesAdded.Reset(); // read service files from Z Capability folder TRAP( err, ServiceInfoL( KCapabilityDirZ, excludeList, filesAdded ) ); LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirZ) returned : %d", err ); CleanupStack::PopAndDestroy( &filesAdded ); CleanupStack::PopAndDestroy( &excludeList ); // this service does not come from file TRAP( err, FolderServiceL() ); LOGGER_WRITE_1( "FolderServiceL() returned : %d", err ); TRAP( err, SyncSolutionsServiceL() ); LOGGER_WRITE_1( "SyncSolutionsServiceL() returned: %d", err ); WriteL( KRootEnd ); TRACE_FUNC_EXIT; }