Commit 60645dfd authored by Simone Gaiarin's avatar Simone Gaiarin
Browse files

Rename kcfg setting to primaryAnnotationToolBar

parent f57e12e2
Pipeline #74719 passed with stage
in 9 minutes and 40 seconds
......@@ -11,7 +11,7 @@
<signal name="colorModesChanged2" >
<label>Same as colorModesChanged(), but kconfig_compiler does not allow to inherit signals, so appending a '2'.</label>
</signal>
<signal name="defaultAnnotationToolBarChanged" />
<signal name="primaryAnnotationToolBarChanged" />
<group name="Dlg Performance" >
<entry key="EnableCompositing" type="Bool" >
<default>true</default>
......@@ -322,13 +322,13 @@
<default>true</default>
<emit signal="viewContinuousChanged" />
</entry>
<entry key="DefaultAnnotationToolBar" type="Enum" >
<default>AnnotationToolBar</default>
<entry key="PrimaryAnnotationToolBar" type="Enum" >
<default>FullAnnotationToolBar</default>
<choices>
<choice name="AnnotationToolBar" />
<choice name="FullAnnotationToolBar" />
<choice name="QuickAnnotationToolBar" />
</choices>
<emit signal="defaultAnnotationToolBarChanged" />
<emit signal="primaryAnnotationToolBarChanged" />
</entry>
<entry key="ViewMode" type="Enum" >
<default>Single</default>
......
......@@ -769,7 +769,7 @@ AnnotationActionHandler::AnnotationActionHandler(PageViewAnnotator *parent, KAct
ac->setDefaultShortcut(d->aAddToQuickTools, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B));
d->updateConfigActions();
connect(Okular::Settings::self(), &Okular::Settings::defaultAnnotationToolBarChanged, this, &AnnotationActionHandler::setupAnnotationToolBarVisibilityAction);
connect(Okular::Settings::self(), &Okular::Settings::primaryAnnotationToolBarChanged, this, &AnnotationActionHandler::setupAnnotationToolBarVisibilityAction);
}
AnnotationActionHandler::~AnnotationActionHandler()
......@@ -797,16 +797,16 @@ void AnnotationActionHandler::setupAnnotationToolBarVisibilityAction()
// hide action
connect(d->aHideToolBar, &QAction::triggered, annotationToolBar, &KToolBar::hide, Qt::UniqueConnection);
KToolBar *defaultAnnotationToolBar = annotationToolBar;
if (Okular::Settings::defaultAnnotationToolBar() == Okular::Settings::EnumDefaultAnnotationToolBar::QuickAnnotationToolBar) {
defaultAnnotationToolBar = mw->toolBar(QStringLiteral("quickAnnotationToolBar"));
KToolBar *primaryAnnotationToolBar = annotationToolBar;
if (Okular::Settings::primaryAnnotationToolBar() == Okular::Settings::EnumPrimaryAnnotationToolBar::QuickAnnotationToolBar) {
primaryAnnotationToolBar = mw->toolBar(QStringLiteral("quickAnnotationToolBar"));
}
d->aToolBarVisibility->setChecked(false);
d->aToolBarVisibility->disconnect();
d->aToolBarVisibility->setChecked(defaultAnnotationToolBar->isVisible());
connect(defaultAnnotationToolBar, &QToolBar::visibilityChanged, d->aToolBarVisibility, &QAction::setChecked, Qt::UniqueConnection);
connect(d->aToolBarVisibility, &QAction::toggled, defaultAnnotationToolBar, &KToolBar::setVisible, Qt::UniqueConnection);
d->aShowToolBar->setEnabled(!defaultAnnotationToolBar->isVisible());
d->aToolBarVisibility->setChecked(primaryAnnotationToolBar->isVisible());
connect(primaryAnnotationToolBar, &QToolBar::visibilityChanged, d->aToolBarVisibility, &QAction::setChecked, Qt::UniqueConnection);
connect(d->aToolBarVisibility, &QAction::toggled, primaryAnnotationToolBar, &KToolBar::setVisible, Qt::UniqueConnection);
d->aShowToolBar->setEnabled(!primaryAnnotationToolBar->isVisible());
}
void AnnotationActionHandler::reparseBuiltinToolsConfig()
......
......@@ -20,12 +20,13 @@ DlgAnnotations::DlgAnnotations(QWidget *parent)
{
QFormLayout *layout = new QFormLayout(this);
// Combobox: default annotation toolbar associated to annotation action in tool menu
QComboBox *annotationToolBar = new QComboBox(this);
annotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Full Annotation Toobar"));
annotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Quick Annotation Toolbar"));
annotationToolBar->setObjectName(QStringLiteral("kcfg_AnnotationToolBar"));
layout->addRow(i18nc("label:listbox Config dialog, general page", "Annotation toolbar:"), annotationToolBar);
// BEGIN Annotation toolbar: Combo box to set the annotation toolbar associated to annotation action in tool menu
QComboBox *primaryAnnotationToolBar = new QComboBox(this);
primaryAnnotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Full Annotation Toobar"));
primaryAnnotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Quick Annotation Toolbar"));
primaryAnnotationToolBar->setObjectName(QStringLiteral("kcfg_PrimaryAnnotationToolBar"));
layout->addRow(i18nc("label:listbox Config dialog, general page", "Annotation toolbar:"), primaryAnnotationToolBar);
// END Annotation toolbar
// BEGIN Author row: Line edit to set the annotation’s default author value.
QLineEdit *authorLineEdit = new QLineEdit(this);
......
Markdown is supported
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