mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-02 14:14:10 +00:00
Select current format on the configure backend dialog
Subscribers: sander, okular-devel Tags: #okular Differential Revision: https://phabricator.kde.org/D14820
This commit is contained in:
parent
e44ff38706
commit
a482c56ba2
|
@ -4457,6 +4457,11 @@ void Document::fillConfigDialog( KConfigDialog * dialog )
|
|||
if ( !dialog )
|
||||
return;
|
||||
|
||||
// We know it's a BackendConfigDialog, but check anyway
|
||||
BackendConfigDialog *bcd = dynamic_cast<BackendConfigDialog*>( dialog );
|
||||
if ( !bcd )
|
||||
return;
|
||||
|
||||
// ensure that we have all the generators with settings loaded
|
||||
QVector<KPluginMetaData> offers = DocumentPrivate::configurableGenerators();
|
||||
d->loadServiceList( offers );
|
||||
|
@ -4482,6 +4487,13 @@ void Document::fillConfigDialog( KConfigDialog * dialog )
|
|||
{
|
||||
iface->addPages( dialog );
|
||||
pagesAdded = true;
|
||||
|
||||
if ( sit.value().generator == d->m_generator )
|
||||
{
|
||||
const int rowCount = bcd->thePageWidget()->model()->rowCount();
|
||||
KPageView *view = bcd->thePageWidget();
|
||||
view->setCurrentPage( view->model()->index( rowCount - 1, 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( pagesAdded )
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <QMutex>
|
||||
#include <QPointer>
|
||||
#include <QUrl>
|
||||
#include <KConfigDialog>
|
||||
#include <KPluginMetaData>
|
||||
|
||||
// local includes
|
||||
|
@ -64,6 +65,20 @@ struct GeneratorInfo
|
|||
|
||||
namespace Okular {
|
||||
|
||||
class BackendConfigDialog : public KConfigDialog
|
||||
{
|
||||
public:
|
||||
BackendConfigDialog(QWidget *parent, const QString &name, KCoreConfigSkeleton *config)
|
||||
: KConfigDialog(parent, name, config)
|
||||
{
|
||||
}
|
||||
|
||||
KPageWidget *thePageWidget()
|
||||
{
|
||||
return pageWidget();
|
||||
}
|
||||
};
|
||||
|
||||
class FontExtractionThread;
|
||||
|
||||
struct DoContinueDirectionMatchSearchStruct
|
||||
|
|
3
part.cpp
3
part.cpp
|
@ -112,6 +112,7 @@
|
|||
#include "core/annotations.h"
|
||||
#include "core/bookmarkmanager.h"
|
||||
#include "core/document.h"
|
||||
#include "core/document_p.h"
|
||||
#include "core/generator.h"
|
||||
#include "core/page.h"
|
||||
#include "core/fileprinter.h"
|
||||
|
@ -1166,7 +1167,7 @@ void Part::setWindowTitleFromDocument()
|
|||
KConfigDialog * Part::slotGeneratorPreferences( )
|
||||
{
|
||||
// Create dialog
|
||||
KConfigDialog * dialog = new KConfigDialog( m_pageView, QStringLiteral("generator_prefs"), Okular::Settings::self() );
|
||||
KConfigDialog * dialog = new Okular::BackendConfigDialog( m_pageView, QStringLiteral("generator_prefs"), Okular::Settings::self() );
|
||||
dialog->setAttribute( Qt::WA_DeleteOnClose );
|
||||
|
||||
if( m_embedMode == ViewerWidgetMode )
|
||||
|
|
Loading…
Reference in a new issue