|
|
|
|
@ -244,6 +244,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() |
|
|
|
|
QVERIFY(part); |
|
|
|
|
|
|
|
|
|
KActionCollection *ac = part->actionCollection(); |
|
|
|
|
QAction *aQuickTools = ac->action(QStringLiteral("annotation_favorites")); |
|
|
|
|
QAction *aHighlighter = ac->action(QStringLiteral("annotation_highlighter")); |
|
|
|
|
QAction *aUnderline = ac->action(QStringLiteral("annotation_underline")); |
|
|
|
|
QAction *aSquiggle = ac->action(QStringLiteral("annotation_squiggle")); |
|
|
|
|
@ -255,6 +256,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() |
|
|
|
|
QAction *aGeomShapes = ac->action(QStringLiteral("annotation_geometrical_shape")); |
|
|
|
|
QAction *aStamp = ac->action(QStringLiteral("annotation_stamp")); |
|
|
|
|
|
|
|
|
|
QFETCH(bool, aQuickToolsEnabled); |
|
|
|
|
QFETCH(bool, aHighlighterEnabled); |
|
|
|
|
QFETCH(bool, aUnderlineEnabled); |
|
|
|
|
QFETCH(bool, aSquiggleEnabled); |
|
|
|
|
@ -266,6 +268,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() |
|
|
|
|
QFETCH(bool, aGeomShapesEnabled); |
|
|
|
|
QFETCH(bool, aStampEnabled); |
|
|
|
|
|
|
|
|
|
QCOMPARE(aQuickTools->isEnabled(), aQuickToolsEnabled); |
|
|
|
|
QCOMPARE(aHighlighter->isEnabled(), aHighlighterEnabled); |
|
|
|
|
QCOMPARE(aUnderline->isEnabled(), aUnderlineEnabled); |
|
|
|
|
QCOMPARE(aSquiggle->isEnabled(), aSquiggleEnabled); |
|
|
|
|
@ -281,6 +284,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() |
|
|
|
|
void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState_data() |
|
|
|
|
{ |
|
|
|
|
QTest::addColumn<QString>("document"); |
|
|
|
|
QTest::addColumn<bool>("aQuickToolsEnabled"); |
|
|
|
|
QTest::addColumn<bool>("aHighlighterEnabled"); |
|
|
|
|
QTest::addColumn<bool>("aUnderlineEnabled"); |
|
|
|
|
QTest::addColumn<bool>("aSquiggleEnabled"); |
|
|
|
|
@ -292,9 +296,9 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState_data() |
|
|
|
|
QTest::addColumn<bool>("aGeomShapesEnabled"); |
|
|
|
|
QTest::addColumn<bool>("aStampEnabled"); |
|
|
|
|
|
|
|
|
|
QTest::addRow("pdf") << QStringLiteral(KDESRCDIR "data/file1.pdf") << true << true << true << true << true << true << true << true << true << true; |
|
|
|
|
QTest::addRow("protected-pdf") << QStringLiteral(KDESRCDIR "data/protected.pdf") << false << false << false << false << false << false << false << false << false << false; |
|
|
|
|
QTest::addRow("image") << QStringLiteral(KDESRCDIR "data/potato.jpg") << false << false << false << false << true << true << true << true << true << true; |
|
|
|
|
QTest::addRow("pdf") << QStringLiteral(KDESRCDIR "data/file1.pdf") << true << true << true << true << true << true << true << true << true << true << true; |
|
|
|
|
QTest::addRow("protected-pdf") << QStringLiteral(KDESRCDIR "data/protected.pdf") << false << false << false << false << false << false << false << false << false << false << false; |
|
|
|
|
QTest::addRow("image") << QStringLiteral(KDESRCDIR "data/potato.jpg") << true << false << false << false << false << true << true << true << true << true << true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AnnotationToolBarTest::testAnnotationToolBarConfigActionsEnabledState() |
|
|
|
|
|