mirror of
https://github.com/YACReader/yacreader
synced 2026-02-23 07:23:00 -05:00
added all empty container views
This commit is contained in:
@ -128,7 +128,10 @@ HEADERS += comic_flow.h \
|
||||
add_label_dialog.h \
|
||||
yacreader_history_controller.h \
|
||||
yacreader_navigation_controller.h \
|
||||
empty_label_widget.h
|
||||
empty_label_widget.h \
|
||||
empty_container_info.h \
|
||||
empty_special_list.h \
|
||||
empty_reading_list_widget.h
|
||||
|
||||
|
||||
SOURCES += comic_flow.cpp \
|
||||
@ -185,7 +188,10 @@ SOURCES += comic_flow.cpp \
|
||||
add_label_dialog.cpp \
|
||||
yacreader_history_controller.cpp \
|
||||
yacreader_navigation_controller.cpp \
|
||||
empty_label_widget.cpp
|
||||
empty_label_widget.cpp \
|
||||
empty_container_info.cpp \
|
||||
empty_special_list.cpp \
|
||||
empty_reading_list_widget.cpp
|
||||
|
||||
|
||||
include(./server/server.pri)
|
||||
|
||||
@ -38,6 +38,15 @@ QIcon SpecialListItem::getIcon() const
|
||||
}
|
||||
}
|
||||
|
||||
ReadingListModel::TypeSpecialList SpecialListItem::getType() const
|
||||
{
|
||||
if(itemData.count()>1)
|
||||
{
|
||||
int id = itemData.at(1).toInt();
|
||||
return (ReadingListModel::TypeSpecialList)id;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
|
||||
LabelItem::LabelItem(const QList<QVariant> &data)
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include <QVariant>
|
||||
|
||||
#include "yacreader_global.h"
|
||||
#include "reading_list_model.h"
|
||||
//TODO add propper constructors, using QList<QVariant> is not safe
|
||||
|
||||
class ListItem
|
||||
@ -25,6 +26,7 @@ class SpecialListItem : public ListItem
|
||||
public:
|
||||
SpecialListItem(const QList<QVariant> &data);
|
||||
QIcon getIcon() const;
|
||||
ReadingListModel::TypeSpecialList getType() const;
|
||||
};
|
||||
|
||||
//------------------------------------------------------
|
||||
|
||||
@ -82,6 +82,12 @@ QVariant ReadingListModel::data(const QModelIndex &index, int role) const
|
||||
if (role == ReadingListModel::IDRole)
|
||||
return item->getId();
|
||||
|
||||
if (role == ReadingListModel::SpecialListTypeRole && typeid(*item) == typeid(SpecialListItem))
|
||||
{
|
||||
SpecialListItem * specialListItem = static_cast<SpecialListItem*>(item);
|
||||
return QVariant(specialListItem->getType());
|
||||
}
|
||||
|
||||
if(typeid(*item) == typeid(ReadingListSeparatorItem))
|
||||
return QVariant();
|
||||
|
||||
|
||||
@ -53,7 +53,8 @@ public:
|
||||
enum Roles {
|
||||
TypeListsRole = Qt::UserRole + 1,
|
||||
IDRole,
|
||||
LabelColorRole
|
||||
LabelColorRole,
|
||||
SpecialListTypeRole
|
||||
};
|
||||
|
||||
enum TypeList {
|
||||
@ -63,6 +64,11 @@ public:
|
||||
Separator
|
||||
};
|
||||
|
||||
enum TypeSpecialList {
|
||||
Reading,
|
||||
Favorites
|
||||
};
|
||||
|
||||
signals:
|
||||
|
||||
private:
|
||||
|
||||
47
YACReaderLibrary/empty_container_info.cpp
Normal file
47
YACReaderLibrary/empty_container_info.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include "empty_container_info.h"
|
||||
|
||||
EmptyContainerInfo::EmptyContainerInfo(QWidget *parent) :
|
||||
QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel())
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
backgroundColor = "#FFFFFF";
|
||||
titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}");
|
||||
#else
|
||||
backgroundColor = "#2A2A2A";
|
||||
titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}");
|
||||
#endif
|
||||
|
||||
iconLabel->setAlignment(Qt::AlignCenter);
|
||||
titleLabel->setAlignment(Qt::AlignCenter);
|
||||
}
|
||||
|
||||
void EmptyContainerInfo::setPixmap(const QPixmap &pixmap)
|
||||
{
|
||||
iconLabel->setPixmap(pixmap);
|
||||
}
|
||||
|
||||
void EmptyContainerInfo::setText(const QString &text)
|
||||
{
|
||||
titleLabel->setText(text);
|
||||
}
|
||||
|
||||
QVBoxLayout * EmptyContainerInfo::setUpDefaultLayout(bool addStretch)
|
||||
{
|
||||
QVBoxLayout * layout = new QVBoxLayout;
|
||||
|
||||
layout->addSpacing(100);
|
||||
layout->addWidget(iconLabel);
|
||||
layout->addSpacing(30);
|
||||
layout->addWidget(titleLabel);
|
||||
if(addStretch)
|
||||
layout->addStretch();
|
||||
|
||||
setLayout(layout);
|
||||
return layout;
|
||||
}
|
||||
|
||||
void EmptyContainerInfo::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter (this);
|
||||
painter.fillRect(0,0,width(),height(),QColor(backgroundColor));
|
||||
}
|
||||
26
YACReaderLibrary/empty_container_info.h
Normal file
26
YACReaderLibrary/empty_container_info.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef EMPTY_CONTAINER_INFO_H
|
||||
#define EMPTY_CONTAINER_INFO_H
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class EmptyContainerInfo : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EmptyContainerInfo(QWidget *parent = 0);
|
||||
void setPixmap(const QPixmap & pixmap);
|
||||
void setText(const QString & text);
|
||||
QVBoxLayout *setUpDefaultLayout(bool addStretch);
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *);
|
||||
|
||||
QLabel * iconLabel;
|
||||
QLabel * titleLabel;
|
||||
QString backgroundColor;
|
||||
};
|
||||
|
||||
#endif // EMPTY_CONTAINER_INFO_H
|
||||
@ -17,28 +17,12 @@ void testListView(QListView * l)
|
||||
}
|
||||
|
||||
EmptyFolderWidget::EmptyFolderWidget(QWidget *parent) :
|
||||
QWidget(parent),subfoldersModel(new QStringListModel())
|
||||
EmptyContainerInfo(parent),subfoldersModel(new QStringListModel())
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
backgroundColor = "#FFFFFF";
|
||||
#else
|
||||
backgroundColor = "#2A2A2A";
|
||||
#endif
|
||||
QVBoxLayout * layout = setUpDefaultLayout(false);
|
||||
|
||||
QVBoxLayout * layout = new QVBoxLayout;
|
||||
|
||||
iconLabel = new QLabel();
|
||||
iconLabel->setPixmap(QPixmap(":/images/empty_folder.png"));
|
||||
iconLabel->setAlignment(Qt::AlignCenter);
|
||||
|
||||
titleLabel = new QLabel(tr("Subfolders in this folder"));
|
||||
titleLabel->setAlignment(Qt::AlignCenter);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}");
|
||||
#else
|
||||
titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}");
|
||||
#endif
|
||||
titleLabel->setText(tr("Subfolders in this folder"));
|
||||
|
||||
foldersView = new QListView();
|
||||
foldersView->setMinimumWidth(282);
|
||||
@ -83,10 +67,6 @@ EmptyFolderWidget::EmptyFolderWidget(QWidget *parent) :
|
||||
foldersView->setSizePolicy(QSizePolicy ::Expanding , QSizePolicy ::Expanding );
|
||||
testListView(foldersView);
|
||||
|
||||
layout->addSpacing(100);
|
||||
layout->addWidget(iconLabel);
|
||||
layout->addSpacing(30);
|
||||
layout->addWidget(titleLabel);
|
||||
layout->addSpacing(12);
|
||||
layout->addWidget(foldersView,1,Qt::AlignHCenter);
|
||||
layout->addStretch();
|
||||
@ -98,7 +78,6 @@ EmptyFolderWidget::EmptyFolderWidget(QWidget *parent) :
|
||||
setStyleSheet(QString("QWidget {background:%1}").arg(backgroundColor));
|
||||
|
||||
setSizePolicy(QSizePolicy ::Expanding , QSizePolicy ::Expanding );
|
||||
setLayout(layout);
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
@ -126,12 +105,6 @@ void EmptyFolderWidget::onItemClicked(const QModelIndex &mi)
|
||||
emit subfolderSelected(parent,mi.row());
|
||||
}
|
||||
|
||||
void EmptyFolderWidget::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter (this);
|
||||
painter.fillRect(0,0,width(),height(),QColor(backgroundColor));
|
||||
}
|
||||
|
||||
//TODO remove repeated code in drag & drop support....
|
||||
void EmptyFolderWidget::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
#ifndef EMPTY_FOLDER_WIDGET_H
|
||||
#define EMPTY_FOLDER_WIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QModelIndex>
|
||||
#include "empty_container_info.h"
|
||||
#include <QtWidgets>
|
||||
|
||||
class QLabel;
|
||||
class QListView;
|
||||
class QStringListModel;
|
||||
|
||||
class EmptyFolderWidget : public QWidget
|
||||
|
||||
class EmptyFolderWidget : public EmptyContainerInfo
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -25,12 +23,9 @@ public slots:
|
||||
void onItemClicked(const QModelIndex & mi);
|
||||
|
||||
protected:
|
||||
QLabel * iconLabel;
|
||||
QLabel * titleLabel;
|
||||
QListView * foldersView;
|
||||
QModelIndex parent;
|
||||
QStringListModel * subfoldersModel;
|
||||
void paintEvent(QPaintEvent *);
|
||||
QString backgroundColor;
|
||||
|
||||
//Drop to import
|
||||
|
||||
@ -1,37 +1,14 @@
|
||||
#include "empty_label_widget.h"
|
||||
|
||||
EmptyLabelWidget::EmptyLabelWidget(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
EmptyContainerInfo(parent)
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
backgroundColor = "#FFFFFF";
|
||||
#else
|
||||
backgroundColor = "#2A2A2A";
|
||||
#endif
|
||||
setUpDefaultLayout(true);
|
||||
|
||||
QVBoxLayout * layout = new QVBoxLayout;
|
||||
|
||||
iconLabel = new QLabel();
|
||||
iconLabel->setPixmap(QPixmap(":/images/empty_label.png"));
|
||||
iconLabel->setAlignment(Qt::AlignCenter);
|
||||
|
||||
//titleLabel->setText(tr("This label doesn't contain comics yet") + QString("<p style='color:rgb(150,150,150);font-size:14px;font-weight:normal;'>%1</p>").arg(tr("Drag and drop folders and comics here")));
|
||||
titleLabel = new QLabel(("This label doesn't contain comics yet"));
|
||||
titleLabel->setAlignment(Qt::AlignCenter);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}");
|
||||
#else
|
||||
titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}");
|
||||
#endif
|
||||
|
||||
layout->addSpacing(100);
|
||||
layout->addWidget(iconLabel);
|
||||
layout->addSpacing(30);
|
||||
layout->addWidget(titleLabel);
|
||||
layout->addStretch();
|
||||
|
||||
setLayout(layout);
|
||||
titleLabel->setText(tr("This label doesn't contain comics yet"));
|
||||
}
|
||||
|
||||
void EmptyLabelWidget::setColor(YACReader::LabelColors color)
|
||||
@ -42,9 +19,3 @@ void EmptyLabelWidget::setColor(YACReader::LabelColors color)
|
||||
YACReader::colorize(img,destColor);
|
||||
iconLabel->setPixmap(QPixmap::fromImage(img));
|
||||
}
|
||||
|
||||
void EmptyLabelWidget::paintEvent(QPaintEvent * event)
|
||||
{
|
||||
QPainter painter (this);
|
||||
painter.fillRect(0,0,width(),height(),QColor(backgroundColor));
|
||||
}
|
||||
|
||||
@ -2,25 +2,21 @@
|
||||
#define EMPTY_LABEL_WIDGET_H
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "empty_container_info.h"
|
||||
#include "yacreader_global.h"
|
||||
|
||||
class EmptyLabelWidget : public QWidget
|
||||
class EmptyLabelWidget : public EmptyContainerInfo
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EmptyLabelWidget(QWidget *parent = 0);
|
||||
void setColor(YACReader::LabelColors color);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
protected:
|
||||
QLabel * iconLabel;
|
||||
QLabel * titleLabel;
|
||||
QString backgroundColor;
|
||||
|
||||
};
|
||||
|
||||
#endif // EMPTY_LABEL_WIDGET_H
|
||||
|
||||
9
YACReaderLibrary/empty_reading_list_widget.cpp
Normal file
9
YACReaderLibrary/empty_reading_list_widget.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "empty_reading_list_widget.h"
|
||||
|
||||
EmptyReadingListWidget::EmptyReadingListWidget(QWidget *parent)
|
||||
:EmptyContainerInfo(parent)
|
||||
{
|
||||
setUpDefaultLayout(true);
|
||||
setPixmap(QPixmap(":/images/empty_reading_list"));
|
||||
setText(tr("This reading list doesn't cotain comics yet"));
|
||||
}
|
||||
13
YACReaderLibrary/empty_reading_list_widget.h
Normal file
13
YACReaderLibrary/empty_reading_list_widget.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef EMPTY_READING_LIST_WIDGET_H
|
||||
#define EMPTY_READING_LIST_WIDGET_H
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "empty_container_info.h"
|
||||
|
||||
class EmptyReadingListWidget : public EmptyContainerInfo
|
||||
{
|
||||
public:
|
||||
EmptyReadingListWidget(QWidget * parent = 0);
|
||||
};
|
||||
|
||||
#endif // EMPTY_READING_LIST_WIDGET_H
|
||||
7
YACReaderLibrary/empty_special_list.cpp
Normal file
7
YACReaderLibrary/empty_special_list.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include "empty_special_list.h"
|
||||
|
||||
EmptySpecialListWidget::EmptySpecialListWidget(QWidget *parent)
|
||||
:EmptyContainerInfo(parent)
|
||||
{
|
||||
setUpDefaultLayout(true);
|
||||
}
|
||||
13
YACReaderLibrary/empty_special_list.h
Normal file
13
YACReaderLibrary/empty_special_list.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef EMPTY_SPECIAL_LIST_H
|
||||
#define EMPTY_SPECIAL_LIST_H
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "empty_container_info.h"
|
||||
|
||||
class EmptySpecialListWidget : public EmptyContainerInfo
|
||||
{
|
||||
public:
|
||||
EmptySpecialListWidget(QWidget * parent = 0);
|
||||
};
|
||||
|
||||
#endif // EMPTY_SPECIAL_LIST_H
|
||||
@ -59,22 +59,7 @@
|
||||
<file>../images/trash.png</file>
|
||||
<file>../images/setReadButton.png</file>
|
||||
<file>../images/openInYACReader.png</file>
|
||||
<!--<file>../images/deleting_progress/imgTopLeft.png</file>
|
||||
<file>../images/deleting_progress/imgTopMiddle.png</file>
|
||||
<file>../images/deleting_progress/imgTopRight.png</file>
|
||||
<file>../images/deleting_progress/imgLeftMiddle.png</file>
|
||||
<file>../images/deleting_progress/imgRightMiddle.png</file>
|
||||
<file>../images/deleting_progress/imgBottomLeft.png</file>
|
||||
<file>../images/deleting_progress/imgBottomMiddle.png</file>
|
||||
<file>../images/deleting_progress/imgBottomRight.png</file>
|
||||
<file>../images/deleting_progress/icon.png</file>
|
||||
<file>../images/social_dialog/close.png</file>
|
||||
<file>../images/social_dialog/facebook.png</file>
|
||||
<file>../images/social_dialog/google+.png</file>
|
||||
<file>../images/social_dialog/icon.png</file>
|
||||
<file>../images/social_dialog/shadow.png</file>
|
||||
<file>../images/social_dialog/twitter.png</file>
|
||||
<file>../images/social_dialog/separator.png</file>-->
|
||||
<!--<file>../images/deleting_progress/imgTopLeft.png</file><file>../images/deleting_progress/imgTopMiddle.png</file><file>../images/deleting_progress/imgTopRight.png</file><file>../images/deleting_progress/imgLeftMiddle.png</file><file>../images/deleting_progress/imgRightMiddle.png</file><file>../images/deleting_progress/imgBottomLeft.png</file><file>../images/deleting_progress/imgBottomMiddle.png</file><file>../images/deleting_progress/imgBottomRight.png</file><file>../images/deleting_progress/icon.png</file><file>../images/social_dialog/close.png</file><file>../images/social_dialog/facebook.png</file><file>../images/social_dialog/google+.png</file><file>../images/social_dialog/icon.png</file><file>../images/social_dialog/shadow.png</file><file>../images/social_dialog/twitter.png</file><file>../images/social_dialog/separator.png</file>-->
|
||||
<file>../images/main_toolbar/divider.png</file>
|
||||
<file>../images/collapsed_branch_osx.png</file>
|
||||
<file>../images/expanded_branch_osx.png</file>
|
||||
@ -112,6 +97,8 @@
|
||||
<file>../images/shortcuts_group_visualization.png</file>
|
||||
<file>../images/searching_icon.png</file>
|
||||
<file>../images/empty_label.png</file>
|
||||
<file>../images/empty_current_readings.png</file>
|
||||
<file>../images/empty_favorites.png</file>
|
||||
<!--<file>../images/busy_background.png</file>-->
|
||||
</qresource>
|
||||
</RCC>
|
||||
@ -15,7 +15,6 @@
|
||||
<file alias="images/main_toolbar/flow@2x.png">../images/main_toolbar/flow_osx@2x.png</file>
|
||||
<file alias="images/main_toolbar/grid.png">../images/main_toolbar/grid_osx.png</file>
|
||||
<file alias="images/main_toolbar/grid@2x.png">../images/main_toolbar/grid_osx@2x.png</file>
|
||||
|
||||
<file alias="images/libraryIcon.png">../images/libraryIcon_osx.png</file>
|
||||
<file alias="images/setRoot.png">../images/setRoot_osx.png</file>
|
||||
<file alias="images/expand.png">../images/expand_osx.png</file>
|
||||
@ -28,7 +27,6 @@
|
||||
<file alias="images/empty_search.png">../images/empty_search_osx.png</file>
|
||||
<file>../images/iconSearch.png</file>
|
||||
<file>../images/clearSearch.png</file>
|
||||
|
||||
<!--reading lists-->
|
||||
<file alias="images/lists/default_0.png">../images/lists/default_0_osx.png</file>
|
||||
<file alias="images/lists/default_1.png">../images/lists/default_1_osx.png</file>
|
||||
@ -45,7 +43,6 @@
|
||||
<file alias="images/lists/label_white.png">../images/lists/label_white_osx.png</file>
|
||||
<file alias="images/lists/label_yellow.png">../images/lists/label_yellow_osx.png</file>
|
||||
<file alias="images/lists/list.png">../images/lists/list_osx.png</file>
|
||||
|
||||
|
||||
<file alias="images/empty_reading_list.png">../images/empty_reading_list_osx.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@ -42,6 +42,6 @@
|
||||
<file>../images/lists/label_white.png</file>
|
||||
<file>../images/lists/label_yellow.png</file>
|
||||
<file>../images/lists/list.png</file>
|
||||
|
||||
<file>../images/empty_reading_list.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@ -66,6 +66,8 @@
|
||||
#include "comics_view_transition.h"
|
||||
#include "empty_folder_widget.h"
|
||||
#include "empty_label_widget.h"
|
||||
#include "empty_special_list.h"
|
||||
#include "empty_reading_list_widget.h"
|
||||
|
||||
#include "edit_shortcuts_dialog.h"
|
||||
#include "shortcuts_manager.h"
|
||||
@ -242,7 +244,10 @@ void LibraryWindow::doLayout()
|
||||
comicsViewStack->addWidget(comicsViewTransition = new ComicsViewTransition());
|
||||
comicsViewStack->addWidget(emptyFolderWidget = new EmptyFolderWidget());
|
||||
comicsViewStack->addWidget(emptyLabelWidget = new EmptyLabelWidget());
|
||||
comicsViewStack->addWidget(emptySpecialList = new EmptySpecialListWidget());
|
||||
comicsViewStack->addWidget(emptyReadingList = new EmptyReadingListWidget());
|
||||
comicsViewStack->addWidget(noSearchResultsWidget = new NoSearchResultsWidget());
|
||||
|
||||
comicsViewStack->addWidget(comicsView);
|
||||
|
||||
comicsViewStack->setCurrentWidget(comicsView);
|
||||
@ -2167,6 +2172,16 @@ void LibraryWindow::showEmptyLabelView()
|
||||
comicsViewStack->setCurrentWidget(emptyLabelWidget);
|
||||
}
|
||||
|
||||
void LibraryWindow::showEmptySpecialList()
|
||||
{
|
||||
comicsViewStack->setCurrentWidget(emptySpecialList);
|
||||
}
|
||||
|
||||
void LibraryWindow::showEmptyReadingListWidget()
|
||||
{
|
||||
comicsViewStack->setCurrentWidget(emptyReadingList);
|
||||
}
|
||||
|
||||
void LibraryWindow::showNoSearchResultsView()
|
||||
{
|
||||
comicsViewStack->setCurrentWidget(noSearchResultsWidget);
|
||||
|
||||
@ -69,6 +69,8 @@ class ReadingListModelProxy;
|
||||
class YACReaderReadingListsView;
|
||||
class YACReaderHistoryController;
|
||||
class EmptyLabelWidget;
|
||||
class EmptySpecialListWidget;
|
||||
class EmptyReadingListWidget;
|
||||
|
||||
#include "comic_db.h"
|
||||
|
||||
@ -123,6 +125,8 @@ private:
|
||||
ComicsViewTransition * comicsViewTransition;
|
||||
EmptyFolderWidget * emptyFolderWidget;
|
||||
EmptyLabelWidget * emptyLabelWidget;
|
||||
EmptySpecialListWidget * emptySpecialList;
|
||||
EmptyReadingListWidget * emptyReadingList;
|
||||
NoSearchResultsWidget * noSearchResultsWidget;
|
||||
|
||||
YACReaderFoldersView * foldersView;
|
||||
@ -361,6 +365,8 @@ public slots:
|
||||
void showComicsView();
|
||||
void showEmptyFolderView();
|
||||
void showEmptyLabelView();
|
||||
void showEmptySpecialList();
|
||||
void showEmptyReadingListWidget();
|
||||
void showNoSearchResultsView();
|
||||
void toggleComicsView();
|
||||
void checkSearchNumResults(int numResults);
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include "yacreader_search_line_edit.h"
|
||||
#include "yacreader_global.h"
|
||||
#include "empty_label_widget.h"
|
||||
#include "empty_special_list.h"
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
@ -98,7 +99,21 @@ void YACReaderNavigationController::loadListInfo(const QModelIndex &modelIndex)
|
||||
|
||||
void YACReaderNavigationController::loadSpecialListInfo(const QModelIndex &modelIndex)
|
||||
{
|
||||
ReadingListModel::TypeSpecialList type = (ReadingListModel::TypeSpecialList)modelIndex.data(ReadingListModel::SpecialListTypeRole).toInt();
|
||||
switch(type)
|
||||
{
|
||||
case ReadingListModel::Favorites:
|
||||
|
||||
libraryWindow->emptySpecialList->setPixmap(QPixmap(":/images/empty_favorites.png"));
|
||||
libraryWindow->emptySpecialList->setText(tr("No favorites"));
|
||||
break;
|
||||
case ReadingListModel::Reading:
|
||||
libraryWindow->emptySpecialList->setPixmap(QPixmap(":/images/empty_current_readings.png"));
|
||||
libraryWindow->emptySpecialList->setText(tr("You are not reading anything yet, come on!!"));
|
||||
break;
|
||||
}
|
||||
libraryWindow->showEmptySpecialList();
|
||||
libraryWindow->disableComicsActions(true);
|
||||
}
|
||||
|
||||
void YACReaderNavigationController::loadLabelInfo(const QModelIndex &modelIndex)
|
||||
@ -126,7 +141,8 @@ void YACReaderNavigationController::loadLabelInfo(const QModelIndex &modelIndex)
|
||||
|
||||
void YACReaderNavigationController::loadReadingListInfo(const QModelIndex &modelIndex)
|
||||
{
|
||||
|
||||
libraryWindow->showEmptyReadingListWidget();
|
||||
libraryWindow->disableComicsActions(true);
|
||||
}
|
||||
|
||||
void YACReaderNavigationController::selectedList(const QModelIndex &mi)
|
||||
|
||||
BIN
images/empty_current_readings.png
Normal file
BIN
images/empty_current_readings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
images/empty_favorites.png
Normal file
BIN
images/empty_favorites.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
images/empty_reading_list.png
Normal file
BIN
images/empty_reading_list.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
images/empty_reading_list_osx.png
Normal file
BIN
images/empty_reading_list_osx.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Reference in New Issue
Block a user