diff options
author | Ken Moore <ken@ixsystems.com> | 2017-10-12 10:43:44 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-10-12 10:43:44 -0400 |
commit | 86f326b3890f232debfb4b2dbcb86d860bf5ae0c (patch) | |
tree | b78aca7f59c15553036bcbb6e6d66a6ddc0509f0 /src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | |
parent | Add some color to the "Warp" starfield. (diff) | |
parent | Added framework to play video when the mouse is put over them. Breaks (diff) | |
download | lumina-86f326b3890f232debfb4b2dbcb86d860bf5ae0c.tar.gz lumina-86f326b3890f232debfb4b2dbcb86d860bf5ae0c.tar.bz2 lumina-86f326b3890f232debfb4b2dbcb86d860bf5ae0c.zip |
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 0fb736d3..4ec8fae7 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -23,20 +23,11 @@ MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ terminate_thread = false; UpdateIcons(); //Set all the icons in the dialog SetupConnections(); - player = new QMediaPlayer(this, QMediaPlayer::VideoSurface); - surface = new LVideoSurface(this); - qDebug() << surface->surfaceFormat(); - player->setVideoOutput(surface); - player->setMuted(true); - connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(setDuration(QMediaPlayer::MediaStatus))); - connect(surface, SIGNAL(frameReceived(QPixmap)), this, SLOT(stopVideo(QPixmap))); INFO = 0; } MainUI::~MainUI(){ terminate_thread = true; - surface->deleteLater(); - player->deleteLater(); this->close(); } @@ -91,20 +82,10 @@ void MainUI::LoadFile(QString path, QString type){ ui->label_file_type->setText(ftype); //Now load the icon for the file if(INFO->isImage()){ - //qDebug() << "Set Image:"; - QPixmap pix(INFO->absoluteFilePath()); - ui->label_file_icon->setPixmap( pix.scaledToHeight(64) ); - ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); - //qDebug() << " - done with image"; + ui->label_file_icon = new LVideoLabel(INFO->absoluteFilePath(), false); + //ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); }else if(INFO->isVideo()){ - timer.start(); - QMediaResource video = QMediaResource(QUrl("file://"+INFO->absoluteFilePath())); - video.setResolution(64,64); - player->setMedia(video); - //player->setMedia(QUrl("file://"+INFO->absoluteFilePath())); - player->play(); - player->pause(); - //Pixmap set when video is loaded in stopVideo + ui->label_file_icon = new LVideoLabel(INFO->absoluteFilePath(), true); }else{ ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); } @@ -315,20 +296,6 @@ void MainUI::getXdgCommand(QString prev){ xdgvaluechanged(); } -void MainUI::stopVideo(QPixmap img) { - ui->label_file_icon->setPixmap( img.scaledToHeight(64) ); - player->pause(); - qDebug() << timer.elapsed(); - qDebug() << player->media().canonicalResource().resolution(); -} - -void MainUI::setDuration(QMediaPlayer::MediaStatus status) { - if(status == QMediaPlayer::BufferedMedia) { - player->setPosition(player->duration() / 2); - player->play(); - } -} - void MainUI::on_tool_xdg_getDir_clicked(){ //Find a directory QString dir = ui->line_xdg_wdir->text(); |