diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index 1d19565d..3523e1ec 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -117,7 +117,8 @@ HEADERS += comic_flow.h \ yacreader_libraries.h \ ../common/exit_check.h \ comics_view.h \ - classic_comics_view.h + classic_comics_view.h \ + empty_folder_widget.h SOURCES += comic_flow.cpp \ @@ -163,7 +164,8 @@ SOURCES += comic_flow.cpp \ yacreader_libraries.cpp \ ../common/exit_check.cpp \ comics_view.cpp \ - classic_comics_view.cpp + classic_comics_view.cpp \ + empty_folder_widget.cpp diff --git a/YACReaderLibrary/db/tablemodel.cpp b/YACReaderLibrary/db/tablemodel.cpp index 1d9e51c2..8987176f 100644 --- a/YACReaderLibrary/db/tablemodel.cpp +++ b/YACReaderLibrary/db/tablemodel.cpp @@ -304,7 +304,9 @@ void TableModel::setupModelData(unsigned long long int folderId,const QString & db.close(); QSqlDatabase::removeDatabase(_databasePath); endResetModel(); - //f.close(); + + if(_data.length()==0) + emit isEmpty(); } QString TableModel::getComicPath(QModelIndex mi) diff --git a/YACReaderLibrary/db/tablemodel.h b/YACReaderLibrary/db/tablemodel.h index 7bfff95b..9df0126a 100644 --- a/YACReaderLibrary/db/tablemodel.h +++ b/YACReaderLibrary/db/tablemodel.h @@ -113,6 +113,7 @@ private: signals: void beforeReset(); void reset(); + void isEmpty(); }; //! [0] diff --git a/YACReaderLibrary/db/treemodel.cpp b/YACReaderLibrary/db/treemodel.cpp index fcf0ada8..f04b7bef 100644 --- a/YACReaderLibrary/db/treemodel.cpp +++ b/YACReaderLibrary/db/treemodel.cpp @@ -53,6 +53,7 @@ #include "data_base_management.h" #include "folder.h" #include "db_helper.h" +#include "qnaturalsorting.h" #ifdef Q_OS_MAC #include @@ -106,7 +107,7 @@ TreeModel::TreeModel(QObject *parent) TreeModel::TreeModel( QSqlQuery &sqlquery, QObject *parent) : QAbstractItemModel(parent),rootItem(0),rootBeforeFilter(0),filterEnabled(false),includeComics(false) { - //lo más probable es que el nodo raíz no necesite tener información + //lo m�s probable es que el nodo ra�z no necesite tener informaci�n QList rootData; rootData << "root"; //id 0, padre 0, title "root" (el id, y el id del padre van a ir en la clase TreeItem) rootItem = new TreeItem(rootData); @@ -265,7 +266,7 @@ void TreeModel::setupModelData(QString path) filterEnabled = false; rootItem = 0; rootBeforeFilter = 0; - //inicializar el nodo raíz + //inicializar el nodo ra�z QList rootData; rootData << "root"; //id 0, padre 0, title "root" (el id, y el id del padre van a ir en la clase TreeItem) rootItem = new TreeItem(rootData); @@ -291,10 +292,10 @@ void TreeModel::setupModelData(QString path) void TreeModel::setupModelData(QSqlQuery &sqlquery, TreeItem *parent) { - //64 bits para la primary key, es decir la misma precisión que soporta sqlit 2^64 - //el diccionario permitirá encontrar cualquier nodo del árbol rápidamente, de forma que añadir un hijo a un padre sea O(1) + //64 bits para la primary key, es decir la misma precisi�n que soporta sqlit 2^64 + //el diccionario permitir� encontrar cualquier nodo del �rbol r�pidamente, de forma que a�adir un hijo a un padre sea O(1) items.clear(); - //se añade el nodo 0 + //se a�ade el nodo 0 items.insert(parent->id,parent); while (sqlquery.next()) { @@ -308,11 +309,11 @@ void TreeModel::setupModelData(QSqlQuery &sqlquery, TreeItem *parent) TreeItem * item = new TreeItem(data); item->id = record.value("id").toULongLong(); - //la inserción de hijos se hace de forma ordenada + //la inserci�n de hijos se hace de forma ordenada TreeItem * parent = items.value(record.value("parentId").toULongLong()); if(parent !=0) //TODO if parent==0 the parent of item was removed from the DB and delete on cascade didn't work, ERROR. parent->appendChild(item); - //se añade el item al map, de forma que se pueda encontrar como padre en siguientes iteraciones + //se a�ade el item al map, de forma que se pueda encontrar como padre en siguientes iteraciones items.insert(item->id,item); } } @@ -323,12 +324,12 @@ void TreeModel::setupFilteredModelData() //TODO hay que liberar memoria de anteriores filtrados - //inicializar el nodo raíz + //inicializar el nodo ra�z if(rootBeforeFilter == 0) rootBeforeFilter = rootItem; else - delete rootItem;//los resultados de la búsqueda anterior deben ser borrados + delete rootItem;//los resultados de la b�squeda anterior deben ser borrados QList rootData; rootData << "root"; //id 1, padre 1, title "root" (el id, y el id del padre van a ir en la clase TreeItem) @@ -365,10 +366,10 @@ void TreeModel::setupFilteredModelData() void TreeModel::setupFilteredModelData(QSqlQuery &sqlquery, TreeItem *parent) { - //64 bits para la primary key, es decir la misma precisión que soporta sqlit 2^64 + //64 bits para la primary key, es decir la misma precisi�n que soporta sqlit 2^64 filteredItems.clear(); - //se añade el nodo 0 al modelo que representa el arbol de elementos que cumplen con el filtro + //se a�ade el nodo 0 al modelo que representa el arbol de elementos que cumplen con el filtro filteredItems.insert(parent->id,parent); while (sqlquery.next()) { //se procesan todos los folders que cumplen con el filtro @@ -387,39 +388,39 @@ void TreeModel::setupFilteredModelData(QSqlQuery &sqlquery, TreeItem *parent) //id del padre quint64 parentId = record.value("parentId").toULongLong(); - //se añade el item al map, de forma que se pueda encontrar como padre en siguientes iteraciones + //se a�ade el item al map, de forma que se pueda encontrar como padre en siguientes iteraciones if(!filteredItems.contains(item->id)) filteredItems.insert(item->id,item); - //es necesario conocer las coordenadas de origen para poder realizar scroll automático en la vista + //es necesario conocer las coordenadas de origen para poder realizar scroll autom�tico en la vista item->originalItem = items.value(item->id); - //si el padre ya existe en el modelo, el item se añade como hijo + //si el padre ya existe en el modelo, el item se a�ade como hijo if(filteredItems.contains(parentId)) filteredItems.value(parentId)->appendChild(item); - else//si el padre aún no se ha añadido, hay que añadirlo a él y todos los padres hasta el nodo raíz + else//si el padre a�n no se ha a�adido, hay que a�adirlo a �l y todos los padres hasta el nodo ra�z { - //comprobamos con esta variable si el último de los padres (antes del nodo raíz) ya existía en el modelo + //comprobamos con esta variable si el �ltimo de los padres (antes del nodo ra�z) ya exist�a en el modelo bool parentPreviousInserted = false; - //mientras no se alcance el nodo raíz se procesan todos los padres (de abajo a arriba) + //mientras no se alcance el nodo ra�z se procesan todos los padres (de abajo a arriba) while(parentId != ROOT ) { - //el padre no estaba en el modelo filtrado, así que se rescata del modelo original + //el padre no estaba en el modelo filtrado, as� que se rescata del modelo original TreeItem * parentItem = items.value(parentId); //se debe crear un nuevo nodo (para no compartir los hijos con el nodo original) - TreeItem * newparentItem = new TreeItem(parentItem->getData()); //padre que se añadirá a la estructura de directorios filtrados + TreeItem * newparentItem = new TreeItem(parentItem->getData()); //padre que se a�adir� a la estructura de directorios filtrados newparentItem->id = parentId; newparentItem->originalItem = parentItem; - //si el modelo contiene al padre, se añade el item actual como hijo + //si el modelo contiene al padre, se a�ade el item actual como hijo if(filteredItems.contains(parentId)) { filteredItems.value(parentId)->appendChild(item); parentPreviousInserted = true; } - //sino se registra el nodo para poder encontrarlo con posterioridad y se añade el item actual como hijo + //sino se registra el nodo para poder encontrarlo con posterioridad y se a�ade el item actual como hijo else { newparentItem->appendChild(item); @@ -432,7 +433,7 @@ void TreeModel::setupFilteredModelData(QSqlQuery &sqlquery, TreeItem *parent) parentId = parentItem->parentItem->id; } - //si el nodo es hijo de 1 y no había sido previamente insertado como hijo, se añade como tal + //si el nodo es hijo de 1 y no hab�a sido previamente insertado como hijo, se a�ade como tal if(!parentPreviousInserted) filteredItems.value(ROOT)->appendChild(item); } @@ -468,7 +469,7 @@ void TreeModel::resetFilter() //items.clear(); filteredItems.clear(); TreeItem * root = rootItem; - rootItem = rootBeforeFilter; //TODO si no se aplica el filtro previamente, esto invalidaría en modelo + rootItem = rootBeforeFilter; //TODO si no se aplica el filtro previamente, esto invalidar�a en modelo if(root !=0) delete root; @@ -518,3 +519,26 @@ void TreeModel::updateFolderFinishedStatus(const QModelIndexList &list, bool sta emit dataChanged(index(list.first().row(),TreeModel::Name),index(list.last().row(),TreeModel::Completed)); } + +QStringList TreeModel::getSubfoldersNames(const QModelIndex &mi) +{ + QStringList result; + qulonglong id = 1; + if(mi.isValid()){ + TreeItem * item = static_cast(mi.internalPointer()); + id = item->id; + } + + QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath); + db.transaction(); + + result = DBHelper::loadSubfoldersNames(id,db); + + db.commit(); + db.close(); + QSqlDatabase::removeDatabase(_databasePath); + + //TODO sort result)) + qSort(result.begin(),result.end(),naturalSortLessThanCI); + return result; +} diff --git a/YACReaderLibrary/db/treemodel.h b/YACReaderLibrary/db/treemodel.h index 02168cbb..d36dab40 100644 --- a/YACReaderLibrary/db/treemodel.h +++ b/YACReaderLibrary/db/treemodel.h @@ -85,6 +85,8 @@ public: void updateFolderCompletedStatus(const QModelIndexList & list, bool status); void updateFolderFinishedStatus(const QModelIndexList & list, bool status); + QStringList getSubfoldersNames(const QModelIndex & mi); + enum Columns { Name = 0, Path = 1, diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index 417d8d4d..39b18751 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -671,5 +671,18 @@ ComicInfo DBHelper::loadComicInfo(QString hash, QSqlDatabase & db) else comicInfo.existOnDb = false; - return comicInfo; + return comicInfo; +} + +QList DBHelper::loadSubfoldersNames(qulonglong folderId, QSqlDatabase &db) +{ + QList result; + QSqlQuery selectQuery(db); + selectQuery.prepare("SELECT name FROM folder WHERE parentId = :parentId AND id <> 1"); //do not select the root folder + selectQuery.bindValue(":parentId", folderId); + selectQuery.exec(); + while(selectQuery.next()){ + result << selectQuery.record().value("name").toString(); + } + return result; } diff --git a/YACReaderLibrary/db_helper.h b/YACReaderLibrary/db_helper.h index b4f88f89..014e65c9 100644 --- a/YACReaderLibrary/db_helper.h +++ b/YACReaderLibrary/db_helper.h @@ -51,6 +51,7 @@ public: static ComicDB loadComic(qulonglong id, QSqlDatabase & db); static ComicDB loadComic(QString cname, QString cpath, QString chash, QSqlDatabase & database); static ComicInfo loadComicInfo(QString hash, QSqlDatabase & db); + static QList loadSubfoldersNames(qulonglong folderId, QSqlDatabase & db); }; #endif diff --git a/YACReaderLibrary/empty_folder_widget.cpp b/YACReaderLibrary/empty_folder_widget.cpp new file mode 100644 index 00000000..6d440f51 --- /dev/null +++ b/YACReaderLibrary/empty_folder_widget.cpp @@ -0,0 +1,89 @@ +#include "empty_folder_widget.h" + +#include +#include +#include +#include + + +#include +void testListView(QListView * l) +{ + QStringListModel * slm = new QStringListModel(QStringList() = {"Lorem ipsum", "Hailer skualer", "Mumbaluba X", "Finger layden", "Pacum tactus filer", "Aposum", "En","Lorem ipsum", "Hailer skualer", "Mumbaluba X", "Finger layden", "Pacum tactus filer", "Aposum", "En" }); + l->setModel(slm); +} + +EmptyFolderWidget::EmptyFolderWidget(QWidget *parent) : + QWidget(parent),subfoldersModel(new QStringListModel()) +{ + QVBoxLayout * layout = new QVBoxLayout; + + iconLabel = new QLabel(); + iconLabel->setPixmap(QPixmap(":/images/empty_folder.png")); + iconLabel->setAlignment(Qt::AlignCenter); + + titleLabel = new QLabel("Subfolders in this folder"); + titleLabel->setAlignment(Qt::AlignCenter); + titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}"); + + foldersView = new QListView(); + foldersView->setMinimumWidth(282); + foldersView->setWrapping(true); + + foldersView->setStyleSheet("QListView {background-color:transparent; border: none; color:#858585; outline:0; font-size: 18px; font:bold; show-decoration-selected: 0; margin:0}" + "QListView::item:selected {background-color: #212121; color:#CCCCCC;}" + "QListView::item:hover {background-color:#212121; color:#CCCCCC; }" + + + "QScrollBar:vertical { border: none; background: #212121; width: 14px; margin: 0 10px 0 0; }" + "QScrollBar::handle:vertical { background: #858585; width: 14px; min-height: 20px; }" + "QScrollBar::add-line:vertical { border: none; background: #212121; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 3px 0 0;}" + + "QScrollBar::sub-line:vertical { border: none; background: #212121; height: 0px; subcontrol-position: top; subcontrol-origin: margin; margin: 0 3px 0 0;}" + "QScrollBar::up-arrow:vertical {border:none;width: 9px;height: 6px;background: url(':/images/folders_view/line-up.png') center top no-repeat;}" + "QScrollBar::down-arrow:vertical {border:none;width: 9px;height: 6px;background: url(':/images/folders_view/line-down.png') center top no-repeat;}" + + "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {background: none; }" + "QScrollBar:horizontal{height:0px;}" + ); + + 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(); + layout->setMargin(0); + layout->setSpacing(0); + + setContentsMargins(0,0,0,0); + + setStyleSheet("QWidget {background:#2A2A2A}"); + + setSizePolicy(QSizePolicy ::Expanding , QSizePolicy ::Expanding ); + setLayout(layout); + + connect(foldersView,SIGNAL(clicked(QModelIndex)),this,SLOT(onItemClicked(QModelIndex))); +} + +void EmptyFolderWidget::setSubfolders(const QModelIndex &mi, const QStringList &foldersNames) +{ + parent = mi; + subfoldersModel->setStringList(foldersNames); + foldersView->setModel(subfoldersModel); +} + +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("#2A2A2A")); +} diff --git a/YACReaderLibrary/empty_folder_widget.h b/YACReaderLibrary/empty_folder_widget.h new file mode 100644 index 00000000..225948be --- /dev/null +++ b/YACReaderLibrary/empty_folder_widget.h @@ -0,0 +1,32 @@ +#ifndef EMPTY_FOLDER_WIDGET_H +#define EMPTY_FOLDER_WIDGET_H + +#include +#include + +class QLabel; +class QListView; +class QStringListModel; + +class EmptyFolderWidget : public QWidget +{ + Q_OBJECT +public: + explicit EmptyFolderWidget(QWidget *parent = 0); + void setSubfolders(const QModelIndex & mi, const QStringList & foldersNames); +signals: + void subfolderSelected(QModelIndex, int); + +public slots: + void onItemClicked(const QModelIndex & mi); + +protected: + QLabel * iconLabel; + QLabel * titleLabel; + QListView * foldersView; + QModelIndex parent; + QStringListModel * subfoldersModel; + void paintEvent(QPaintEvent *); +}; + +#endif // EMPTY_FOLDER_WIDGET_H diff --git a/YACReaderLibrary/images_osx.qrc b/YACReaderLibrary/images_osx.qrc index d5604ff7..64c41b0c 100644 --- a/YACReaderLibrary/images_osx.qrc +++ b/YACReaderLibrary/images_osx.qrc @@ -19,5 +19,6 @@ ../images/openLibraryIcon_osx.png ../images/flow_to_grid.gif ../images/grid_to_flow.gif + ../images/empty_folder.png diff --git a/YACReaderLibrary/images_win.qrc b/YACReaderLibrary/images_win.qrc index 5d2bd0af..ffa97d93 100644 --- a/YACReaderLibrary/images_win.qrc +++ b/YACReaderLibrary/images_win.qrc @@ -18,5 +18,6 @@ ../images/main_toolbar/grid.png ../images/flow_to_grid.gif ../images/grid_to_flow.gif + ../images/empty_folder.png diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 003bf740..6697f997 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -63,6 +63,7 @@ #include "classic_comics_view.h" #include "grid_comics_view.h" #include "comics_view_transition.h" +#include "empty_folder_widget.h" #include "QsLog.h" @@ -205,8 +206,11 @@ void LibraryWindow::doLayout() doComicsViewConnections(); comicsView->setToolBar(editInfoToolBar); - comicsViewStack->addWidget(comicsView); comicsViewStack->addWidget(comicsViewTransition = new ComicsViewTransition()); + comicsViewStack->addWidget(emptyFolderWidget = new EmptyFolderWidget()); + comicsViewStack->addWidget(comicsView); + + comicsViewStack->setCurrentWidget(comicsView); fullScreenToolTip = new QLabel(comicsView); fullScreenToolTip->setText(tr(" press 'F' to close fullscreen mode ")); @@ -887,6 +891,8 @@ void LibraryWindow::createConnections() connect(comicsViewTransition,SIGNAL(transitionFinished()),this,SLOT(showComicsView())); + connect(dmCV,SIGNAL(isEmpty()),this,SLOT(showEmptyFolderView())); + connect(emptyFolderWidget,SIGNAL(subfolderSelected(QModelIndex,int)),this,SLOT(selectSubfolder(QModelIndex,int))); } void LibraryWindow::loadLibrary(const QString & name) @@ -1075,8 +1081,20 @@ void LibraryWindow::loadCovers(const QModelIndex & mi) QStringList paths = dmCV->getPaths(currentPath()); checkEmptyFolder(&paths); - if(paths.size()>0) + if(paths.size()>0) { comicsView->setCurrentIndex(dmCV->index(0,0)); + if(comicsViewStack->currentWidget() == emptyFolderWidget) + comicsViewStack->setCurrentWidget(comicsView); + } + else + emptyFolderWidget->setSubfolders(mi,dm->getSubfoldersNames(mi)); +} + +void LibraryWindow::selectSubfolder(const QModelIndex &mi, int child) +{ + QModelIndex dest = dm->index(child,0,mi); + foldersView->setCurrentIndex(dest); + loadCovers(dest); } void LibraryWindow::checkEmptyFolder(QStringList * paths) @@ -1521,7 +1539,7 @@ void LibraryWindow::switchToComicsView(ComicsView * from, ComicsView * to) comicsView->setToolBar(editInfoToolBar); comicsViewStack->removeWidget(from); - comicsViewStack->insertWidget(0,comicsView); + comicsViewStack->addWidget(comicsView); delete from; @@ -1530,7 +1548,7 @@ void LibraryWindow::switchToComicsView(ComicsView * from, ComicsView * to) void LibraryWindow::showComicsViewTransition() { - comicsViewStack->setCurrentIndex(1); + comicsViewStack->setCurrentWidget(comicsViewTransition); comicsViewTransition->startMovie(); } @@ -1556,14 +1574,22 @@ void LibraryWindow::toggleComicsView_delayed() void LibraryWindow::showComicsView() { - comicsViewStack->setCurrentIndex(0); + comicsViewStack->setCurrentWidget(comicsView); +} + +void LibraryWindow::showEmptyFolderView() +{ + comicsViewStack->setCurrentWidget(emptyFolderWidget); } //TODO recover the current comics selection and restore it in the destination void LibraryWindow::toggleComicsView() { - QTimer::singleShot(0,this,SLOT(showComicsViewTransition())); - QTimer::singleShot(32,this,SLOT(toggleComicsView_delayed())); + if(comicsViewStack->currentWidget()!=emptyFolderWidget) { + QTimer::singleShot(0,this,SLOT(showComicsViewTransition())); + QTimer::singleShot(32,this,SLOT(toggleComicsView_delayed())); + } else + toggleComicsView_delayed(); } void LibraryWindow::asignNumbers() diff --git a/YACReaderLibrary/library_window.h b/YACReaderLibrary/library_window.h index 5d098c12..2f9026f6 100644 --- a/YACReaderLibrary/library_window.h +++ b/YACReaderLibrary/library_window.h @@ -53,6 +53,8 @@ class ComicsView; class ClassicComicsView; class GridComicsView; class ComicsViewTransition; +class EmptyFolderWidget; + #include "comic_db.h" using namespace YACReader; @@ -99,6 +101,7 @@ private: GridComicsView * gridComicsView; QStackedWidget * comicsViewStack; ComicsViewTransition * comicsViewTransition; + EmptyFolderWidget * emptyFolderWidget; YACReaderTreeView * foldersView; YACReaderLibraryListWidget * selectedLibrary; @@ -207,104 +210,107 @@ private: void doComicsViewConnections(); - //ACTIONS MANAGEMENT - void disableComicsActions(bool disabled); - void disableLibrariesActions(bool disabled); - void disableNoUpdatedLibrariesActions(bool disabled); - void disableFoldersActions(bool disabled); + //ACTIONS MANAGEMENT + void disableComicsActions(bool disabled); + void disableLibrariesActions(bool disabled); + void disableNoUpdatedLibrariesActions(bool disabled); + void disableFoldersActions(bool disabled); - void disableAllActions(); - //void disableActions(); - //void enableActions(); - //void enableLibraryActions(); + void disableAllActions(); + //void disableActions(); + //void enableActions(); + //void enableLibraryActions(); - QString currentPath(); + QString currentPath(); - //settings - QSettings * settings; + //settings + QSettings * settings; - //navigation backward and forward - int currentFolderNavigation; - QList history; + //navigation backward and forward + int currentFolderNavigation; + QList history; - bool removeError; + bool removeError; ComicsViewStatus comicsViewStatus; protected: - virtual void closeEvent ( QCloseEvent * event ); + virtual void closeEvent ( QCloseEvent * event ); public: - LibraryWindow(); - public slots: - void loadLibrary(const QString & path); - void loadCovers(const QModelIndex & mi); - void checkEmptyFolder(QStringList * paths = 0); - void reloadCovers(); - void openComic(); - void createLibrary(); - void create(QString source,QString dest, QString name); - void showAddLibrary(); - void openLibrary(QString path, QString name); - void loadLibraries(); - void saveLibraries(); - void reloadCurrentLibrary(); - void openLastCreated(); - void updateLibrary(); - //void deleteLibrary(); - void openContainingFolder(); - void setFolderAsNotCompleted(); - void setFolderAsCompleted(); - void setFolderAsFinished(); - void setFolderAsNotFinished(); - void openContainingFolderComic(); - void deleteCurrentLibrary(); - void removeLibrary(); - void renameLibrary(); - void rename(QString newName); - void cancelCreating(); - void stopLibraryCreator(); - void setRootIndex(); - void toggleFullScreen(); - void toNormal(); - void toFullScreen(); - void setFoldersFilter(QString filter); - void showProperties(); - void exportLibrary(QString destPath); - void importLibrary(QString clc,QString destPath,QString name); - void reloadOptions(); - void setCurrentComicsStatusReaded(YACReaderComicReadStatus readStatus); - void setCurrentComicReaded(); - void setCurrentComicUnreaded(); - void hideComicFlow(bool hide); - void showExportComicsInfo(); - void showImportComicsInfo(); - void asignNumbers(); - void showNoLibrariesWidget(); - void showRootWidget(); - void showImportingWidget(); - void manageCreatingError(const QString & error); - void manageUpdatingError(const QString & error); - void manageOpeningLibraryError(const QString & error); - QModelIndexList getSelectedComics(); - void deleteComics(); - //void showSocial(); - void backward(); - void forward(); - void updateHistory(const QModelIndex & mi); - void updateFoldersViewConextMenu(const QModelIndex & mi); - void libraryAlreadyExists(const QString & name); - void importLibraryPackage(); - void updateComicsView(quint64 libraryId, const ComicDB & comic); - void setCurrentComicOpened(); - void showComicVineScraper(); - void setRemoveError(); - void checkRemoveError(); - void resetComicRating(); - void switchToComicsView(ComicsView *from, ComicsView *to); - void showComicsViewTransition(); - void toggleComicsView_delayed();//used in orther to avoid flickering; - void showComicsView(); - void toggleComicsView(); + LibraryWindow(); + +public slots: + void loadLibrary(const QString & path); + void loadCovers(const QModelIndex & mi); + void selectSubfolder(const QModelIndex & mi, int child); + void checkEmptyFolder(QStringList * paths = 0); + void reloadCovers(); + void openComic(); + void createLibrary(); + void create(QString source,QString dest, QString name); + void showAddLibrary(); + void openLibrary(QString path, QString name); + void loadLibraries(); + void saveLibraries(); + void reloadCurrentLibrary(); + void openLastCreated(); + void updateLibrary(); + //void deleteLibrary(); + void openContainingFolder(); + void setFolderAsNotCompleted(); + void setFolderAsCompleted(); + void setFolderAsFinished(); + void setFolderAsNotFinished(); + void openContainingFolderComic(); + void deleteCurrentLibrary(); + void removeLibrary(); + void renameLibrary(); + void rename(QString newName); + void cancelCreating(); + void stopLibraryCreator(); + void setRootIndex(); + void toggleFullScreen(); + void toNormal(); + void toFullScreen(); + void setFoldersFilter(QString filter); + void showProperties(); + void exportLibrary(QString destPath); + void importLibrary(QString clc,QString destPath,QString name); + void reloadOptions(); + void setCurrentComicsStatusReaded(YACReaderComicReadStatus readStatus); + void setCurrentComicReaded(); + void setCurrentComicUnreaded(); + void hideComicFlow(bool hide); + void showExportComicsInfo(); + void showImportComicsInfo(); + void asignNumbers(); + void showNoLibrariesWidget(); + void showRootWidget(); + void showImportingWidget(); + void manageCreatingError(const QString & error); + void manageUpdatingError(const QString & error); + void manageOpeningLibraryError(const QString & error); + QModelIndexList getSelectedComics(); + void deleteComics(); + //void showSocial(); + void backward(); + void forward(); + void updateHistory(const QModelIndex & mi); + void updateFoldersViewConextMenu(const QModelIndex & mi); + void libraryAlreadyExists(const QString & name); + void importLibraryPackage(); + void updateComicsView(quint64 libraryId, const ComicDB & comic); + void setCurrentComicOpened(); + void showComicVineScraper(); + void setRemoveError(); + void checkRemoveError(); + void resetComicRating(); + void switchToComicsView(ComicsView *from, ComicsView *to); + void showComicsViewTransition(); + void toggleComicsView_delayed();//used in orther to avoid flickering; + void showComicsView(); + void showEmptyFolderView(); + void toggleComicsView(); }; #endif diff --git a/images/empty_folder.png b/images/empty_folder.png new file mode 100644 index 00000000..fa3b13cd Binary files /dev/null and b/images/empty_folder.png differ