2017-04-23 15:05:48 +02:00
|
|
|
#include "mainwindow.hpp"
|
2017-06-22 17:41:29 +02:00
|
|
|
#include "aboutbox.hpp"
|
2017-04-23 15:05:48 +02:00
|
|
|
#include "screenshotter.hpp"
|
2017-06-22 17:41:29 +02:00
|
|
|
#include "settingsdialog.hpp"
|
2017-04-23 15:05:48 +02:00
|
|
|
#include "ui_mainwindow.h"
|
2017-11-23 20:33:49 +01:00
|
|
|
#include "utils.hpp"
|
2019-05-10 00:17:43 +02:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QClipboard>
|
2017-06-22 17:41:29 +02:00
|
|
|
#include <QMessageBox>
|
2017-07-25 10:13:39 +02:00
|
|
|
#include <QShortcut>
|
2017-05-16 15:52:15 +02:00
|
|
|
#include <colorpicker/colorpickerscene.hpp>
|
2017-06-22 17:41:29 +02:00
|
|
|
#include <formats.hpp>
|
2017-04-26 22:00:13 +02:00
|
|
|
#include <hotkeying.hpp>
|
2018-02-18 02:35:29 +01:00
|
|
|
#include <logger.hpp>
|
2017-06-27 11:33:11 +02:00
|
|
|
#include <platformbackend.hpp>
|
2017-06-06 01:26:26 +02:00
|
|
|
#include <recording/recordingformats.hpp>
|
2017-04-23 20:29:24 +02:00
|
|
|
#include <settings.hpp>
|
2017-04-23 15:05:48 +02:00
|
|
|
#include <uploaders/uploadersingleton.hpp>
|
2019-05-08 21:07:06 +02:00
|
|
|
#include <QBuffer>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QFile>
|
2019-05-08 22:00:10 +02:00
|
|
|
#include <QIcon>
|
2019-05-08 21:07:06 +02:00
|
|
|
#include <QStandardPaths>
|
|
|
|
#include <QDesktopServices>
|
|
|
|
#include <logs/requestlogging.hpp>
|
2019-05-08 22:00:10 +02:00
|
|
|
#include "io/ioutils.hpp"
|
2019-05-08 21:07:06 +02:00
|
|
|
#include <monospacetextdialog.hpp>
|
2019-05-11 15:00:12 +02:00
|
|
|
#include <clipboard/clipboardcopy.hpp>
|
2019-05-16 00:29:05 +02:00
|
|
|
#include <logs/screenshotfile.h>
|
2019-05-16 18:41:44 +02:00
|
|
|
#include <QDateTime>
|
2017-04-23 15:05:48 +02:00
|
|
|
|
2017-04-25 22:17:36 +02:00
|
|
|
MainWindow *MainWindow::instance;
|
2019-05-16 18:41:44 +02:00
|
|
|
qint8 trayIconClicks = 0;
|
|
|
|
bool wasDoubleCLick = false;
|
2017-04-25 22:17:36 +02:00
|
|
|
|
2019-05-08 21:07:06 +02:00
|
|
|
using requestlogging::LoggedRequest;
|
|
|
|
|
2017-06-18 19:04:25 +02:00
|
|
|
void MainWindow::rec() {
|
|
|
|
if (controller->isRunning()) return;
|
2017-07-29 17:22:17 +02:00
|
|
|
auto f = static_cast<formats::Recording>(
|
|
|
|
settings::settings().value("recording/format", static_cast<int>(formats::Recording::None)).toInt());
|
2017-07-05 13:01:53 +02:00
|
|
|
if (f >= formats::Recording::None) {
|
2018-01-01 16:37:31 +01:00
|
|
|
logger::warn(tr("Recording format not set in settings. Aborting."));
|
2017-07-05 13:01:53 +02:00
|
|
|
return;
|
|
|
|
}
|
2017-06-18 19:04:25 +02:00
|
|
|
RecordingContext *ctx = new RecordingContext;
|
|
|
|
RecordingFormats *format = new RecordingFormats(f);
|
|
|
|
ctx->consumer = format->getConsumer();
|
|
|
|
ctx->finalizer = format->getFinalizer();
|
|
|
|
ctx->validator = format->getValidator();
|
|
|
|
ctx->format = format->getFormat();
|
|
|
|
ctx->postUploadTask = format->getPostUploadTask();
|
|
|
|
ctx->anotherFormat = format->getAnotherFormat();
|
|
|
|
controller->start(ctx);
|
|
|
|
}
|
|
|
|
|
2017-07-29 17:22:17 +02:00
|
|
|
#define ACTION(english, menu) \
|
|
|
|
[&]() -> QAction * { \
|
2017-08-01 23:33:45 +02:00
|
|
|
QAction *a = menu->addAction(english); \
|
2017-07-29 17:22:17 +02:00
|
|
|
return a; \
|
|
|
|
}()
|
|
|
|
|
2017-06-22 17:41:29 +02:00
|
|
|
void addHotkey(QString name, std::function<void()> action) {
|
|
|
|
hotkeying::load(name, action);
|
|
|
|
}
|
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
|
|
|
|
instance = this;
|
|
|
|
ui->setupUi(this);
|
2017-07-08 12:53:08 +02:00
|
|
|
setWindowIcon(QIcon(":/icons/icon.png"));
|
2017-05-09 17:26:00 +02:00
|
|
|
tray = new QSystemTrayIcon(windowIcon(), this);
|
|
|
|
tray->setToolTip("KShare");
|
|
|
|
tray->setVisible(true);
|
2017-07-31 00:21:24 +02:00
|
|
|
menu = new QMenu(this);
|
2017-08-01 23:33:45 +02:00
|
|
|
QAction *shtoggle = ACTION(tr("Show/Hide"), menu);
|
|
|
|
QAction *fullscreen = ACTION(tr("Take fullscreen shot"), menu);
|
|
|
|
QAction *area = ACTION(tr("Take area shot"), menu);
|
2017-06-27 11:33:11 +02:00
|
|
|
|
|
|
|
#ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW
|
2017-08-01 23:33:45 +02:00
|
|
|
QAction *active = ACTION(tr("Screenshot active window"), menu);
|
2017-06-27 11:33:11 +02:00
|
|
|
connect(active, &QAction::triggered, this, [] { screenshotter::activeDelayed(); });
|
|
|
|
#endif
|
2019-05-11 20:29:51 +02:00
|
|
|
QAction *copyClipboard = ACTION(tr("Copy from Clipbaord"), menu);
|
2017-08-01 23:33:45 +02:00
|
|
|
QAction *picker = ACTION(tr("Show color picker"), menu);
|
|
|
|
QAction *rec = ACTION(tr("Record screen"), menu);
|
|
|
|
QAction *recoff = ACTION(tr("Stop recording"), menu);
|
|
|
|
QAction *recabort = ACTION(tr("Abort recording"), menu);
|
2019-05-07 20:18:22 +02:00
|
|
|
menu->addActions({ shtoggle, picker });
|
2017-05-09 17:26:00 +02:00
|
|
|
menu->addSeparator();
|
2019-05-11 20:29:51 +02:00
|
|
|
menu->addActions({ fullscreen, area, copyClipboard });
|
2017-06-27 11:33:11 +02:00
|
|
|
#ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW
|
2017-07-30 11:14:17 +02:00
|
|
|
menu->addAction(active);
|
2017-06-27 11:33:11 +02:00
|
|
|
#endif
|
2017-06-18 19:04:25 +02:00
|
|
|
menu->addSeparator();
|
2017-07-05 12:15:14 +02:00
|
|
|
menu->addActions({ rec, recoff, recabort });
|
2019-05-07 20:18:22 +02:00
|
|
|
|
|
|
|
QAction *quit = ACTION(tr("Quit"), menu);
|
|
|
|
QAction *about = ACTION(tr("About"), menu);
|
|
|
|
menu->addSeparator();
|
|
|
|
menu->addActions({ about, quit });
|
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
connect(quit, &QAction::triggered, this, &MainWindow::quit);
|
|
|
|
connect(shtoggle, &QAction::triggered, this, &MainWindow::toggleVisible);
|
2017-05-16 19:16:09 +02:00
|
|
|
connect(picker, &QAction::triggered, [] { ColorPickerScene::showPicker(); });
|
2017-07-10 21:47:04 +02:00
|
|
|
connect(tray, &QSystemTrayIcon::messageClicked, this, &QWidget::show);
|
2019-05-16 18:41:44 +02:00
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
connect(tray, &QSystemTrayIcon::activated, this, [this](QSystemTrayIcon::ActivationReason reason) {
|
2019-05-16 18:41:44 +02:00
|
|
|
if (reason == QSystemTrayIcon::MiddleClick) {
|
|
|
|
screenshotter::fullscreenDelayed();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (reason == QSystemTrayIcon::DoubleClick) {
|
|
|
|
wasDoubleCLick = true;
|
|
|
|
toggleVisible();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (reason != QSystemTrayIcon::Trigger) return;
|
|
|
|
|
|
|
|
trayIconClicks++;
|
|
|
|
if (trayIconClicks == 1) {
|
|
|
|
QTimer::singleShot(QApplication::doubleClickInterval(), [this] {
|
|
|
|
if(wasDoubleCLick) {
|
|
|
|
wasDoubleCLick = false;
|
2019-05-16 18:56:53 +02:00
|
|
|
trayIconClicks = 0;
|
2019-05-16 18:41:44 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(trayIconClicks == 1) {
|
|
|
|
// Single Click
|
|
|
|
screenshotter::areaDelayed();
|
|
|
|
} else {
|
|
|
|
// Double Click
|
|
|
|
toggleVisible();
|
|
|
|
}
|
|
|
|
trayIconClicks = 0;
|
|
|
|
});
|
|
|
|
}
|
2017-05-09 17:26:00 +02:00
|
|
|
});
|
|
|
|
connect(fullscreen, &QAction::triggered, this, [] { screenshotter::fullscreenDelayed(); });
|
|
|
|
connect(area, &QAction::triggered, this, [] { screenshotter::areaDelayed(); });
|
2019-05-11 20:29:51 +02:00
|
|
|
connect(copyClipboard, &QAction::triggered, this, &clipboardcopy::copyClipboard);
|
2017-06-18 19:04:25 +02:00
|
|
|
connect(rec, &QAction::triggered, this, &MainWindow::rec);
|
2017-07-05 12:15:14 +02:00
|
|
|
connect(recoff, &QAction::triggered, controller, &RecordingController::end);
|
|
|
|
connect(recabort, &QAction::triggered, controller, &RecordingController::abort);
|
2019-05-08 10:37:04 +02:00
|
|
|
connect(about, &QAction::triggered, this, &MainWindow::on_actionAbout_triggered);
|
2019-05-08 21:07:06 +02:00
|
|
|
|
|
|
|
connect(ui->settingsButton, &QPushButton::clicked, this, &MainWindow::on_actionSettings_triggered);
|
|
|
|
connect(ui->fullscreenButton, &QPushButton::clicked, this, [] { screenshotter::fullscreenDelayed(); });
|
|
|
|
connect(ui->areaButton, &QPushButton::clicked, this, [] { screenshotter::areaDelayed(); });
|
|
|
|
connect(ui->aboutButton, &QPushButton::clicked, this, &MainWindow::on_actionAbout_triggered);
|
|
|
|
connect(ui->screenshotFolderButton, &QPushButton::clicked, this, &MainWindow::openScreenshotFolder);
|
2019-05-11 15:00:12 +02:00
|
|
|
connect(ui->clipboardButton, &QPushButton::clicked, this, &clipboardcopy::copyClipboard);
|
2019-05-08 21:07:06 +02:00
|
|
|
connect(ui->colorPickerButton, &QPushButton::clicked, this, [] { ColorPickerScene::showPicker(); });
|
2017-05-09 17:26:00 +02:00
|
|
|
|
2019-05-10 00:17:43 +02:00
|
|
|
ui->treeWidget->addAction(ui->actionOpenURL);
|
|
|
|
ui->treeWidget->addAction(ui->actionOpenLocalFile);
|
|
|
|
ui->treeWidget->addAction(ui->actionOpenRequest);
|
|
|
|
ui->treeWidget->addAction(ui->actionCopyLinktoClipboard);
|
|
|
|
|
2019-05-08 22:00:10 +02:00
|
|
|
ui->aboutButton->setFocus();
|
|
|
|
|
2017-06-22 17:41:29 +02:00
|
|
|
tray->setContextMenu(menu);
|
2017-05-09 17:26:00 +02:00
|
|
|
|
2017-06-22 17:41:29 +02:00
|
|
|
addHotkey("fullscreen", [] { screenshotter::fullscreen(); });
|
|
|
|
addHotkey("area", [] { screenshotter::area(); });
|
2017-06-27 11:33:11 +02:00
|
|
|
addHotkey("active", [] { screenshotter::active(); });
|
2017-06-22 17:41:29 +02:00
|
|
|
addHotkey("picker", [] { ColorPickerScene::showPicker(); });
|
2019-05-11 15:00:12 +02:00
|
|
|
addHotkey("clipboard", [] { clipboardcopy::copyClipboard(); });
|
2017-06-22 17:41:29 +02:00
|
|
|
addHotkey("recordingstop", [&] { controller->end(); });
|
2017-07-05 12:15:14 +02:00
|
|
|
addHotkey("recordingabort", [&] { controller->abort(); });
|
2017-06-22 17:41:29 +02:00
|
|
|
addHotkey("recordingstart", [&] { this->rec(); });
|
2017-05-09 17:26:00 +02:00
|
|
|
|
|
|
|
auto errors = UploaderSingleton::inst().errors();
|
2017-06-22 17:41:29 +02:00
|
|
|
for (auto err : errors) ui->logBox->addItem(QString("ERROR: ") + err.what());
|
|
|
|
setWindowTitle("KShare v" + QApplication::applicationVersion());
|
|
|
|
val = true;
|
2019-05-08 21:07:06 +02:00
|
|
|
|
|
|
|
QList<LoggedRequest> requests = requestlogging::getRequests();
|
|
|
|
for (LoggedRequest req : requests) {
|
2019-05-16 00:29:05 +02:00
|
|
|
addResponse(req.getResponseCode(), req.getScreenshotFile(), req.getResult(), req.getUrl(), req.getTime());
|
2019-05-08 21:07:06 +02:00
|
|
|
}
|
2017-05-09 17:26:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow() {
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2017-06-22 17:41:29 +02:00
|
|
|
bool MainWindow::valid() {
|
|
|
|
return val;
|
2017-05-09 17:26:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow *MainWindow::inst() {
|
|
|
|
return instance;
|
|
|
|
}
|
2017-05-06 13:21:12 +02:00
|
|
|
|
|
|
|
void MainWindow::closeEvent(QCloseEvent *event) {
|
2017-05-15 14:42:40 +02:00
|
|
|
if (settings::settings().value("hideOnClose", true).toBool()) {
|
|
|
|
event->ignore();
|
2017-06-22 17:41:29 +02:00
|
|
|
hide();
|
2017-05-15 14:42:40 +02:00
|
|
|
} else
|
|
|
|
QApplication::exit(0);
|
2017-05-06 13:21:12 +02:00
|
|
|
}
|
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
void MainWindow::quit() {
|
|
|
|
QCoreApplication::quit();
|
|
|
|
}
|
2017-05-06 13:21:12 +02:00
|
|
|
|
|
|
|
void MainWindow::toggleVisible() {
|
2017-05-09 17:26:00 +02:00
|
|
|
this->setVisible(!this->isVisible());
|
|
|
|
if (this->isVisible()) {
|
2017-05-13 22:39:05 +02:00
|
|
|
this->raise(); // that didn't work
|
|
|
|
this->setWindowState(Qt::WindowActive); // maybe that works
|
|
|
|
this->activateWindow(); // maybe that works
|
2017-05-09 17:26:00 +02:00
|
|
|
}
|
2017-05-06 13:21:12 +02:00
|
|
|
}
|
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
void MainWindow::on_actionQuit_triggered() {
|
|
|
|
quit();
|
|
|
|
}
|
2017-05-06 13:21:12 +02:00
|
|
|
|
2017-06-18 23:31:40 +02:00
|
|
|
void MainWindow::on_actionStart_triggered() {
|
|
|
|
rec();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionStop_triggered() {
|
|
|
|
controller->end();
|
|
|
|
}
|
2017-06-22 17:41:29 +02:00
|
|
|
|
|
|
|
void MainWindow::on_actionSettings_triggered() {
|
|
|
|
SettingsDialog *dialog = new SettingsDialog(this);
|
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->show();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionAbout_triggered() {
|
|
|
|
AboutBox *box = new AboutBox(this);
|
|
|
|
box->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
box->show();
|
|
|
|
}
|
2017-06-27 18:29:08 +02:00
|
|
|
|
2017-07-05 12:15:14 +02:00
|
|
|
void MainWindow::on_actionAbort_triggered() {
|
|
|
|
controller->abort();
|
|
|
|
}
|
2017-08-21 16:17:20 +02:00
|
|
|
|
2019-05-10 00:17:43 +02:00
|
|
|
void MainWindow::on_actionOpenRequest_triggered() {
|
|
|
|
QString file = ui->treeWidget->currentItem()->text(4);
|
2019-05-08 21:07:06 +02:00
|
|
|
file = settings::dir().absoluteFilePath("responses/" + file.left(file.length() - 4));
|
|
|
|
|
|
|
|
QFile dataFile(file);
|
2019-05-09 19:53:58 +02:00
|
|
|
if (!dataFile.open(QIODevice::ReadOnly)) {
|
|
|
|
logger::info(file);
|
|
|
|
logger::error(dataFile.errorString());
|
|
|
|
return;
|
|
|
|
}
|
2019-05-08 21:07:06 +02:00
|
|
|
MonospaceTextDialog *dialog = new MonospaceTextDialog(file, dataFile.readAll());
|
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
2017-08-21 16:17:20 +02:00
|
|
|
dialog->show();
|
|
|
|
}
|
2018-05-09 20:40:57 +02:00
|
|
|
|
2019-05-10 00:17:43 +02:00
|
|
|
void MainWindow::on_actionOpenURL_triggered() {
|
|
|
|
QDesktopServices::openUrl(QUrl(ui->treeWidget->currentItem()->text(2)));
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionOpenLocalFile_triggered() {
|
2019-05-10 00:31:55 +02:00
|
|
|
// TODO: Cleanup code, because this switch function is used 3 times
|
2019-05-10 00:17:43 +02:00
|
|
|
QString file = ui->treeWidget->currentItem()->text(1);
|
2019-05-10 00:31:55 +02:00
|
|
|
QDir saveDir;
|
|
|
|
switch (settings::settings().value("saveLocation", 1).toInt()) {
|
|
|
|
case 0:
|
|
|
|
saveDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
|
|
|
|
if (QStandardPaths::writableLocation(QStandardPaths::PicturesLocation).isEmpty()) {
|
|
|
|
qFatal("%s", tr("Cannot determine location for pictures").toLocal8Bit().constData());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (QStandardPaths::writableLocation(QStandardPaths::HomeLocation).isEmpty()) {
|
|
|
|
qFatal("%s", tr("Cannot determine location of your home directory").toLocal8Bit().constData());
|
|
|
|
}
|
|
|
|
saveDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Screenshots";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qFatal("%s", tr("Invalid config [saveLocation not int or is not in range]").toLocal8Bit().constData());
|
|
|
|
return;
|
|
|
|
case 2:
|
|
|
|
// Do not Save images
|
|
|
|
return;
|
|
|
|
}
|
2019-05-10 00:17:43 +02:00
|
|
|
|
2019-05-10 00:31:55 +02:00
|
|
|
QDesktopServices::openUrl(QUrl::fromLocalFile(saveDir.absoluteFilePath(file)));
|
2019-05-10 00:17:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionCopyLinktoClipboard_triggered() {
|
|
|
|
QApplication::clipboard()->setText(ui->treeWidget->currentItem()->text(2));
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_treeWidget_doubleClicked(const QModelIndex &) {
|
|
|
|
on_actionOpenURL_triggered();
|
|
|
|
}
|
|
|
|
|
2019-05-08 21:07:06 +02:00
|
|
|
void MainWindow::openScreenshotFolder() {
|
|
|
|
QDir saveDir;
|
|
|
|
switch (settings::settings().value("saveLocation", 1).toInt()) {
|
|
|
|
case 0:
|
|
|
|
saveDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
|
|
|
|
if (QStandardPaths::writableLocation(QStandardPaths::PicturesLocation).isEmpty()) {
|
|
|
|
qFatal("%s", tr("Cannot determine location for pictures").toLocal8Bit().constData());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (QStandardPaths::writableLocation(QStandardPaths::HomeLocation).isEmpty()) {
|
|
|
|
qFatal("%s", tr("Cannot determine location of your home directory").toLocal8Bit().constData());
|
|
|
|
}
|
|
|
|
saveDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Screenshots";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qFatal("%s", tr("Invalid config [saveLocation not int or is not in range]").toLocal8Bit().constData());
|
|
|
|
return;
|
|
|
|
case 2:
|
|
|
|
// Do not Save images
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QDesktopServices::openUrl(QUrl::fromLocalFile(saveDir.absolutePath()));
|
|
|
|
}
|
|
|
|
|
2018-05-09 20:40:57 +02:00
|
|
|
void MainWindow::setTrayIcon(QIcon icon) {
|
|
|
|
tray->setIcon(icon);
|
|
|
|
}
|
2019-05-08 22:16:51 +02:00
|
|
|
|
2019-05-16 00:29:05 +02:00
|
|
|
void MainWindow::addResponse(int httpCode, ScreenshotFile sf, QString result, QString url, QString time) {
|
2019-05-08 22:16:51 +02:00
|
|
|
QString httpStatus = ioutils::httpString(httpCode);
|
2019-05-16 00:29:05 +02:00
|
|
|
QTreeWidgetItem* tw = new QTreeWidgetItem({ QString::number(httpCode) + " " + httpStatus, sf.getSubfolder() + QDir::separator() + sf.getFilename(), result, url, time + " UTC" });
|
2019-05-08 22:16:51 +02:00
|
|
|
|
|
|
|
if(httpCode >= 200 && httpCode < 300) {
|
|
|
|
tw->setIcon(0, *(new QIcon(":/icons/checked.png")));
|
|
|
|
} else {
|
|
|
|
tw->setIcon(0, *(new QIcon(":/icons/error.png")));
|
|
|
|
}
|
|
|
|
|
2019-05-12 01:24:33 +02:00
|
|
|
ui->treeWidget->insertTopLevelItem(0, tw);
|
2019-05-16 00:29:05 +02:00
|
|
|
}
|