mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-03-03 02:47:43 +01:00
Hide developer mode
This commit is contained in:
parent
2c03d0b4f3
commit
c0cdcb28de
@ -282,6 +282,7 @@ PDFViewerMainWindow::PDFViewerMainWindow(QWidget* parent) :
|
||||
connect(m_progress, &pdf::PDFProgress::progressFinished, this, &PDFViewerMainWindow::onProgressFinished);
|
||||
|
||||
m_programController->finishInitialization();
|
||||
updateDeveloperMenu();
|
||||
|
||||
if (pdf::PDFToolManager* toolManager = m_programController->getToolManager())
|
||||
{
|
||||
@ -384,6 +385,12 @@ void PDFViewerMainWindow::onProgressFinished()
|
||||
m_programController->updateActionsAvailability();
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::updateDeveloperMenu()
|
||||
{
|
||||
bool isDeveloperMode = m_programController->getSettings()->getSettings().m_allowDeveloperMode;
|
||||
ui->menuDeveloper->menuAction()->setVisible(isDeveloperMode);
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::updateUI(bool fullUpdate)
|
||||
{
|
||||
pdf::PDFTemporaryValueChange guard(&m_isLoadingUI, true);
|
||||
|
@ -101,6 +101,8 @@ private:
|
||||
void onProgressStep(int percentage);
|
||||
void onProgressFinished();
|
||||
|
||||
void updateDeveloperMenu();
|
||||
|
||||
QIcon createStickyNoteIcon(QString key) const;
|
||||
|
||||
Ui::PDFViewerMainWindow* ui;
|
||||
|
@ -53,6 +53,7 @@ void PDFViewerSettings::readSettings(QSettings& settings, const pdf::PDFCMSSetti
|
||||
m_settings.m_instancedFontCacheLimit = settings.value("instancedFontCacheLimit", defaultSettings.m_instancedFontCacheLimit).toInt();
|
||||
m_settings.m_allowLaunchApplications = settings.value("allowLaunchApplications", defaultSettings.m_allowLaunchApplications).toBool();
|
||||
m_settings.m_allowLaunchURI = settings.value("allowLaunchURI", defaultSettings.m_allowLaunchURI).toBool();
|
||||
m_settings.m_allowDeveloperMode = settings.value("allowDeveloperMode", defaultSettings.m_allowDeveloperMode).toBool();
|
||||
m_settings.m_multithreadingStrategy = static_cast<pdf::PDFExecutionPolicy::Strategy>(settings.value("multithreadingStrategy", static_cast<int>(defaultSettings.m_multithreadingStrategy)).toInt());
|
||||
m_settings.m_magnifierSize = settings.value("magnifierSize", defaultSettings.m_magnifierSize).toInt();
|
||||
m_settings.m_magnifierZoom = settings.value("magnifierZoom", defaultSettings.m_magnifierZoom).toDouble();
|
||||
@ -118,6 +119,7 @@ void PDFViewerSettings::writeSettings(QSettings& settings)
|
||||
settings.setValue("instancedFontCacheLimit", m_settings.m_instancedFontCacheLimit);
|
||||
settings.setValue("allowLaunchApplications", m_settings.m_allowLaunchApplications);
|
||||
settings.setValue("allowLaunchURI", m_settings.m_allowLaunchURI);
|
||||
settings.setValue("allowDeveloperMode", m_settings.m_allowDeveloperMode);
|
||||
settings.setValue("multithreadingStrategy", static_cast<int>(m_settings.m_multithreadingStrategy));
|
||||
settings.setValue("magnifierSize", m_settings.m_magnifierSize);
|
||||
settings.setValue("magnifierZoom", m_settings.m_magnifierZoom);
|
||||
@ -257,6 +259,7 @@ PDFViewerSettings::Settings::Settings() :
|
||||
m_colorTolerance(0.01),
|
||||
m_allowLaunchApplications(true),
|
||||
m_allowLaunchURI(true),
|
||||
m_allowDeveloperMode(false),
|
||||
m_compiledPageCacheLimit(128 * 1024),
|
||||
m_thumbnailsCacheLimit(PIXMAP_CACHE_LIMIT),
|
||||
m_fontCacheLimit(pdf::DEFAULT_FONT_CACHE_LIMIT),
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
pdf::PDFReal m_colorTolerance;
|
||||
bool m_allowLaunchApplications;
|
||||
bool m_allowLaunchURI;
|
||||
bool m_allowDeveloperMode;
|
||||
pdf::PDFExecutionPolicy::Strategy m_multithreadingStrategy;
|
||||
|
||||
// Cache settings
|
||||
|
@ -294,6 +294,7 @@ void PDFViewerSettingsDialog::loadData()
|
||||
ui->magnifierZoomEdit->setValue(m_settings.m_magnifierZoom);
|
||||
ui->maximumUndoStepsEdit->setValue(m_settings.m_maximumUndoSteps);
|
||||
ui->maximumRedoStepsEdit->setValue(m_settings.m_maximumRedoSteps);
|
||||
ui->developerModeCheckBox->setChecked(m_settings.m_allowDeveloperMode);
|
||||
|
||||
// CMS
|
||||
ui->cmsTypeComboBox->setCurrentIndex(ui->cmsTypeComboBox->findData(int(m_cmsSettings.system)));
|
||||
@ -440,6 +441,10 @@ void PDFViewerSettingsDialog::saveData()
|
||||
{
|
||||
m_settings.m_allowLaunchURI = ui->allowRunURICheckBox->isChecked();
|
||||
}
|
||||
else if (sender == ui->developerModeCheckBox)
|
||||
{
|
||||
m_settings.m_allowDeveloperMode = ui->developerModeCheckBox->isChecked();
|
||||
}
|
||||
else if (sender == ui->compiledPageCacheSizeEdit)
|
||||
{
|
||||
m_settings.m_compiledPageCacheLimit = ui->compiledPageCacheSizeEdit->value();
|
||||
|
@ -26,7 +26,7 @@
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>5</number>
|
||||
<number>7</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="enginePage">
|
||||
<layout class="QVBoxLayout" name="enginePageLayout">
|
||||
@ -882,20 +882,31 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="magnifierZoomEdit">
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="maximumRedoStepsEdit">
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="maximumUndoStepsLabel">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="maximumRedoStepsLabel">
|
||||
<property name="text">
|
||||
<string>Maximum undo steps</string>
|
||||
<string>Maximum redo steps</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="magnifierSizeLabel">
|
||||
<property name="text">
|
||||
<string>Magnifier size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="maximumUndoStepsEdit">
|
||||
<property name="maximum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -912,9 +923,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="maximumRecentFileCountEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="magnifierZoomLabel">
|
||||
<property name="text">
|
||||
@ -922,31 +930,37 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="magnifierSizeLabel">
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="maximumRecentFileCountEdit"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="maximumUndoStepsLabel">
|
||||
<property name="text">
|
||||
<string>Magnifier size</string>
|
||||
<string>Maximum undo steps</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="maximumRedoStepsLabel">
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="magnifierZoomEdit">
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="developerModeCheckBox">
|
||||
<property name="text">
|
||||
<string>Maximum redo steps</string>
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="maximumUndoStepsEdit">
|
||||
<property name="maximum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="maximumRedoStepsEdit">
|
||||
<property name="maximum">
|
||||
<number>20</number>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="developerModeLabel">
|
||||
<property name="text">
|
||||
<string>Developer mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user