Commit 54dd173c authored by Simone Gaiarin's avatar Simone Gaiarin
Browse files

Use combobox to select default annotation toolbar style

parent 8ca2498d
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<signal name="colorModesChanged2" > <signal name="colorModesChanged2" >
<label>Same as colorModesChanged(), but kconfig_compiler does not allow to inherit signals, so appending a '2'.</label> <label>Same as colorModesChanged(), but kconfig_compiler does not allow to inherit signals, so appending a '2'.</label>
</signal> </signal>
<signal name="legacyAnnotationToolBarChanged" /> <signal name="defaultAnnotationToolBarChanged" />
<group name="Dlg Performance" > <group name="Dlg Performance" >
<entry key="EnableCompositing" type="Bool" > <entry key="EnableCompositing" type="Bool" >
<default>true</default> <default>true</default>
...@@ -322,9 +322,13 @@ ...@@ -322,9 +322,13 @@
<default>true</default> <default>true</default>
<emit signal="viewContinuousChanged" /> <emit signal="viewContinuousChanged" />
</entry> </entry>
<entry key="LegacyAnnotationToolBar" type="Bool" > <entry key="DefaultAnnotationToolBar" type="Enum" >
<default>false</default> <default>AnnotationToolBar</default>
<emit signal="legacyAnnotationToolBarChanged" /> <choices>
<choice name="AnnotationToolBar" />
<choice name="QuickAnnotationToolBar" />
</choices>
<emit signal="defaultAnnotationToolBarChanged" />
</entry> </entry>
<entry key="ViewMode" type="Enum" > <entry key="ViewMode" type="Enum" >
<default>Single</default> <default>Single</default>
......
...@@ -769,7 +769,7 @@ AnnotationActionHandler::AnnotationActionHandler(PageViewAnnotator *parent, KAct ...@@ -769,7 +769,7 @@ AnnotationActionHandler::AnnotationActionHandler(PageViewAnnotator *parent, KAct
ac->setDefaultShortcut(d->aAddToQuickTools, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B)); ac->setDefaultShortcut(d->aAddToQuickTools, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B));
d->updateConfigActions(); d->updateConfigActions();
connect(Okular::Settings::self(), &Okular::Settings::legacyAnnotationToolBarChanged, this, &AnnotationActionHandler::setupAnnotationToolBarVisibilityAction); connect(Okular::Settings::self(), &Okular::Settings::defaultAnnotationToolBarChanged, this, &AnnotationActionHandler::setupAnnotationToolBarVisibilityAction);
} }
AnnotationActionHandler::~AnnotationActionHandler() AnnotationActionHandler::~AnnotationActionHandler()
...@@ -798,7 +798,7 @@ void AnnotationActionHandler::setupAnnotationToolBarVisibilityAction() ...@@ -798,7 +798,7 @@ void AnnotationActionHandler::setupAnnotationToolBarVisibilityAction()
connect(d->aHideToolBar, &QAction::triggered, annotationToolBar, &KToolBar::hide, Qt::UniqueConnection); connect(d->aHideToolBar, &QAction::triggered, annotationToolBar, &KToolBar::hide, Qt::UniqueConnection);
KToolBar *defaultAnnotationToolBar = annotationToolBar; KToolBar *defaultAnnotationToolBar = annotationToolBar;
if (Okular::Settings::legacyAnnotationToolBar()) { if (Okular::Settings::defaultAnnotationToolBar() == Okular::Settings::EnumDefaultAnnotationToolBar::QuickAnnotationToolBar) {
defaultAnnotationToolBar = mw->toolBar(QStringLiteral("quickAnnotationToolBar")); defaultAnnotationToolBar = mw->toolBar(QStringLiteral("quickAnnotationToolBar"));
} }
d->aToolBarVisibility->setChecked(false); d->aToolBarVisibility->setChecked(false);
......
...@@ -91,6 +91,15 @@ DlgGeneral::DlgGeneral(QWidget *parent, Okular::EmbedMode embedMode) ...@@ -91,6 +91,15 @@ DlgGeneral::DlgGeneral(QWidget *parent, Okular::EmbedMode embedMode)
useCustomColor->setChecked(false); useCustomColor->setChecked(false);
customColor->setEnabled(false); customColor->setEnabled(false);
connect(useCustomColor, &QCheckBox::toggled, customColor, &QWidget::setEnabled); connect(useCustomColor, &QCheckBox::toggled, customColor, &QWidget::setEnabled);
if (embedMode != Okular::ViewerWidgetMode) {
// Combobox: default annotation toolbar associated to annotation action in tool menu
QComboBox *defaultAnnotationToolBar = new QComboBox(this);
defaultAnnotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Annotation Toobar"));
defaultAnnotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Quick Annotation Toolbar"));
defaultAnnotationToolBar->setObjectName(QStringLiteral("kcfg_DefaultAnnotationToolBar"));
layout->addRow(i18nc("label:listbox Config dialog, general page", "Default annotation toolbar:"), defaultAnnotationToolBar);
}
// END Appearance section // END Appearance section
layout->addRow(new QLabel(this)); layout->addRow(new QLabel(this));
...@@ -165,11 +174,6 @@ DlgGeneral::DlgGeneral(QWidget *parent, Okular::EmbedMode embedMode) ...@@ -165,11 +174,6 @@ DlgGeneral::DlgGeneral(QWidget *parent, Okular::EmbedMode embedMode)
openInContinuousModeByDefault->setText(i18nc("@option:check Config dialog, general page", "Open in continuous mode by default")); openInContinuousModeByDefault->setText(i18nc("@option:check Config dialog, general page", "Open in continuous mode by default"));
openInContinuousModeByDefault->setObjectName(QStringLiteral("kcfg_ViewContinuous")); openInContinuousModeByDefault->setObjectName(QStringLiteral("kcfg_ViewContinuous"));
layout->addRow(programFeaturesLabel(), openInContinuousModeByDefault); layout->addRow(programFeaturesLabel(), openInContinuousModeByDefault);
QCheckBox *useLegacyAnnotationToolBar = new QCheckBox(this);
useLegacyAnnotationToolBar->setText(i18nc("@option:check Config dialog, general page", "Use legacy annotation toolbar"));
useLegacyAnnotationToolBar->setObjectName(QStringLiteral("kcfg_LegacyAnnotationToolBar"));
layout->addRow(programFeaturesLabel(), useLegacyAnnotationToolBar);
// END Program features section // END Program features section
// If no Program features section, don’t add a second spacer: // If no Program features section, don’t add a second spacer:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment