mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Add a new type of "look" to the import widget. It is going to be used as the "upgrading..." view while a library is being upgraded.
This commit is contained in:
parent
910ec62d30
commit
f8527b9a03
@ -42,8 +42,6 @@ YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget * par
|
|||||||
normal->setPixmap(line);
|
normal->setPixmap(line);
|
||||||
glow->setPixmap(glowLine);
|
glow->setPixmap(glowLine);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QHBoxLayout * layout = new QHBoxLayout();
|
QHBoxLayout * layout = new QHBoxLayout();
|
||||||
|
|
||||||
layout->addWidget(normal,0,Qt::AlignVCenter);
|
layout->addWidget(normal,0,Qt::AlignVCenter);
|
||||||
@ -155,6 +153,7 @@ ImportWidget::ImportWidget(QWidget *parent) :
|
|||||||
|
|
||||||
QPushButton * stop = new QPushButton(tr("stop"));
|
QPushButton * stop = new QPushButton(tr("stop"));
|
||||||
stop->setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Maximum);
|
stop->setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Maximum);
|
||||||
|
stopButton = stop;
|
||||||
|
|
||||||
QVBoxLayout * layout = new QVBoxLayout(this);
|
QVBoxLayout * layout = new QVBoxLayout(this);
|
||||||
QHBoxLayout * buttonLayout = new QHBoxLayout();
|
QHBoxLayout * buttonLayout = new QHBoxLayout();
|
||||||
@ -192,7 +191,7 @@ ImportWidget::ImportWidget(QWidget *parent) :
|
|||||||
layout->addLayout(buttonLayout,0);
|
layout->addLayout(buttonLayout,0);
|
||||||
layout->addSpacing(10);
|
layout->addSpacing(10);
|
||||||
layout->addStretch();
|
layout->addStretch();
|
||||||
portadasLabel = new QLabel("<font color=\"#565959\">"+tr("Some of the comics being added...")+"</font>");
|
coversLabel = new QLabel("<font color=\"#565959\">"+tr("Some of the comics being added...")+"</font>");
|
||||||
|
|
||||||
hideButton = new QToolButton(this);
|
hideButton = new QToolButton(this);
|
||||||
hideButton->setFixedSize(25,18);
|
hideButton->setFixedSize(25,18);
|
||||||
@ -202,7 +201,7 @@ ImportWidget::ImportWidget(QWidget *parent) :
|
|||||||
|
|
||||||
connect(hideButton,SIGNAL(toggled(bool)),this,SLOT(showCovers(bool)));
|
connect(hideButton,SIGNAL(toggled(bool)),this,SLOT(showCovers(bool)));
|
||||||
|
|
||||||
layout->addWidget(portadasLabel,0,Qt::AlignHCenter);
|
layout->addWidget(coversLabel,0,Qt::AlignHCenter);
|
||||||
layout->addWidget(coversViewContainer);
|
layout->addWidget(coversViewContainer);
|
||||||
//layout->addStretch();
|
//layout->addStretch();
|
||||||
layout->addWidget(currentComicLabel,0,Qt::AlignHCenter);
|
layout->addWidget(currentComicLabel,0,Qt::AlignHCenter);
|
||||||
@ -346,6 +345,11 @@ void ImportWidget::setImportLook()
|
|||||||
iconLabel->setPixmap(QPixmap(":/images/importingIcon.png"));
|
iconLabel->setPixmap(QPixmap(":/images/importingIcon.png"));
|
||||||
text->setText("<font color=\"#495252\">"+tr("Importing comics")+"</font>");
|
text->setText("<font color=\"#495252\">"+tr("Importing comics")+"</font>");
|
||||||
textDescription->setText("<font color=\"#565959\">"+tr("<p>YACReaderLibrary is now creating a new library.</p><p>Create a library could take several minutes. You can stop the process and update the library later for completing the task.</p>")+"</font>");
|
textDescription->setText("<font color=\"#565959\">"+tr("<p>YACReaderLibrary is now creating a new library.</p><p>Create a library could take several minutes. You can stop the process and update the library later for completing the task.</p>")+"</font>");
|
||||||
|
|
||||||
|
stopButton->setVisible(true);
|
||||||
|
coversLabel->setVisible(true);
|
||||||
|
coversViewContainer->setVisible(true);
|
||||||
|
hideButton->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportWidget::setUpdateLook()
|
void ImportWidget::setUpdateLook()
|
||||||
@ -353,6 +357,23 @@ void ImportWidget::setUpdateLook()
|
|||||||
iconLabel->setPixmap(QPixmap(":/images/updatingIcon.png"));
|
iconLabel->setPixmap(QPixmap(":/images/updatingIcon.png"));
|
||||||
text->setText("<font color=\"#495252\">"+tr("Updating the library")+"</font>");
|
text->setText("<font color=\"#495252\">"+tr("Updating the library")+"</font>");
|
||||||
textDescription->setText("<font color=\"#565959\">"+tr("<p>The current library is being updated. For faster updates, please, update your libraries frequently.</p><p>You can stop the process and continue updating this library later.</p>")+"</font>");
|
textDescription->setText("<font color=\"#565959\">"+tr("<p>The current library is being updated. For faster updates, please, update your libraries frequently.</p><p>You can stop the process and continue updating this library later.</p>")+"</font>");
|
||||||
|
|
||||||
|
stopButton->setVisible(true);
|
||||||
|
coversLabel->setVisible(true);
|
||||||
|
coversViewContainer->setVisible(true);
|
||||||
|
hideButton->setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImportWidget::setUpgradeLook()
|
||||||
|
{
|
||||||
|
iconLabel->setPixmap(QPixmap(":/images/updatingIcon.png"));
|
||||||
|
text->setText("<font color=\"#495252\">"+tr("Upgrading the library")+"</font>");
|
||||||
|
textDescription->setText("<font color=\"#565959\">"+tr("<p>The current library is being upgraded, please wait.</p>")+"</font>");
|
||||||
|
|
||||||
|
stopButton->setVisible(false);
|
||||||
|
coversLabel->setVisible(false);
|
||||||
|
coversViewContainer->setVisible(false);
|
||||||
|
hideButton->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportWidget::clearScene()
|
void ImportWidget::clearScene()
|
||||||
@ -363,7 +384,7 @@ void ImportWidget::clearScene()
|
|||||||
|
|
||||||
void ImportWidget::showCovers(bool hide)
|
void ImportWidget::showCovers(bool hide)
|
||||||
{
|
{
|
||||||
portadasLabel->setHidden(hide);
|
coversLabel->setHidden(hide);
|
||||||
coversViewContainer->setHidden(hide);
|
coversViewContainer->setHidden(hide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,9 @@
|
|||||||
#ifndef IMPORT_WIDGET_H
|
#ifndef IMPORT_WIDGET_H
|
||||||
#define IMPORT_WIDGET_H
|
#define IMPORT_WIDGET_H
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class QLabel;
|
#include <QtWidgets>
|
||||||
class QGraphicsView;
|
|
||||||
class QGraphicsScene;
|
|
||||||
class QElapsedTimer;
|
|
||||||
class QVBoxLayout;
|
|
||||||
class QToolButton;
|
|
||||||
class QResizeEvent;
|
|
||||||
class QPropertyAnimation;
|
|
||||||
|
|
||||||
class ImportWidget : public QWidget
|
class ImportWidget : public QWidget
|
||||||
{
|
{
|
||||||
@ -28,11 +21,12 @@ public slots:
|
|||||||
void clearScene();
|
void clearScene();
|
||||||
void setImportLook();
|
void setImportLook();
|
||||||
void setUpdateLook();
|
void setUpdateLook();
|
||||||
|
void setUpgradeLook();
|
||||||
void showCovers(bool hide);
|
void showCovers(bool hide);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel * currentComicLabel;
|
QLabel * currentComicLabel;
|
||||||
QLabel * portadasLabel;
|
QLabel * coversLabel;
|
||||||
QLabel * iconLabel;
|
QLabel * iconLabel;
|
||||||
QLabel * text;
|
QLabel * text;
|
||||||
QLabel * textDescription;
|
QLabel * textDescription;
|
||||||
@ -40,6 +34,7 @@ private:
|
|||||||
QGraphicsView * coversView;
|
QGraphicsView * coversView;
|
||||||
QGraphicsScene * coversScene;
|
QGraphicsScene * coversScene;
|
||||||
QPropertyAnimation * scrollAnimation;
|
QPropertyAnimation * scrollAnimation;
|
||||||
|
QPushButton * stopButton;
|
||||||
|
|
||||||
int previousWidth;
|
int previousWidth;
|
||||||
bool updatingCovers;
|
bool updatingCovers;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user