mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
creado yacreader_global.h
reestructuraci?n de parte del c?digo cambio a Qt 4.8.3 uso de QSettings en YACReader, falta leer la configuraci?n desde qsettings
This commit is contained in:
parent
c760120e39
commit
a4ecda4ae9
@ -18,10 +18,6 @@ HEADERS += comic.h \
|
|||||||
magnifying_glass.h \
|
magnifying_glass.h \
|
||||||
main_window_viewer.h \
|
main_window_viewer.h \
|
||||||
viewer.h \
|
viewer.h \
|
||||||
../common/pictureflow.h \
|
|
||||||
../common/custom_widgets.h \
|
|
||||||
../common/check_new_version.h \
|
|
||||||
../common/qnaturalsorting.h \
|
|
||||||
goto_flow.h \
|
goto_flow.h \
|
||||||
options_dialog.h \
|
options_dialog.h \
|
||||||
bookmarks.h \
|
bookmarks.h \
|
||||||
@ -29,9 +25,14 @@ HEADERS += comic.h \
|
|||||||
render.h \
|
render.h \
|
||||||
shortcuts_dialog.h \
|
shortcuts_dialog.h \
|
||||||
translator.h \
|
translator.h \
|
||||||
../common/goto_flow_widget.h \
|
|
||||||
goto_flow_gl.h \
|
goto_flow_gl.h \
|
||||||
../common/yacreader_flow_gl.h
|
goto_flow_widget.h \
|
||||||
|
../common/pictureflow.h \
|
||||||
|
../common/custom_widgets.h \
|
||||||
|
../common/check_new_version.h \
|
||||||
|
../common/qnaturalsorting.h \
|
||||||
|
../common/yacreader_flow_gl.h \
|
||||||
|
../common/yacreader_global.h
|
||||||
|
|
||||||
SOURCES += comic.cpp \
|
SOURCES += comic.cpp \
|
||||||
configuration.cpp \
|
configuration.cpp \
|
||||||
@ -40,10 +41,6 @@ SOURCES += comic.cpp \
|
|||||||
main.cpp \
|
main.cpp \
|
||||||
main_window_viewer.cpp \
|
main_window_viewer.cpp \
|
||||||
viewer.cpp \
|
viewer.cpp \
|
||||||
../common/pictureflow.cpp \
|
|
||||||
../common/custom_widgets.cpp \
|
|
||||||
../common/check_new_version.cpp \
|
|
||||||
../common/qnaturalsorting.cpp \
|
|
||||||
goto_flow.cpp \
|
goto_flow.cpp \
|
||||||
options_dialog.cpp \
|
options_dialog.cpp \
|
||||||
bookmarks.cpp \
|
bookmarks.cpp \
|
||||||
@ -51,8 +48,12 @@ SOURCES += comic.cpp \
|
|||||||
render.cpp \
|
render.cpp \
|
||||||
shortcuts_dialog.cpp \
|
shortcuts_dialog.cpp \
|
||||||
translator.cpp \
|
translator.cpp \
|
||||||
../common/goto_flow_widget.cpp \
|
|
||||||
goto_flow_gl.cpp \
|
goto_flow_gl.cpp \
|
||||||
|
goto_flow_widget.cpp \
|
||||||
|
../common/pictureflow.cpp \
|
||||||
|
../common/custom_widgets.cpp \
|
||||||
|
../common/check_new_version.cpp \
|
||||||
|
../common/qnaturalsorting.cpp \
|
||||||
../common/yacreader_flow_gl.cpp
|
../common/yacreader_flow_gl.cpp
|
||||||
|
|
||||||
RESOURCES += images.qrc \
|
RESOURCES += images.qrc \
|
||||||
|
@ -47,7 +47,7 @@ void Configuration::load(const QString & path)
|
|||||||
//gotoSlideSize = QSize(220,350); //huge
|
//gotoSlideSize = QSize(220,350); //huge
|
||||||
zoomLevel = 0.5;
|
zoomLevel = 0.5;
|
||||||
adjustToWidth = true;
|
adjustToWidth = true;
|
||||||
flowType = PictureFlow::Strip;
|
flowType = Strip;
|
||||||
fullScreen = false;
|
fullScreen = false;
|
||||||
fitToWidthRatio = 1;
|
fitToWidthRatio = 1;
|
||||||
windowSize = QSize(0,0);
|
windowSize = QSize(0,0);
|
||||||
@ -95,7 +95,7 @@ void Configuration::load(const QString & path)
|
|||||||
adjustToWidth = line.toInt();
|
adjustToWidth = line.toInt();
|
||||||
else
|
else
|
||||||
if(name==FLOW_TYPE)
|
if(name==FLOW_TYPE)
|
||||||
flowType = (PictureFlow::FlowType)line.toInt();
|
flowType = (FlowType)line.toInt();
|
||||||
else
|
else
|
||||||
if(name==FULLSCREEN)
|
if(name==FULLSCREEN)
|
||||||
fullScreen = line.toInt();
|
fullScreen = line.toInt();
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "pictureflow.h"
|
#include <QPoint>
|
||||||
|
#include <QColor>
|
||||||
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
#define CONF_FILE_PATH "."
|
#define CONF_FILE_PATH "."
|
||||||
#define SLIDE_ASPECT_RATIO 1.585
|
#define SLIDE_ASPECT_RATIO 1.585
|
||||||
@ -20,7 +22,7 @@
|
|||||||
float zoomLevel;
|
float zoomLevel;
|
||||||
bool adjustToWidth;
|
bool adjustToWidth;
|
||||||
bool fullScreen;
|
bool fullScreen;
|
||||||
PictureFlow::FlowType flowType;
|
FlowType flowType;
|
||||||
float fitToWidthRatio;
|
float fitToWidthRatio;
|
||||||
QPoint windowPos;
|
QPoint windowPos;
|
||||||
QSize windowSize;
|
QSize windowSize;
|
||||||
@ -50,8 +52,8 @@
|
|||||||
void setZoomLevel(float zl) { zoomLevel = zl;};
|
void setZoomLevel(float zl) { zoomLevel = zl;};
|
||||||
bool getAdjustToWidth() {return adjustToWidth;};
|
bool getAdjustToWidth() {return adjustToWidth;};
|
||||||
void setAdjustToWidth(bool atw=true) {adjustToWidth = atw;};
|
void setAdjustToWidth(bool atw=true) {adjustToWidth = atw;};
|
||||||
PictureFlow::FlowType getFlowType(){return flowType;};
|
FlowType getFlowType(){return flowType;};
|
||||||
void setFlowType(PictureFlow::FlowType type){flowType = type;};
|
void setFlowType(FlowType type){flowType = type;};
|
||||||
bool getFullScreen(){return fullScreen;};
|
bool getFullScreen(){return fullScreen;};
|
||||||
void setFullScreen(bool f){fullScreen = f;};
|
void setFullScreen(bool f){fullScreen = f;};
|
||||||
float getFitToWidthRatio(){return fitToWidthRatio;};
|
float getFitToWidthRatio(){return fitToWidthRatio;};
|
||||||
|
@ -18,7 +18,7 @@ QMutex mutexGoToFlow;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
GoToFlow::GoToFlow(QWidget *parent,PictureFlow::FlowType flowType)
|
GoToFlow::GoToFlow(QWidget *parent,FlowType flowType)
|
||||||
:GoToFlowWidget(parent),ready(false)
|
:GoToFlowWidget(parent),ready(false)
|
||||||
{
|
{
|
||||||
updateTimer = new QTimer;
|
updateTimer = new QTimer;
|
||||||
@ -269,7 +269,7 @@ void GoToFlow::wheelEvent(QWheelEvent * event)
|
|||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlow::setFlowType(PictureFlow::FlowType flowType)
|
void GoToFlow::setFlowType(FlowType flowType)
|
||||||
{
|
{
|
||||||
flow->setFlowType(flowType);
|
flow->setFlowType(flowType);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ class GoToFlow : public GoToFlowWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GoToFlow(QWidget* parent = 0,PictureFlow::FlowType flowType = PictureFlow::CoverFlowLike);
|
GoToFlow(QWidget* parent = 0,FlowType flowType = CoverFlowLike);
|
||||||
bool ready; //comic is ready for read.
|
bool ready; //comic is ready for read.
|
||||||
void keyPressEvent(QKeyEvent* event);
|
void keyPressEvent(QKeyEvent* event);
|
||||||
bool eventFilter(QObject *target, QEvent *event);
|
bool eventFilter(QObject *target, QEvent *event);
|
||||||
@ -56,7 +56,7 @@ private:
|
|||||||
void reset();
|
void reset();
|
||||||
void setNumSlides(unsigned int slides);
|
void setNumSlides(unsigned int slides);
|
||||||
void setImageReady(int index,const QByteArray & image);
|
void setImageReady(int index,const QByteArray & image);
|
||||||
void setFlowType(PictureFlow::FlowType flowType);
|
void setFlowType(FlowType flowType);
|
||||||
void updateSize();
|
void updateSize();
|
||||||
void updateConfig(QSettings * settings);
|
void updateConfig(QSettings * settings);
|
||||||
signals:
|
signals:
|
||||||
|
@ -19,6 +19,8 @@ MainWindowViewer::MainWindowViewer()
|
|||||||
|
|
||||||
void MainWindowViewer::loadConfiguration()
|
void MainWindowViewer::loadConfiguration()
|
||||||
{
|
{
|
||||||
|
settings = new QSettings("YACReader.ini",QSettings::IniFormat);
|
||||||
|
|
||||||
Configuration & config = Configuration::getConfiguration();
|
Configuration & config = Configuration::getConfiguration();
|
||||||
currentDirectory = config.getDefaultPath();
|
currentDirectory = config.getDefaultPath();
|
||||||
fullscreen = config.getFullScreen();
|
fullscreen = config.getFullScreen();
|
||||||
@ -26,9 +28,6 @@ void MainWindowViewer::loadConfiguration()
|
|||||||
|
|
||||||
void MainWindowViewer::setupUI()
|
void MainWindowViewer::setupUI()
|
||||||
{
|
{
|
||||||
settings = new QSettings("YACReader.ini",QSettings::IniFormat);
|
|
||||||
settings->beginGroup("config");
|
|
||||||
|
|
||||||
setWindowIcon(QIcon(":/images/icon.png"));
|
setWindowIcon(QIcon(":/images/icon.png"));
|
||||||
|
|
||||||
viewer = new Viewer(this);
|
viewer = new Viewer(this);
|
||||||
|
@ -109,6 +109,7 @@ class ShortcutsDialog;
|
|||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
|
|
||||||
QSettings * settings;
|
QSettings * settings;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent ( QCloseEvent * event );
|
virtual void closeEvent ( QCloseEvent * event );
|
||||||
public:
|
public:
|
||||||
|
@ -96,18 +96,19 @@ void OptionsDialog::findFolder()
|
|||||||
|
|
||||||
void OptionsDialog::saveOptions()
|
void OptionsDialog::saveOptions()
|
||||||
{
|
{
|
||||||
Configuration & conf = Configuration::getConfiguration();
|
settings->setValue("goToFlowSize",QSize(static_cast<int>(slideSize->sliderPosition()*SLIDE_ASPECT_RATIO),slideSize->sliderPosition()));
|
||||||
conf.setDefaultPath(pathEdit->text());
|
|
||||||
conf.setGotoSlideSize(QSize(static_cast<int>(slideSize->sliderPosition()*SLIDE_ASPECT_RATIO),slideSize->sliderPosition()));
|
|
||||||
if(sw->radio1->isChecked())
|
if(sw->radio1->isChecked())
|
||||||
conf.setFlowType(PictureFlow::CoverFlowLike);
|
settings->setValue("flowTypeSW",0);
|
||||||
if(sw->radio2->isChecked())
|
if(sw->radio2->isChecked())
|
||||||
conf.setFlowType(PictureFlow::Strip);
|
settings->setValue("flowTypeSW",1);
|
||||||
if(sw->radio3->isChecked())
|
if(sw->radio3->isChecked())
|
||||||
conf.setFlowType(PictureFlow::StripOverlapped);
|
settings->setValue("flowTypeSW",2);
|
||||||
conf.setFitToWidthRatio(fitToWidthRatioS->sliderPosition()/100.0);
|
|
||||||
conf.setBackgroundColor(colorDialog->currentColor());
|
settings->setValue("path",pathEdit->text());
|
||||||
conf.save();
|
|
||||||
|
settings->setValue("color",colorDialog->currentColor());
|
||||||
|
settings->setValue("adjustToWidthRatio",fitToWidthRatioS->sliderPosition()/100.0);
|
||||||
|
|
||||||
close();
|
close();
|
||||||
emit(accepted());
|
emit(accepted());
|
||||||
}
|
}
|
||||||
@ -115,24 +116,28 @@ void OptionsDialog::saveOptions()
|
|||||||
void OptionsDialog::restoreOptions(QSettings * settings)
|
void OptionsDialog::restoreOptions(QSettings * settings)
|
||||||
{
|
{
|
||||||
YACReaderOptionsDialog::restoreOptions(settings);
|
YACReaderOptionsDialog::restoreOptions(settings);
|
||||||
|
|
||||||
Configuration & conf = Configuration::getConfiguration();
|
slideSize->setSliderPosition(settings->value("goToFlowSize").toSize().height());
|
||||||
|
switch(settings->value("flowTypeSW").toInt())
|
||||||
slideSize->setSliderPosition(conf.getGotoSlideSize().height());
|
{
|
||||||
fitToWidthRatioS->setSliderPosition(conf.getFitToWidthRatio()*100);
|
case 0:
|
||||||
pathEdit->setText(conf.getDefaultPath());
|
|
||||||
updateColor(Configuration::getConfiguration().getBackgroundColor());
|
|
||||||
switch(conf.getFlowType()){
|
|
||||||
case PictureFlow::CoverFlowLike:
|
|
||||||
sw->radio1->setChecked(true);
|
sw->radio1->setChecked(true);
|
||||||
break;
|
break;
|
||||||
case PictureFlow::Strip:
|
case 1:
|
||||||
sw->radio2->setChecked(true);
|
sw->radio2->setChecked(true);
|
||||||
break;
|
break;
|
||||||
case PictureFlow::StripOverlapped:
|
case 2:
|
||||||
sw->radio3->setChecked(true);
|
sw->radio3->setChecked(true);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
sw->radio1->setChecked(true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pathEdit->setText(settings->value("path").toString());
|
||||||
|
|
||||||
|
updateColor(settings->value("color").value<QColor>());
|
||||||
|
fitToWidthRatioS->setSliderPosition(settings->value("adjustToWidthRatio").toFloat()*100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,17 +19,18 @@ HEADERS += comic_flow.h \
|
|||||||
create_library_dialog.h \
|
create_library_dialog.h \
|
||||||
library_creator.h \
|
library_creator.h \
|
||||||
library_window.h \
|
library_window.h \
|
||||||
../common/pictureflow.h \
|
|
||||||
add_library_dialog.h \
|
add_library_dialog.h \
|
||||||
../common/custom_widgets.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 \
|
||||||
../common/qnaturalsorting.h \
|
|
||||||
bundle_creator.h \
|
bundle_creator.h \
|
||||||
|
export_comics_info_dialog.h \
|
||||||
|
import_comics_info_dialog.h \
|
||||||
|
server_config_dialog.h \
|
||||||
|
comic_flow_widget.h \
|
||||||
./db/data_base_management.h \
|
./db/data_base_management.h \
|
||||||
./db/treeitem.h \
|
./db/treeitem.h \
|
||||||
./db/treemodel.h \
|
./db/treemodel.h \
|
||||||
@ -38,31 +39,31 @@ HEADERS += comic_flow.h \
|
|||||||
./db/comic_db.h \
|
./db/comic_db.h \
|
||||||
./db/folder.h \
|
./db/folder.h \
|
||||||
./db/library_item.h \
|
./db/library_item.h \
|
||||||
export_comics_info_dialog.h \
|
|
||||||
import_comics_info_dialog.h \
|
|
||||||
../common/check_new_version.h \
|
|
||||||
../YACReader/comic.h \
|
../YACReader/comic.h \
|
||||||
../YACReader/bookmarks.h \
|
../YACReader/bookmarks.h \
|
||||||
server_config_dialog.h \
|
../common/pictureflow.h \
|
||||||
comic_flow_widget.h \
|
../common/custom_widgets.h \
|
||||||
../common/yacreader_flow_gl.h
|
../common/qnaturalsorting.h \
|
||||||
|
../common/yacreader_flow_gl.h \
|
||||||
|
../common/yacreader_global.h
|
||||||
|
|
||||||
SOURCES += comic_flow.cpp \
|
SOURCES += comic_flow.cpp \
|
||||||
create_library_dialog.cpp \
|
create_library_dialog.cpp \
|
||||||
library_creator.cpp \
|
library_creator.cpp \
|
||||||
library_window.cpp \
|
library_window.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
../common/pictureflow.cpp \
|
|
||||||
add_library_dialog.cpp \
|
add_library_dialog.cpp \
|
||||||
../common/custom_widgets.cpp \
|
|
||||||
rename_library_dialog.cpp \
|
rename_library_dialog.cpp \
|
||||||
properties_dialog.cpp \
|
properties_dialog.cpp \
|
||||||
options_dialog.cpp \
|
options_dialog.cpp \
|
||||||
export_library_dialog.cpp \
|
export_library_dialog.cpp \
|
||||||
import_library_dialog.cpp \
|
import_library_dialog.cpp \
|
||||||
package_manager.cpp \
|
package_manager.cpp \
|
||||||
../common/qnaturalsorting.cpp \
|
|
||||||
bundle_creator.cpp \
|
bundle_creator.cpp \
|
||||||
|
export_comics_info_dialog.cpp \
|
||||||
|
import_comics_info_dialog.cpp \
|
||||||
|
server_config_dialog.cpp \
|
||||||
|
comic_flow_widget.cpp \
|
||||||
./db/data_base_management.cpp \
|
./db/data_base_management.cpp \
|
||||||
./db/treeitem.cpp \
|
./db/treeitem.cpp \
|
||||||
./db/treemodel.cpp \
|
./db/treemodel.cpp \
|
||||||
@ -71,13 +72,11 @@ SOURCES += comic_flow.cpp \
|
|||||||
./db/comic_db.cpp \
|
./db/comic_db.cpp \
|
||||||
./db/folder.cpp \
|
./db/folder.cpp \
|
||||||
./db/library_item.cpp \
|
./db/library_item.cpp \
|
||||||
export_comics_info_dialog.cpp \
|
|
||||||
import_comics_info_dialog.cpp \
|
|
||||||
../common/check_new_version.cpp \
|
|
||||||
../YACReader/comic.cpp \
|
../YACReader/comic.cpp \
|
||||||
../YACReader/bookmarks.cpp \
|
../YACReader/bookmarks.cpp \
|
||||||
server_config_dialog.cpp \
|
../common/pictureflow.cpp \
|
||||||
comic_flow_widget.cpp \
|
../common/custom_widgets.cpp \
|
||||||
|
../common/qnaturalsorting.cpp \
|
||||||
../common/yacreader_flow_gl.cpp
|
../common/yacreader_flow_gl.cpp
|
||||||
|
|
||||||
include(./server/server.pri)
|
include(./server/server.pri)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#include "data_base_management.h"
|
#include "data_base_management.h"
|
||||||
#include "check_new_version.h"
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "custom_widgets.h"
|
#include "custom_widgets.h"
|
||||||
#include "yacreader_flow_gl.h"
|
#include "yacreader_flow_gl.h"
|
||||||
|
|
||||||
PictureFlow::FlowType flowType = PictureFlow::Strip;
|
FlowType flowType = Strip;
|
||||||
|
|
||||||
OptionsDialog::OptionsDialog(QWidget * parent)
|
OptionsDialog::OptionsDialog(QWidget * parent)
|
||||||
:YACReaderOptionsDialog(parent)
|
:YACReaderOptionsDialog(parent)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "custom_widgets.h"
|
#include "custom_widgets.h"
|
||||||
|
|
||||||
extern PictureFlow::FlowType flowType;
|
extern FlowType flowType;
|
||||||
|
|
||||||
class OptionsDialog : public YACReaderOptionsDialog
|
class OptionsDialog : public YACReaderOptionsDialog
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <QHttpResponseHeader>
|
#include <QHttpResponseHeader>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
#define VERSION "5.0.0"
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
class HttpVersionChecker : public QWidget
|
class HttpVersionChecker : public QWidget
|
||||||
{
|
{
|
||||||
|
@ -535,6 +535,11 @@ YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget * parent)
|
|||||||
useGL = useGL = new QCheckBox(tr("Use hardware acceleration (restart needed)"));
|
useGL = useGL = new QCheckBox(tr("Use hardware acceleration (restart needed)"));
|
||||||
connect(useGL,SIGNAL(stateChanged(int)),this,SLOT(saveUseGL(int)));
|
connect(useGL,SIGNAL(stateChanged(int)),this,SLOT(saveUseGL(int)));
|
||||||
|
|
||||||
|
//sw CONNECTIONS
|
||||||
|
connect(sw->radio1,SIGNAL(toggled(bool)),this,SLOT(setClassicConfig()));
|
||||||
|
connect(sw->radio2,SIGNAL(toggled(bool)),this,SLOT(setStripeConfig()));
|
||||||
|
connect(sw->radio3,SIGNAL(toggled(bool)),this,SLOT(setOverlappedStripeConfig()));
|
||||||
|
|
||||||
//gl CONNECTIONS
|
//gl CONNECTIONS
|
||||||
connect(gl->radioClassic,SIGNAL(toggled(bool)),this,SLOT(setClassicConfig()));
|
connect(gl->radioClassic,SIGNAL(toggled(bool)),this,SLOT(setClassicConfig()));
|
||||||
connect(gl->radioStripe,SIGNAL(toggled(bool)),this,SLOT(setStripeConfig()));
|
connect(gl->radioStripe,SIGNAL(toggled(bool)),this,SLOT(setStripeConfig()));
|
||||||
@ -604,63 +609,65 @@ void YACReaderOptionsDialog::saveUseGL(int b)
|
|||||||
sw->setVisible(true);
|
sw->setVisible(true);
|
||||||
}
|
}
|
||||||
resize(0,0);
|
resize(0,0);
|
||||||
|
|
||||||
settings->setValue("useOpenGL",b);
|
settings->setValue("useOpenGL",b);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderOptionsDialog::saveXRotation(int value)
|
void YACReaderOptionsDialog::saveXRotation(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("xRotation",gl->xRotation->getValue());
|
settings->setValue("xRotation",gl->xRotation->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveYPosition(int value)
|
void YACReaderOptionsDialog::saveYPosition(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("yPosition",gl->yPosition->getValue());
|
settings->setValue("yPosition",gl->yPosition->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveCoverDistance(int value)
|
void YACReaderOptionsDialog::saveCoverDistance(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("coverDistance",gl->coverDistance->getValue());
|
settings->setValue("coverDistance",gl->coverDistance->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveCentralDistance(int value)
|
void YACReaderOptionsDialog::saveCentralDistance(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("centralDistance",gl->centralDistance->getValue());
|
settings->setValue("centralDistance",gl->centralDistance->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveZoomLevel(int value)
|
void YACReaderOptionsDialog::saveZoomLevel(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("zoomLevel",gl->zoomLevel->getValue());
|
settings->setValue("zoomLevel",gl->zoomLevel->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveYCoverOffset(int value)
|
void YACReaderOptionsDialog::saveYCoverOffset(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("yCoverOffset",gl->yCoverOffset->getValue());
|
settings->setValue("yCoverOffset",gl->yCoverOffset->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveZCoverOffset(int value)
|
void YACReaderOptionsDialog::saveZCoverOffset(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("zCoverOffset",gl->zCoverOffset->getValue());
|
settings->setValue("zCoverOffset",gl->zCoverOffset->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveCoverRotation(int value)
|
void YACReaderOptionsDialog::saveCoverRotation(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("coverRotation",gl->coverRotation->getValue());
|
settings->setValue("coverRotation",gl->coverRotation->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveFadeOutDist(int value)
|
void YACReaderOptionsDialog::saveFadeOutDist(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("fadeOutDist",gl->fadeOutDist->getValue());
|
settings->setValue("fadeOutDist",gl->fadeOutDist->getValue());
|
||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::saveLightStrength(int value)
|
void YACReaderOptionsDialog::saveLightStrength(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("lightStrength",gl->lightStrength->getValue());
|
settings->setValue("lightStrength",gl->lightStrength->getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderOptionsDialog::saveMaxAngle(int value)
|
void YACReaderOptionsDialog::saveMaxAngle(int value)
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Custom);
|
settings->setValue("flowType",Custom);
|
||||||
settings->setValue("maxAngle",gl->maxAngle->getValue());
|
settings->setValue("maxAngle",gl->maxAngle->getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,6 +675,8 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
|
|||||||
{
|
{
|
||||||
this->settings = settings;
|
this->settings = settings;
|
||||||
|
|
||||||
|
//FLOW CONFIG
|
||||||
|
|
||||||
if(settings->contains("useOpenGL") && settings->value("useOpenGL").toInt() == Qt::Checked)
|
if(settings->contains("useOpenGL") && settings->value("useOpenGL").toInt() == Qt::Checked)
|
||||||
{
|
{
|
||||||
sw->setVisible(false);
|
sw->setVisible(false);
|
||||||
@ -691,70 +700,72 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gl->performanceSlider->setValue(settings->value("performance").toInt());
|
gl->performanceSlider->setValue(settings->value("performance").toInt());
|
||||||
PictureFlow::FlowType flowType;
|
FlowType flowType;
|
||||||
switch(settings->value("flowType").toInt())
|
switch(settings->value("flowType").toInt())
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
flowType = PictureFlow::CoverFlowLike;
|
flowType = CoverFlowLike;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
flowType = PictureFlow::Strip;
|
flowType = Strip;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
flowType = PictureFlow::StripOverlapped;
|
flowType = StripOverlapped;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
flowType = PictureFlow::Modern;
|
flowType = Modern;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
flowType = PictureFlow::Roulette;
|
flowType = Roulette;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
flowType = PictureFlow::Custom;
|
flowType = Custom;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(flowType == PictureFlow::Custom)
|
if(flowType == Custom)
|
||||||
{
|
{
|
||||||
loadConfig();
|
loadConfig();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flowType == PictureFlow::CoverFlowLike)
|
if(flowType == CoverFlowLike)
|
||||||
{
|
{
|
||||||
setClassicConfig();
|
setClassicConfig();
|
||||||
gl->radioClassic->setChecked(true);
|
gl->radioClassic->setChecked(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flowType == PictureFlow::Strip)
|
if(flowType == Strip)
|
||||||
{
|
{
|
||||||
setStripeConfig();
|
setStripeConfig();
|
||||||
gl->radioStripe->setChecked(true);
|
gl->radioStripe->setChecked(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flowType == PictureFlow::StripOverlapped)
|
if(flowType == StripOverlapped)
|
||||||
{
|
{
|
||||||
setOverlappedStripeConfig();
|
setOverlappedStripeConfig();
|
||||||
gl->radioOver->setChecked(true);
|
gl->radioOver->setChecked(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flowType == PictureFlow::Modern)
|
if(flowType == Modern)
|
||||||
{
|
{
|
||||||
setModernConfig();
|
setModernConfig();
|
||||||
gl->radionModern->setChecked(true);
|
gl->radionModern->setChecked(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flowType == PictureFlow::Roulette)
|
if(flowType == Roulette)
|
||||||
{
|
{
|
||||||
setRouletteConfig();
|
setRouletteConfig();
|
||||||
gl->radioDown->setChecked(true);
|
gl->radioDown->setChecked(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//END FLOW CONFIG
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderOptionsDialog::loadConfig()
|
void YACReaderOptionsDialog::loadConfig()
|
||||||
@ -773,35 +784,35 @@ void YACReaderOptionsDialog::loadConfig()
|
|||||||
}
|
}
|
||||||
void YACReaderOptionsDialog::setClassicConfig()
|
void YACReaderOptionsDialog::setClassicConfig()
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::CoverFlowLike);
|
settings->setValue("flowType",CoverFlowLike);
|
||||||
|
|
||||||
gl->setValues(presetYACReaderFlowClassicConfig);
|
gl->setValues(presetYACReaderFlowClassicConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderOptionsDialog::setStripeConfig()
|
void YACReaderOptionsDialog::setStripeConfig()
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Strip);
|
settings->setValue("flowType",Strip);
|
||||||
|
|
||||||
gl->setValues(presetYACReaderFlowStripeConfig);
|
gl->setValues(presetYACReaderFlowStripeConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderOptionsDialog::setOverlappedStripeConfig()
|
void YACReaderOptionsDialog::setOverlappedStripeConfig()
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::StripOverlapped);
|
settings->setValue("flowType",StripOverlapped);
|
||||||
|
|
||||||
gl->setValues(presetYACReaderFlowOverlappedStripeConfig);
|
gl->setValues(presetYACReaderFlowOverlappedStripeConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderOptionsDialog::setModernConfig()
|
void YACReaderOptionsDialog::setModernConfig()
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Modern);
|
settings->setValue("flowType",Modern);
|
||||||
|
|
||||||
gl->setValues(defaultYACReaderFlowConfig);
|
gl->setValues(defaultYACReaderFlowConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void YACReaderOptionsDialog::setRouletteConfig()
|
void YACReaderOptionsDialog::setRouletteConfig()
|
||||||
{
|
{
|
||||||
settings->setValue("flowType",PictureFlow::Roulette);
|
settings->setValue("flowType",Roulette);
|
||||||
|
|
||||||
gl->setValues(pressetYACReaderFlowDownConfig);
|
gl->setValues(pressetYACReaderFlowDownConfig);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
|
|
||||||
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
#include "pictureflow.h"
|
#include "pictureflow.h"
|
||||||
|
|
||||||
#include "yacreader_flow_gl.h"
|
#include "yacreader_flow_gl.h"
|
||||||
@ -269,28 +271,28 @@ protected:
|
|||||||
public:
|
public:
|
||||||
YACReaderOptionsDialog(QWidget * parent);
|
YACReaderOptionsDialog(QWidget * parent);
|
||||||
public slots:
|
public slots:
|
||||||
void restoreOptions(QSettings * settings);
|
virtual void restoreOptions(QSettings * settings);
|
||||||
void saveOptions();
|
virtual void saveOptions();
|
||||||
protected slots:
|
protected slots:
|
||||||
void savePerformance(int value);
|
virtual void savePerformance(int value);
|
||||||
void saveUseGL(int b);
|
virtual void saveUseGL(int b);
|
||||||
void saveXRotation(int value);
|
virtual void saveXRotation(int value);
|
||||||
void saveYPosition(int value);
|
virtual void saveYPosition(int value);
|
||||||
void saveCoverDistance(int value);
|
virtual void saveCoverDistance(int value);
|
||||||
void saveCentralDistance(int value);
|
virtual void saveCentralDistance(int value);
|
||||||
void saveZoomLevel(int value);
|
virtual void saveZoomLevel(int value);
|
||||||
void saveYCoverOffset(int value);
|
virtual void saveYCoverOffset(int value);
|
||||||
void saveZCoverOffset(int value);
|
virtual void saveZCoverOffset(int value);
|
||||||
void saveCoverRotation(int value);
|
virtual void saveCoverRotation(int value);
|
||||||
void saveFadeOutDist(int value);
|
virtual void saveFadeOutDist(int value);
|
||||||
void saveLightStrength(int value);
|
virtual void saveLightStrength(int value);
|
||||||
void saveMaxAngle(int value);
|
virtual void saveMaxAngle(int value);
|
||||||
void loadConfig();
|
virtual void loadConfig();
|
||||||
void setClassicConfig();
|
virtual void setClassicConfig();
|
||||||
void setStripeConfig();
|
virtual void setStripeConfig();
|
||||||
void setOverlappedStripeConfig();
|
virtual void setOverlappedStripeConfig();
|
||||||
void setModernConfig();
|
virtual void setModernConfig();
|
||||||
void setRouletteConfig();
|
virtual void setRouletteConfig();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void optionsChanged();
|
void optionsChanged();
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#define PICTUREFLOW_H
|
#define PICTUREFLOW_H
|
||||||
|
|
||||||
#include <qwidget.h>
|
#include <qwidget.h>
|
||||||
|
#include "yacreader_global.h" //FlowType
|
||||||
|
|
||||||
class PictureFlowPrivate;
|
class PictureFlowPrivate;
|
||||||
|
|
||||||
@ -59,15 +60,7 @@ public:
|
|||||||
BlurredReflection
|
BlurredReflection
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FlowType
|
|
||||||
{
|
|
||||||
CoverFlowLike,
|
|
||||||
Strip,
|
|
||||||
StripOverlapped,
|
|
||||||
Modern,
|
|
||||||
Roulette,
|
|
||||||
Custom
|
|
||||||
};
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Creates a new PictureFlow widget.
|
Creates a new PictureFlow widget.
|
||||||
|
@ -871,7 +871,7 @@ void YACReaderFlowGL::updateMarks()
|
|||||||
{
|
{
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
/*void YACReaderFlowGL::setFlowType(PictureFlow::FlowType flowType)
|
/*void YACReaderFlowGL::setFlowType(FlowType flowType)
|
||||||
{
|
{
|
||||||
//TODO esperar a que se reimplemente flowtype
|
//TODO esperar a que se reimplemente flowtype
|
||||||
}*/
|
}*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//OpenGL Coverflow API by J.Roth
|
//OpenGL Coverflow API by J.Roth
|
||||||
|
#ifndef __YACREADER_FLOW_GL_H
|
||||||
#pragma once
|
#define __YACREADER_FLOW_GL_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -380,4 +380,6 @@ private:
|
|||||||
//protected:
|
//protected:
|
||||||
// void run();
|
// void run();
|
||||||
//
|
//
|
||||||
//};
|
//};
|
||||||
|
|
||||||
|
#endif
|
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
echo Setting up a Qt environment...
|
echo Setting up a Qt environment...
|
||||||
|
|
||||||
set QTDIR=D:\Desarrollo\Qt\4.8.0
|
set QTDIR=D:\Desarrollo\Qt\4.8.3
|
||||||
echo -- QTDIR set to D:\Desarrollo\Qt\4.8.0
|
echo -- QTDIR set to D:\Desarrollo\Qt\4.8.3
|
||||||
set PATH=D:\Desarrollo\Qt\4.8.0\bin;%PATH%
|
set PATH=D:\Desarrollo\Qt\4.8.3\bin;%PATH%
|
||||||
echo -- Added D:\Desarrollo\Qt\4.8.0\bin to PATH
|
echo -- Added D:\Desarrollo\Qt\4.8.3\bin to PATH
|
||||||
set QMAKESPEC=win32-msvc2010
|
set QMAKESPEC=win32-msvc2010
|
||||||
echo -- QMAKESPEC set to "win32-msvc2010"
|
echo -- QMAKESPEC set to "win32-msvc2010"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user