summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-17 21:30:54 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-17 21:30:54 (GMT)
commit16f13c04d20f4981957d4bbd332666e13e275782 (patch)
tree7e2cc5ba2cde39194757549ad7f6ea6a039c6082
parentf59383196de140c87e4158c62c848f03dcf62ee9 (diff)
kdelibs4support--
-rw-r--r--conf/dlgpresentationbase.ui11
-rw-r--r--conf/okular.kcfg2
-rw-r--r--conf/preferencesdialog.cpp2
-rw-r--r--conf/settings.kcfgc2
-rw-r--r--conf/widgetannottools.cpp31
-rw-r--r--conf/widgetannottools.h4
-rw-r--r--shell/main.cpp2
-rw-r--r--shell/okular_main.cpp2
-rw-r--r--shell/shell.cpp4
-rw-r--r--shell/shell.h6
-rw-r--r--tests/mainshelltest.cpp2
-rw-r--r--ui/latexrenderer.cpp7
12 files changed, 46 insertions, 29 deletions
diff --git a/conf/dlgpresentationbase.ui b/conf/dlgpresentationbase.ui
index 31db693..fc22679 100644
--- a/conf/dlgpresentationbase.ui
+++ b/conf/dlgpresentationbase.ui
@@ -41,13 +41,10 @@
</widget>
</item>
<item>
- <widget class="KIntSpinBox" name="kcfg_SlidesAdvanceTime" >
+ <widget class="KPluralHandlingSpinBox" name="kcfg_SlidesAdvanceTime" >
<property name="enabled" >
<bool>false</bool>
</property>
- <property name="suffix" >
- <string> sec.</string>
- </property>
<property name="value" >
<number>5</number>
</property>
@@ -313,9 +310,9 @@
<header>kcolorbutton.h</header>
</customwidget>
<customwidget>
- <class>KIntSpinBox</class>
- <extends>KIntSpinBox</extends>
- <header>knuminput.h</header>
+ <class>KPluralHandlingSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>KPluralHandlingSpinBox</header>
</customwidget>
</customwidgets>
<resources/>
diff --git a/conf/okular.kcfg b/conf/okular.kcfg
index f77b690..55f5cdc 100644
--- a/conf/okular.kcfg
+++ b/conf/okular.kcfg
@@ -37,7 +37,7 @@
<code>
QStringList annotationTools;
// load the default tool list from the 'xml tools definition' file
- QFile infoFile( KStandardDirs::locate("data", "okular/tools.xml") );
+ QFile infoFile( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/tools.xml") );
if ( infoFile.exists() &amp;&amp; infoFile.open( QIODevice::ReadOnly ) )
{
QDomDocument doc;
diff --git a/conf/preferencesdialog.cpp b/conf/preferencesdialog.cpp
index 096bee1..1ddb5e6 100644
--- a/conf/preferencesdialog.cpp
+++ b/conf/preferencesdialog.cpp
@@ -10,7 +10,7 @@
// reimplementing this
#include "preferencesdialog.h"
-#include <klocale.h>
+#include <KLocalizedString>
// single config pages
#include "dlggeneral.h"
diff --git a/conf/settings.kcfgc b/conf/settings.kcfgc
index dfbb441..5d17a9e 100644
--- a/conf/settings.kcfgc
+++ b/conf/settings.kcfgc
@@ -6,5 +6,5 @@ Mutators=true
Singleton=true
Visibility=OKULAR_PART_EXPORT
IncludeFiles=settings_core.h,okular_part_export.h
-SourceIncludeFiles=kstandarddirs.h,qdom.h
+SourceIncludeFiles=qdom.h,QStandardPaths
MemberVariables=dpointer
diff --git a/conf/widgetannottools.cpp b/conf/widgetannottools.cpp
index b6b5912..7934d91 100644
--- a/conf/widgetannottools.cpp
+++ b/conf/widgetannottools.cpp
@@ -28,6 +28,10 @@
#include <QtWidgets/QStackedWidget>
#include <QtXml/QDomDocument>
#include <QtXml/QDomElement>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QVBoxLayout>
#include "core/annotations.h"
#include "ui/annotationwidgets.h"
@@ -254,36 +258,51 @@ void WidgetAnnotTools::slotMoveDown()
}
EditAnnotToolDialog::EditAnnotToolDialog( QWidget *parent, const QDomElement &initialState )
- : KDialog( parent ), m_stubann( 0 ), m_annotationWidget( 0 )
+ : QDialog( parent ), m_stubann( 0 ), m_annotationWidget( 0 )
{
- setButtons( Ok | Cancel );
- setDefaultButton( Ok );
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ okButton->setDefault(true);
QLabel * tmplabel;
QWidget *widget = new QWidget( this );
QGridLayout * widgetLayout = new QGridLayout( widget );
- setMainWidget(widget);
+ mainLayout->addWidget(widget);
+ mainLayout->addWidget(buttonBox);
+
m_name = new KLineEdit( widget );
+ mainLayout->addWidget(m_name);
tmplabel = new QLabel( i18n( "&Name:" ), widget );
+ mainLayout->addWidget(tmplabel);
tmplabel->setBuddy( m_name );
widgetLayout->addWidget( tmplabel, 0, 0, Qt::AlignRight );
widgetLayout->addWidget( m_name, 0, 1 );
m_type = new KComboBox( false, widget );
+ mainLayout->addWidget(m_type);
connect(m_type, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &EditAnnotToolDialog::slotTypeChanged);
tmplabel = new QLabel( i18n( "&Type:" ), widget );
+ mainLayout->addWidget(tmplabel);
tmplabel->setBuddy( m_type );
widgetLayout->addWidget( tmplabel, 1, 0, Qt::AlignRight );
widgetLayout->addWidget( m_type, 1, 1 );
m_toolIcon = new QLabel( widget );
+ mainLayout->addWidget(m_toolIcon);
m_toolIcon->setAlignment( Qt::AlignRight | Qt::AlignTop );
m_toolIcon->setMinimumSize( 40, 32 );
widgetLayout->addWidget( m_toolIcon, 0, 2, 2, 1 );
m_appearanceBox = new QGroupBox( i18n( "Appearance" ), widget );
+ mainLayout->addWidget(m_appearanceBox);
m_appearanceBox->setLayout( new QVBoxLayout( m_appearanceBox ) );
widgetLayout->addWidget( m_appearanceBox, 2, 0, 1, 3 );
@@ -301,11 +320,11 @@ EditAnnotToolDialog::EditAnnotToolDialog( QWidget *parent, const QDomElement &in
if ( initialState.isNull() )
{
- setCaption( i18n("Create annotation tool") );
+ setWindowTitle( i18n("Create annotation tool") );
}
else
{
- setCaption( i18n("Edit annotation tool") );
+ setWindowTitle( i18n("Edit annotation tool") );
loadTool( initialState );
}
diff --git a/conf/widgetannottools.h b/conf/widgetannottools.h
index c1ed276..455b9c2 100644
--- a/conf/widgetannottools.h
+++ b/conf/widgetannottools.h
@@ -10,7 +10,7 @@
#ifndef _WIDGETANNOTTOOLS_H_
#define _WIDGETANNOTTOOLS_H_
-#include <kdialog.h>
+#include <QDialog>
#include <qdom.h>
#include <qwidget.h>
@@ -61,7 +61,7 @@ class WidgetAnnotTools : public QWidget
void slotMoveDown();
};
-class EditAnnotToolDialog : public KDialog
+class EditAnnotToolDialog : public QDialog
{
Q_OBJECT
diff --git a/shell/main.cpp b/shell/main.cpp
index 821b529..6146cb3 100644
--- a/shell/main.cpp
+++ b/shell/main.cpp
@@ -14,7 +14,7 @@
#include "shell.h"
-#include <klocale.h>
+#include <KLocalizedString>
#include <QtDBus/qdbusinterface.h>
#include <QTextStream>
#include <kwindowsystem.h>
diff --git a/shell/okular_main.cpp b/shell/okular_main.cpp
index 72d5bd2..c0fbb15 100644
--- a/shell/okular_main.cpp
+++ b/shell/okular_main.cpp
@@ -16,7 +16,7 @@
#include "shell.h"
#include <QtWidgets/qapplication.h>
-#include <klocale.h>
+#include <KLocalizedString>
#include <QtDBus/qdbusinterface.h>
#include <QTextStream>
#include <kwindowsystem.h>
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 422b517..f813a29 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -37,7 +37,7 @@
#include <KToggleFullScreenAction>
#include <KActionCollection>
#include <KWindowSystem>
-#include <KTabWidget>
+#include <QTabWidget>
#include <KXMLGUIFactory>
#include <QDragMoveEvent>
#include <QTabBar>
@@ -89,7 +89,7 @@ Shell::Shell( const QString &serializedOptions )
if (firstPart)
{
// Setup tab bar
- m_tabWidget = new KTabWidget( this );
+ m_tabWidget = new QTabWidget( this );
m_tabWidget->setTabsClosable( true );
m_tabWidget->setElideMode( Qt::ElideRight );
m_tabWidget->tabBar()->hide();
diff --git a/shell/shell.h b/shell/shell.h
index b0fa7d7..bc1a35d 100644
--- a/shell/shell.h
+++ b/shell/shell.h
@@ -20,13 +20,13 @@
#include <kparts/readwritepart.h>
#include <QMimeType>
#include <QMimeDatabase>
-#include <kaction.h>
+#include <qaction.h>
#include <QtDBus/QtDBus>
class KRecentFilesAction;
class KToggleAction;
-class KTabWidget;
+class QTabWidget;
class KPluginFactory;
class KDocumentViewer;
@@ -144,7 +144,7 @@ private:
KToggleAction* m_showMenuBarAction;
bool m_menuBarWasShown, m_toolBarWasShown;
bool m_unique;
- KTabWidget* m_tabWidget;
+ QTabWidget* m_tabWidget;
KToggleAction* m_openInTab;
struct TabState
diff --git a/tests/mainshelltest.cpp b/tests/mainshelltest.cpp
index 2a9ee8d..19a09f2 100644
--- a/tests/mainshelltest.cpp
+++ b/tests/mainshelltest.cpp
@@ -58,7 +58,7 @@ class MainShellTest : public QObject, public Okular::PartTest
Q_OBJECT
public:
- static KTabWidget* tabWidget(Shell *s)
+ static QTabWidget* tabWidget(Shell *s)
{
return s->m_tabWidget;
}
diff --git a/ui/latexrenderer.cpp b/ui/latexrenderer.cpp
index 0b25ccf..468fa95 100644
--- a/ui/latexrenderer.cpp
+++ b/ui/latexrenderer.cpp
@@ -13,7 +13,7 @@
#include "latexrenderer.h"
#include <QtCore/QDebug>
-#include <kstandarddirs.h>
+
#include <kprocess.h>
#include <QColor>
@@ -22,6 +22,7 @@
#include <QImage>
#include <qtemporaryfile.h>
#include <QTextStream>
+#include <QStandardPaths>
#include "debug_ui.h"
@@ -139,7 +140,7 @@ LatexRenderer::Error LatexRenderer::handleLatex( QString& fileName, const QStrin
\\end{document}";
tempFile->close();
- QString latexExecutable = KStandardDirs::findExe("latex");
+ QString latexExecutable = QStandardPaths::findExecutable("latex");
if (latexExecutable.isEmpty())
{
qCDebug(OkularUiDebug) << "Could not find latex!";
@@ -163,7 +164,7 @@ LatexRenderer::Error LatexRenderer::handleLatex( QString& fileName, const QStrin
return LatexFailed;
}
- QString dvipngExecutable = KStandardDirs::findExe("dvipng");
+ QString dvipngExecutable = QStandardPaths::findExecutable("dvipng");
if (dvipngExecutable.isEmpty())
{
qCDebug(OkularUiDebug) << "Could not find dvipng!";