115
115
m_defaultsButton = m_dialogButtonBox->addButton(tr("Defaults"), QDialogButtonBox::ResetRole);
116
116
connect(m_defaultsButton, SIGNAL(clicked()), SLOT(reset()));
118
m_defaultsOnCurrentTabButton = m_dialogButtonBox->addButton(tr("Defaults on current tab"), QDialogButtonBox::ResetRole);
119
connect(m_defaultsOnCurrentTabButton, SIGNAL(clicked()), SLOT(resetCurrentTab()));
118
121
m_behaviorLayout = new QFormLayout(m_tabWidget->widget(0));
119
122
m_interfaceLayout = new QFormLayout(m_tabWidget->widget(2));
120
123
m_modifiersLayout = new QFormLayout(m_tabWidget->widget(4));
207
210
s_settings->mainWindow().setNewTabNextToCurrentTab(m_newTabNextToCurrentTabCheckBox->isChecked());
212
s_settings->mainWindow().setRecentlyUsedCount(m_recentlyUsedCountSpinBox->value());
209
214
s_settings->mainWindow().setFileToolBar(m_fileToolBarLineEdit->text().split(",", QString::SkipEmptyParts));
210
215
s_settings->mainWindow().setEditToolBar(m_editToolBarLineEdit->text().split(",", QString::SkipEmptyParts));
211
216
s_settings->mainWindow().setViewToolBar(m_viewToolBarLineEdit->text().split(",", QString::SkipEmptyParts));
228
233
void SettingsDialog::reset()
232
if(m_pdfSettingsWidget != 0)
234
m_pdfSettingsWidget->reset();
241
if(m_psSettingsWidget != 0)
243
m_psSettingsWidget->reset();
248
241
ShortcutHandler::instance()->reset();
252
m_openUrlCheckBox->setChecked(Defaults::DocumentView::openUrl());
254
m_autoRefreshCheckBox->setChecked(Defaults::DocumentView::autoRefresh());
256
m_trackRecentlyUsedCheckBox->setChecked(Defaults::MainWindow::trackRecentlyUsed());
258
m_restoreTabsCheckBox->setChecked(Defaults::MainWindow::restoreTabs());
259
m_restoreBookmarksCheckBox->setChecked(Defaults::MainWindow::restoreBookmarks());
260
m_restorePerFileSettingsCheckBox->setChecked(Defaults::MainWindow::restorePerFileSettings());
262
m_presentationSyncCheckBox->setChecked(Defaults::PresentationView::sync());
263
m_presentationScreenSpinBox->setValue(Defaults::PresentationView::screen());
265
m_highlightColorComboBox->lineEdit()->setText(Defaults::PageItem::highlightColor().name());
266
m_highlightDurationSpinBox->setValue(Defaults::DocumentView::highlightDuration());
267
m_annotationColorComboBox->lineEdit()->setText(Defaults::PageItem::annotationColor().name());
269
m_sourceEditorLineEdit->clear();
273
m_decoratePagesCheckBox->setChecked(Defaults::PageItem::decoratePages());
274
m_decorateLinksCheckBox->setChecked(Defaults::PageItem::decorateLinks());
275
m_decorateFormFieldsCheckBox->setChecked(Defaults::PageItem::decorateFormFields());
277
m_backgroundColorComboBox->lineEdit()->setText(Defaults::PageItem::backgroundColor().name());
278
m_paperColorComboBox->lineEdit()->setText(Defaults::PageItem::paperColor().name());
280
m_pagesPerRowSpinBox->setValue(Defaults::DocumentView::pagesPerRow());
282
m_pageSpacingSpinBox->setValue(Defaults::DocumentView::pageSpacing());
283
m_thumbnailSpacingSpinBox->setValue(Defaults::DocumentView::thumbnailSpacing());
285
m_thumbnailSizeSpinBox->setValue(Defaults::DocumentView::thumbnailSize());
287
m_cacheSizeComboBox->setCurrentIndex(m_cacheSizeComboBox->findData(Defaults::PageItem::cacheSize()));
288
m_prefetchCheckBox->setChecked(Defaults::DocumentView::prefetch());
289
m_prefetchDistanceSpinBox->setValue(Defaults::DocumentView::prefetchDistance());
293
m_tabPositionComboBox->setCurrentIndex(m_tabPositionComboBox->findData(static_cast< uint >(Defaults::MainWindow::tabPosition())));
294
m_tabVisibilityComboBox->setCurrentIndex(m_tabVisibilityComboBox->findData(static_cast< uint >(Defaults::MainWindow::tabVisibility())));
296
m_newTabNextToCurrentTabCheckBox->setChecked(Defaults::MainWindow::newTabNextToCurrentTab());
298
m_fileToolBarLineEdit->setText(Defaults::MainWindow::fileToolBar().join(","));
299
m_editToolBarLineEdit->setText(Defaults::MainWindow::editToolBar().join(","));
300
m_viewToolBarLineEdit->setText(Defaults::MainWindow::viewToolBar().join(","));
302
m_currentPageInWindowTitleCheckBox->setChecked(Defaults::MainWindow::currentPageInWindowTitle());
304
m_highlightCurrentThumbnailCheckBox->setChecked(Defaults::DocumentView::highlightCurrentThumbnail());
305
m_limitThumbnailsToResultsCheckBox->setChecked(Defaults::DocumentView::limitThumbnailsToResults());
309
m_zoomModifiersComboBox->setCurrentIndex(m_zoomModifiersComboBox->findData(static_cast< int >(Defaults::DocumentView::zoomModifiers())));
310
m_rotateModifiersComboBox->setCurrentIndex(m_rotateModifiersComboBox->findData(static_cast< int >(Defaults::DocumentView::rotateModifiers())));
311
m_scrollModifiersComboBox->setCurrentIndex(m_scrollModifiersComboBox->findData(static_cast< int >(Defaults::DocumentView::scrollModifiers())));
313
m_copyToClipboardModifiersComboBox->setCurrentIndex(m_copyToClipboardModifiersComboBox->findData(static_cast< int >(Defaults::PageItem::copyToClipboardModifiers())));
314
m_addAnnotationModifiersComboBox->setCurrentIndex(m_addAnnotationModifiersComboBox->findData(static_cast< int >(Defaults::PageItem::addAnnotationModifiers())));
246
void SettingsDialog::resetCurrentTab()
248
switch(m_tabWidget->currentIndex())
263
ShortcutHandler::instance()->reset();
317
271
void SettingsDialog::createBehaviorTab()
423
377
m_behaviorLayout->addRow(tr("Source editor:"), m_sourceEditorLineEdit);
380
void SettingsDialog::resetBehaviorTab()
382
m_openUrlCheckBox->setChecked(Defaults::DocumentView::openUrl());
384
m_autoRefreshCheckBox->setChecked(Defaults::DocumentView::autoRefresh());
386
m_trackRecentlyUsedCheckBox->setChecked(Defaults::MainWindow::trackRecentlyUsed());
388
m_restoreTabsCheckBox->setChecked(Defaults::MainWindow::restoreTabs());
389
m_restoreBookmarksCheckBox->setChecked(Defaults::MainWindow::restoreBookmarks());
390
m_restorePerFileSettingsCheckBox->setChecked(Defaults::MainWindow::restorePerFileSettings());
392
m_presentationSyncCheckBox->setChecked(Defaults::PresentationView::sync());
393
m_presentationScreenSpinBox->setValue(Defaults::PresentationView::screen());
395
m_highlightColorComboBox->lineEdit()->setText(Defaults::PageItem::highlightColor().name());
396
m_highlightDurationSpinBox->setValue(Defaults::DocumentView::highlightDuration());
397
m_annotationColorComboBox->lineEdit()->setText(Defaults::PageItem::annotationColor().name());
399
m_sourceEditorLineEdit->clear();
426
402
void SettingsDialog::createGraphicsTab()
428
404
// decorate pages
535
511
m_graphicsLayout->addRow(tr("Prefetch distance:"), m_prefetchDistanceSpinBox);
514
void SettingsDialog::resetGraphicsTab()
518
if(m_pdfSettingsWidget != 0)
520
m_pdfSettingsWidget->reset();
527
if(m_psSettingsWidget != 0)
529
m_psSettingsWidget->reset();
534
m_decoratePagesCheckBox->setChecked(Defaults::PageItem::decoratePages());
535
m_decorateLinksCheckBox->setChecked(Defaults::PageItem::decorateLinks());
536
m_decorateFormFieldsCheckBox->setChecked(Defaults::PageItem::decorateFormFields());
538
m_backgroundColorComboBox->lineEdit()->setText(Defaults::PageItem::backgroundColor().name());
539
m_paperColorComboBox->lineEdit()->setText(Defaults::PageItem::paperColor().name());
541
m_pagesPerRowSpinBox->setValue(Defaults::DocumentView::pagesPerRow());
543
m_pageSpacingSpinBox->setValue(Defaults::DocumentView::pageSpacing());
544
m_thumbnailSpacingSpinBox->setValue(Defaults::DocumentView::thumbnailSpacing());
546
m_thumbnailSizeSpinBox->setValue(Defaults::DocumentView::thumbnailSize());
548
m_cacheSizeComboBox->setCurrentIndex(m_cacheSizeComboBox->findData(Defaults::PageItem::cacheSize()));
549
m_prefetchCheckBox->setChecked(Defaults::DocumentView::prefetch());
550
m_prefetchDistanceSpinBox->setValue(Defaults::DocumentView::prefetchDistance());
538
553
void SettingsDialog::createInterfaceTab()
566
581
m_interfaceLayout->addRow(tr("New tab next to current tab:"), m_newTabNextToCurrentTabCheckBox);
583
// recently used count
585
m_recentlyUsedCountSpinBox = new QSpinBox(this);
586
m_recentlyUsedCountSpinBox->setRange(1, 50);
587
m_recentlyUsedCountSpinBox->setValue(s_settings->mainWindow().recentlyUsedCount());
588
m_recentlyUsedCountSpinBox->setToolTip(tr("Effective after restart."));
590
m_interfaceLayout->addRow(tr("Recently used count:"), m_recentlyUsedCountSpinBox);
570
594
m_fileToolBarLineEdit = new QLineEdit(this);
611
635
m_interfaceLayout->addRow(tr("Limit thumbnails to results:"), m_limitThumbnailsToResultsCheckBox);
638
void SettingsDialog::resetInterfaceTab()
640
m_tabPositionComboBox->setCurrentIndex(m_tabPositionComboBox->findData(static_cast< uint >(Defaults::MainWindow::tabPosition())));
641
m_tabVisibilityComboBox->setCurrentIndex(m_tabVisibilityComboBox->findData(static_cast< uint >(Defaults::MainWindow::tabVisibility())));
643
m_newTabNextToCurrentTabCheckBox->setChecked(Defaults::MainWindow::newTabNextToCurrentTab());
645
m_recentlyUsedCountSpinBox->setValue(Defaults::MainWindow::recentlyUsedCount());
647
m_fileToolBarLineEdit->setText(Defaults::MainWindow::fileToolBar().join(","));
648
m_editToolBarLineEdit->setText(Defaults::MainWindow::editToolBar().join(","));
649
m_viewToolBarLineEdit->setText(Defaults::MainWindow::viewToolBar().join(","));
651
m_currentPageInWindowTitleCheckBox->setChecked(Defaults::MainWindow::currentPageInWindowTitle());
653
m_highlightCurrentThumbnailCheckBox->setChecked(Defaults::DocumentView::highlightCurrentThumbnail());
654
m_limitThumbnailsToResultsCheckBox->setChecked(Defaults::DocumentView::limitThumbnailsToResults());
614
657
void SettingsDialog::createModifiersTab()
616
659
// zoom modifiers
644
687
m_modifiersLayout->addRow(tr("Add annotation:"), m_addAnnotationModifiersComboBox);
690
void SettingsDialog::resetModifiersTab()
692
m_zoomModifiersComboBox->setCurrentIndex(m_zoomModifiersComboBox->findData(static_cast< int >(Defaults::DocumentView::zoomModifiers())));
693
m_rotateModifiersComboBox->setCurrentIndex(m_rotateModifiersComboBox->findData(static_cast< int >(Defaults::DocumentView::rotateModifiers())));
694
m_scrollModifiersComboBox->setCurrentIndex(m_scrollModifiersComboBox->findData(static_cast< int >(Defaults::DocumentView::scrollModifiers())));
696
m_copyToClipboardModifiersComboBox->setCurrentIndex(m_copyToClipboardModifiersComboBox->findData(static_cast< int >(Defaults::PageItem::copyToClipboardModifiers())));
697
m_addAnnotationModifiersComboBox->setCurrentIndex(m_addAnnotationModifiersComboBox->findData(static_cast< int >(Defaults::PageItem::addAnnotationModifiers())));
647
700
void SettingsDialog::createModifiersComboBox(QComboBox*& comboBox, const Qt::KeyboardModifiers& modifiers)
649
702
comboBox = new QComboBox(this);