mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
detect recovery devices, cleanup code , use const pointers wherever possible, refactor img thumbnail loading, refactor gallery widget
This commit is contained in:
@@ -31,11 +31,8 @@
|
||||
#include <QUrl>
|
||||
#include <qrencode.h>
|
||||
|
||||
PhotoImportDialog::PhotoImportDialog(const QStringList &files,
|
||||
bool hasDirectories, QWidget *parent)
|
||||
: QDialog(parent), selectedFiles(files),
|
||||
containsDirectories(hasDirectories), m_httpServer(nullptr),
|
||||
m_mediaPlayer(nullptr)
|
||||
PhotoImportDialog::PhotoImportDialog(const QStringList &files, QWidget *parent)
|
||||
: QDialog(parent), selectedFiles(files)
|
||||
{
|
||||
setupUI();
|
||||
setModal(true);
|
||||
@@ -59,16 +56,6 @@ void PhotoImportDialog::setupUI()
|
||||
{
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||
|
||||
// Warning label for directories
|
||||
if (containsDirectories) {
|
||||
warningLabel =
|
||||
new QLabel("⚠️ Warning: Selected items contain directories. All "
|
||||
"gallery-compatible files will be included.",
|
||||
this);
|
||||
warningLabel->setWordWrap(true);
|
||||
mainLayout->addWidget(warningLabel);
|
||||
}
|
||||
|
||||
// File list
|
||||
QLabel *listLabel = new QLabel(
|
||||
QString("Files to be served (%1 items):").arg(selectedFiles.size()),
|
||||
@@ -230,6 +217,7 @@ void PhotoImportDialog::onServerStarted()
|
||||
void PhotoImportDialog::onDownloadProgress(const QString &fileName,
|
||||
int bytesDownloaded, int totalBytes)
|
||||
{
|
||||
// TODO: bring in a progress bar each item
|
||||
m_progressLabel->setText(QString("Downloaded: %1 (%2 KB)")
|
||||
.arg(fileName)
|
||||
.arg(bytesDownloaded / 1024));
|
||||
|
||||
Reference in New Issue
Block a user