mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -04:00
moved history navigation to its own class
This commit is contained in:
parent
ab81cebf92
commit
3b08d75d15
@ -1,290 +1,292 @@
|
||||
######################################################################
|
||||
# Automatically generated by qmake (2.01a) dom 12. oct 20:47:48 2008
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = YACReaderLibrary
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
INCLUDEPATH += ../common \
|
||||
./server \
|
||||
./db \
|
||||
../custom_widgets \
|
||||
./comic_vine \
|
||||
./comic_vine/model
|
||||
|
||||
DEFINES += SERVER_RELEASE NOMINMAX YACREADER_LIBRARY
|
||||
|
||||
win32 {
|
||||
|
||||
LIBS += -L../dependencies/poppler/lib -loleaut32 -lole32 -lshell32
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
LIBS += -lpoppler-qt5
|
||||
INCLUDEPATH += ../dependencies/poppler/include/qt5
|
||||
}
|
||||
else {
|
||||
LIBS += -lpoppler-qt4
|
||||
INCLUDEPATH += ../dependencies/poppler/include/qt4
|
||||
}
|
||||
|
||||
#QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL
|
||||
#QMAKE_LFLAGS_RELEASE += /LTCG
|
||||
CONFIG -= embed_manifest_exe
|
||||
}
|
||||
|
||||
unix:!macx{
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
INCLUDEPATH += /usr/include/poppler/qt5
|
||||
LIBS += -L/usr/lib -lpoppler-qt5
|
||||
}
|
||||
else {
|
||||
INCLUDEPATH += /usr/include/poppler/qt4
|
||||
LIBS += -L/usr/lib -lpoppler-qt4
|
||||
}
|
||||
LIBS += -lGLU
|
||||
}
|
||||
|
||||
macx{
|
||||
#INCLUDEPATH += "/Volumes/Mac OS X Lion/usr/X11/include"
|
||||
#isEqual(QT_MAJOR_VERSION, 5) {
|
||||
#INCLUDEPATH += /usr/local/include/poppler/qt5
|
||||
#LIBS += -L/usr/local/lib -lpoppler-qt5
|
||||
#}
|
||||
#else {
|
||||
#INCLUDEPATH += /usr/local/include/poppler/qt4
|
||||
#LIBS += -L/usr/local/lib -lpoppler-qt4
|
||||
#}
|
||||
#QT += macextras
|
||||
|
||||
LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
|
||||
|
||||
OBJECTIVE_SOURCES += $$PWD/../common/pdf_comic.mm
|
||||
HEADERS += $$PWD/../common/pdf_comic.h
|
||||
CONFIG += objective_c
|
||||
QT += macextras gui-private
|
||||
}
|
||||
|
||||
unix{
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
}
|
||||
|
||||
#CONFIG += release
|
||||
CONFIG -= flat
|
||||
QT += sql network opengl script
|
||||
|
||||
# Input
|
||||
HEADERS += comic_flow.h \
|
||||
create_library_dialog.h \
|
||||
library_creator.h \
|
||||
library_window.h \
|
||||
add_library_dialog.h \
|
||||
rename_library_dialog.h \
|
||||
properties_dialog.h \
|
||||
options_dialog.h \
|
||||
export_library_dialog.h \
|
||||
import_library_dialog.h \
|
||||
package_manager.h \
|
||||
bundle_creator.h \
|
||||
export_comics_info_dialog.h \
|
||||
import_comics_info_dialog.h \
|
||||
server_config_dialog.h \
|
||||
comic_flow_widget.h \
|
||||
db_helper.h \
|
||||
./db/data_base_management.h \
|
||||
./db/folder_item.h \
|
||||
./db/folder_model.h \
|
||||
./db/comic_model.h \
|
||||
./db/comic_item.h \
|
||||
../common/comic_db.h \
|
||||
../common/folder.h \
|
||||
../common/library_item.h \
|
||||
../common/comic.h \
|
||||
../common/bookmarks.h \
|
||||
../common/pictureflow.h \
|
||||
../common/custom_widgets.h \
|
||||
../common/qnaturalsorting.h \
|
||||
../common/yacreader_flow_gl.h \
|
||||
../common/yacreader_global.h \
|
||||
../common/onstart_flow_selection_dialog.h \
|
||||
no_libraries_widget.h \
|
||||
import_widget.h \
|
||||
yacreader_local_server.h \
|
||||
yacreader_main_toolbar.h \
|
||||
comics_remover.h \
|
||||
../common/http_worker.h \
|
||||
yacreader_libraries.h \
|
||||
../common/exit_check.h \
|
||||
comics_view.h \
|
||||
classic_comics_view.h \
|
||||
empty_folder_widget.h \
|
||||
no_search_results_widget.h \
|
||||
comic_files_manager.h \
|
||||
db/reading_list_model.h \
|
||||
db/reading_list_item.h \
|
||||
yacreader_folders_view.h \
|
||||
yacreader_reading_lists_view.h \
|
||||
add_label_dialog.h
|
||||
|
||||
|
||||
SOURCES += comic_flow.cpp \
|
||||
create_library_dialog.cpp \
|
||||
library_creator.cpp \
|
||||
library_window.cpp \
|
||||
main.cpp \
|
||||
add_library_dialog.cpp \
|
||||
rename_library_dialog.cpp \
|
||||
properties_dialog.cpp \
|
||||
options_dialog.cpp \
|
||||
export_library_dialog.cpp \
|
||||
import_library_dialog.cpp \
|
||||
package_manager.cpp \
|
||||
bundle_creator.cpp \
|
||||
export_comics_info_dialog.cpp \
|
||||
import_comics_info_dialog.cpp \
|
||||
server_config_dialog.cpp \
|
||||
comic_flow_widget.cpp \
|
||||
db_helper.cpp \
|
||||
./db/data_base_management.cpp \
|
||||
./db/folder_item.cpp \
|
||||
./db/folder_model.cpp \
|
||||
./db/comic_model.cpp \
|
||||
./db/comic_item.cpp \
|
||||
../common/comic_db.cpp \
|
||||
../common/folder.cpp \
|
||||
../common/library_item.cpp \
|
||||
../common/comic.cpp \
|
||||
../common/bookmarks.cpp \
|
||||
../common/pictureflow.cpp \
|
||||
../common/custom_widgets.cpp \
|
||||
../common/qnaturalsorting.cpp \
|
||||
../common/yacreader_flow_gl.cpp \
|
||||
../common/onstart_flow_selection_dialog.cpp \
|
||||
no_libraries_widget.cpp \
|
||||
import_widget.cpp \
|
||||
yacreader_local_server.cpp \
|
||||
yacreader_main_toolbar.cpp \
|
||||
comics_remover.cpp \
|
||||
../common/http_worker.cpp \
|
||||
../common/yacreader_global.cpp \
|
||||
yacreader_libraries.cpp \
|
||||
../common/exit_check.cpp \
|
||||
comics_view.cpp \
|
||||
classic_comics_view.cpp \
|
||||
empty_folder_widget.cpp \
|
||||
no_search_results_widget.cpp \
|
||||
comic_files_manager.cpp \
|
||||
db/reading_list_model.cpp \
|
||||
db/reading_list_item.cpp \
|
||||
yacreader_folders_view.cpp \
|
||||
yacreader_reading_lists_view.cpp \
|
||||
add_label_dialog.cpp
|
||||
|
||||
|
||||
include(./server/server.pri)
|
||||
include(../custom_widgets/custom_widgets_yacreaderlibrary.pri)
|
||||
include(../compressed_archive/wrapper.pri)
|
||||
include(./comic_vine/comic_vine.pri)
|
||||
include(../QsLog/QsLog.pri)
|
||||
include(../shortcuts_management/shortcuts_management.pri)
|
||||
|
||||
RESOURCES += images.qrc files.qrc
|
||||
win32:RESOURCES += images_win.qrc
|
||||
unix:!macx:RESOURCES += images_win.qrc
|
||||
macx:RESOURCES += images_osx.qrc
|
||||
|
||||
RC_FILE = icon.rc
|
||||
|
||||
macx {
|
||||
ICON = YACReaderLibrary.icns
|
||||
}
|
||||
|
||||
TRANSLATIONS = yacreaderlibrary_es.ts \
|
||||
yacreaderlibrary_ru.ts \
|
||||
yacreaderlibrary_pt.ts \
|
||||
yacreaderlibrary_fr.ts \
|
||||
yacreaderlibrary_nl.ts \
|
||||
yacreaderlibrary_tr.ts \
|
||||
yacreaderlibrary_de.ts \
|
||||
yacreaderlibrary_source.ts
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
Release:DESTDIR = ../release5
|
||||
Debug:DESTDIR = ../debug5
|
||||
|
||||
#QML/GridView
|
||||
QT += quick qml
|
||||
|
||||
HEADERS += grid_comics_view.h \
|
||||
comics_view_transition.h
|
||||
|
||||
SOURCES += grid_comics_view.cpp \
|
||||
comics_view_transition.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
win32:RESOURCES += qml_win.qrc
|
||||
unix:!macx:RESOURCES += qml_win.qrc
|
||||
macx:RESOURCES += qml_osx.qrc
|
||||
|
||||
} else {
|
||||
Release:DESTDIR = ../release
|
||||
Debug:DESTDIR = ../debug
|
||||
}
|
||||
|
||||
win32 {
|
||||
!exists(../compressed_archive/lib7zip){
|
||||
error(You\'ll need 7zip source code to compile YACReader. \
|
||||
Please check the compressed_archive folder for further instructions.)
|
||||
}
|
||||
}
|
||||
|
||||
unix {
|
||||
exists (../compressed_archive/libp7zip) {
|
||||
message(Found p7zip source code...)
|
||||
system(patch -d ../compressed_archive -N -p0 -i libp7zip.patch)
|
||||
} else {
|
||||
error(You\'ll need 7zip source code to compile YACReader. \
|
||||
Please check the compressed_archive folder for further instructions.)
|
||||
}
|
||||
}
|
||||
|
||||
unix:!macx {
|
||||
#set install prefix if it's empty
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
|
||||
BINDIR = $$PREFIX/bin
|
||||
LIBDIR = $$PREFIX/lib
|
||||
DATADIR = $$PREFIX/share
|
||||
|
||||
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
|
||||
|
||||
#MAKE INSTALL
|
||||
INSTALLS += bin icon desktop server translation manpage
|
||||
|
||||
bin.path = $$BINDIR
|
||||
isEmpty(DESTDIR) {
|
||||
bin.files = YACReaderLibrary
|
||||
} else {
|
||||
bin.files = $$DESTDIR/YACReaderLibrary
|
||||
}
|
||||
|
||||
server.path = $$DATADIR/yacreader
|
||||
server.files = ../release/server
|
||||
|
||||
icon.path = $$DATADIR/yacreader
|
||||
icon.files = ../images/iconLibrary.png ../images/db.png ../images/coversPackage.png
|
||||
|
||||
desktop.path = $$DATADIR/applications
|
||||
desktop.extra = desktop-file-edit --set-icon=$$DATADIR/yacreader/iconLibrary.png $$PWD/../YACReaderLibrary.desktop
|
||||
desktop.files = ../YACReaderLibrary.desktop
|
||||
#TODO: icons should be located at /usr/share/icons and have the same basename as their application
|
||||
|
||||
translation.path = $$DATADIR/yacreader/languages
|
||||
translation.files = ../release/languages/yacreaderlibrary_*
|
||||
|
||||
manpage.path = $$DATADIR/man/man1
|
||||
manpage.files = ../YACReaderLibrary.1
|
||||
}
|
||||
######################################################################
|
||||
# Automatically generated by qmake (2.01a) dom 12. oct 20:47:48 2008
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = YACReaderLibrary
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
INCLUDEPATH += ../common \
|
||||
./server \
|
||||
./db \
|
||||
../custom_widgets \
|
||||
./comic_vine \
|
||||
./comic_vine/model
|
||||
|
||||
DEFINES += SERVER_RELEASE NOMINMAX YACREADER_LIBRARY
|
||||
|
||||
win32 {
|
||||
|
||||
LIBS += -L../dependencies/poppler/lib -loleaut32 -lole32 -lshell32
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
LIBS += -lpoppler-qt5
|
||||
INCLUDEPATH += ../dependencies/poppler/include/qt5
|
||||
}
|
||||
else {
|
||||
LIBS += -lpoppler-qt4
|
||||
INCLUDEPATH += ../dependencies/poppler/include/qt4
|
||||
}
|
||||
|
||||
#QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL
|
||||
#QMAKE_LFLAGS_RELEASE += /LTCG
|
||||
CONFIG -= embed_manifest_exe
|
||||
}
|
||||
|
||||
unix:!macx{
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
INCLUDEPATH += /usr/include/poppler/qt5
|
||||
LIBS += -L/usr/lib -lpoppler-qt5
|
||||
}
|
||||
else {
|
||||
INCLUDEPATH += /usr/include/poppler/qt4
|
||||
LIBS += -L/usr/lib -lpoppler-qt4
|
||||
}
|
||||
LIBS += -lGLU
|
||||
}
|
||||
|
||||
macx{
|
||||
#INCLUDEPATH += "/Volumes/Mac OS X Lion/usr/X11/include"
|
||||
#isEqual(QT_MAJOR_VERSION, 5) {
|
||||
#INCLUDEPATH += /usr/local/include/poppler/qt5
|
||||
#LIBS += -L/usr/local/lib -lpoppler-qt5
|
||||
#}
|
||||
#else {
|
||||
#INCLUDEPATH += /usr/local/include/poppler/qt4
|
||||
#LIBS += -L/usr/local/lib -lpoppler-qt4
|
||||
#}
|
||||
#QT += macextras
|
||||
|
||||
LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
|
||||
|
||||
OBJECTIVE_SOURCES += $$PWD/../common/pdf_comic.mm
|
||||
HEADERS += $$PWD/../common/pdf_comic.h
|
||||
CONFIG += objective_c
|
||||
QT += macextras gui-private
|
||||
}
|
||||
|
||||
unix{
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
}
|
||||
|
||||
#CONFIG += release
|
||||
CONFIG -= flat
|
||||
QT += sql network opengl script
|
||||
|
||||
# Input
|
||||
HEADERS += comic_flow.h \
|
||||
create_library_dialog.h \
|
||||
library_creator.h \
|
||||
library_window.h \
|
||||
add_library_dialog.h \
|
||||
rename_library_dialog.h \
|
||||
properties_dialog.h \
|
||||
options_dialog.h \
|
||||
export_library_dialog.h \
|
||||
import_library_dialog.h \
|
||||
package_manager.h \
|
||||
bundle_creator.h \
|
||||
export_comics_info_dialog.h \
|
||||
import_comics_info_dialog.h \
|
||||
server_config_dialog.h \
|
||||
comic_flow_widget.h \
|
||||
db_helper.h \
|
||||
./db/data_base_management.h \
|
||||
./db/folder_item.h \
|
||||
./db/folder_model.h \
|
||||
./db/comic_model.h \
|
||||
./db/comic_item.h \
|
||||
../common/comic_db.h \
|
||||
../common/folder.h \
|
||||
../common/library_item.h \
|
||||
../common/comic.h \
|
||||
../common/bookmarks.h \
|
||||
../common/pictureflow.h \
|
||||
../common/custom_widgets.h \
|
||||
../common/qnaturalsorting.h \
|
||||
../common/yacreader_flow_gl.h \
|
||||
../common/yacreader_global.h \
|
||||
../common/onstart_flow_selection_dialog.h \
|
||||
no_libraries_widget.h \
|
||||
import_widget.h \
|
||||
yacreader_local_server.h \
|
||||
yacreader_main_toolbar.h \
|
||||
comics_remover.h \
|
||||
../common/http_worker.h \
|
||||
yacreader_libraries.h \
|
||||
../common/exit_check.h \
|
||||
comics_view.h \
|
||||
classic_comics_view.h \
|
||||
empty_folder_widget.h \
|
||||
no_search_results_widget.h \
|
||||
comic_files_manager.h \
|
||||
db/reading_list_model.h \
|
||||
db/reading_list_item.h \
|
||||
yacreader_folders_view.h \
|
||||
yacreader_reading_lists_view.h \
|
||||
add_label_dialog.h \
|
||||
yacreader_history_controller.h
|
||||
|
||||
|
||||
SOURCES += comic_flow.cpp \
|
||||
create_library_dialog.cpp \
|
||||
library_creator.cpp \
|
||||
library_window.cpp \
|
||||
main.cpp \
|
||||
add_library_dialog.cpp \
|
||||
rename_library_dialog.cpp \
|
||||
properties_dialog.cpp \
|
||||
options_dialog.cpp \
|
||||
export_library_dialog.cpp \
|
||||
import_library_dialog.cpp \
|
||||
package_manager.cpp \
|
||||
bundle_creator.cpp \
|
||||
export_comics_info_dialog.cpp \
|
||||
import_comics_info_dialog.cpp \
|
||||
server_config_dialog.cpp \
|
||||
comic_flow_widget.cpp \
|
||||
db_helper.cpp \
|
||||
./db/data_base_management.cpp \
|
||||
./db/folder_item.cpp \
|
||||
./db/folder_model.cpp \
|
||||
./db/comic_model.cpp \
|
||||
./db/comic_item.cpp \
|
||||
../common/comic_db.cpp \
|
||||
../common/folder.cpp \
|
||||
../common/library_item.cpp \
|
||||
../common/comic.cpp \
|
||||
../common/bookmarks.cpp \
|
||||
../common/pictureflow.cpp \
|
||||
../common/custom_widgets.cpp \
|
||||
../common/qnaturalsorting.cpp \
|
||||
../common/yacreader_flow_gl.cpp \
|
||||
../common/onstart_flow_selection_dialog.cpp \
|
||||
no_libraries_widget.cpp \
|
||||
import_widget.cpp \
|
||||
yacreader_local_server.cpp \
|
||||
yacreader_main_toolbar.cpp \
|
||||
comics_remover.cpp \
|
||||
../common/http_worker.cpp \
|
||||
../common/yacreader_global.cpp \
|
||||
yacreader_libraries.cpp \
|
||||
../common/exit_check.cpp \
|
||||
comics_view.cpp \
|
||||
classic_comics_view.cpp \
|
||||
empty_folder_widget.cpp \
|
||||
no_search_results_widget.cpp \
|
||||
comic_files_manager.cpp \
|
||||
db/reading_list_model.cpp \
|
||||
db/reading_list_item.cpp \
|
||||
yacreader_folders_view.cpp \
|
||||
yacreader_reading_lists_view.cpp \
|
||||
add_label_dialog.cpp \
|
||||
yacreader_history_controller.cpp
|
||||
|
||||
|
||||
include(./server/server.pri)
|
||||
include(../custom_widgets/custom_widgets_yacreaderlibrary.pri)
|
||||
include(../compressed_archive/wrapper.pri)
|
||||
include(./comic_vine/comic_vine.pri)
|
||||
include(../QsLog/QsLog.pri)
|
||||
include(../shortcuts_management/shortcuts_management.pri)
|
||||
|
||||
RESOURCES += images.qrc files.qrc
|
||||
win32:RESOURCES += images_win.qrc
|
||||
unix:!macx:RESOURCES += images_win.qrc
|
||||
macx:RESOURCES += images_osx.qrc
|
||||
|
||||
RC_FILE = icon.rc
|
||||
|
||||
macx {
|
||||
ICON = YACReaderLibrary.icns
|
||||
}
|
||||
|
||||
TRANSLATIONS = yacreaderlibrary_es.ts \
|
||||
yacreaderlibrary_ru.ts \
|
||||
yacreaderlibrary_pt.ts \
|
||||
yacreaderlibrary_fr.ts \
|
||||
yacreaderlibrary_nl.ts \
|
||||
yacreaderlibrary_tr.ts \
|
||||
yacreaderlibrary_de.ts \
|
||||
yacreaderlibrary_source.ts
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 5) {
|
||||
Release:DESTDIR = ../release5
|
||||
Debug:DESTDIR = ../debug5
|
||||
|
||||
#QML/GridView
|
||||
QT += quick qml
|
||||
|
||||
HEADERS += grid_comics_view.h \
|
||||
comics_view_transition.h
|
||||
|
||||
SOURCES += grid_comics_view.cpp \
|
||||
comics_view_transition.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
win32:RESOURCES += qml_win.qrc
|
||||
unix:!macx:RESOURCES += qml_win.qrc
|
||||
macx:RESOURCES += qml_osx.qrc
|
||||
|
||||
} else {
|
||||
Release:DESTDIR = ../release
|
||||
Debug:DESTDIR = ../debug
|
||||
}
|
||||
|
||||
win32 {
|
||||
!exists(../compressed_archive/lib7zip){
|
||||
error(You\'ll need 7zip source code to compile YACReader. \
|
||||
Please check the compressed_archive folder for further instructions.)
|
||||
}
|
||||
}
|
||||
|
||||
unix {
|
||||
exists (../compressed_archive/libp7zip) {
|
||||
message(Found p7zip source code...)
|
||||
system(patch -d ../compressed_archive -N -p0 -i libp7zip.patch)
|
||||
} else {
|
||||
error(You\'ll need 7zip source code to compile YACReader. \
|
||||
Please check the compressed_archive folder for further instructions.)
|
||||
}
|
||||
}
|
||||
|
||||
unix:!macx {
|
||||
#set install prefix if it's empty
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
|
||||
BINDIR = $$PREFIX/bin
|
||||
LIBDIR = $$PREFIX/lib
|
||||
DATADIR = $$PREFIX/share
|
||||
|
||||
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
|
||||
|
||||
#MAKE INSTALL
|
||||
INSTALLS += bin icon desktop server translation manpage
|
||||
|
||||
bin.path = $$BINDIR
|
||||
isEmpty(DESTDIR) {
|
||||
bin.files = YACReaderLibrary
|
||||
} else {
|
||||
bin.files = $$DESTDIR/YACReaderLibrary
|
||||
}
|
||||
|
||||
server.path = $$DATADIR/yacreader
|
||||
server.files = ../release/server
|
||||
|
||||
icon.path = $$DATADIR/yacreader
|
||||
icon.files = ../images/iconLibrary.png ../images/db.png ../images/coversPackage.png
|
||||
|
||||
desktop.path = $$DATADIR/applications
|
||||
desktop.extra = desktop-file-edit --set-icon=$$DATADIR/yacreader/iconLibrary.png $$PWD/../YACReaderLibrary.desktop
|
||||
desktop.files = ../YACReaderLibrary.desktop
|
||||
#TODO: icons should be located at /usr/share/icons and have the same basename as their application
|
||||
|
||||
translation.path = $$DATADIR/yacreader/languages
|
||||
translation.files = ../release/languages/yacreaderlibrary_*
|
||||
|
||||
manpage.path = $$DATADIR/man/man1
|
||||
manpage.files = ../YACReaderLibrary.1
|
||||
}
|
||||
|
@ -77,6 +77,8 @@
|
||||
#include "yacreader_reading_lists_view.h"
|
||||
#include "add_label_dialog.h"
|
||||
|
||||
#include "yacreader_history_controller.h"
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
@ -116,6 +118,8 @@ void LibraryWindow::setupUI()
|
||||
settings = new QSettings(YACReader::getSettingsPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
|
||||
settings->beginGroup("libraryConfig");
|
||||
|
||||
historyController = new YACReaderHistoryController(this);
|
||||
|
||||
createActions();
|
||||
doModels();
|
||||
|
||||
@ -1016,8 +1020,14 @@ void LibraryWindow::createMenus()
|
||||
void LibraryWindow::createConnections()
|
||||
{
|
||||
//history navigation
|
||||
connect(backAction,SIGNAL(triggered()),this,SLOT(backward()));
|
||||
connect(forwardAction,SIGNAL(triggered()),this,SLOT(forward()));
|
||||
connect(backAction,SIGNAL(triggered()),historyController,SLOT(backward()));
|
||||
connect(forwardAction,SIGNAL(triggered()),historyController,SLOT(forward()));
|
||||
//--
|
||||
connect(historyController,SIGNAL(enabledBackward(bool)),backAction,SLOT(setEnabled(bool)));
|
||||
connect(historyController,SIGNAL(enabledForward(bool)),forwardAction,SLOT(setEnabled(bool)));
|
||||
connect(historyController,SIGNAL(modelIndexSelected(QModelIndex)),this,SLOT(loadCovers(QModelIndex)));
|
||||
connect(historyController,SIGNAL(modelIndexSelected(QModelIndex)),foldersView,SLOT(setCurrentIndex(QModelIndex)));
|
||||
connect(foldersView, SIGNAL(clicked(QModelIndex)), historyController, SLOT(updateHistory(QModelIndex)));
|
||||
|
||||
//libraryCreator connections
|
||||
connect(createLibraryDialog,SIGNAL(createLibrary(QString,QString,QString)),this,SLOT(create(QString,QString,QString)));
|
||||
@ -1065,8 +1075,7 @@ void LibraryWindow::createConnections()
|
||||
|
||||
//navigations between view modes (tree,list and flow)
|
||||
connect(foldersView, SIGNAL(pressed(QModelIndex)), this, SLOT(updateFoldersViewConextMenu(QModelIndex)));
|
||||
connect(foldersView, SIGNAL(clicked(QModelIndex)), this, SLOT(loadCovers(QModelIndex)));
|
||||
connect(foldersView, SIGNAL(clicked(QModelIndex)), this, SLOT(updateHistory(QModelIndex)));
|
||||
connect(foldersView, SIGNAL(clicked(QModelIndex)), this, SLOT(loadCovers(QModelIndex)));
|
||||
|
||||
//drops in folders view
|
||||
connect(foldersView, SIGNAL(copyComicsToFolder(QList<QPair<QString,QString> >,QModelIndex)), this, SLOT(copyAndImportComicsToFolder(QList<QPair<QString,QString> >,QModelIndex)));
|
||||
@ -1170,11 +1179,7 @@ void LibraryWindow::loadLibrary(const QString & name)
|
||||
{
|
||||
if(!libraries.isEmpty()) //si hay bibliotecas...
|
||||
{
|
||||
currentFolderNavigation=0;
|
||||
backAction->setDisabled(true);
|
||||
forwardAction->setDisabled(true);
|
||||
history.clear();
|
||||
history.append(QModelIndex());
|
||||
historyController->clear();
|
||||
|
||||
showRootWidget();
|
||||
QString path=libraries.getPath(name)+"/.yacreaderlibrary";
|
||||
@ -1700,7 +1705,7 @@ void LibraryWindow::selectSubfolder(const QModelIndex &mi, int child)
|
||||
{
|
||||
QModelIndex dest = foldersModel->index(child,0,mi);
|
||||
foldersView->setCurrentIndex(dest);
|
||||
updateHistory(dest);
|
||||
historyController->updateHistory(dest);
|
||||
loadCovers(dest);
|
||||
}
|
||||
|
||||
@ -2001,8 +2006,7 @@ void LibraryWindow::setRootIndex()
|
||||
if(d.exists(path))
|
||||
{
|
||||
loadCovers(QModelIndex());
|
||||
if(history.count()>1)
|
||||
updateHistory(QModelIndex());
|
||||
historyController->updateHistory(QModelIndex());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2071,7 +2075,7 @@ void LibraryWindow::setSearchFilter(const YACReader::SearchModifiers modifier, Q
|
||||
{
|
||||
QModelIndex mi = foldersModel->indexFromItem(index,column);
|
||||
foldersView->scrollTo(mi,QAbstractItemView::PositionAtTop);
|
||||
updateHistory(mi);
|
||||
historyController->updateHistory(mi);
|
||||
foldersView->setCurrentIndex(mi);
|
||||
|
||||
}
|
||||
@ -2535,59 +2539,6 @@ void LibraryWindow::showSocial()
|
||||
socialDialog->setHidden(false);
|
||||
}*/
|
||||
|
||||
void LibraryWindow::backward()
|
||||
{
|
||||
if(currentFolderNavigation>0)
|
||||
{
|
||||
currentFolderNavigation--;
|
||||
loadCovers(history.at(currentFolderNavigation));
|
||||
foldersView->setCurrentIndex(history.at(currentFolderNavigation));
|
||||
forwardAction->setEnabled(true);
|
||||
}
|
||||
if(currentFolderNavigation==0)
|
||||
{
|
||||
backAction->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::forward()
|
||||
{
|
||||
if(currentFolderNavigation<history.count()-1)
|
||||
{
|
||||
currentFolderNavigation++;
|
||||
loadCovers(history.at(currentFolderNavigation));
|
||||
foldersView->setCurrentIndex(history.at(currentFolderNavigation));
|
||||
backAction->setEnabled(true);
|
||||
}
|
||||
if(currentFolderNavigation==history.count()-1)
|
||||
{
|
||||
forwardAction->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::updateHistory(const QModelIndex &mi)
|
||||
{
|
||||
//remove history from current index
|
||||
if(!mi.isValid())
|
||||
return;
|
||||
int numElementsToRemove = history.count() - (currentFolderNavigation+1);
|
||||
while(numElementsToRemove>0)
|
||||
{
|
||||
numElementsToRemove--;
|
||||
history.removeLast();
|
||||
}
|
||||
|
||||
if(mi!=history.at(currentFolderNavigation))
|
||||
{
|
||||
history.append(mi);
|
||||
|
||||
backAction->setEnabled(true);
|
||||
currentFolderNavigation++;
|
||||
}
|
||||
|
||||
forwardAction->setEnabled(false);
|
||||
}
|
||||
|
||||
void LibraryWindow::updateFoldersViewConextMenu(const QModelIndex &mi)
|
||||
{
|
||||
if(!mi.isValid())
|
||||
|
@ -64,6 +64,7 @@ class ComicFilesManager;
|
||||
class QProgressDialog;
|
||||
class ReadingListModel;
|
||||
class YACReaderReadingListsView;
|
||||
class YACReaderHistoryController;
|
||||
|
||||
#include "comic_db.h"
|
||||
|
||||
@ -265,8 +266,7 @@ private:
|
||||
QSettings * settings;
|
||||
|
||||
//navigation backward and forward
|
||||
int currentFolderNavigation;
|
||||
QList<QModelIndex> history;
|
||||
YACReaderHistoryController * historyController;
|
||||
|
||||
bool removeError;
|
||||
|
||||
@ -331,9 +331,6 @@ public slots:
|
||||
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();
|
||||
|
66
YACReaderLibrary/yacreader_history_controller.cpp
Normal file
66
YACReaderLibrary/yacreader_history_controller.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
#include "yacreader_history_controller.h"
|
||||
|
||||
YACReaderHistoryController::YACReaderHistoryController(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void YACReaderHistoryController::clear()
|
||||
{
|
||||
currentFolderNavigation = 0;
|
||||
history.clear();
|
||||
history.append(QModelIndex()); //root folder is always the first item
|
||||
|
||||
emit(enabledBackward(false));
|
||||
emit(enabledForward(false));
|
||||
}
|
||||
|
||||
void YACReaderHistoryController::backward()
|
||||
{
|
||||
if(currentFolderNavigation>0)
|
||||
{
|
||||
currentFolderNavigation--;
|
||||
emit(modelIndexSelected(history.at(currentFolderNavigation)));
|
||||
emit(enabledForward(true));
|
||||
}
|
||||
|
||||
if(currentFolderNavigation==0)
|
||||
emit(enabledBackward(false));
|
||||
}
|
||||
|
||||
void YACReaderHistoryController::forward()
|
||||
{
|
||||
if(currentFolderNavigation<history.count()-1)
|
||||
{
|
||||
currentFolderNavigation++;
|
||||
emit(modelIndexSelected(history.at(currentFolderNavigation)));
|
||||
emit(enabledBackward(true));
|
||||
}
|
||||
|
||||
if(currentFolderNavigation==history.count()-1)
|
||||
emit(enabledForward(false));
|
||||
}
|
||||
|
||||
void YACReaderHistoryController::updateHistory(const QModelIndex &mi)
|
||||
{
|
||||
//remove history from current index
|
||||
if(!mi.isValid() && history.count() == 1)
|
||||
return;
|
||||
|
||||
int numElementsToRemove = history.count() - (currentFolderNavigation+1);
|
||||
while(numElementsToRemove>0)
|
||||
{
|
||||
numElementsToRemove--;
|
||||
history.removeLast();
|
||||
}
|
||||
|
||||
if(mi!=history.at(currentFolderNavigation))
|
||||
{
|
||||
history.append(mi);
|
||||
|
||||
emit(enabledBackward(true));
|
||||
currentFolderNavigation++;
|
||||
}
|
||||
|
||||
emit(enabledForward(false));
|
||||
}
|
31
YACReaderLibrary/yacreader_history_controller.h
Normal file
31
YACReaderLibrary/yacreader_history_controller.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef YACREADER_HISTORY_CONTROLLER_H
|
||||
#define YACREADER_HISTORY_CONTROLLER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <QModelIndex>
|
||||
|
||||
class YACReaderHistoryController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderHistoryController(QObject *parent = 0);
|
||||
|
||||
signals:
|
||||
void enabledForward(bool enabled);
|
||||
void enabledBackward(bool enabled);
|
||||
void modelIndexSelected(QModelIndex mi);
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
void backward();
|
||||
void forward();
|
||||
void updateHistory(const QModelIndex & mi);
|
||||
|
||||
protected:
|
||||
int currentFolderNavigation;
|
||||
QList<QModelIndex> history;
|
||||
|
||||
};
|
||||
|
||||
#endif // YACREADER_HISTORY_CONTROLLER_H
|
Loading…
x
Reference in New Issue
Block a user