From 36df3d58e25beb06f16fdf821f18fe8a4bcce2ae Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 20 Oct 2016 12:05:22 -0400 Subject: Finish up the last couple buttons/actions related to the new Tray UI. 1) If closing the main window while an operation is running, hide it instead until the file operation is finished - then close. 2) Fix the icon on the show errors button 3) Hook up the show errors button to show a scroll dialog with the errors. --- src-qt5/desktop-utils/lumina-fm/OPWidget.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fm/OPWidget.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp b/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp index 3e842b90..3638e2a8 100644 --- a/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp +++ b/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp @@ -7,16 +7,19 @@ #include "OPWidget.h" #include "ui_OPWidget.h" +#include "ScrollDialog.h" + OPWidget::OPWidget(QWidget *parent) : QWidget(parent), ui(new Ui::OPWidget()){ starttime = endtime = -1; WA = new QWidgetAction(0); WA->setDefaultWidget(this); worker = 0; workthread = 0; + dlg = 0; //Now create the widget ui->setupUi(this); ui->tool_close->setIcon( LXDG::findIcon("dialog-close","view-close") ); - ui->tool_showerrors->setIcon(LXDG::findIcon("view-search","")); + ui->tool_showerrors->setIcon(LXDG::findIcon("dialog-warning","")); //connect the widget buttons connect(ui->tool_close, SIGNAL(clicked()), this, SLOT(closeWidget()) ); connect(ui->tool_showerrors, SIGNAL(clicked()), this, SLOT(showErrors()) ); @@ -26,6 +29,7 @@ OPWidget::~OPWidget(){ if(worker!=0){ worker->stopped = true; worker->deleteLater(); } if(workthread!=0){ workthread->quit(); workthread->wait(); delete workthread; } WA->deleteLater(); + if(dlg!=0){ dlg->deleteLater(); } } QWidgetAction* OPWidget::widgetAction(){ @@ -87,7 +91,12 @@ void OPWidget::closeWidget(){ void OPWidget::showErrors(){ qDebug() << "Errors:" << Errors; - //TODO + if(dlg==0){ + dlg = new ScrollDialog(); //need this to persist outside this function + dlg->setWindowTitle(tr("File Operation Errors")); + dlg->setText( Errors.join("\n") ); + } + dlg->showNormal(); } void OPWidget::opFinished(QStringList errors){ -- cgit