aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-09-08 16:04:07 -0400
committerKen Moore <ken@ixsystems.com>2017-09-08 16:04:07 -0400
commit6507d181b3a6c59dd374aa6890a4a43b9e516d5b (patch)
tree4778fa553204f175a72f6fe05c7c6c0866a4800c
parentPut a failsafe in for overwriting default apps: (diff)
parentSet default tooltip to be translateable in case issues arise (diff)
downloadlumina-6507d181b3a6c59dd374aa6890a4a43b9e516d5b.tar.gz
lumina-6507d181b3a6c59dd374aa6890a4a43b9e516d5b.tar.bz2
lumina-6507d181b3a6c59dd374aa6890a4a43b9e516d5b.zip
Merge branch 'master' of github.com:trueos/lumina
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.desktop2
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/MainUI.cpp14
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/MainUI.h3
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp1
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.h1
-rw-r--r--src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.cpp13
-rw-r--r--src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h60
-rw-r--r--src-qt5/desktop-utils/lumina-fm/MainUI.cpp2
-rw-r--r--src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp57
-rw-r--r--src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h18
11 files changed, 119 insertions, 54 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
index 8e0a9d28..e6e89075 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
@@ -16,7 +16,7 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal)
label->setAutoRaise(true);
label->setToolButtonStyle(Qt::ToolButtonIconOnly);
label->setIcon( LXDG::findIcon("format-view-carousel", "preferences-desktop-display") );
- label->setToolTip(QString("Workspace 1"));
+ label->setToolTip(QString(tr("Workspace 1")));
connect(label, SIGNAL(clicked()), this, SLOT(openMenu()));
menu = new QMenu(this);
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(menuActionTriggered(QAction*)));
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.desktop b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.desktop
index 7eb91bee..9d36fffa 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.desktop
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
X-Desktop-File-Install-Version=0.11
-Name=Lumine Theme Engine
+Name=Lumina Theme Engine
Comment=Lumina Theme Engine
Exec=lthemeengine
Icon=preferences-desktop-theme
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
index afead9af..9d220824 100644
--- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp
@@ -72,9 +72,11 @@ MainUI::~MainUI(){
void MainUI::LoadArguments(QStringList args){
bool burnIMG = false;
bool autoExtract = false;
+ //bool autoArchive = false;
for(int i=0; i<args.length(); i++){
if(args[i]=="--burn-img"){ burnIMG = true; continue; }
if(args[i]=="--ax"){ autoExtract = true; continue; }
+ //if(args[i]=="--aa"){ autoArchive = true; continue; }
if(QFile::exists(args[i])){
ui->label_progress->setText(tr("Opening Archive..."));
if(autoExtract){
@@ -86,6 +88,14 @@ void MainUI::LoadArguments(QStringList args){
if(burnIMG){ BurnImgToUSB(); } //Go ahead and launch the burn dialog right away
break;
}
+ //if(autoArchive){
+ //get rest of arguments
+ //for(int i=1; i<args.length(); i++){
+ // aaFileList << args[i];}
+ // now launch autoarchive method with arg list
+ // autoArchiveFiles(aaFileList);
+ // connect(BACKEND, SIGNAL(ArchivalSuccessful()), this, SLOT(close()) );
+ //}
}
}
@@ -252,6 +262,10 @@ void MainUI::autoextractFiles(){
BACKEND->startExtract(dir, true);
}
+/*
+void MainUI::autoArchiveFiles(aaFileList){
+*/
+
void MainUI::extractSelection(){
if(ui->tree_contents->currentItem()==0){ return; } //nothing selected
QList<QTreeWidgetItem*> sel = ui->tree_contents->selectedItems();
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.h b/src-qt5/desktop-utils/lumina-archiver/MainUI.h
index 61475fb2..a2687895 100644
--- a/src-qt5/desktop-utils/lumina-archiver/MainUI.h
+++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.h
@@ -25,7 +25,7 @@ public:
void LoadArguments(QStringList);
void loadIcons();
-
+ //QStringList aaFileList;
private:
Ui::MainUI *ui;
@@ -47,6 +47,7 @@ private slots:
void remFiles();
void extractFiles();
void autoextractFiles();
+ //void autoArchiveFiles(QStringList aaFileList);
void extractSelection();
void ViewFile(QTreeWidgetItem *it);
void UpdateTree();
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
index 9fe735a3..e0b802a4 100644
--- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
+++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp
@@ -262,6 +262,7 @@ void Backend::procFinished(int retcode, QProcess::ExitStatus){
}
}
if(args.contains("-x")){ result = tr("Extraction Finished"); emit ExtractSuccessful(); }
+ //if(args.contains("-aa")){ result = tr("Archival Finished"); emit ArchivalSuccessful(); }
else if(args.contains("-c")){ result = tr("Modification Finished"); }
if(needupdate){ startList(); }
else{ emit ProcessFinished(retcode==0, result); result.clear(); }
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
index dd08361c..d86ecf7c 100644
--- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
+++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
@@ -64,6 +64,7 @@ signals:
void ProcessStarting();
void ProgressUpdate(int, QString); //percentage, text
void ProcessFinished(bool, QString); //success, text
+ //void ArchivalSuccessful();
};
#endif
diff --git a/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.cpp b/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.cpp
new file mode 100644
index 00000000..e13894e1
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.cpp
@@ -0,0 +1,13 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2017, q5sys
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+#include "vidnail.h"
+
+VidNail::VidNail(QObject *parent) : QObject(parent){
+}
+
+VidNail::~VidNail(){
+}
diff --git a/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h b/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h
new file mode 100644
index 00000000..45b6ca58
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h
@@ -0,0 +1,60 @@
+#ifndef VIDNAIL_H
+#define VIDNAIL_H
+
+extern "C" {
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+}
+
+class VidNail;
+
+struct vFrame {
+ vFrame() : *width(0), *height(0) {}
+ vFrame(int *width, int *height : width(width), height(height) {}
+ int *width;
+ int *height;
+};
+
+public:
+
+ QString getCodec();
+ void goto(int timeInSeconds);
+ void readVideoFrame();
+ void getScaledVideoFrame(int scaledSize, vFrame& vFrame);
+
+ int getWidth();
+ int getHeight();
+ int getLength();
+
+ void makeThumbnail(const QString& videoFile, QImage &image);
+ void setThumbnailSize(int size);
+ void setPercentage(int percent);
+ void setTime(const QString& Time);
+
+ void writeVidNail(vFrame& frame, QImage& image);
+
+
+ private:
+
+ bool readVideoPacket();
+ bool getVideoPacket();
+ void scaleVideo(int scaledSize, int& scaledWidth, int& scaledHeight);
+ void createVFrame(AVFrame *vFrame, quint8 *frameBuffer, int width, int height);
+ void calculateDimensions(int size);
+ void generateThumbnail(const QString& videoFile, ImageWriter& imageWriter, QImage& image);
+ QString getMimeType(const QString& videoFile);
+ QString getExtension(const QString& videoFilename);
+
+
+ private:
+ int videoStream;
+ AVFormatContext *inputVideoFormatContext;
+ AVCodecContext *inputvideoCodecContext;
+ AVCodec *inputVideoCodec;
+ AVStream *inputVideoStream;
+ AVFrame *inputVideoFrame;
+ quint8 *inputFrameBuffer;
+ AVPacket *videoPacket;
+
+
+#endif // VIDNAIL_H
diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
index ec425dd9..abb99975 100644
--- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
@@ -139,7 +139,7 @@ void MainUI::OpenDirs(QStringList dirs){
if(DWLIST[j]->id().section("-",1,1).toInt() >= id){ id = DWLIST[j]->id().section("-",1,1).toInt()+1; }
}
//Create the new DirWidget
- DirWidget *DW = new DirWidget("DW-"+QString::number(id), this);
+ DirWidget *DW = new DirWidget("DW-"+QString::number(id), settings, this);
DW->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
ui->BrowserLayout->addWidget(DW);
DWLIST << DW;
diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp
index 3790d145..8273d09c 100644
--- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp
+++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp
@@ -28,7 +28,7 @@
#define DEBUG 0
-DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){
+DirWidget::DirWidget(QString objID, QSettings *settings, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){
ui->setupUi(this); //load the designer file
ID = objID;
//Assemble the toolbar for the widget
@@ -54,6 +54,7 @@ DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new U
toolbar->addAction(ui->actionDualColumn);
columnActionGroup->addAction(ui->actionDualColumn);
toolbar->addAction(ui->actionMenu);
+ this->settings = settings;
//Add the browser widgets
RCBW = 0; //right column browser is unavailable initially
BW = new BrowserWidget("", this);
@@ -241,6 +242,7 @@ void DirWidget::createShortcuts(){
kPaste= new QShortcut(QKeySequence(QKeySequence::Paste),this);
kRename= new QShortcut(QKeySequence(Qt::Key_F2),this);
kExtract= new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_E), this);
+ //kArchive= new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_R), this);
kFav= new QShortcut(QKeySequence(Qt::Key_F3),this);
kDel= new QShortcut(QKeySequence(QKeySequence::Delete),this);
kOpSS= new QShortcut(QKeySequence(Qt::Key_F6),this);
@@ -257,6 +259,7 @@ void DirWidget::createShortcuts(){
connect(kPaste, SIGNAL(activated()), this, SLOT(pasteFiles()) );
connect(kRename, SIGNAL(activated()), this, SLOT(renameFiles()) );
connect(kExtract, SIGNAL(activated()), this, SLOT(autoExtractFiles()) );
+ //connect(kArchive, SIGNAL(activated()), this, SLOT(autoArchiveFiles()) );
connect(kFav, SIGNAL(activated()), this, SLOT(favoriteFiles()) );
connect(kDel, SIGNAL(activated()), this, SLOT(removeFiles()) );
connect(kOpSS, SIGNAL(activated()), this, SLOT(openInSlideshow()) );
@@ -338,8 +341,7 @@ void DirWidget::on_tool_zoom_in_clicked(){
size += 16;
setThumbnailSize(size);
//Now Save the size value as the default for next time
- QSettings SET("lumina-desktop","lumina-fm");
- SET.setValue("iconsize", size);
+ settings->setValue("iconsize", size);
}
void DirWidget::on_tool_zoom_out_clicked(){
@@ -348,8 +350,7 @@ void DirWidget::on_tool_zoom_out_clicked(){
size -= 16;
setThumbnailSize(size);
//Now Save the size value as the default for next time
- QSettings SET("lumina-desktop","lumina-fm");
- SET.setValue("iconsize", size);
+ settings->setValue("iconsize", size);
}
// -- Top Snapshot Buttons
@@ -552,7 +553,9 @@ void DirWidget::UpdateContextMenu(){
contextMenu->addAction(LXDG::findIcon("edit-cut",""), tr("Cut Selection"), this, SLOT(cutFiles()), kCut->key() )->setEnabled(canmodify);
contextMenu->addAction(LXDG::findIcon("edit-copy",""), tr("Copy Selection"), this, SLOT(copyFiles()), kCopy->key() )->setEnabled(canmodify);
if(LUtils::isValidBinary("lumina-archiver") && sel.length() ==1){ contextMenu->addAction(LXDG::findIcon("archive",""), tr("Auto-Extract"), this, SLOT(autoExtractFiles()), kExtract->key() )->setEnabled(canmodify); }
- }
+ //if(LUtils::isValidBinary("lumina-archiver") && sel.length() ==1){ contextMenu->addAction(LXDG::findIcon("archive",""), tr("Auto-Archive"), this, SLOT(autoArchiveFiles()), kArchive->key() )->setEnabled(canmodify); }
+
+ }
if( QApplication::clipboard()->mimeData()->hasFormat("x-special/lumina-copied-files") ){
contextMenu->addAction(LXDG::findIcon("edit-paste",""), tr("Paste"), this, SLOT(pasteFiles()), QKeySequence(Qt::CTRL+Qt::Key_V) )->setEnabled(canmodify);
}
@@ -735,36 +738,6 @@ void DirWidget::createNewXDGEntry(){
// - Selected FILE operations
-//---------------------------------------------------//
-/*
-QStringList DirWidget::getPreferredApplications(){
- QStringList out;
- //First list all the applications registered for that same mimetype
- QString mime = fileEXT;
- out << LXDG::findAvailableAppsForMime(mime);
-
- //Now search the internal settings for that extension and find any applications last used
- QStringList keys = settings->allKeys();
- for(int i=0; i<keys.length(); i++){
- if(keys[i].startsWith("default/")){ continue; } //ignore the defaults (they will also be in the main)
- if(keys[i].toLower() == fileEXT.toLower()){
- QStringList files = settings->value(keys[i]).toString().split(":::");
- qDebug() << "Found Files:" << keys[i] << files;
- bool cleaned = false;
- for(int j=0; j<files.length(); j++){
- if(QFile::exists(files[j])){ out << files[j]; }
- else{ files.removeAt(j); j--; cleaned=true; } //file no longer available - remove it
- }
- if(cleaned){ settings->setValue(keys[i], files.join(":::")); } //update the registry
- if(!out.isEmpty()){ break; } //already found files
- }
- }
- //Make sure we don't have any duplicates before we return the list
- out.removeDuplicates();
- return out;
-}
- */
- //---------------------------------------------------//
void DirWidget::cutFiles(){
QStringList sel = currentBrowser()->currentSelection();
@@ -882,13 +855,15 @@ void DirWidget::autoExtractFiles(){
QStringList files = currentBrowser()->currentSelection();
qDebug() << "Starting auto-extract:" << files;
ExternalProcess::launch("lumina-archiver", QStringList() << "--ax" << files);
- /*ExternalProcess *pExtract= new ExternalProcess(this);
- QString program = "lumina-archiver --ax ";
+}
+
+/*
+ * void DirWidget::autoArchiveFiles(){
QStringList files = currentBrowser()->currentSelection();
- for(int i=0; i<files.length(); i++){
- QString runline = program + files[i];
- pExtract->start(runline);*/
+ qDebug() << "Starting auto-archival:" << files;
+ ExternalProcess::launch("lumina-archiver", QStringList() << "--aa" << files);
}
+*/
//====================
// PROTECTED
diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h
index e1dafaa8..8dd367df 100644
--- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h
+++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h
@@ -32,7 +32,7 @@ class DirWidget : public QWidget{
Q_OBJECT
public:
enum DETAILTYPES{ NAME, SIZE, TYPE, DATEMOD, DATECREATE};
- DirWidget(QString objID, QWidget *parent = 0); //needs a unique ID (to distinguish from other DirWidgets)
+ DirWidget(QString objID, QSettings *settings, QWidget *parent = 0); //needs a unique ID (to distinguish from other DirWidgets)
~DirWidget();
void cleanup(); //called before the browser is closed down
@@ -75,6 +75,7 @@ private:
QString ID, cBID; //unique ID assigned by the parent, and currently active browser widget
QString normalbasedir, snapbasedir, snaprelpath; //for maintaining directory context while moving between snapshots
QStringList snapshots, needThumbs, tmpSel;
+ QSettings *settings;
bool canmodify;
//The Toolbar and associated items
@@ -86,7 +87,7 @@ private:
//The keyboard shortcuts for context menu items
QShortcut *kZoomIn, *kZoomOut, *kNewFile, *kNewDir, *kNewXDG, *kCut, *kCopy, *kPaste, *kRename, \
- *kFav, *kDel, *kOpSS, *kOpMM, *kOpTerm, *kExtract;
+ *kFav, *kDel, *kOpSS, *kOpMM, *kOpTerm, *kExtract; //, *kArchive;
//Functions for internal use
void createShortcuts(); //on init only
@@ -95,13 +96,11 @@ private:
BrowserWidget* currentBrowser();
QStringList currentDirFiles(); //all the "files" available within the current dir/browser
- //QProcess *pExtract;
-
- //OpenWithMenu
- QString fileEXT, filePath;
- QStringList mimetypes, keys, files;
- //QStringList getPreferredApplications();
-
+ //QProcess *pExtract;
+ //OpenWithMenu
+ QString fileEXT, filePath;
+ QStringList mimetypes, keys, files;
+ //QStringList getPreferredApplications();
private slots:
//UI BUTTONS/Actions
@@ -158,6 +157,7 @@ private slots:
void runWithFiles();
//void attachToNewEmail();
void autoExtractFiles();
+ //void autoArchiveFiles();
// - Context-specific operations
void openInSlideshow();
bgstack15