Add an action to toggle Change Colors

This has the exact same behaviour of clicking the toolbox Settigs > Configure Okular > Accessibility > Change colors and then clicking Ok, therefore changing the saved configs.

BUGS: 173264
FIXED-IN: 4.12.0
This commit is contained in:
Ciro Santilli 2013-10-26 11:40:41 +02:00 committed by Albert Astals Cid
parent e95b1db23c
commit afc74e76ef
2 changed files with 12 additions and 0 deletions

View file

@ -533,6 +533,10 @@ do { \
mz->setShortcut( Qt::CTRL + Qt::Key_2 );
mz->setActionGroup( d->mouseModeActionGroup );
mz->setChecked( Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::Zoom );
KAction * aToogleChangeColors = new KAction(i18n("&Toogle Change Colors"), this);
ac->addAction("toogle_change_colors", aToogleChangeColors );
connect( aToogleChangeColors, SIGNAL(triggered()), this, SLOT(slotToogleChangeColors()) );
}
// WARNING: 'setupViewerActions' must have been called before this method
@ -4881,6 +4885,13 @@ void PageView::slotProcessRenditionAction( const Okular::RenditionAction *action
};
}
void PageView::slotToogleChangeColors()
{
Okular::SettingsCore::setChangeColors( !Okular::SettingsCore::changeColors() );
Okular::Settings::self()->writeConfig();
viewport()->update();
}
//END private SLOTS
#include "pageview.moc"

View file

@ -262,6 +262,7 @@ Q_OBJECT
void slotAnnotationWindowDestroyed( QObject *window );
void slotProcessMovieAction( const Okular::MovieAction *action );
void slotProcessRenditionAction( const Okular::RenditionAction *action );
void slotToogleChangeColors();
};
#endif