mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Linux port
This commit is contained in:
committed by
Jakub Melka
parent
68704cd8e5
commit
cbeb91fe18
18
Pdf4QtViewer/Pdf4QtViewer.qbs
Normal file
18
Pdf4QtViewer/Pdf4QtViewer.qbs
Normal file
@@ -0,0 +1,18 @@
|
||||
Pdf4QtLibrary {
|
||||
name: "Pdf4QtViewer"
|
||||
files: [
|
||||
"*.h",
|
||||
"*.cpp",
|
||||
"*.ui",
|
||||
"pdf4qtviewer.qrc",
|
||||
]
|
||||
cpp.includePaths: ["."]
|
||||
cpp.defines: ['QT_INSTALL_DIRECTORY=""']
|
||||
Depends { name: "Qt"; submodules: ["printsupport", "texttospeech", "network", "xml"] }
|
||||
Depends { name: "Pdf4QtLib" }
|
||||
Export {
|
||||
Depends { name: "cpp" }
|
||||
cpp.includePaths: ["."]
|
||||
Depends { name: "Pdf4QtLib" }
|
||||
}
|
||||
}
|
@@ -1769,9 +1769,15 @@ void PDFProgramController::updatePageLayoutActions()
|
||||
|
||||
void PDFProgramController::loadPlugins()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
QDir directory(QApplication::applicationDirPath() + "/pdfplugins");
|
||||
QStringList availablePlugins = directory.entryList(QStringList("*.dll"));
|
||||
|
||||
#elif defined(Q_OS_UNIX)
|
||||
QDir directory(QApplication::applicationDirPath() + "/../pdfplugins");
|
||||
QStringList availablePlugins = directory.entryList(QStringList("*.so"));
|
||||
#else
|
||||
static_assert(false, "Implement this for another OS!");
|
||||
#endif
|
||||
for (const QString& availablePlugin : availablePlugins)
|
||||
{
|
||||
QString pluginFileName = directory.absoluteFilePath(availablePlugin);
|
||||
|
@@ -84,6 +84,9 @@ bool PDFSendMail::sendMail(QWidget* parent, QString subject, QString fileName)
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
#elif defined(Q_OS_UNIX)
|
||||
// TODO
|
||||
return false;
|
||||
#else
|
||||
static_assert(false, "Implement this for another OS!");
|
||||
|
@@ -464,7 +464,7 @@ void PDFSidebarWidget::updateSignatures(const std::vector<pdf::PDFSignatureVerif
|
||||
if (keyUsageFlags.testFlag(pdf::PDFCertificateInfo::KeyUsageCertSign))
|
||||
{
|
||||
m_certificateInfos.push_back(currentCertificateInfo);
|
||||
certRoot->setData(0, Qt::UserRole, m_certificateInfos.size() - 1);
|
||||
certRoot->setData(0, Qt::UserRole, QVariant(static_cast<qint64>(m_certificateInfos.size() - 1)));
|
||||
}
|
||||
|
||||
auto addName = [certRoot, ¤tCertificateInfo, &infoIcon](pdf::PDFCertificateInfo::NameEntry nameEntry, QString caption)
|
||||
|
@@ -90,8 +90,10 @@ PDFViewerMainWindow::PDFViewerMainWindow(QWidget* parent) :
|
||||
m_pageZoomSpinBox(nullptr),
|
||||
m_isLoadingUI(false),
|
||||
m_progress(new pdf::PDFProgress(this)),
|
||||
#ifdef Q_OS_WIN
|
||||
m_taskbarButton(new QWinTaskbarButton(this)),
|
||||
m_progressTaskbarIndicator(nullptr),
|
||||
#endif
|
||||
m_progressDialog(nullptr),
|
||||
m_isChangingProgressStep(false)
|
||||
{
|
||||
@@ -103,7 +105,9 @@ PDFViewerMainWindow::PDFViewerMainWindow(QWidget* parent) :
|
||||
adjustToolbar(ui->mainToolBar);
|
||||
|
||||
// Initialize task bar progress
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator = m_taskbarButton->progress();
|
||||
#endif
|
||||
|
||||
// Initialize actions
|
||||
m_actionManager->setAction(PDFActionManager::Open, ui->actionOpen);
|
||||
@@ -347,9 +351,11 @@ void PDFViewerMainWindow::onProgressStarted(pdf::ProgressStartupInfo info)
|
||||
m_progressDialog->setCancelButton(nullptr);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->setRange(0, 100);
|
||||
m_progressTaskbarIndicator->reset();
|
||||
m_progressTaskbarIndicator->show();
|
||||
#endif
|
||||
|
||||
m_programController->setIsBusy(true);
|
||||
m_programController->updateActionsAvailability();
|
||||
@@ -369,7 +375,9 @@ void PDFViewerMainWindow::onProgressStep(int percentage)
|
||||
m_progressDialog->setValue(percentage);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->setValue(percentage);
|
||||
#endif
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::onProgressFinished()
|
||||
@@ -380,7 +388,9 @@ void PDFViewerMainWindow::onProgressFinished()
|
||||
m_progressDialog->deleteLater();
|
||||
m_progressDialog = nullptr;
|
||||
}
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->hide();
|
||||
#endif
|
||||
|
||||
m_programController->setIsBusy(false);
|
||||
m_programController->updateActionsAvailability();
|
||||
@@ -507,7 +517,9 @@ void PDFViewerMainWindow::closeEvent(QCloseEvent* event)
|
||||
void PDFViewerMainWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
#ifdef Q_OS_WIN
|
||||
m_taskbarButton->setWindow(windowHandle());
|
||||
#endif
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::dragEnterEvent(QDragEnterEvent* event)
|
||||
|
@@ -38,8 +38,10 @@
|
||||
#include <QFuture>
|
||||
#include <QTreeView>
|
||||
#include <QMainWindow>
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QWinTaskbarButton>
|
||||
#include <QWinTaskbarProgress>
|
||||
#endif
|
||||
#include <QFutureWatcher>
|
||||
#include <QProgressDialog>
|
||||
|
||||
@@ -118,8 +120,10 @@ private:
|
||||
QDoubleSpinBox* m_pageZoomSpinBox;
|
||||
bool m_isLoadingUI;
|
||||
pdf::PDFProgress* m_progress;
|
||||
#ifdef Q_OS_WIN
|
||||
QWinTaskbarButton* m_taskbarButton;
|
||||
QWinTaskbarProgress* m_progressTaskbarIndicator;
|
||||
#endif
|
||||
|
||||
QProgressDialog* m_progressDialog;
|
||||
bool m_isChangingProgressStep;
|
||||
|
@@ -15,8 +15,8 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "PDFViewerMainWindowLite.h"
|
||||
#include "ui_PDFViewerMainWindowLite.h"
|
||||
#include "pdfviewermainwindowlite.h"
|
||||
#include "ui_pdfviewermainwindowlite.h"
|
||||
|
||||
#include "pdfaboutdialog.h"
|
||||
#include "pdfsidebarwidget.h"
|
||||
@@ -88,8 +88,10 @@ PDFViewerMainWindowLite::PDFViewerMainWindowLite(QWidget* parent) :
|
||||
m_pageZoomSpinBox(nullptr),
|
||||
m_isLoadingUI(false),
|
||||
m_progress(new pdf::PDFProgress(this)),
|
||||
#ifdef Q_OS_WIN
|
||||
m_taskbarButton(new QWinTaskbarButton(this)),
|
||||
m_progressTaskbarIndicator(nullptr),
|
||||
#endif
|
||||
m_progressDialog(nullptr),
|
||||
m_isChangingProgressStep(false)
|
||||
{
|
||||
@@ -101,7 +103,9 @@ PDFViewerMainWindowLite::PDFViewerMainWindowLite(QWidget* parent) :
|
||||
adjustToolbar(ui->mainToolBar);
|
||||
|
||||
// Initialize task bar progress
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator = m_taskbarButton->progress();
|
||||
#endif
|
||||
|
||||
// Initialize actions
|
||||
m_actionManager->setAction(PDFActionManager::Open, ui->actionOpen);
|
||||
@@ -271,9 +275,11 @@ void PDFViewerMainWindowLite::onProgressStarted(pdf::ProgressStartupInfo info)
|
||||
m_progressDialog->setCancelButton(nullptr);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->setRange(0, 100);
|
||||
m_progressTaskbarIndicator->reset();
|
||||
m_progressTaskbarIndicator->show();
|
||||
#endif
|
||||
|
||||
m_programController->setIsBusy(true);
|
||||
m_programController->updateActionsAvailability();
|
||||
@@ -293,7 +299,9 @@ void PDFViewerMainWindowLite::onProgressStep(int percentage)
|
||||
m_progressDialog->setValue(percentage);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->setValue(percentage);
|
||||
#endif
|
||||
}
|
||||
|
||||
void PDFViewerMainWindowLite::onProgressFinished()
|
||||
@@ -304,7 +312,9 @@ void PDFViewerMainWindowLite::onProgressFinished()
|
||||
m_progressDialog->deleteLater();
|
||||
m_progressDialog = nullptr;
|
||||
}
|
||||
#ifdef Q_OS_WIN
|
||||
m_progressTaskbarIndicator->hide();
|
||||
#endif
|
||||
|
||||
m_programController->setIsBusy(false);
|
||||
m_programController->updateActionsAvailability();
|
||||
@@ -410,7 +420,9 @@ void PDFViewerMainWindowLite::closeEvent(QCloseEvent* event)
|
||||
void PDFViewerMainWindowLite::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
#ifdef Q_OS_WIN
|
||||
m_taskbarButton->setWindow(windowHandle());
|
||||
#endif
|
||||
}
|
||||
|
||||
void PDFViewerMainWindowLite::dragEnterEvent(QDragEnterEvent* event)
|
||||
|
@@ -38,8 +38,10 @@
|
||||
#include <QFuture>
|
||||
#include <QTreeView>
|
||||
#include <QMainWindow>
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QWinTaskbarButton>
|
||||
#include <QWinTaskbarProgress>
|
||||
#endif
|
||||
#include <QFutureWatcher>
|
||||
#include <QProgressDialog>
|
||||
|
||||
@@ -114,8 +116,10 @@ private:
|
||||
QDoubleSpinBox* m_pageZoomSpinBox;
|
||||
bool m_isLoadingUI;
|
||||
pdf::PDFProgress* m_progress;
|
||||
#ifdef Q_OS_WIN
|
||||
QWinTaskbarButton* m_taskbarButton;
|
||||
QWinTaskbarProgress* m_progressTaskbarIndicator;
|
||||
#endif
|
||||
|
||||
QProgressDialog* m_progressDialog;
|
||||
bool m_isChangingProgressStep;
|
||||
|
Reference in New Issue
Block a user