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