From 711b219a001d0c4fdd61367903696fa1c6ff1a3d Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Tue, 3 Oct 2017 15:24:26 -0400 Subject: Added experimental video thumbnails in lumina-fm and fileinfo --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 25 ++++++++++++++++++++-- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 9 +++++--- .../lumina-fileinfo/lumina-fileinfo.pro | 3 ++- 3 files changed, 31 insertions(+), 6 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index d82f09ce..4d695ab4 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -8,6 +8,7 @@ #include "MainUI.h" #include "ui_MainUI.h" +#include #include #include @@ -22,12 +23,17 @@ MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ terminate_thread = false; UpdateIcons(); //Set all the icons in the dialog SetupConnections(); + player = new QMediaPlayer(0, QMediaPlayer::VideoSurface); + surface = new LVideoSurface(); + player->setVideoOutput(surface); INFO = 0; } MainUI::~MainUI(){ terminate_thread = true; this->close(); + delete surface; + delete player; } //============= @@ -86,7 +92,15 @@ void MainUI::LoadFile(QString path, QString type){ 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"; - }else{ + }/*else if(INFO->isVideo()){ + player->setMedia(QUrl("file://"+INFO->absoluteFilePath())); + player->play(); + player->setPosition(player->duration() / 2); + connect(surface, SIGNAL(frameReceived(QImage)), this, SLOT(stopVideo(QImage))); + //Pixmap set when video is loaded in stopVideo + //ui->label_file_icon->setPixmap( QPixmap::fromImage(surface->frameImage()).scaledToHeight(64) ); + //ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); + }*/else{ ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); } //Now verify the tab is available in the widget @@ -103,7 +117,7 @@ void MainUI::LoadFile(QString path, QString type){ } //Now load the special XDG desktop info qDebug() << "Check XDG Info:" << type; - //qDebug() << INFO->isDesktopFile() << type; + qDebug() << INFO->isDesktopFile() << type; if(INFO->isDesktopFile() || !type.isEmpty()){ if(INFO->XDG()->type == XDGDesktop::APP){ @@ -296,6 +310,13 @@ void MainUI::getXdgCommand(QString prev){ xdgvaluechanged(); } +/*void MainUI::stopVideo(QImage img) { + static bool flag = true; + if(flag) { player->setPosition(player->duration() / 2); flag = false;} + player->pause(); + ui->label_file_icon->setPixmap( QPixmap::fromImage( img.scaledToHeight(64) )); +}*/ + void MainUI::on_tool_xdg_getDir_clicked(){ //Find a directory QString dir = ui->line_xdg_wdir->text(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index cbe23d9e..e1f37425 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -14,11 +14,11 @@ #define _LUMINA_FILE_INFO_MAIN_UI_H #include - +#include #include +#include -namespace Ui{ - class MainUI; +namespace Ui{ class MainUI; }; class MainUI : public QDialog{ @@ -35,6 +35,8 @@ public slots: private: Ui::MainUI *ui; LFileInfo *INFO; + LVideoSurface *surface; + QMediaPlayer *player; bool canwrite; bool terminate_thread; //flag for terminating the GetDirSize task @@ -51,6 +53,7 @@ private slots: //UI Buttons void on_push_close_clicked(); void on_push_save_clicked(); + //void stopVideo(QImage); void getXdgCommand(QString prev = ""); //void on_tool_xdg_getCommand_clicked(QString prev = ""); void on_tool_xdg_getDir_clicked(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro b/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro index bbaf842e..b53d8cba 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro +++ b/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro @@ -1,7 +1,7 @@ include("$${PWD}/../../OS-detect.pri") QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets concurrent +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets concurrent multimedia TARGET = lumina-fileinfo @@ -13,6 +13,7 @@ target.path = $${L_BINDIR} include(../../core/libLumina/LUtils.pri) #includes LUtils include(../../core/libLumina/LuminaXDG.pri) #include(../../core/libLumina/LuminaSingleApplication.pri) +include(../../core/libLumina/LVideoSurface.pri) include(../../core/libLumina/LuminaThemes.pri) SOURCES += main.cpp\ -- cgit From 3005f7ab6b19cabf423b85ec7c3845d840c7cb18 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Tue, 3 Oct 2017 18:36:51 -0400 Subject: Reworked the VideoSurface subclass --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 37 ++++++++++++++---------- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 4 ++- 2 files changed, 24 insertions(+), 17 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 4d695ab4..40d2d544 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -23,17 +23,20 @@ MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ terminate_thread = false; UpdateIcons(); //Set all the icons in the dialog SetupConnections(); - player = new QMediaPlayer(0, QMediaPlayer::VideoSurface); - surface = new LVideoSurface(); + player = new QMediaPlayer(this, QMediaPlayer::VideoSurface); + surface = new LVideoSurface(this); 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(); - delete surface; - delete player; } //============= @@ -92,15 +95,12 @@ void MainUI::LoadFile(QString path, QString type){ 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"; - }/*else if(INFO->isVideo()){ + }else if(INFO->isVideo()){ player->setMedia(QUrl("file://"+INFO->absoluteFilePath())); player->play(); - player->setPosition(player->duration() / 2); - connect(surface, SIGNAL(frameReceived(QImage)), this, SLOT(stopVideo(QImage))); + player->pause(); //Pixmap set when video is loaded in stopVideo - //ui->label_file_icon->setPixmap( QPixmap::fromImage(surface->frameImage()).scaledToHeight(64) ); - //ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); - }*/else{ + }else{ ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); } //Now verify the tab is available in the widget @@ -117,7 +117,7 @@ void MainUI::LoadFile(QString path, QString type){ } //Now load the special XDG desktop info qDebug() << "Check XDG Info:" << type; - qDebug() << INFO->isDesktopFile() << type; + //qDebug() << INFO->isDesktopFile() << type; if(INFO->isDesktopFile() || !type.isEmpty()){ if(INFO->XDG()->type == XDGDesktop::APP){ @@ -310,12 +310,17 @@ void MainUI::getXdgCommand(QString prev){ xdgvaluechanged(); } -/*void MainUI::stopVideo(QImage img) { - static bool flag = true; - if(flag) { player->setPosition(player->duration() / 2); flag = false;} +void MainUI::stopVideo(QPixmap img) { + ui->label_file_icon->setPixmap( img.scaledToHeight(64) ); player->pause(); - ui->label_file_icon->setPixmap( QPixmap::fromImage( img.scaledToHeight(64) )); -}*/ +} + +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 diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index e1f37425..5ce7b01a 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -37,6 +37,7 @@ private: LFileInfo *INFO; LVideoSurface *surface; QMediaPlayer *player; + bool flag; bool canwrite; bool terminate_thread; //flag for terminating the GetDirSize task @@ -53,7 +54,8 @@ private slots: //UI Buttons void on_push_close_clicked(); void on_push_save_clicked(); - //void stopVideo(QImage); + void stopVideo(QPixmap); + void setDuration(QMediaPlayer::MediaStatus); void getXdgCommand(QString prev = ""); //void on_tool_xdg_getCommand_clicked(QString prev = ""); void on_tool_xdg_getDir_clicked(); -- cgit From 79fbc99707377264761434b44147281457189691 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Thu, 5 Oct 2017 17:06:58 -0400 Subject: Finished video thumnails for lumina-fm and lumina-fileinfo --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 9 ++++++++- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 40d2d544..0fb736d3 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -25,6 +25,7 @@ MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ 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))); @@ -96,7 +97,11 @@ void MainUI::LoadFile(QString path, QString type){ ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); //qDebug() << " - done with image"; }else if(INFO->isVideo()){ - player->setMedia(QUrl("file://"+INFO->absoluteFilePath())); + 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 @@ -313,6 +318,8 @@ void MainUI::getXdgCommand(QString prev){ 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) { diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index 5ce7b01a..3bc85aae 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace Ui{ class MainUI; }; @@ -38,6 +39,7 @@ private: LVideoSurface *surface; QMediaPlayer *player; bool flag; + QElapsedTimer timer; bool canwrite; bool terminate_thread; //flag for terminating the GetDirSize task -- cgit From f649d4976e64cfdf9b32022d55bfd08f39d00a8f Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Wed, 11 Oct 2017 20:51:56 -0400 Subject: Added framework to play video when the mouse is put over them. Breaks picture and video preview for lumina-fileinfo currently --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 39 ++-------------------- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 3 +- .../lumina-fileinfo/lumina-fileinfo.pro | 2 +- 3 files changed, 5 insertions(+), 39 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') 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(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index 3bc85aae..8cac813c 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -17,6 +17,7 @@ #include #include #include +#include #include namespace Ui{ class MainUI; @@ -56,8 +57,6 @@ private slots: //UI Buttons void on_push_close_clicked(); void on_push_save_clicked(); - void stopVideo(QPixmap); - void setDuration(QMediaPlayer::MediaStatus); void getXdgCommand(QString prev = ""); //void on_tool_xdg_getCommand_clicked(QString prev = ""); void on_tool_xdg_getDir_clicked(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro b/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro index b53d8cba..14345f50 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro +++ b/src-qt5/desktop-utils/lumina-fileinfo/lumina-fileinfo.pro @@ -13,7 +13,7 @@ target.path = $${L_BINDIR} include(../../core/libLumina/LUtils.pri) #includes LUtils include(../../core/libLumina/LuminaXDG.pri) #include(../../core/libLumina/LuminaSingleApplication.pri) -include(../../core/libLumina/LVideoSurface.pri) +include(../../core/libLumina/LVideoLabel.pri) include(../../core/libLumina/LuminaThemes.pri) SOURCES += main.cpp\ -- cgit From cd928a79ff4bf6da55689bc100168355ec962b50 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Mon, 16 Oct 2017 21:00:07 -0400 Subject: Updated how video thumbnails are loaded. Now cached to stop crash when resizing. --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 4ec8fae7..58ef8cbd 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -80,12 +80,17 @@ void MainUI::LoadFile(QString path, QString type){ else{ ftype = INFO->suffix().toUpper(); } if(INFO->isHidden()){ ftype = QString(tr("Hidden %1")).arg(type); } ui->label_file_type->setText(ftype); + //Now load the icon for the file if(INFO->isImage()){ - 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)" ); + 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)" ); }else if(INFO->isVideo()){ - ui->label_file_icon = new LVideoLabel(INFO->absoluteFilePath(), true); + ui->label_file_icon->hide(); + LVideoLabel *mediaLabel = new LVideoLabel(INFO->absoluteFilePath(), ui->tab_file); + mediaLabel->setShrinkPixmap(true); + ui->formLayout->replaceWidget(ui->label_file_icon, mediaLabel); }else{ ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); } @@ -101,6 +106,7 @@ void MainUI::LoadFile(QString path, QString type){ ui->tabWidget->removeTab( ui->tabWidget->indexOf(ui->tab_file) ); } } + //Now load the special XDG desktop info qDebug() << "Check XDG Info:" << type; //qDebug() << INFO->isDesktopFile() << type; -- cgit From 3a38773ce20620610e87c84c40ebfd6d2f478203 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Sat, 21 Oct 2017 17:48:29 -0400 Subject: Finished video thumbnails and roll over playback for lumina-fm and lumina-fileinfo --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 58ef8cbd..fb55ad99 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -89,7 +89,7 @@ void MainUI::LoadFile(QString path, QString type){ }else if(INFO->isVideo()){ ui->label_file_icon->hide(); LVideoLabel *mediaLabel = new LVideoLabel(INFO->absoluteFilePath(), ui->tab_file); - mediaLabel->setShrinkPixmap(true); + mediaLabel->setFixedSize(64,64); ui->formLayout->replaceWidget(ui->label_file_icon, mediaLabel); }else{ ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); -- cgit From 1e4bb99764f6012260adb4192604a392bd62bf0a Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Wed, 25 Oct 2017 18:23:38 -0400 Subject: Fixed issues with previews and LVideoWidget sizing --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index fb55ad99..c712afed 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -88,7 +88,7 @@ void MainUI::LoadFile(QString path, QString type){ ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); }else if(INFO->isVideo()){ ui->label_file_icon->hide(); - LVideoLabel *mediaLabel = new LVideoLabel(INFO->absoluteFilePath(), ui->tab_file); + LVideoLabel *mediaLabel = new LVideoLabel(INFO->absoluteFilePath(), true, ui->tab_file); mediaLabel->setFixedSize(64,64); ui->formLayout->replaceWidget(ui->label_file_icon, mediaLabel); }else{ -- cgit From ccea2e1130bf1cf54aea58528a493aacadbeda13 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 1 Nov 2017 12:47:19 -0400 Subject: Start working on fixing up lumina-fileinfo --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 28 ++--- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 11 +- src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui | 132 +++++++++++++++++++---- src-qt5/desktop-utils/lumina-fileinfo/main.cpp | 23 ++-- 4 files changed, 137 insertions(+), 57 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index c712afed..0247e011 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -15,15 +15,13 @@ #include #include -//LFileInfo INFO = LFileInfo(""); - MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ ui->setupUi(this); //load the designer form canwrite = false; terminate_thread = false; + INFO = new LFileInfo(); UpdateIcons(); //Set all the icons in the dialog SetupConnections(); - INFO = 0; } MainUI::~MainUI(){ @@ -80,7 +78,7 @@ void MainUI::LoadFile(QString path, QString type){ else{ ftype = INFO->suffix().toUpper(); } if(INFO->isHidden()){ ftype = QString(tr("Hidden %1")).arg(type); } ui->label_file_type->setText(ftype); - + //Now load the icon for the file if(INFO->isImage()){ QPixmap pix(INFO->absoluteFilePath()); @@ -159,18 +157,20 @@ void MainUI::LoadFile(QString path, QString type){ } void MainUI::UpdateIcons(){ - this->setWindowIcon(LXDG::findIcon("document-preview","unknown")); - ui->push_close->setIcon( LXDG::findIcon("dialog-close","") ); - ui->push_save->setIcon( LXDG::findIcon("document-save","") ); - ui->tool_xdg_getCommand->setIcon( LXDG::findIcon("edit-find-page","") ); - ui->tool_xdg_getDir->setIcon( LXDG::findIcon("document-open","") ); + } //============== // PRIVATE //============== void MainUI::ReloadAppIcon(){ - ui->push_xdg_getIcon->setIcon( LXDG::findIcon(ui->push_xdg_getIcon->whatsThis(),"") ); + //qDebug() << "Reload App Icon:"; + ui->label_xdg_icon->setPixmap( LXDG::findIcon(ui->line_xdg_icon->text(),"").pixmap(64,64) ); + //qDebug() << "Check Desktop File entry"; + if(INFO->iconfile()!=ui->line_xdg_icon->text()){ + xdgvaluechanged(); + } + //qDebug() << "Done with app icon"; } void MainUI::GetDirSize(const QString dirname) const { @@ -225,6 +225,7 @@ void MainUI::GetDirSize(const QString dirname) const { void MainUI::SetupConnections(){ connect(ui->line_xdg_command, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); connect(ui->line_xdg_comment, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); + connect(ui->line_xdg_icon, SIGNAL(textChanged(QString)), this, SLOT(ReloadAppIcon()) ); connect(ui->tool_xdg_getCommand, SIGNAL(clicked()), this, SLOT(getXdgCommand()) ); connect(ui->line_xdg_name, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); connect(ui->line_xdg_wdir, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); @@ -262,7 +263,7 @@ void MainUI::on_push_save_clicked(){ XDG->name = ui->line_xdg_name->text(); XDG->genericName = ui->line_xdg_name->text().toLower(); XDG->comment = ui->line_xdg_comment->text(); - XDG->icon = ui->push_xdg_getIcon->whatsThis(); + XDG->icon = ui->line_xdg_icon->text(); //Now do the type-specific fields if(XDG->type == XDGDesktop::APP){ XDG->exec = ui->line_xdg_command->text(); @@ -321,14 +322,15 @@ void MainUI::on_push_xdg_getIcon_clicked(){ for(int i=0; ipush_xdg_getIcon->setWhatsThis(file); + ui->line_xdg_icon->setText(file); ReloadAppIcon(); xdgvaluechanged(); } //XDG Value Changed void MainUI::xdgvaluechanged(){ - if(INFO!=0 && (INFO->isDesktopFile() || INFO->filePath().isEmpty() ) ){ + //qDebug() << "xdgvaluechanged"; + if( INFO->isDesktopFile() || INFO->filePath().isEmpty() ){ ui->push_save->setVisible(true); //Compare the current UI values to the file values ui->push_save->setEnabled(canwrite); //assume changed at this point diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index 8cac813c..089dbe6c 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -33,18 +33,17 @@ public: public slots: void UpdateIcons(); - + void ReloadAppIcon(); private: Ui::MainUI *ui; LFileInfo *INFO; - LVideoSurface *surface; - QMediaPlayer *player; - bool flag; - QElapsedTimer timer; + LVideoSurface *surface; + QMediaPlayer *player; + bool flag; + QElapsedTimer timer; bool canwrite; bool terminate_thread; //flag for terminating the GetDirSize task - void ReloadAppIcon(); void GetDirSize(const QString dirname) const; //function to get folder size signals: diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui index 51657ba1..d3b88b28 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui @@ -6,13 +6,22 @@ 0 0 - 349 - 354 + 535 + 580 + + + 0 + 0 + + File Information + + + @@ -307,9 +316,24 @@ + + + 0 + 0 + + + + + 16777215 + 42 + + + + + @@ -317,47 +341,107 @@ true + + + 0 + 0 + + + + + 16777215 + 42 + + + + + - - + + + + 0 + 0 + + + - 275 - 16777215 + 64 + 64 - - No Icon - - + 64 64 + + QFrame::StyledPanel + + + + - - - Qt::Horizontal - - - - 40 - 20 - - - + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 20000 + 42 + + + + + 2 + 2 + + + + + 0 + 0 + + + + + + + + + + + 24 + 24 + + + + @@ -391,6 +475,9 @@ Save + + + QToolButton::InstantPopup @@ -404,6 +491,9 @@ Close + + + QToolButton::DelayedPopup diff --git a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp index a602f290..463f856a 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp @@ -11,36 +11,25 @@ int main(int argc, char ** argv) { LTHEME::LoadCustomEnvSettings(); QApplication a(argc, argv); - a.setAttribute(Qt::AA_UseHighDpiPixmaps); + a.setAttribute(Qt::AA_UseHighDpiPixmaps); LUtils::LoadTranslation(&a, "l-fileinfo"); - //LuminaThemeEngine theme(&a); //Read the input variables QString path = ""; QString flag = ""; for(int i=1; i Date: Wed, 1 Nov 2017 15:13:52 -0400 Subject: Rework quite a bit of the lumina-fileinfo backend. Still not quite finished yet, but it is already much more stable/reliable. Just need to add new features. --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 327 +++---- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 22 +- src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui | 1053 +++++++++++----------- src-qt5/desktop-utils/lumina-fileinfo/main.cpp | 17 +- 4 files changed, 747 insertions(+), 672 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 0247e011..a990fc29 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -15,13 +15,18 @@ #include #include -MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ +MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ ui->setupUi(this); //load the designer form canwrite = false; terminate_thread = false; INFO = new LFileInfo(); UpdateIcons(); //Set all the icons in the dialog SetupConnections(); + + //Disable buttons that are not working yet + ui->actionOpen_File->setVisible(false); + ui->actionOpen_Directory->setVisible(false); + ui->menuSave_As->setEnabled(false); } MainUI::~MainUI(){ @@ -37,123 +42,12 @@ void MainUI::LoadFile(QString path, QString type){ //Do the first file information tab qDebug() << "Load File:" << path << type; INFO = new LFileInfo(path); - if(INFO->exists()){ canwrite = INFO->isWritable(); } - else if(!INFO->filePath().isEmpty()){ - //See if the containing directory can be written - //QFileInfo chk(INFO->absolutePath()); - canwrite = (INFO->isDir() && INFO->isWritable()); - }else{ - canwrite = true; //no associated file yet - } - if(!INFO->exists() && !type.isEmpty()){ - //Set the proper type flag on the shortcut - if(type=="APP"){ INFO->XDG()->type = XDGDesktop::APP; } - else if(type=="LINK"){ INFO->XDG()->type = XDGDesktop::LINK; } - } //First load the general file information if(!INFO->filePath().isEmpty()){ - ui->label_file_name->setText( INFO->fileName() ); - ui->label_file_mimetype->setText( INFO->mimetype() ); - if(!INFO->isDir()){ ui->label_file_size->setText( LUtils::BytesToDisplaySize( INFO->size() ) ); } - else { - ui->label_file_size->setText(tr("---Calculating---")); - QtConcurrent::run(this, &MainUI::GetDirSize, INFO->absoluteFilePath()); - } - ui->label_file_owner->setText(INFO->owner()); - ui->label_file_group->setText(INFO->group()); - ui->label_file_created->setText( INFO->created().toString(Qt::SystemLocaleLongDate) ); - ui->label_file_modified->setText( INFO->lastModified().toString(Qt::SystemLocaleLongDate) ); - //Get the file permissions - QString perms; - if(INFO->isReadable() && INFO->isWritable()){ perms = tr("Read/Write"); } - else if(INFO->isReadable()){ perms = tr("Read Only"); } - else if(INFO->isWritable()){ perms = tr("Write Only"); } - else{ perms = tr("No Access"); } - ui->label_file_perms->setText(perms); - //Now the special "type" for the file - QString ftype; - if(INFO->suffix().toLower()=="desktop"){ ftype = tr("XDG Shortcut"); } - else if(INFO->isDir()){ ftype = tr("Directory"); } - else if(INFO->isExecutable()){ ftype = tr("Binary"); } - else{ ftype = INFO->suffix().toUpper(); } - if(INFO->isHidden()){ ftype = QString(tr("Hidden %1")).arg(type); } - ui->label_file_type->setText(ftype); - - //Now load the icon for the file - if(INFO->isImage()){ - 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)" ); - }else if(INFO->isVideo()){ - ui->label_file_icon->hide(); - LVideoLabel *mediaLabel = new LVideoLabel(INFO->absoluteFilePath(), true, ui->tab_file); - mediaLabel->setFixedSize(64,64); - ui->formLayout->replaceWidget(ui->label_file_icon, mediaLabel); - }else{ - ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); - } - //Now verify the tab is available in the widget - //qDebug() << "Check tab widget"; - if(ui->tabWidget->indexOf(ui->tab_file)<0){ - //qDebug() << "Add File Info Tab"; - ui->tabWidget->addTab(ui->tab_file, tr("File Information")); - } - //qDebug() << "Done with Tab Check"; + SyncFileInfo(); }else{ - if(ui->tabWidget->indexOf(ui->tab_file)>=0){ - ui->tabWidget->removeTab( ui->tabWidget->indexOf(ui->tab_file) ); - } + SetupNewFile(); } - - //Now load the special XDG desktop info - qDebug() << "Check XDG Info:" << type; - //qDebug() << INFO->isDesktopFile() << type; - if(INFO->isDesktopFile() || !type.isEmpty()){ - - if(INFO->XDG()->type == XDGDesktop::APP){ - ui->line_xdg_command->setText(INFO->XDG()->exec); - ui->line_xdg_wdir->setText(INFO->XDG()->path); - ui->check_xdg_useTerminal->setChecked( INFO->XDG()->useTerminal ); - ui->check_xdg_startupNotify->setChecked( INFO->XDG()->startupNotify ); - }else if(INFO->XDG()->type==XDGDesktop::LINK){ - //Hide the options that are unavailable for links - //Command line (exec) - ui->line_xdg_command->setVisible(false); - ui->tool_xdg_getCommand->setVisible(false); - ui->lblCommand->setVisible(false); - //Options - ui->lblOptions->setVisible(false); - ui->check_xdg_useTerminal->setVisible(false); - ui->check_xdg_startupNotify->setVisible(false); - //Now load the variables for this type of shortcut - ui->lblWorkingDir->setText(tr("URL:")); - ui->line_xdg_wdir->setText( INFO->XDG()->url ); - ui->tool_xdg_getDir->setVisible(false); //the dir selection button - - } - ui->line_xdg_name->setText(INFO->XDG()->name); - ui->line_xdg_comment->setText(INFO->XDG()->comment); - ui->push_xdg_getIcon->setWhatsThis( INFO->XDG()->icon ); - ReloadAppIcon(); - ui->push_save->setVisible(true); - ui->push_save->setEnabled(false); - //Now ensure the xdg tab exists in the widget - if(ui->tabWidget->indexOf(ui->tab_deskedit)<0){ - qDebug() << "Adding the deskedit tab"; - ui->tabWidget->addTab(ui->tab_deskedit, tr("Edit Shortcut")); - } - }else{ - xdgvaluechanged(); //just do the disables here - //Also remove the xdg tab - if(ui->tabWidget->indexOf(ui->tab_deskedit) >= 0){ - qDebug() << "Removing the deskedit tab"; - ui->tabWidget->removeTab( ui->tabWidget->indexOf(ui->tab_deskedit) ); - } - } - //Setup the tab - if(type.isEmpty()){ ui->tabWidget->setCurrentIndex(0); } - else if(ui->tabWidget->count()>1){ ui->tabWidget->setCurrentIndex(1); } - qDebug() << "Done Loading File"; } void MainUI::UpdateIcons(){ @@ -221,8 +115,160 @@ void MainUI::GetDirSize(const QString dirname) const { emit folder_size_changed(filesize, file_number, dir_number, true); } +void MainUI::SyncFileInfo(){ + qDebug() << "Sync File Info"; + if(INFO->filePath().isEmpty()){ return; } + if(INFO->exists()){ canwrite = INFO->isWritable(); } + else{ + //See if the containing directory can be written + QFileInfo chk(INFO->absolutePath()); + canwrite = (chk.isDir() && chk.isWritable()); + } + ui->label_file_name->setText( INFO->fileName() ); + ui->label_file_mimetype->setText( INFO->mimetype() ); + if(!INFO->isDir()){ ui->label_file_size->setText( LUtils::BytesToDisplaySize( INFO->size() ) ); } + else { + ui->label_file_size->setText(tr("---Calculating---")); + QtConcurrent::run(this, &MainUI::GetDirSize, INFO->absoluteFilePath()); + } + ui->label_file_owner->setText(INFO->owner()); + ui->label_file_group->setText(INFO->group()); + ui->label_file_created->setText( INFO->created().toString(Qt::SystemLocaleLongDate) ); + ui->label_file_modified->setText( INFO->lastModified().toString(Qt::SystemLocaleLongDate) ); + //Get the file permissions + QString perms; + if(INFO->isReadable() && INFO->isWritable()){ perms = tr("Read/Write"); } + else if(INFO->isReadable()){ perms = tr("Read Only"); } + else if(INFO->isWritable()){ perms = tr("Write Only"); } + else{ perms = tr("No Access"); } + ui->label_file_perms->setText(perms); + //Now the special "type" for the file + QString ftype; + if(INFO->suffix().toLower()=="desktop"){ ftype = tr("XDG Shortcut"); } + else if(INFO->isDir()){ ftype = tr("Directory"); } + else if(INFO->isExecutable()){ ftype = tr("Binary"); } + else{ ftype = INFO->suffix().toUpper(); } + if(INFO->isHidden()){ ftype = QString(tr("Hidden %1")).arg(ftype); } + ui->label_file_type->setText(ftype); + + //Now load the icon for the file + if(INFO->isImage()){ + 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)" ); + }else if(INFO->isVideo()){ + ui->label_file_icon->hide(); + LVideoLabel *mediaLabel = new LVideoLabel(INFO->absoluteFilePath(), true, ui->tab_file); + mediaLabel->setFixedSize(64,64); + ui->formLayout->replaceWidget(ui->label_file_icon, mediaLabel); + }else{ + ui->label_file_icon->setPixmap( LXDG::findIcon( INFO->iconfile(), "unknown").pixmap(QSize(64,64)) ); + } + + //qDebug() << "Check XDG Info:" + //qDebug() << INFO->isDesktopFile() << type; + syncXdgStruct(INFO->XDG()); + //Make sure the right tabs are available + if(ui->tabWidget->indexOf(ui->tab_file)<0){ + //qDebug() << "Add File Info Tab"; + ui->tabWidget->addTab(ui->tab_file, tr("File Information")); + } + if(!INFO->isDesktopFile()){ + if(ui->tabWidget->indexOf(ui->tab_deskedit)>=0){ + ui->tabWidget->removeTab( ui->tabWidget->indexOf(ui->tab_deskedit) ); + } + } + ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tab_file) ); +} + +void MainUI::SetupNewFile(){ + //qDebug() << "Setup New File"; + if(!INFO->filePath().isEmpty()){ + INFO = new LFileInfo(); + } + terminate_thread = true; //just in case + canwrite = true; //can always write a new file + syncXdgStruct(INFO->XDG()); + //Make sure the right tabs are enabled + if(ui->tabWidget->indexOf(ui->tab_file)>=0){ + ui->tabWidget->removeTab( ui->tabWidget->indexOf(ui->tab_file) ); + } + if(ui->tabWidget->indexOf(ui->tab_deskedit)<0){ + //qDebug() << "Adding the deskedit tab"; + ui->tabWidget->addTab(ui->tab_deskedit, tr("XDG Shortcut")); + } + ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tab_deskedit) ); +} + +void MainUI::syncXdgStruct(XDGDesktop *XDG){ + bool cleanup = false; + if(XDG==0){ XDG = new XDGDesktop(); cleanup = true;} //make sure nothing crashes + if(XDG->type == XDGDesktop::APP){ + ui->line_xdg_command->setText(XDG->exec); + ui->line_xdg_wdir->setText(XDG->path); + ui->check_xdg_useTerminal->setChecked( XDG->useTerminal ); + ui->check_xdg_startupNotify->setChecked( XDG->startupNotify ); + }else if(XDG->type==XDGDesktop::LINK){ + //Hide the options that are unavailable for links + //Command line (exec) + ui->line_xdg_command->setVisible(false); + ui->tool_xdg_getCommand->setVisible(false); + ui->lblCommand->setVisible(false); + //Options + ui->lblOptions->setVisible(false); + ui->check_xdg_useTerminal->setVisible(false); + ui->check_xdg_startupNotify->setVisible(false); + //Now load the variables for this type of shortcut + ui->lblWorkingDir->setText(tr("URL:")); + ui->line_xdg_wdir->setText( XDG->url ); + ui->tool_xdg_getDir->setVisible(false); //the dir selection button + } + ui->line_xdg_name->setText(XDG->name); + ui->line_xdg_comment->setText(XDG->comment); + ui->line_xdg_icon->setText( XDG->icon ); + ReloadAppIcon(); + ui->actionSave_Shortcut->setVisible(true); + ui->actionSave_Shortcut->setEnabled(false); + if(cleanup){ delete XDG; } +} + +bool MainUI::saveFile(QString path){ + //qDebug() << "Request save file:" << path; + XDGDesktop *XDG = INFO->XDG(); + if(XDG==0){ XDG = new XDGDesktop(); } + if(XDG->type == XDGDesktop::BAD){ XDG->type = XDGDesktop::APP; } + //Update the file path in the data structure + XDG->filePath = path; + //Now change the structure + XDG->name = ui->line_xdg_name->text(); + XDG->genericName = ui->line_xdg_name->text().toLower(); + XDG->comment = ui->line_xdg_comment->text(); + XDG->icon = ui->line_xdg_icon->text(); + //Now do the type-specific fields + if(XDG->type == XDGDesktop::APP){ + XDG->exec = ui->line_xdg_command->text(); + XDG->tryexec = ui->line_xdg_command->text().section(" ",0,0); //use the first word/binary for the existance check + XDG->path = ui->line_xdg_wdir->text(); //working dir/path + XDG->useTerminal = ui->check_xdg_useTerminal->isChecked(); + XDG->startupNotify = ui->check_xdg_startupNotify->isChecked(); + }else if(XDG->type==XDGDesktop::LINK){ + XDG->url = ui->line_xdg_wdir->text(); //we re-used this field + } + //Clear any info which this utility does not support at the moment + XDG->actionList.clear(); + XDG->actions.clear(); + //Now save the structure to file + //qDebug() << "Saving File:" << XDG->filePath; + return XDG->saveDesktopFile(true); //Try to merge the file/structure as necessary +} + // Initialization procedures void MainUI::SetupConnections(){ + connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(closeApplication()) ); + connect(ui->actionSave_Shortcut, SIGNAL(triggered()), this, SLOT(save_clicked()) ); + connect(ui->actionNew_Shortcut, SIGNAL(triggered()), this, SLOT(SetupNewFile()) ); + connect(ui->actionOpen_File, SIGNAL(triggered()), this, SLOT(open_file()) ); + connect(ui->actionOpen_Directory, SIGNAL(triggered()), this, SLOT(open_dir()) ); connect(ui->line_xdg_command, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); connect(ui->line_xdg_comment, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); connect(ui->line_xdg_icon, SIGNAL(textChanged(QString)), this, SLOT(ReloadAppIcon()) ); @@ -235,55 +281,34 @@ void MainUI::SetupConnections(){ } //UI Buttons -void MainUI::on_push_close_clicked(){ +void MainUI::closeApplication(){ terminate_thread = true; - if(ui->push_save->isEnabled()){ + if(ui->actionSave_Shortcut->isEnabled()){ //Still have unsaved changes //TO-DO - prompt for whether to save the changes } this->close(); } -void MainUI::on_push_save_clicked(){ +void MainUI::save_clicked(){ //Save all the xdg values into the structure - if( (!INFO->isDesktopFile() && !INFO->filePath().isEmpty()) || !canwrite){ return; } - if(INFO->filePath().isEmpty()){ + QString filePath = INFO->filePath(); + if( !filePath.isEmpty() && !INFO->isDesktopFile() ){ return; } + if(filePath.isEmpty() || !canwrite){ //Need to prompt for where to save the file and what to call it QString appdir = QString(getenv("XDG_DATA_HOME"))+"/applications/"; if(!QFile::exists(appdir)){ QDir dir; dir.mkpath(appdir); } - QString filePath = QFileDialog::getSaveFileName(this, tr("Save Application File"), appdir, tr("Application Registrations (*.desktop)") ); + filePath = QFileDialog::getSaveFileName(this, tr("Save Application File"), appdir, tr("XDG Shortcuts (*.desktop)") ); if(filePath.isEmpty()){ return; } if(!filePath.endsWith(".desktop")){ filePath.append(".desktop"); } - //Update the file paths in the data structure - INFO->setFile(filePath); - INFO->XDG()->filePath = filePath; } - XDGDesktop *XDG = INFO->XDG(); - //Now change the structure - XDG->name = ui->line_xdg_name->text(); - XDG->genericName = ui->line_xdg_name->text().toLower(); - XDG->comment = ui->line_xdg_comment->text(); - XDG->icon = ui->line_xdg_icon->text(); - //Now do the type-specific fields - if(XDG->type == XDGDesktop::APP){ - XDG->exec = ui->line_xdg_command->text(); - XDG->tryexec = ui->line_xdg_command->text().section(" ",0,0); //use the first word/binary for the existance check - XDG->path = ui->line_xdg_wdir->text(); //working dir/path - XDG->useTerminal = ui->check_xdg_useTerminal->isChecked(); - XDG->startupNotify = ui->check_xdg_startupNotify->isChecked(); - }else if(XDG->type==XDGDesktop::LINK){ - XDG->url = ui->line_xdg_wdir->text(); //we re-used this field - } - //Clear any info which this utility does not support at the moment - XDG->actionList.clear(); - XDG->actions.clear(); - //Now save the structure to file - bool saved = XDG->saveDesktopFile(true); //Try to merge the file/structure as necessary - qDebug() << "File Saved:" << saved; - ui->push_save->setEnabled( !saved ); + //qDebug() << " -Try Saving File:" << filePath; + bool saved = saveFile(filePath); + //qDebug() << "File Saved:" << saved; + ui->actionSave_Shortcut->setEnabled( !saved ); if(saved){ //Re-load the file info - LoadFile(INFO->absoluteFilePath()); + LoadFile(filePath); } } @@ -331,14 +356,14 @@ void MainUI::on_push_xdg_getIcon_clicked(){ void MainUI::xdgvaluechanged(){ //qDebug() << "xdgvaluechanged"; if( INFO->isDesktopFile() || INFO->filePath().isEmpty() ){ - ui->push_save->setVisible(true); + ui->actionSave_Shortcut->setVisible(true); //Compare the current UI values to the file values - ui->push_save->setEnabled(canwrite); //assume changed at this point + ui->actionSave_Shortcut->setEnabled(canwrite); //assume changed at this point // TO-DO }else{ - ui->push_save->setVisible(false); - ui->push_save->setEnabled(false); + ui->actionSave_Shortcut->setVisible(false); + ui->actionSave_Shortcut->setEnabled(false); } } diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index 089dbe6c..f45e15d7 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -13,17 +13,19 @@ #ifndef _LUMINA_FILE_INFO_MAIN_UI_H #define _LUMINA_FILE_INFO_MAIN_UI_H -#include +#include #include -#include #include #include #include -namespace Ui{ class MainUI; +#include + +namespace Ui{ + class MainUI; }; -class MainUI : public QDialog{ +class MainUI : public QMainWindow{ Q_OBJECT public: MainUI(); @@ -34,6 +36,7 @@ public: public slots: void UpdateIcons(); void ReloadAppIcon(); + private: Ui::MainUI *ui; LFileInfo *INFO; @@ -46,16 +49,23 @@ private: bool terminate_thread; //flag for terminating the GetDirSize task void GetDirSize(const QString dirname) const; //function to get folder size + void SyncFileInfo(); + + void syncXdgStruct(XDGDesktop*); + + bool saveFile(QString path); + signals: void folder_size_changed(quint64 size, quint64 files, quint64 folders, bool finished) const; //Signal for updating the folder size asynchronously private slots: + void SetupNewFile(); //Initialization functions void SetupConnections(); //UI Buttons - void on_push_close_clicked(); - void on_push_save_clicked(); + void closeApplication(); + void save_clicked(); void getXdgCommand(QString prev = ""); //void on_tool_xdg_getCommand_clicked(QString prev = ""); void on_tool_xdg_getDir_clicked(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui index d3b88b28..f8414026 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui @@ -1,522 +1,571 @@ MainUI - + 0 0 - 535 - 580 + 800 + 658 - - - 0 - 0 - - File Information - + - - - - - 1 - - - - File Information - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - icon - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - - Owner: - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Group: - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Permissions: - - - - - - - Qt::Horizontal - - - - - - - Created: - - - - - - - Note: The time a file was created might be more recent than the time modified if the file permissions were changed recently. - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Last Modified: - - - - - - - Type: - - - - - - - MimeType: - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - File Size: - - - - - - - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - Edit Shortcut - - - - 2 - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - - Working Dir: - - - - - - - Use startup notification - - - - - - - true - - - - - - - Icon: - - - - - - - Command: - - - - - - - Comment: - - - - - - - - - - Run in terminal - - - - - - - Name: - - - - - - - Options - - - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 42 - - - - - - - - - - - - - - true - - - - 0 - 0 - - - - - 16777215 - 42 - - - - - - - - - - - - - - - - - 0 - 0 - - - - - 64 - 64 - - - - - 64 - 64 - - - - QFrame::StyledPanel - - - - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 20000 - 42 - - - - - 2 - 2 - - - - - 0 - 0 - - - - - - - - - - - 24 - 24 - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Save - - - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextBesideIcon - + + + + + + 1 + + + + File Information + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + icon + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + + + + Owner: + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Group: + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Permissions: + + + + + + + Qt::Horizontal + + + + + + + Created: + + + + + + + Note: The time a file was created might be more recent than the time modified if the file permissions were changed recently. + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Last Modified: + + + + + + + Type: + + + + + + + MimeType: + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + File Size: + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + - - - - - Close - - - - - - QToolButton::DelayedPopup - - - Qt::ToolButtonTextBesideIcon - + + + XDG Shortcut + + + + 2 + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + + Working Dir: + + + + + + + Use startup notification + + + + + + + true + + + + + + + Icon: + + + + + + + Command: + + + + + + + Comment: + + + + + + + + + + Run in terminal + + + + + + + Name: + + + + + + + Options + + + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 42 + + + + + + + + .. + + + + + + + true + + + + 0 + 0 + + + + + 16777215 + 42 + + + + + + + + .. + + + + + + + + + + 0 + 0 + + + + + 64 + 64 + + + + + 64 + 64 + + + + QFrame::StyledPanel + + + + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 20000 + 42 + + + + + 2 + 2 + + + + + 0 + 0 + + + + + + + + .. + + + + 24 + 24 + + + + + + + + + + Qt::Horizontal + + + + - - - - + + + + + + + + 0 + 0 + 800 + 39 + + + + + File + + + + Save As + + + + + + + + + + + + + + + + + + + + + + + + + + Open File + + + Ctrl+O + + + Qt::ApplicationShortcut + + + + + + + + Quit + + + Ctrl+Q + + + Qt::ApplicationShortcut + + + + + + + + Save Shortcut + + + Ctrl+S + + + Qt::ApplicationShortcut + + + + + + + + Local Shortcut + + + + + + + + Register Shortcut + + + + + + + + Open Directory + + + + + + + + New Shortcut + + - - - line_xdg_name - line_xdg_comment - line_xdg_command - line_xdg_wdir - check_xdg_startupNotify - check_xdg_useTerminal - tool_xdg_getCommand - tool_xdg_getDir - diff --git a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp index 463f856a..ce62399d 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp @@ -20,26 +20,17 @@ int main(int argc, char ** argv) QString flag = ""; for(int i=1; i Date: Thu, 2 Nov 2017 10:21:06 -0400 Subject: Finish up the large cleanup of lumina-fileinfo. --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 137 +++++++++++++++++++++-- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 15 ++- src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui | 99 ++++++++++++++-- 3 files changed, 227 insertions(+), 24 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fileinfo') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index a990fc29..e64346ae 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -24,9 +24,9 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ SetupConnections(); //Disable buttons that are not working yet - ui->actionOpen_File->setVisible(false); - ui->actionOpen_Directory->setVisible(false); - ui->menuSave_As->setEnabled(false); + //ui->actionOpen_File->setVisible(false); + //ui->actionOpen_Directory->setVisible(false); + //ui->menuSave_As->setEnabled(false); } MainUI::~MainUI(){ @@ -67,6 +67,15 @@ void MainUI::ReloadAppIcon(){ //qDebug() << "Done with app icon"; } +void MainUI::stopDirSize(){ + if(sizeThread.isRunning()){ + terminate_thread = true; + sizeThread.waitForFinished(); + QApplication::processEvents(); //throw away any last signals waiting to be processed + } + terminate_thread = false; +} + void MainUI::GetDirSize(const QString dirname) const { const quint16 update_frequency = 2000; //For reducing the number of folder_size_changed calls quint64 filesize = 0; @@ -117,6 +126,7 @@ void MainUI::GetDirSize(const QString dirname) const { void MainUI::SyncFileInfo(){ qDebug() << "Sync File Info"; + stopDirSize(); if(INFO->filePath().isEmpty()){ return; } if(INFO->exists()){ canwrite = INFO->isWritable(); } else{ @@ -129,7 +139,7 @@ void MainUI::SyncFileInfo(){ if(!INFO->isDir()){ ui->label_file_size->setText( LUtils::BytesToDisplaySize( INFO->size() ) ); } else { ui->label_file_size->setText(tr("---Calculating---")); - QtConcurrent::run(this, &MainUI::GetDirSize, INFO->absoluteFilePath()); + sizeThread = QtConcurrent::run(this, &MainUI::GetDirSize, INFO->absoluteFilePath()); } ui->label_file_owner->setText(INFO->owner()); ui->label_file_group->setText(INFO->group()); @@ -171,12 +181,14 @@ void MainUI::SyncFileInfo(){ //Make sure the right tabs are available if(ui->tabWidget->indexOf(ui->tab_file)<0){ //qDebug() << "Add File Info Tab"; - ui->tabWidget->addTab(ui->tab_file, tr("File Information")); + ui->tabWidget->insertTab(0, ui->tab_file, tr("File Information")); } if(!INFO->isDesktopFile()){ if(ui->tabWidget->indexOf(ui->tab_deskedit)>=0){ ui->tabWidget->removeTab( ui->tabWidget->indexOf(ui->tab_deskedit) ); } + }else if(ui->tabWidget->indexOf(ui->tab_deskedit)<0){ + ui->tabWidget->addTab( ui->tab_deskedit, tr("XDG Shortcut") ); } ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tab_file) ); } @@ -186,7 +198,7 @@ void MainUI::SetupNewFile(){ if(!INFO->filePath().isEmpty()){ INFO = new LFileInfo(); } - terminate_thread = true; //just in case + stopDirSize(); canwrite = true; //can always write a new file syncXdgStruct(INFO->XDG()); //Make sure the right tabs are enabled @@ -230,6 +242,7 @@ void MainUI::syncXdgStruct(XDGDesktop *XDG){ ui->actionSave_Shortcut->setVisible(true); ui->actionSave_Shortcut->setEnabled(false); if(cleanup){ delete XDG; } + checkXDGValidity(); } bool MainUI::saveFile(QString path){ @@ -262,13 +275,47 @@ bool MainUI::saveFile(QString path){ return XDG->saveDesktopFile(true); //Try to merge the file/structure as necessary } +QString MainUI::findOpenDirFile(bool isdir){ + static QList urls; + if(urls.isEmpty()){ + urls << QUrl::fromLocalFile("/"); + QStringList dirs = QString(getenv("XDG_DATA_DIRS")).split(":"); + for(int i=0; iactionQuit, SIGNAL(triggered()), this, SLOT(closeApplication()) ); connect(ui->actionSave_Shortcut, SIGNAL(triggered()), this, SLOT(save_clicked()) ); + connect(ui->actionLocal_Shortcut, SIGNAL(triggered()), this, SLOT(save_as_local_clicked()) ); + connect(ui->actionRegister_Shortcut, SIGNAL(triggered()), this, SLOT(save_as_register_clicked()) ); connect(ui->actionNew_Shortcut, SIGNAL(triggered()), this, SLOT(SetupNewFile()) ); - connect(ui->actionOpen_File, SIGNAL(triggered()), this, SLOT(open_file()) ); - connect(ui->actionOpen_Directory, SIGNAL(triggered()), this, SLOT(open_dir()) ); + connect(ui->actionOpen_File, SIGNAL(triggered()), this, SLOT(open_file_clicked()) ); + connect(ui->actionOpen_Directory, SIGNAL(triggered()), this, SLOT(open_dir_clicked()) ); connect(ui->line_xdg_command, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); connect(ui->line_xdg_comment, SIGNAL(editingFinished()), this, SLOT(xdgvaluechanged()) ); connect(ui->line_xdg_icon, SIGNAL(textChanged(QString)), this, SLOT(ReloadAppIcon()) ); @@ -312,6 +359,50 @@ void MainUI::save_clicked(){ } } +void MainUI::save_as_local_clicked(){ + QString filePath = QFileDialog::getSaveFileName(this, tr("Save Application File"), QDir::homePath(), tr("XDG Shortcuts (*.desktop)") ); + if(filePath.isEmpty()){ return; } + if(!filePath.endsWith(".desktop")){ filePath.append(".desktop"); } + + //qDebug() << " -Try Saving File:" << filePath; + bool saved = saveFile(filePath); + //qDebug() << "File Saved:" << saved; + ui->actionSave_Shortcut->setEnabled( !saved ); + if(saved){ + //Re-load the file info + LoadFile(filePath); + } +} + +void MainUI::save_as_register_clicked(){ + QString appdir = QString(getenv("XDG_DATA_HOME"))+"/applications/"; + if(!QFile::exists(appdir)){ QDir dir; dir.mkpath(appdir); } + QString filePath = QFileDialog::getSaveFileName(this, tr("Save Application File"), appdir, tr("XDG Shortcuts (*.desktop)") ); + if(filePath.isEmpty()){ return; } + if(!filePath.endsWith(".desktop")){ filePath.append(".desktop"); } + + //qDebug() << " -Try Saving File:" << filePath; + bool saved = saveFile(filePath); + //qDebug() << "File Saved:" << saved; + ui->actionSave_Shortcut->setEnabled( !saved ); + if(saved){ + //Re-load the file info + LoadFile(filePath); + } +} + +void MainUI::open_dir_clicked(){ + QString path = findOpenDirFile(true); //directory only + if(path.isEmpty()){ return; } + LoadFile(path, ""); +} + +void MainUI::open_file_clicked(){ + QString path = findOpenDirFile(false); //files only + if(path.isEmpty()){ return; } + LoadFile(path, ""); +} + void MainUI::getXdgCommand(QString prev){ //Find a binary to run QString dir = prev; //start with the previous attempt (if there was one) @@ -353,16 +444,38 @@ void MainUI::on_push_xdg_getIcon_clicked(){ } //XDG Value Changed +bool MainUI::checkXDGValidity(){ + XDGDesktop tmp; + tmp.type = XDGDesktop::APP; //make this adjustable later (GUI radio buttons?) + tmp.name = ui->line_xdg_name->text(); + tmp.genericName = ui->line_xdg_name->text().toLower(); + tmp.comment = ui->line_xdg_comment->text(); + tmp.icon = ui->line_xdg_icon->text(); + //Now do the type-specific fields + if(tmp.type == XDGDesktop::APP){ + tmp.exec = ui->line_xdg_command->text(); + tmp.tryexec = ui->line_xdg_command->text().section(" ",0,0); //use the first word/binary for the existance check + tmp.path = ui->line_xdg_wdir->text(); //working dir/path + tmp.useTerminal = ui->check_xdg_useTerminal->isChecked(); + tmp.startupNotify = ui->check_xdg_startupNotify->isChecked(); + }else if(tmp.type==XDGDesktop::LINK){ + tmp.url = ui->line_xdg_wdir->text(); //we re-used this field + } + bool valid = tmp.isValid(); + ui->label_xdg_statusicon->setPixmap( LXDG::findIcon( valid ? "dialog-ok" : "dialog-cancel", "").pixmap(32,32) ); + ui->label_xdg_status->setText( valid ? tr("Valid Settings") : tr("Invalid Settings") ); + return tmp.isValid(); +} + void MainUI::xdgvaluechanged(){ //qDebug() << "xdgvaluechanged"; if( INFO->isDesktopFile() || INFO->filePath().isEmpty() ){ - ui->actionSave_Shortcut->setVisible(true); + bool valid = checkXDGValidity(); //Compare the current UI values to the file values - ui->actionSave_Shortcut->setEnabled(canwrite); //assume changed at this point - // TO-DO + ui->menuSave_As->setEnabled(valid); + ui->actionSave_Shortcut->setEnabled(canwrite && valid); //assume changed at this point }else{ - ui->actionSave_Shortcut->setVisible(false); ui->actionSave_Shortcut->setEnabled(false); } } diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index f45e15d7..d7b17207 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -44,9 +45,12 @@ private: QMediaPlayer *player; bool flag; QElapsedTimer timer; + QFuture sizeThread; bool canwrite; bool terminate_thread; //flag for terminating the GetDirSize task + void stopDirSize(); + void GetDirSize(const QString dirname) const; //function to get folder size void SyncFileInfo(); @@ -54,6 +58,7 @@ private: void syncXdgStruct(XDGDesktop*); bool saveFile(QString path); + QString findOpenDirFile(bool isdir = false); signals: void folder_size_changed(quint64 size, quint64 files, quint64 folders, bool finished) const; //Signal for updating the folder size asynchronously @@ -66,16 +71,20 @@ private slots: //UI Buttons void closeApplication(); void save_clicked(); + void save_as_local_clicked(); + void save_as_register_clicked(); + void open_dir_clicked(); + void open_file_clicked(); void getXdgCommand(QString prev = ""); - //void on_tool_xdg_getCommand_clicked(QString prev = ""); void on_tool_xdg_getDir_clicked(); void on_push_xdg_getIcon_clicked(); //XDG Value Changed + bool checkXDGValidity(); void xdgvaluechanged(); - //Folder size - void refresh_folder_size(quint64 size, quint64 files, quint64 folders, bool finished); //Slot for updating the folder size asynchronously + //Folder size + void refresh_folder_size(quint64 size, quint64 files, quint64 folders, bool finished); //Slot for updating the folder size asynchronously }; #endif diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui index f8414026..217c1a10 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.ui @@ -14,7 +14,8 @@ File Information - + + .. @@ -442,6 +443,78 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + 32 + 32 + + + + + + + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + + true + + + + + + + + + @@ -473,7 +546,8 @@ Save As - + + .. @@ -493,7 +567,8 @@ - + + .. Open File @@ -507,7 +582,8 @@ - + + .. Quit @@ -521,7 +597,8 @@ - + + .. Save Shortcut @@ -535,7 +612,8 @@ - + + .. Local Shortcut @@ -543,7 +621,8 @@ - + + .. Register Shortcut @@ -551,7 +630,8 @@ - + + .. Open Directory @@ -559,7 +639,8 @@ - + + .. New Shortcut -- cgit