Beispiel #1
0
void MainWindow::mkconnections()
{
    connect(bar,SIGNAL(closeClicked()),SLOT(close()));
    connect(bar,SIGNAL(maximizeClicked(bool)),SLOT(showWind(bool)));
    connect(bar,SIGNAL(hideClicked()),SLOT(showMinimized()));
    connect(playlists,SIGNAL(songAdded(QString,QString)),&library,SLOT(addSongInPlaylist(QString,QString)));
    connect(bar,SIGNAL(addFilePressed()),SLOT(addFiles()));
    connect(bar,SIGNAL(addFolderPressed()),SLOT(addFolder()));
    connect(&player,SIGNAL(inPlaylist(bool)),SLOT(changePlayerConnections(bool)));
    connect(&library,SIGNAL(newSong(Song)),table,SLOT(addSongInList(Song)));
    connect(&player,SIGNAL(positionChanged(qint64)),bar,SIGNAL(seekChanged(qint64)));
    connect(&player,SIGNAL(currentSongChanged(Song)),bar,SIGNAL(songChanged(Song)));
    connect(bar,SIGNAL(playClicked()),&player,SLOT(playpause()));
    connect(addFile,SIGNAL(triggered()),SLOT(addFiles()));
    connect(actionAddFolder,SIGNAL(triggered()),SLOT(addFolder()));
    connect(actionOuvrir,SIGNAL(triggered()),SLOT(openFile()));
    connect(bar,SIGNAL(volumeChanged(int)),&player,SLOT(setVolume(int)));
    connect(bar,SIGNAL(positionChanged(int)),&player,SLOT(setPosition(int)));
    connect(bar,SIGNAL(seekBarPressed()),&player,SLOT(pause()));
    connect(bar,SIGNAL(seekBarReleased()),&player,SLOT(play()));
    connect(&player,SIGNAL(playbackStateChanged(bool)),bar,SLOT(changeButton(bool)));
    connect(tree,SIGNAL(albumChosen(QString,QString)),table,SLOT(showSongsFrom(QString,QString)));
    connect(tree,SIGNAL(artistChosen(QString)),table,SLOT(showSongsBy(QString)));
    connect(&library,SIGNAL(libraryChanged(Library*)),tree,SLOT(updateTree(Library*)));
    connect(table,SIGNAL(newPlaylist(Song)),this,SLOT(mkPlaylist(Song)));
    connect(playlists,SIGNAL(playlistChosen(QString)),table,SLOT(showSongsIn(QString)));
    connect(table,SIGNAL(deleteSong(Song,bool)),&library,SLOT(deleteSong(Song,bool)));
    connect(bar,SIGNAL(newQuery(QString,int)),table,SLOT(setQuery(QString,int)));
    connect(bar,SIGNAL(newPlaybackMode(QMediaPlaylist::PlaybackMode)),&player,SLOT(setPlayBackMode(QMediaPlaylist::PlaybackMode)));
    connect(table,SIGNAL(songChosen(int)),&player,SLOT(play(int)));
    connect(table,SIGNAL(newSongList(SongList)),&player,SLOT(update(SongList)));
    connect(&player,SIGNAL(inPlaylist(bool)),bar,SLOT(enableNavigation(bool)));
    connect(bar,SIGNAL(miniLecteur()),&mLecteur,SLOT(show()));
    connect(bar,SIGNAL(miniLecteur()),SLOT(hide()));
    connect(&mLecteur,SIGNAL(windowedMode()),SLOT(show()));
    connect(&mLecteur,SIGNAL(positionChanged(int)),bar,SIGNAL(positionChanged(int)));
    connect(&mLecteur,SIGNAL(seekBarPressed()),bar,SIGNAL(seekBarPressed()));
    connect(&mLecteur,SIGNAL(seekBarReleased()),bar,SIGNAL(seekBarReleased()));
    connect(&mLecteur,SIGNAL(positionChanged(int)),bar,SIGNAL(positionChanged(int)));
    connect(&mLecteur,SIGNAL(playClicked()),bar,SIGNAL(playClicked()));
    connect(&mLecteur,SIGNAL(nextClicked()),bar,SIGNAL(nextClicked()));
    connect(&mLecteur,SIGNAL(previousClicked()),bar,SIGNAL(previousClicked()));
    connect(&mLecteur,SIGNAL(volumeChanged(int)),bar,SIGNAL(volumeChanged(int)));
    connect(&player,SIGNAL(currentSongChanged(Song)),&mLecteur,SLOT(setNewSong(Song)));
    connect(&player,SIGNAL(positionChanged(qint64)),&mLecteur,SLOT(setPosition(qint64)));
    connect(&player,SIGNAL(playbackStateChanged(bool)),&mLecteur,SLOT(changeButton(bool)));
    connect(&player,SIGNAL(indexChanged(int,int)),table,SLOT(setIconTo(int,int)));
    connect(table,SIGNAL(addFileTriggered()),SLOT(addFiles()));
    connect(table,SIGNAL(addFolderTriggered()),SLOT(addFolder()));

}
Beispiel #2
0
void ProjectView::slotProject(int id)
{
	ProjectViewItem *item = dynamic_cast<ProjectViewItem*>(currentItem());
	if(item) {
		if(item->type() == KileType::Project) {
			switch(id) {
				case KPV_ID_BUILDTREE:
					emit(buildProjectTree(item->url()));
				break;
				case KPV_ID_OPTIONS:
					emit(projectOptions(item->url()));
				break;
				case KPV_ID_CLOSE:
					emit(closeProject(item->url()));
				return; //don't access "item" later on
				case KPV_ID_ARCHIVE:
					emit(projectArchive(item->url()));
				break;
				case KPV_ID_ADDFILES:
					emit(addFiles(item->url()));
				break;
				case KPV_ID_OPENALLFILES:
					emit(openAllFiles(item->url()));
				break;
				default:
				break;
			}
		}
	}
}
Beispiel #3
0
void MainWindow::connectSignals
(
    void
)
{
    connect( ui->fileMenu, SIGNAL( aboutToShow() ), this, SLOT( enableExport() ) );
    connect( ui->toolsMenu, SIGNAL( aboutToShow() ), this, SLOT( enableClassify() ) );

    connect( ui->addFilesAction, SIGNAL( triggered() ), this, SLOT( addFiles() ) );
    connect( ui->addDirectoryAction, SIGNAL( triggered() ), this, SLOT( addDirectory() ) );
    connect( ui->aetExportAction, SIGNAL( triggered() ), this, SLOT( exportAetSession() ) );
    connect( ui->stepExportAction, SIGNAL( triggered() ), this, SLOT( exportStepSession() ) );
    connect( ui->exitAction, SIGNAL( triggered() ), qApp, SLOT( quit() ) );

    connect( ui->classifyAction, SIGNAL( triggered() ), session, SLOT( classify() ) );
    connect( ui->optionsAction, SIGNAL( triggered() ), this, SLOT( showOptionsDialog() ) );

    connect( this, SIGNAL( settingsChanged() ), session, SLOT( loadSettings() ) );

    connect( itemListModel, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( updateFileTreeView() ) );
    connect( variantListModel, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SLOT( updateFileTreeView() ) );

    connect( ui->varianceSlider, SIGNAL( valueChanged( int ) ), session, SLOT( setCurrentVariance( int ) ) );

    connect( session, SIGNAL( classificationChanged() ), this, SLOT( updateVariance() ) );
}
Beispiel #4
0
QMenu* VlcWidget::GenerateMenuForOpenAction ()
{
    QMenu *result = new QMenu;

    connect (result->addAction (tr ("Open file")),
             SIGNAL (triggered ()),
             this,
             SLOT (addFiles ()));

    connect (result->addAction (tr ("Open folder")),
             SIGNAL (triggered ()),
             this,
             SLOT (addFolder ()));

    connect (result->addAction (tr ("Open URL")),
             SIGNAL (triggered ()),
             this,
             SLOT (addUrl ()));

    connect (result->addAction (tr ("Open DVD")),
             SIGNAL (triggered ()),
             this,
             SLOT (addDVD ()));

    connect (result->addAction (tr ("Open Simple DVD")),
             SIGNAL (triggered ()),
             this,
             SLOT (addSimpleDVD ()));

    return result;
}
void UploadProgressPresenter::sltDataUpload(const FileUploadInfoModel& uf)
{
    addFiles(uf);

    //шлем информация о статистике загрузок(для отображения на statusBar)
    emit information(m_model.statistic());
}
void MusicPlayer::addFiles()
{
    fileLoadingList = QFileDialog::getOpenFileNames(widget, tr("Select Music Files"),
                      QDesktopServices::storageLocation(QDesktopServices::MusicLocation));

    addFiles(fileLoadingList);
}
StorageTinyLog::StorageTinyLog(
    const std::string & path_,
    const std::string & name_,
    const ColumnsDescription & columns_,
    bool attach,
    size_t max_compress_block_size_)
    : IStorage{columns_},
    path(path_), name(name_),
    max_compress_block_size(max_compress_block_size_),
    file_checker(path + escapeForFileName(name) + '/' + "sizes.json"),
    log(&Logger::get("StorageTinyLog"))
{
    if (path.empty())
        throw Exception("Storage " + getName() + " requires data path", ErrorCodes::INCORRECT_FILE_NAME);

    String full_path = path + escapeForFileName(name) + '/';
    if (!attach)
    {
        /// create files if they do not exist
        if (0 != mkdir(full_path.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) && errno != EEXIST)
            throwFromErrno("Cannot create directory " + full_path, ErrorCodes::CANNOT_CREATE_DIRECTORY);
    }

    for (const auto & col : getColumns().getAllPhysical())
        addFiles(col.name, *col.type);
}
Beispiel #8
0
MSBuildQbsProductProject::MSBuildQbsProductProject(
        const GeneratableProject &project,
        const GeneratableProductData &product,
        const Internal::VisualStudioVersionInfo &versionInfo,
        VisualStudioGenerator *parent)
    : MSBuildTargetProject(project, versionInfo, parent)
{
    Q_ASSERT(project.projects.size() == project.commandLines.size());
    Q_ASSERT(project.projects.size() == product.data.size());

    const int count = std::max(project.projects.size(), product.data.size());

    globalsPropertyGroup()->appendProperty(QStringLiteral("QbsProductName"), product.name());

    MSBuildImport *cppDefaultProps = new MSBuildImport(this);
    cppDefaultProps->setProject(QStringLiteral("$(VCTargetsPath)\\Microsoft.Cpp.Default.props"));

    for (int i = 0; i < count; ++i) {
        addConfiguration(
                    project,
                    project.projects.values().at(i),
                    product.data.values().at(i),
                    project.commandLines.values().at(i));
    }

    MSBuildImport *cppProps = new MSBuildImport(this);
    cppProps->setProject(QStringLiteral("$(VCTargetsPath)\\Microsoft.Cpp.props"));

    for (int i = 0; i < count; ++i)
        addItemDefGroup(project.projects.values().at(i), product.data.values().at(i));

    addFiles(project, product);
}
void PageExtractStats::connects()
{
    MY_DEBUG;

    connect(pushbuttonFiles, SIGNAL(clicked()),
            this, SLOT(addFiles()));
    connect(pushbuttonClearFiles, SIGNAL(clicked()),
            listwidgetFiles, SLOT(clear()));
}
Beispiel #10
0
void TagEditor::createActions(){

    connect(LoadScriptButton,SIGNAL(clicked()),this,SLOT(loadScript()));
    connect(SaveScriptButton,SIGNAL(clicked()),this,SLOT(saveScript()));
    connect(RunScriptButton,SIGNAL(clicked()),this, SLOT(runScript()));

    QAction* searchOnlineAction = new QAction(tr("Search for selected file/album in online musicdatabases..."), this);
    searchOnlineAction->setShortcut(tr("Ctrl+S"));
    connect(searchOnlineAction, SIGNAL(triggered()), this, SLOT(searchOnline()));
    QAction* searchForFilesAction = new QAction(tr("Search for files to add to workspace..."), this);
    //searchForFilesAction->setShortcut(tr("Ctrl+S"));
    connect(searchForFilesAction, SIGNAL(triggered()), this, SLOT(searchAndAddFiles()));

    TreeView->setContextMenuPolicy(Qt::ActionsContextMenu);
    TreeView->addAction(searchOnlineAction);
    TreeView->addAction(searchForFilesAction);


    connect( TreeView, SIGNAL( expanded( const QModelIndex & )  ), this, SLOT( resizeColumn() ) );
    connect( TreeView, SIGNAL( collapsed( const QModelIndex & )  ), this, SLOT( resizeColumn() ) );
    //connect( TreeWidget_, SIGNAL( currentRowChanged( int )  ), this, SLOT( showTagInfo(int) ) );
    connect( TreeWidget_, SIGNAL( itemSelectionChanged() ), this, SLOT( showTagInfo() ) );
    connect( AddButton, SIGNAL( clicked()  ), this, SLOT(addFiles() ) );
    connect( RemoveButton, SIGNAL( clicked()  ), this, SLOT(removeFiles() ) );
    connect( ClearButton, SIGNAL( clicked()  ), this, SLOT(removeAllFiles() ) );
    connect( SaveButton, SIGNAL( clicked()  ), this, SLOT(saveTag() ) );
    connect( ChooseDirButton, SIGNAL( clicked()  ), this, SLOT(chooseDir() ) );

    connect( actionSettings, SIGNAL( triggered() ), this, SLOT( showSettings() ) );
    connect( actionRewriteTag, SIGNAL( triggered() ), this, SLOT( rewriteTag() ) );
    connect( actionRenameFiles, SIGNAL( triggered() ), this, SLOT( renameFiles() ) );
    connect( actionReplaceTags, SIGNAL( triggered() ), this, SLOT( replaceTags() ) );
    connect( actionSerialize, SIGNAL( triggered() ), this, SLOT( serialize() ) );
    connect( actionClearTags, SIGNAL( triggered() ), this, SLOT( clearTags() ) );
    //connect( actionRemoveFrames, SIGNAL( triggered() ), this, SLOT( removeFrames() ) );
    //styles

    QSignalMapper *styleMapper = new QSignalMapper(this);
    QStringList styles = QStyleFactory::keys();
    for(int i=0;i<styles.size();i++){
        QAction *a = new QAction(styles[i],menuStyle);
        a->setCheckable(true);
        connect(a, SIGNAL(triggered()), styleMapper, SLOT(map()));
        styleMapper->setMapping(a, styles[i]);
        menuStyle->addAction(a);
    }
    menuStyle->addSeparator();
    QAction *actionCustomStyleSheet = new QAction("Custom...",menuStyle);
    actionCustomStyleSheet->setCheckable(true);
    connect(actionCustomStyleSheet, SIGNAL(triggered()), this, SLOT(openStyleSheet()));
    menuStyle->addAction( actionCustomStyleSheet );
    connect(styleMapper, SIGNAL(mapped(const QString &)), this, SLOT(setGUIStyle(const QString &)));

}
ofxTweakbar* ofxTweakbar::addLoader(string sPath, string sExt) {
	if(sPath == "") {
		sPath = ofToDataPath(".", true);
	}
	addFiles("ofxtweakbar_file", NULL)
		->setPath(sPath,sExt)
		->create()
		->setLabel("Select file ...");
	addButton("load", ofxtweakbar_loadclick, this)->setLabel("LOAD");	
	return this;
}
Beispiel #12
0
CAddFilesDialog::CAddFilesDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CAddFilesDialog)
{
    ui->setupUi(this);

    ui->tableView->setModel(&m_model);

    connect(ui->addBtn, SIGNAL(clicked()), this, SLOT(onAddFile()));
    connect(ui->actionAdd_directory, SIGNAL(triggered()), this, SLOT(addDirectory()));
    connect(ui->actionAdd_file, SIGNAL(triggered()), this, SLOT(addFiles()));
}
void TFileAttachmentWidget::onAddTriggered()
{  
  QSettings settings("Invictus Innovations", "Keyhotee");
  QString path = settings.value("AttachmentPath", ".").toString();  

  QStringList selectedFiles = QFileDialog::getOpenFileNames(this, "File(s) to attach", path);
  
  if (selectedFiles.size())
  {
    settings.setValue("AttachmentPath", QFileInfo(selectedFiles.first()).path());
    addFiles( selectedFiles );
  }
}
Beispiel #14
0
/**
 * @brief Extracts all files from specified directory and adds supported files to playlist
 * @param name Path to directory that will be checked
 * @return Number of files accepted from given directory
 */
int plaPlayList::addDirectory(QString name)
{
    int retVal = 0;
    QDir dir(name);
    if (!dir.exists()) {
        OnError(QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss.zzz"), "ERROR", QString("Directory '%1' was not found.").arg(name));
        return retVal;
    }
    QStringList acceptedFiles = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);
    acceptedFiles = filterSupportedFiles(acceptedFiles);
    addFiles(acceptedFiles);
    return acceptedFiles.count();
}
void WidgetFilesList::addFiles()
{
    //get last .mo folder
    QSettings settings("OMOptim", "Settings");
    QString lastMoFolder = settings.value("LastMoFolder").toString();

    QStringList fileNames = QFileDialog::getOpenFileNames(
            this,
            "Files to copy for simulation",
            lastMoFolder,
            _filter );

    addFiles(fileNames);
}
Beispiel #16
0
void StorageTinyLog::truncate(const ASTPtr &, const Context &)
{
    if (name.empty())
        throw Exception("Logical error: table name is empty", ErrorCodes::LOGICAL_ERROR);

    auto file = Poco::File(path + escapeForFileName(name));
    file.remove(true);
    file.createDirectories();

    files.clear();
    file_checker = FileChecker{path + escapeForFileName(name) + '/' + "sizes.json"};

    for (const auto &column : getColumns().getAllPhysical())
        addFiles(column.name, *column.type);
}
void ProjectTreeViewBase::browseToAddExistingFiles()
{
    const File location (item.isGroup() ? item.determineGroupFolder() : getFile());
    FileChooser fc ("Add Files to Jucer Project", location, String::empty, false);

    if (fc.browseForMultipleFilesOrDirectories())
    {
        StringArray files;

        for (int i = 0; i < fc.getResults().size(); ++i)
            files.add (fc.getResults().getReference(i).getFullPathName());

        addFiles (files, 0);
    }
}
Beispiel #18
0
bool XpiksTestsApp::addFilesForTest(const QList<QUrl> &urls) {
    LOG_INFO << urls.size() << "urls";
    SignalWaiter waiter;
    QObject::connect(&m_MetadataIOCoordinator, &MetadataIO::MetadataIOCoordinator::metadataReadingFinished,
                     &waiter, &SignalWaiter::finished);

    int addedCount = addFiles(urls);
    if (addedCount != urls.length()) {
        LOG_WARNING << "Failed to add files:" << addedCount << "added instead of" << urls.length();
        return false;
    }

    bool success = doContinueReading(waiter);
    return success;
}
Beispiel #19
0
void advertise(int udp , int senderId, int numLinks, int numFiles){
	node* curr = routing.head;
	char* ptr;
	
	while( curr != NULL ){
		routingEntry* re = (routingEntry*)curr->data;
		if (re->isNeighbor){
			
			
			struct sockaddr_in cli_addr;
			struct hostent *h;
			
			if((h = gethostbyname(re->hostName))==NULL) {
				printf("error resolving host\n");
				return;
			}
			memset(&cli_addr, '\0', sizeof(cli_addr));
			cli_addr.sin_family = AF_INET;
			cli_addr.sin_addr.s_addr = *(in_addr_t *)h->h_addr;
			cli_addr.sin_port = htons(re->routingPort);
			
			char* sendBuf = createPacket(numLinks, numFiles);
			ptr = addHeader(sendBuf, '1', senderId, re->seqNumSend, numLinks, numFiles);
			printBuf(sendBuf, ptr-sendBuf+1);
			//printf("Header length is %ld\n", ptr-sendBuf+1);
			ptr = addNodeIds(ptr, senderId);
			printBuf(sendBuf, ptr-sendBuf+1);
			//printf("header + Nodes length is %ld\n", ptr-sendBuf+1);
			ptr = addFiles(ptr);
			int packetSize = ptr-sendBuf+1;
			printf("The packet length is %d\n",packetSize );
			
			printBuf(sendBuf, packetSize);
			char* tmp = "ssdsds";
			ssize_t sen;
			sen = sendto(udp, sendBuf,packetSize, 0, (struct sockaddr *)&cli_addr, sizeof(cli_addr));
			//printf("Send to node %d on port %d\n", re->nodeId, re->routingPort);
			if(sen <= 0 ){
				printf("This is really bad\n");
			}
			
			
			
		}
		curr = curr->next;
	}
}
Beispiel #20
0
bool KNMusicModel::dropMimeData(const QMimeData *data,
                                Qt::DropAction action,
                                int row,
                                int column,
                                const QModelIndex &parent)
{
    //When mimedata contains url data, and ensure that move&copy action enabled.
    if((action==Qt::MoveAction || action==Qt::CopyAction))
    {
        if(data->hasUrls())
        {
            addFiles(KNGlobal::urlToPathList(data->urls()));
            return true;
        }
    }
    return QStandardItemModel::dropMimeData(data, action, row, column, parent);
}
void PatientDataUpload::on_btnAdd_clicked()
{
    QFileDialog dialog(this);
    dialog.setDirectory(QDir::homePath());
    dialog.setFileMode(QFileDialog::ExistingFiles);
    // Set Filter ?
    QStringList fileNames;
    if (dialog.exec())
    {
        fileNames = dialog.selectedFiles();
    }

    if(fileNames.length() > 0)
    {
        // Files have been added
        addFiles(fileNames);
    }
}
Beispiel #22
0
//------------------------------------------------------------//
// Main -- Write the hists to file
//------------------------------------------------------------//
void makeLimitHists(char* SR, char* channel, char* grid, char* sys, char* LR="", int nFiles=0)
{

  gSystem->Load("libSusyFitter.so");

  // Adding a hack -- Breaking up files for submission
  // means I need a way to recombine things at the end.
  // Here I will hadd the necessary files if nFiles != 0
  if( nFiles != 0 ) addFiles(SR,channel,grid,sys,LR,nFiles);

  //const char* interpretation = "mC1:mN1";
  const char* interpretation = "mN1:mC1";

  TString base = TString(Form("%s_%s_%s%s_%s",SR,channel,grid,LR,sys));
  makeLimitHypoTestResults(base, grid, interpretation);
  makeSemiFinalHists(base, interpretation);

}
Beispiel #23
0
MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
  ui->setupUi(this);
  QString title = tr("Archive Manager");
  if( getuid()==0){ title.append(" ("+tr("Admin Mode")+")"); }
  this->setWindowTitle(title);
  BACKEND = new Backend(this);
  connect(BACKEND, SIGNAL(ProcessStarting()), this, SLOT(ProcStarting()) );
  connect(BACKEND, SIGNAL(ProcessFinished(bool, QString)), this, SLOT(ProcFinished(bool, QString)) );
  connect(BACKEND, SIGNAL(ProgressUpdate(int, QString)), this, SLOT(ProcUpdate(int, QString)) );

  //Add a spacer between toolbar items
  QWidget *spacer = new QWidget(this);
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  ui->toolBar->insertWidget(ui->actionAdd_File, spacer);

  //Connect the UI signals/slots
  connect(ui->action_New, SIGNAL(triggered()), this, SLOT(NewArchive()) );
  connect(ui->action_Open, SIGNAL(triggered()), this, SLOT(OpenArchive()) );
  connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(close()) );
  connect(ui->actionAdd_File, SIGNAL(triggered()), this, SLOT(addFiles()) );
  connect(ui->actionRemove_File, SIGNAL(triggered()), this, SLOT(remFiles()) );
  connect(ui->actionExtract_All, SIGNAL(triggered()), this, SLOT(extractFiles()) );
  connect(ui->actionExtract_Sel, SIGNAL(triggered()), this, SLOT(extractSelection()) );
  connect(ui->actionAdd_Dirs, SIGNAL(triggered()), this, SLOT(addDirs()) );
  connect(ui->tree_contents, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(ViewFile(QTreeWidgetItem*)) );
  connect(ui->actionUSB_Image, SIGNAL(triggered()), this, SLOT(BurnImgToUSB()) );

  //Set Keyboard Shortcuts
  ui->action_New->setShortcut(tr("CTRL+N"));
  ui->action_Open->setShortcut(tr("CTRL+O"));
  ui->action_Quit->setShortcut(tr("CTRL+Q"));
  ui->actionExtract_All->setShortcut(tr("CTRL+E"));
  
  ui->progressBar->setVisible(false);
  ui->label_progress->setVisible(false);
  ui->label_progress_icon->setVisible(false);
  ui->actionAdd_File->setEnabled(false);
  ui->actionRemove_File->setEnabled(false);
  ui->actionExtract_All->setEnabled(false);
  ui->actionAdd_Dirs->setEnabled(false);
  ui->actionUSB_Image->setEnabled(false);
  loadIcons();
  ui->tree_contents->setHeaderLabels( QStringList() << tr("File") << tr("MimeType") << tr("Size")+" " );
}
Beispiel #24
0
//------------------------------------------------------------------------------------
void AddFilesThread::run()
{
    try
    {
        ofsFile.mount(ofsFileName.c_str());
    }
    catch(...)
    {
        return;
    }

    mTotalFileSize = generateList(mlist);

    std::sort(mlist.begin(), mlist.end(), AddFilesListCompare);

    addFiles(mlist);

    ofsFile.unmount();
}
Beispiel #25
0
void MadaoWindow::setAllActions()
{
    playPauseAction = new QAction(style()->standardIcon(QStyle::SP_MediaPlay)
    ,tr("Play"), this);
    stopAction = new QAction(style()->standardIcon(QStyle::SP_MediaStop)
    ,tr("Stop"), this);
    addFilesAction = new QAction(style()->standardIcon(QStyle::SP_ArrowUp)
    ,tr("Add"), this);
    nextAction = new QAction(style()->standardIcon(QStyle::SP_MediaSkipForward)
    ,tr("Next"), this);
    prevAction = new QAction(style()->standardIcon(QStyle::SP_MediaSkipBackward)
    ,tr("Previous"), this);

    connect(playPauseAction, SIGNAL(triggered()), this, SLOT(playPauseMusic()));
    connect(stopAction,      SIGNAL(triggered()), this, SLOT(stopMusic()));
    connect(addFilesAction,  SIGNAL(triggered()), this, SLOT(addFiles()));
    connect(nextAction,      SIGNAL(triggered()), this, SLOT(nextMusic()));
    connect(prevAction,      SIGNAL(triggered()), this, SLOT(previousMusic()));

}
Beispiel #26
0
void QuantaProjectPart::slotInsertFolder()
{
  KUrl url = KUrl();
  url = KFileDialog::getExistingUrl(m_projectBase, Koncrete::Core::mainWindow(), i18n("Insert Folder in Project"));

  if (!url.isEmpty())
  {
    if (!m_projectBase.isParentOf(url))
    {
      KUrlRequesterDialog urlRequesterDlg(m_projectBase.pathOrUrl(), Koncrete::Core::mainWindow());
      urlRequesterDlg.setWindowTitle(i18n("%1: Copy to Project", url.pathOrUrl()));
      urlRequesterDlg.urlRequester()->setMode(KFile::Directory | KFile::ExistingOnly);
      urlRequesterDlg.exec();
      KUrl destination = urlRequesterDlg.selectedUrl();
      if (!destination.isEmpty())
      {
        destination.adjustPath(KUrl::AddTrailingSlash);
        QuantaNetAccess::dircopy(url, destination, this, false);
      }
    } else
    {
      KUrl::List urls = ExtFileInfo::allFilesRelative(url, "*");
      QStringList filenames;
      KUrl u = KUrl::relativeUrl(m_projectBase, url);
      QStringList sections = u.path(KUrl::AddTrailingSlash).split('/', QString::SkipEmptyParts);
      QString section;
      for (int i = 0 ; i < sections.count(); i++)
      {
        section += sections[i] + '/';
        filenames += section;
      }
      KUrl::List::ConstIterator end = urls.constEnd();
      for (KUrl::List::ConstIterator it = urls.begin(); it != end; ++it)
      {
        filenames += url.fileName() + '/' + (*it).path();
      }
      addFiles(filenames);
    }
  }
}
void SendFileTreeWidget::addFileClient()
{
    // Show the file dialog, let the user select what torrent to start downloading.
     QStringList pathList = QFileDialog::getOpenFileNames(this, tr("Add Files"),
                                                    Macai::preferences->lastSendFilePath,
                                                    tr("All files (*)"));
    if (pathList.isEmpty())
    {
        return;
    }

    QStringList dupPathList;
    bool bAlready = false;
    foreach (SendJob job, sendJobs)
    {
        if ( pathList.contains(job.fileName) )
        {
            dupPathList << job.fileName;
            pathList.removeOne(job.fileName);
            bAlready = true;
        }
    }

    if( !pathList.isEmpty() )
    {
        addFiles(pathList);
        Macai::preferences->lastSendFilePath = pathList.at(0);
    }
    if(bAlready)
    {
        QString list;
        foreach( QString str, dupPathList)
        {
            list.append(str);
            list.append("\n");
        }
        QMessageBox::warning(this, tr("Already added"),
                             tr("The data file(s):\n%1is "
                                "already being added.").arg(list));
    }
WidgetFilesList::WidgetFilesList(QFileInfoList & filesList,QWidget *parent,QString filter,QString infos,bool editable):
    QWidget(parent),_filesList(filesList),
    _ui(new Ui::WidgetFilesListClass)
{
    _ui->setupUi(this);
    _filter = filter;

    for(int i=0;i<_filesList.size();i++)
        _ui->filesList->addItem(_filesList.at(i).absoluteFilePath());

    setInfos(infos);

    _editable = editable;
    if(!editable)
    {
        _ui->pushAddFiles->hide();
        _ui->pushRemoveFiles->hide();
    }

    connect(_ui->pushAddFiles,SIGNAL(clicked()),this,SLOT(addFiles()));
    connect(_ui->pushRemoveFiles,SIGNAL(clicked()),this,SLOT(removeFiles()));
}
Beispiel #29
0
void QmmpFileDialogImpl::on_addPushButton_clicked()
{
    QStringList l;
    if (m_mode != FileDialog::SaveFile)
    {
        QModelIndexList ml;
        if (stackedWidget->currentIndex() == 0)
            ml = fileListView->selectionModel()->selectedIndexes();
        else
            ml = treeView->selectionModel()->selectedIndexes();
        foreach(QModelIndex i,ml)
        {
            if (!l.contains(m_model->filePath(i)))
                l << m_model->filePath(i);
        }
        if (!l.isEmpty())
        {
            addToHistory(l[0]);
            addFiles(l);
            return;
        }
    }
Beispiel #30
0
mainwindow::mainwindow(){
    currentState=0;
    hd = new helpdialog;
    m=new mediaobject;
    setupUi(this);
    setWindowTitle("Music Player");
    m=new mediaobject;
    QObject::connect(actionAbout, SIGNAL(triggered()), this, SLOT(helpShow()));
    QObject::connect(actionExit,SIGNAL(triggered()),this,SLOT(close()));
    QObject::connect(actionAdd_Files,SIGNAL(triggered()),this,SLOT(addFiles()));
    QObject::connect(buttonPause,SIGNAL(clicked()),this,SLOT(pauseFile()));
    QObject::connect(buttonPlay,SIGNAL(clicked()),this,SLOT(playCurrent()));
    QObject::connect(buttonStop,SIGNAL(clicked()),m->mobj,SLOT(stop()));
    QObject::connect(m,SIGNAL(currentSourceChanged(Phonon::MediaSource)),this,SLOT(fetchNext(Phonon::MediaSource)));
    QObject::connect(m->mobj,SIGNAL(aboutToFinish()),this,SLOT(aboutToFinish()));
    QObject::connect(m->mobj,SIGNAL(stateChanged(Phonon::State,Phonon::State)),this,SLOT(metaStateChanged(Phonon::State,Phonon::State)));
    seekSlider->setMediaObject(m->mobj);
    volumeSlider->setAudioOutput(m->audioOutput);
    show();
    // Signal and slots for help -> AboutUs

    //m->setQueue(list);
}