diff options
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/MainUI.cpp | 19 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/MainUI.h | 2 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/MainUI.ui | 15 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp | 15 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp | 16 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-screenshot/MainUI.h | 1 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-screenshot/MainUI.ui | 57 |
7 files changed, 106 insertions, 19 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp index e465cdf8..2972550c 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp @@ -42,6 +42,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ 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()) ); + connect(ui->tree_contents, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()) ); //Set Keyboard Shortcuts ui->action_New->setShortcut(tr("CTRL+N")); @@ -88,7 +89,7 @@ void MainUI::loadIcons(){ ui->actionAdd_Dirs->setIcon( LXDG::findIcon("archive-insert-directory","") ); ui->actionRemove_File->setIcon( LXDG::findIcon("archive-remove","") ); ui->actionExtract_All->setIcon( LXDG::findIcon("archive-extract","") ); - ui->actionExtract_Sel->setIcon( LXDG::findIcon("archive-extract","") ); + ui->actionExtract_Sel->setIcon( LXDG::findIcon("edit-select-all","") ); ui->actionUSB_Image->setIcon( LXDG::findIcon("drive-removable-media-usb-pendrive","drive-removable-media-usb") ); } @@ -112,6 +113,12 @@ QTreeWidgetItem* MainUI::findItem(QString path, QTreeWidgetItem *start){ } bool MainUI::cleanItems(QStringList list, QTreeWidgetItem *start){ + //Quick detection for an empty list + if(list.isEmpty() && ui->tree_contents->topLevelItemCount()>0){ + ui->tree_contents->clear(); + return true; + } + //Recursive resolution of items bool changed = false; if(start==0){ for(int i=0; i<ui->tree_contents->topLevelItemCount(); i++){ @@ -154,7 +161,7 @@ QString MainUI::CreateFileTypes(){ QString MainUI::OpenFileTypes(){ QStringList types; - types << QString(tr("All Types %1")).arg("(*.tar.gz *.tar.xz *.tar.bz *.tar.bz2 *.tar.lzma *.tar *.zip *.tgz *.txz *.tbz *.tbz2 *.tlz *.cpio *.pax *.ar *.shar *.7z *.iso *.img *.xar *.jar *.rpm)"); + types << QString(tr("All Known Types %1")).arg("(*.tar.gz *.tar.xz *.tar.bz *.tar.bz2 *.tar.lzma *.tar *.zip *.tgz *.txz *.tbz *.tbz2 *.tlz *.cpio *.pax *.ar *.shar *.7z *.iso *.img *.xar *.jar *.rpm)"); types << tr("Uncompressed Archive (*.tar)"); types << tr("GZip Compressed Archive (*.tar.gz *.tgz)"); types << tr("BZip Compressed Archive (*.tar.bz *.tbz)"); @@ -171,6 +178,7 @@ QString MainUI::OpenFileTypes(){ types << tr("READ-ONLY: XAR archive (*.xar)"); types << tr("READ-ONLY: Java archive (*.jar)"); types << tr("READ-ONLY: RedHat Package (*.rpm)"); + types << tr("Show All Files (*)"); return types.join(";;"); } @@ -340,7 +348,8 @@ void MainUI::ProcFinished(bool success, QString msg){ canmodify = canmodify && BACKEND->canModify(); //also include the file type limitations ui->actionAdd_File->setEnabled(canmodify); ui->actionRemove_File->setEnabled(canmodify && info.exists()); - ui->actionExtract_All->setEnabled(info.exists()); + ui->actionExtract_All->setEnabled(info.exists() && ui->tree_contents->topLevelItemCount()>0); + ui->actionExtract_Sel->setEnabled(info.exists() && !ui->tree_contents->selectedItems().isEmpty()); ui->actionAdd_Dirs->setEnabled(canmodify); } @@ -349,3 +358,7 @@ void MainUI::ProcUpdate(int percent, QString txt){ ui->progressBar->setValue(percent); if(!txt.isEmpty()){ ui->label_progress->setText(txt); } } + +void MainUI::selectionChanged(){ + ui->actionExtract_Sel->setEnabled(!ui->tree_contents->selectedItems().isEmpty()); +} diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.h b/src-qt5/desktop-utils/lumina-archiver/MainUI.h index bf37d26a..273078ea 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.h +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.h @@ -55,6 +55,8 @@ private slots: void ProcFinished(bool, QString); void ProcUpdate(int percent, QString txt); + //UI Slots + void selectionChanged(); }; #endif diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.ui b/src-qt5/desktop-utils/lumina-archiver/MainUI.ui index 6666b7cb..0fc9eadf 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.ui @@ -15,6 +15,15 @@ </property> <widget class="QWidget" name="centralwidget"> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>3</number> + </property> + <property name="topMargin"> + <number>1</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item> <layout class="QHBoxLayout" name="horizontalLayout"> <item> @@ -111,7 +120,7 @@ <x>0</x> <y>0</y> <width>403</width> - <height>22</height> + <height>20</height> </rect> </property> <widget class="QMenu" name="menuFile"> @@ -168,6 +177,7 @@ <addaction name="actionRemove_File"/> <addaction name="separator"/> <addaction name="actionExtract_All"/> + <addaction name="actionExtract_Sel"/> </widget> <action name="action_Open"> <property name="text"> @@ -226,6 +236,9 @@ <property name="text"> <string>Extract Selection</string> </property> + <property name="statusTip"> + <string>Extract Selected Items</string> + </property> </action> <action name="actionUSB_Image"> <property name="text"> diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp index 78efd51c..0659f8b1 100644 --- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp @@ -27,6 +27,7 @@ Backend::~Backend(){ // PUBLIC //=============== void Backend::loadFile(QString path){ + //qDebug() << "Loading Archive:" << path; filepath = path; tmpfilepath = filepath.section("/",0,-2)+"/"+".tmp_larchiver_"+filepath.section("/",-1); flags.clear(); @@ -149,7 +150,7 @@ void Backend::startViewFile(QString path){ args << "-x"; args << flags <<"--include" << path <<"--strip-components" << QString::number(path.count("/")) << "-C" << QDir::tempPath(); STARTING=true; - qDebug() << "Starting command:" << "tar" << args; + //qDebug() << "Starting command:" << "tar" << args; PROC.start("tar", args); } @@ -195,6 +196,7 @@ void Backend::startList(){ QStringList args; args << "-tv"; LIST = STARTING=true; + //qDebug() << "Starting List:" << "tar "+args.join(" ")+" "+flags.join(" "); PROC.start("tar", QStringList() << args << flags); } @@ -203,12 +205,17 @@ void Backend::startList(){ //=============== void Backend::procFinished(int retcode, QProcess::ExitStatus){ static QString result; - processData(); //qDebug() << "Process Finished:" << PROC.arguments() << retcode; + processData(); LIST = STARTING = false; if(PROC.arguments().contains("-tv")){ - if(retcode!=0){ contents.clear(); } //could not read archive - emit ProcessFinished(true,result); + if(retcode!=0){ //could not read archive + contents.clear(); + result = tr("Could not read archive"); + }else if(result.isEmpty()){ + result = tr("Archive Loaded"); + } + emit ProcessFinished((retcode==0), result); result.clear(); }else{ bool needupdate = true; diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp index 40c9857b..2c5dc700 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp @@ -9,7 +9,7 @@ #include <LuminaX11.h> #include <QMessageBox> - +#include <QClipboard> MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ ui->setupUi(this); //load the designer file @@ -30,7 +30,8 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ scaleTimer->setSingleShot(true); scaleTimer->setInterval(200); //~1/5 second tabbar = new QTabBar(this); - ui->tabLayout->insertWidget(0,tabbar); + tabbar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + ui->tabLayout->insertWidget(0,tabbar, Qt::AlignLeft | Qt::AlignBottom); tabbar->addTab(LXDG::findIcon("view-preview",""), tr("View")); tabbar->addTab(LXDG::findIcon("preferences-other",""), tr("Settings")); ui->stackedWidget->setCurrentWidget(ui->page_current); @@ -47,6 +48,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ //connect(ui->push_snap, SIGNAL(clicked()), this, SLOT(startScreenshot()) ); connect(ui->actionTake_Screenshot, SIGNAL(triggered()), this, SLOT(startScreenshot()) ); connect(ui->tool_crop, SIGNAL(clicked()), IMG, SLOT(cropImage()) ); + connect(ui->tool_copy_to_clipboard, SIGNAL(clicked()), this, SLOT(copyToClipboard()) ); connect(IMG, SIGNAL(selectionChanged(bool)), this, SLOT(imgselchanged(bool)) ); connect(IMG, SIGNAL(scaleFactorChanged(int)), this, SLOT(imgScalingChanged(int)) ); connect(ui->slider_zoom, SIGNAL(valueChanged(int)), this, SLOT(sliderChanged()) ); @@ -74,16 +76,14 @@ MainUI::~MainUI(){} void MainUI::setupIcons(){ //Setup the icons - //ui->tool_save->setIcon( LXDG::findIcon("document-save","") ); ui->tool_quicksave->setIcon( LXDG::findIcon("document-edit","") ); ui->actionSave_As->setIcon( LXDG::findIcon("document-save-as","") ); ui->actionQuick_Save->setIcon( LXDG::findIcon("document-save","") ); ui->actionClose->setIcon( LXDG::findIcon("application-exit","") ); - //ui->push_snap->setIcon( LXDG::findIcon("camera-web","") ); + ui->tool_copy_to_clipboard->setIcon( LXDG::findIcon("insert-image","") ); ui->actionTake_Screenshot->setIcon( LXDG::findIcon("camera-web","") ); ui->tool_crop->setIcon( LXDG::findIcon("transform-crop","") ); ui->tool_resize->setIcon( LXDG::findIcon("transform-scale","") ); - //ui->actionEdit->setIcon( LXDG::findIcon("applications-graphics","") ); this->setWindowIcon( LXDG::findIcon("camera-web","") ); } @@ -121,6 +121,12 @@ void MainUI::quicksave(){ } } +void MainUI::copyToClipboard(){ + qDebug() << "Copy Image to clipboard"; + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setImage(IMG->image()); + qDebug() << " - Success:" << !clipboard->image().isNull(); +} void MainUI::startScreenshot(){ if(mousegrabbed){ return; } diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h index 396bfafe..5ff496a5 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h @@ -63,6 +63,7 @@ private slots: } void saveScreenshot(); void quicksave(); + void copyToClipboard(); void startScreenshot(); diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui b/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui index cddee009..0c70d3d8 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>386</width> - <height>288</height> + <width>480</width> + <height>318</height> </rect> </property> <property name="sizePolicy"> @@ -54,7 +54,7 @@ <item> <widget class="QFrame" name="frame_modify"> <property name="frameShape"> - <enum>QFrame::NoFrame</enum> + <enum>QFrame::StyledPanel</enum> </property> <property name="frameShadow"> <enum>QFrame::Raised</enum> @@ -83,12 +83,44 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="statusTip"> + <string>Open screenshot with an application</string> + </property> <property name="text"> - <string>Open With...</string> + <string>Open</string> </property> <property name="toolButtonStyle"> <enum>Qt::ToolButtonTextBesideIcon</enum> </property> + <property name="autoRaise"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="tool_copy_to_clipboard"> + <property name="statusTip"> + <string>Copy screenshot to clipboard</string> + </property> + <property name="text"> + <string>Copy</string> + </property> + <property name="shortcut"> + <string>Ctrl+C</string> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> </widget> </item> <item> @@ -99,12 +131,18 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="statusTip"> + <string>Resize screenshot to selection</string> + </property> <property name="text"> <string>Resize</string> </property> <property name="toolButtonStyle"> <enum>Qt::ToolButtonTextBesideIcon</enum> </property> + <property name="autoRaise"> + <bool>true</bool> + </property> </widget> </item> <item> @@ -115,12 +153,18 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="statusTip"> + <string>Crop screenshot to selection</string> + </property> <property name="text"> <string>&Crop</string> </property> <property name="toolButtonStyle"> <enum>Qt::ToolButtonTextBesideIcon</enum> </property> + <property name="autoRaise"> + <bool>true</bool> + </property> </widget> </item> </layout> @@ -210,8 +254,8 @@ <rect> <x>0</x> <y>0</y> - <width>344</width> - <height>216</height> + <width>439</width> + <height>230</height> </rect> </property> </widget> @@ -466,6 +510,7 @@ <addaction name="actionQuick_Save"/> <addaction name="actionClose"/> </widget> + <widget class="QStatusBar" name="statusBar"/> <action name="actionTake_Screenshot"> <property name="text"> <string>Capture</string> |