Skip to content

Commit

Permalink
add plguins for JPEG-XR/DDS/JPEG 2000, add options for Folder/Catalog…
Browse files Browse the repository at this point in the history
… views

- add plguins for JPEG-XR/DDS/JPEG 2000
- add option for saving progress.ini
- add option for save width of Folder/Catalog views
- add option to start app with Folder/Catalog view
  • Loading branch information
kanryu committed Mar 13, 2018
1 parent 87b3b6b commit 2a7ef9a
Show file tree
Hide file tree
Showing 17 changed files with 382 additions and 125 deletions.
5 changes: 4 additions & 1 deletion QuickViewer/QuickViewer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contains(DEFINES, QV_WITHOUT_OPENGL) {
QT += opengl opengl-private
}

VERSION = 1.0.9
VERSION = 1.1.0

TARGET = QuickViewer
TEMPLATE = app
Expand Down Expand Up @@ -245,6 +245,9 @@ win32 : !CONFIG(debug, debug|release) {
install_qrawspeed.files = \
../../../qrawspeed/imageformats-$${TARGET_ARCH}/qrawspeed0.dll \
../../../qrawspeed/imageformats-$${TARGET_ARCH}/qapng2.dll \
../../../qrawspeed/imageformats-$${TARGET_ARCH}/qjp2.dll \
../../../qrawspeed/imageformats-$${TARGET_ARCH}/qdds.dll \
../../../qrawspeed/imageformats-$${TARGET_ARCH}/qjpegxr.dll \

# ../../../qrawspeed/imageformats-$${TARGET_ARCH}/qlodepng0.dll \

Expand Down
6 changes: 6 additions & 0 deletions QuickViewer/src/catalog/catalogwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ void CatalogWindow::dropEvent(QDropEvent *e)
resetVolumes();
}

void CatalogWindow::resizeEvent(QResizeEvent *event)
{
QWidget::resizeEvent(event);
qApp->setCatalogViewWidth(event->size().width());
}

void CatalogWindow::on_treeItemChanged(QString)
{
//ui->pathCombo->setCurrentText(QDir::toNativeSeparators(path));
Expand Down
1 change: 1 addition & 0 deletions QuickViewer/src/catalog/catalogwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CatalogWindow : public QWidget
void searchByWord(bool doForce=false);
void dragEnterEvent(QDragEnterEvent *e);
void dropEvent(QDropEvent *e);
void resizeEvent(QResizeEvent *event);
bool isCatalogSearching();
void clearTagFrame();
void initTagButtons();
Expand Down
1 change: 1 addition & 0 deletions QuickViewer/src/folderview/folderwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void FolderWindow::dropEvent(QDropEvent *e)
void FolderWindow::resizeEvent(QResizeEvent *event)
{
QWidget::resizeEvent(event);
qApp->setFolderViewWidth(event->size().width());
resetPathLabel(event->size().width());

}
Expand Down
46 changes: 40 additions & 6 deletions QuickViewer/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
, m_sliderChanging(false)
, m_onWindowClosing(false)
, m_viewerWindowStateMaximized(false)
// , contextMenu(this)
, m_pageManager(this)
Expand Down Expand Up @@ -131,11 +132,15 @@ MainWindow::MainWindow(QWidget *parent)
// Folders
ui->actionOpenVolumeWithProgress->setChecked(qApp->OpenVolumeWithProgress());
ui->actionShowReadProgress->setChecked(qApp->ShowReadProgress());
ui->actionSaveReadProgress->setChecked(qApp->SaveReadProgress());
ui->actionSaveFolderViewWidth->setChecked(qApp->SaveFolderViewWidth());

// Catalogs
ui->actionCatalogIconLongText->setChecked(qApp->IconLongText());
ui->actionSearchTitleWithOptions->setChecked(qApp->SearchTitleWithOptions());
ui->actionCatalogTitleWithoutOptions->setChecked(qApp->TitleWithoutOptions());
ui->actionShowTagBar->setChecked(qApp->ShowTagBar());
ui->actionSaveCatalogViewWidth->setChecked(qApp->SaveCatalogViewWidth());

switch(qApp->CatalogViewModeSetting()) {
case qvEnums::List: ui->actionCatalogViewList->setChecked(true); break;
Expand Down Expand Up @@ -334,7 +339,7 @@ void MainWindow::keyPressEvent(QKeyEvent *event)

void MainWindow::closeEvent(QCloseEvent *)
{
onCatalogWindow_closed();
m_onWindowClosing = true;
delete m_contextMenu;
m_contextMenu = nullptr;
qApp->setWindowGeometry(saveGeometry());
Expand Down Expand Up @@ -452,7 +457,7 @@ void MainWindow::loadVolume(QString path, bool prohibitProhibit2Page)
if(m_pageManager.loadVolume(path)) {
return;
}

createFolderWindow(true, path);
ui->statusLabel->setText(tr("Image file not found. Can't be opened", "Text to display in the status bar when failed to open the specified Volume"));
}

Expand Down Expand Up @@ -492,6 +497,12 @@ void MainWindow::makeBookmarkMenu()
void MainWindow::setThumbnailManager(ThumbnailManager *manager)
{
m_thumbManager = manager;

switch(qApp->ShowOptionViewOnStartup()) {
case qvEnums::NoViewStartup: break;
case qvEnums::FolderStartup: createFolderWindow(!qApp->ShowPanelSeparateWindow()); break;
case qvEnums::CatalogStartup: createCatalogWindow(!qApp->ShowPanelSeparateWindow()); break;
}
}

void MainWindow::onActionExit_triggered()
Expand Down Expand Up @@ -633,6 +644,8 @@ void MainWindow::onFolderWindow_closed()
if(m_folderWindow) {
delete m_folderWindow;
m_folderWindow = nullptr;
if(!m_onWindowClosing)
qApp->setShowOptionViewOnStartup(qvEnums::NoViewStartup);
}
}

Expand All @@ -648,9 +661,9 @@ void MainWindow::onFolderWindow_openVolume(QString path)
loadVolume(path);
}

void MainWindow::createFolderWindow(bool docked)
void MainWindow::createFolderWindow(bool docked, QString path)
{
QString oldpath;
QString oldpath = path;
if(m_folderWindow) {
oldpath = m_folderWindow->currentPath();
onFolderWindow_closed();
Expand All @@ -660,8 +673,10 @@ void MainWindow::createFolderWindow(bool docked)
if(oldpath.isEmpty())
oldpath = qApp->HomeFolderPath();
}
qApp->setShowOptionViewOnStartup(qvEnums::FolderStartup);
if(docked) {
closeAllDockedWindow();
int lastwidth = qApp->FolderViewWidth();
m_folderWindow = new FolderWindow(nullptr, ui);
m_folderWindow->setFolderPath(oldpath, false);
connect(m_folderWindow, SIGNAL(closed()), this, SLOT(onFolderWindow_closed()));
Expand All @@ -670,7 +685,7 @@ void MainWindow::createFolderWindow(bool docked)
ui->catalogSplitter->insertWidget(0, m_folderWindow);
auto sizes = ui->catalogSplitter->sizes();
int sum = sizes[0]+sizes[1];
sizes[0] = 200;
sizes[0] = qApp->SaveFolderViewWidth() ? lastwidth : 200;
sizes[1] = sum-sizes[0];
ui->catalogSplitter->setSizes(sizes);
m_folderWindow->setAsInnerWidget();
Expand Down Expand Up @@ -706,6 +721,8 @@ void MainWindow::onCatalogWindow_closed()
if(m_catalogWindow) {
delete m_catalogWindow;
m_catalogWindow = nullptr;
if(!m_onWindowClosing)
qApp->setShowOptionViewOnStartup(qvEnums::NoViewStartup);
}
}

Expand All @@ -720,16 +737,18 @@ void MainWindow::createCatalogWindow(bool docked)
{
if(m_catalogWindow)
onCatalogWindow_closed();
qApp->setShowOptionViewOnStartup(qvEnums::CatalogStartup);
if(docked) {
closeAllDockedWindow();
int lastwidth = qApp->CatalogViewWidth();
m_catalogWindow = new CatalogWindow(nullptr, ui);
m_catalogWindow->setThumbnailManager(m_thumbManager);
connect(m_catalogWindow, SIGNAL(closed()), this, SLOT(onCatalogWindow_closed()));
connect(m_catalogWindow, SIGNAL(openVolume(QString)), this, SLOT(onCatalogWindow_openVolume(QString)));
ui->catalogSplitter->insertWidget(0, m_catalogWindow);
auto sizes = ui->catalogSplitter->sizes();
int sum = sizes[0]+sizes[1];
sizes[0] = 200;
sizes[0] = qApp->SaveCatalogViewWidth() ? lastwidth : 200;
sizes[1] = sum-sizes[0];
ui->catalogSplitter->setSizes(sizes);
m_catalogWindow->setAsInnerWidget();
Expand Down Expand Up @@ -1126,6 +1145,16 @@ void MainWindow::onActionShowReadProgress_triggered(bool enabled)
}
}

void MainWindow::onActionSaveReadProgress_triggered(bool enable)
{
qApp->setSaveReadProgress(enable);
}

void MainWindow::onActionSaveFolderViewWidth_triggered(bool enable)
{
qApp->setSaveFolderViewWidth(enable);
}

void MainWindow::resetVolumeCaption()
{
m_volumeCaption = m_imageString.getTitleBarText();
Expand Down Expand Up @@ -1235,6 +1264,11 @@ void MainWindow::onActionCatalogIconLongText_triggered(bool enable)
m_catalogWindow->resetViewMode();
}

void MainWindow::onActionSaveCatalogViewWidth_triggered(bool enable)
{
qApp->setSaveCatalogViewWidth(enable);
}

void MainWindow::onActionTurnPageOnLeft_triggered()
{
if(qApp->RightSideBook())
Expand Down
6 changes: 5 additions & 1 deletion QuickViewer/src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MainWindow : public QMainWindow

// FolderWindow
bool isFolderSearching();
void createFolderWindow(bool docked);
void createFolderWindow(bool docked, QString path="");

// CatalogWindow
bool isCatalogSearching();
Expand Down Expand Up @@ -96,6 +96,8 @@ public slots:
void onFolderWindow_openVolume(QString path);
void onActionOpenVolumeWithProgress_triggered(bool enabled);
void onActionShowReadProgress_triggered(bool enabled);
void onActionSaveReadProgress_triggered(bool enable);
void onActionSaveFolderViewWidth_triggered(bool enable);

// Catalog
void onActionShowCatalog_triggered();
Expand All @@ -108,6 +110,7 @@ public slots:
void onActionCatalogViewIconNoText_triggered();
void onActionShowTagBar_triggered(bool enable);
void onActionCatalogIconLongText_triggered(bool enable);
void onActionSaveCatalogViewWidth_triggered(bool enable);

// RetouchWindow
void onActionShowBrightnessWindow_triggered(bool enable);
Expand Down Expand Up @@ -200,6 +203,7 @@ private slots:
Ui::MainWindow *ui;
bool m_viewerWindowStateMaximized;
bool m_sliderChanging;
bool m_onWindowClosing;

/**
* @brief m_contextMenu Define on the context menu mainwindow.ui for the main screen and separate at startup
Expand Down
79 changes: 79 additions & 0 deletions QuickViewer/src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
<addaction name="actionCatalogIconLongText"/>
<addaction name="actionCatalogTitleWithoutOptions"/>
<addaction name="actionSearchTitleWithOptions"/>
<addaction name="actionSaveCatalogViewWidth"/>
</widget>
<widget class="QMenu" name="menu_Folder">
<property name="title">
Expand All @@ -430,9 +431,11 @@
<addaction name="separator"/>
<addaction name="actionOpenVolumeWithProgress"/>
<addaction name="actionShowReadProgress"/>
<addaction name="actionSaveReadProgress"/>
<addaction name="separator"/>
<addaction name="actionShowSubfolders"/>
<addaction name="actionConfirmDeletePage"/>
<addaction name="actionSaveFolderViewWidth"/>
</widget>
<widget class="QMenu" name="menu_Image">
<property name="title">
Expand Down Expand Up @@ -1227,6 +1230,30 @@
<string extracomment="Switch to previous image, or to previous volume if the page is last button">Prev page or volume</string>
</property>
</action>
<action name="actionSaveCatalogViewWidth">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string extracomment="Flag to restore the width of Catalog view">Save the Catalog view width</string>
</property>
</action>
<action name="actionSaveFolderViewWidth">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string extracomment="Flag to restore the width of Folder view">Save the Folder display width</string>
</property>
</action>
<action name="actionSaveReadProgress">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string extracomment="Flag to save progress.ini">Save how far you read</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down Expand Up @@ -2769,6 +2796,54 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionSaveCatalogViewWidth</sender>
<signal>triggered(bool)</signal>
<receiver>MainWindow</receiver>
<slot>onActionSaveCatalogViewWidth_triggered(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>392</x>
<y>294</y>
</hint>
</hints>
</connection>
<connection>
<sender>actionSaveFolderViewWidth</sender>
<signal>triggered(bool)</signal>
<receiver>MainWindow</receiver>
<slot>onActionSaveFolderViewWidth_triggered(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>392</x>
<y>294</y>
</hint>
</hints>
</connection>
<connection>
<sender>actionSaveReadProgress</sender>
<signal>triggered(bool)</signal>
<receiver>MainWindow</receiver>
<slot>onActionSaveReadProgress_triggered(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>392</x>
<y>294</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>on_nextPage_triggered()</slot>
Expand Down Expand Up @@ -2846,5 +2921,9 @@
<slot>onActionShaderCpuSpline36_triggered()</slot>
<slot>onActionShaderCpuLanczos3_triggered()</slot>
<slot>onActionShaderCpuLanczos4_triggered()</slot>
<slot>onActionSaveCatalogViewWidth_triggered(bool)</slot>
<slot>onActionSaveFolderViewWidth_triggered(bool)</slot>
<slot>onActionDisableCreationProgress_triggered(bool)</slot>
<slot>onActionSaveReadProgress_triggered(bool)</slot>
</slots>
</ui>
Loading

0 comments on commit 2a7ef9a

Please sign in to comment.