summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-10 12:08:47 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-10 12:08:47 (GMT)
commitfc73cbf8869e60a1089a01f4bd0717d523fc74f9 (patch)
treebf499cfe85afeeca330d59d1b5796ba9c97bd1c3
parentb32d8153013ab7b744e00ef999957621bf85554a (diff)
Port UI: dialog buttons and friends
-rw-r--r--ui/annotationpropertiesdialog.cpp15
-rw-r--r--ui/pagepainter.cpp4
-rw-r--r--ui/pageview.cpp12
-rw-r--r--ui/presentationwidget.cpp4
-rw-r--r--ui/propertiesdialog.cpp12
5 files changed, 27 insertions, 20 deletions
diff --git a/ui/annotationpropertiesdialog.cpp b/ui/annotationpropertiesdialog.cpp
index 31c29ee..5bf3d0d 100644
--- a/ui/annotationpropertiesdialog.cpp
+++ b/ui/annotationpropertiesdialog.cpp
@@ -14,6 +14,7 @@
#include <qlayout.h>
#include <qlabel.h>
#include <qheaderview.h>
+#include <QtWidgets/qpushbutton.h>
#include <qtextedit.h>
#include <kicon.h>
#include <klineedit.h>
@@ -36,15 +37,15 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen
setCaptionTextbyAnnotType();
if ( canEditAnnotations )
{
- setButtons( Ok | Apply | Cancel );
- enableButton( Apply, false );
+ setStandardButtons( QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel );
+ button( QDialogButtonBox::Apply )->setEnabled( false );
connect( this, SIGNAL(applyClicked()), this, SLOT(slotapply()) );
connect( this, SIGNAL(okClicked()), this, SLOT(slotapply()) );
}
else
{
- setButtons( Close );
- setDefaultButton( Close );
+ setStandardButtons( QDialogButtonBox::Close );
+ button( QDialogButtonBox::Close )->setDefault( true );
}
m_annotWidget = AnnotationWidgetFactory::widgetFor( ann );
@@ -153,13 +154,13 @@ void AnnotsPropertiesDialog::setCaptionTextbyAnnotType()
captiontext = i18n( "Annotation Properties" );
break;
}
- setCaption( captiontext );
+ setWindowTitle( captiontext );
}
void AnnotsPropertiesDialog::setModified()
{
modified = true;
- enableButton( Apply, true );
+ button( QDialogButtonBox::Apply )->setEnabled( true );
}
void AnnotsPropertiesDialog::slotapply()
@@ -178,7 +179,7 @@ void AnnotsPropertiesDialog::slotapply()
m_modifyDateLabel->setText( i18n( "Modified: %1", KGlobal::locale()->formatDateTime( m_annot->modificationDate(), KLocale::LongDate, true ) ) );
modified = false;
- enableButton( Apply, false );
+ button( QDialogButtonBox::Apply )->setEnabled( false );
}
#include "moc_annotationpropertiesdialog.cpp"
diff --git a/ui/pagepainter.cpp b/ui/pagepainter.cpp
index 55a56c3..9273420 100644
--- a/ui/pagepainter.cpp
+++ b/ui/pagepainter.cpp
@@ -36,7 +36,9 @@
#include "settings_core.h"
#include "core/document_p.h"
-K_GLOBAL_STATIC_WITH_ARGS( QPixmap, busyPixmap, ( KIconLoader::global()->loadIcon("okular", KIconLoader::NoGroup, 32, KIconLoader::DefaultState, QStringList(), 0, true) ) )
+#pragma message("KF5: enable busyPixmap again")
+QPixmap *busyPixmap = new QPixmap();
+//K_GLOBAL_STATIC_WITH_ARGS( QPixmap, busyPixmap, ( KIconLoader::global()->loadIcon("okular", KIconLoader::NoGroup, 32, KIconLoader::DefaultState, QStringList(), 0, true) ) )
#define TEXTANNOTATION_ICONSIZE 24
diff --git a/ui/pageview.cpp b/ui/pageview.cpp
index 34aa1de..214d581 100644
--- a/ui/pageview.cpp
+++ b/ui/pageview.cpp
@@ -200,8 +200,8 @@ public:
KAction * aMouseMagnifier;
KToggleAction * aToggleAnnotator;
KSelectAction * aZoom;
- KAction * aZoomIn;
- KAction * aZoomOut;
+ QAction * aZoomIn;
+ QAction * aZoomOut;
KToggleAction * aZoomFitWidth;
KToggleAction * aZoomFitPage;
KToggleAction * aZoomAutoFit;
@@ -554,8 +554,8 @@ void PageView::setupActions( KActionCollection * ac )
{
d->actionCollection = ac;
- d->aZoomIn->setShortcut( KStandardShortcut::zoomIn() );
- d->aZoomOut->setShortcut( KStandardShortcut::zoomOut() );
+ d->aZoomIn->setShortcut( QKeySequence(QKeySequence::ZoomIn) );
+ d->aZoomOut->setShortcut( QKeySequence(QKeySequence::ZoomOut) );
// Mouse-Mode actions
d->aMouseSelect = new KAction(KIcon( "select-rectangular" ), i18n("&Selection Tool"), this);
@@ -654,8 +654,8 @@ void PageView::setupActions( KActionCollection * ac )
toggleFormWidgets( false );
// Setup undo and redo actions
- KAction *kundo = KStandardAction::create( KStandardAction::Undo, d->document, SLOT(undo()), ac );
- KAction *kredo = KStandardAction::create( KStandardAction::Redo, d->document, SLOT(redo()), ac );
+ QAction *kundo = KStandardAction::create( KStandardAction::Undo, d->document, SLOT(undo()), ac );
+ QAction *kredo = KStandardAction::create( KStandardAction::Redo, d->document, SLOT(redo()), ac );
connect(d->document, SIGNAL(canUndoChanged(bool)), kundo, SLOT(setEnabled(bool)));
connect(d->document, SIGNAL(canRedoChanged(bool)), kredo, SLOT(setEnabled(bool)));
kundo->setEnabled(false);
diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp
index e82869d..2824724 100644
--- a/ui/presentationwidget.cpp
+++ b/ui/presentationwidget.cpp
@@ -39,6 +39,7 @@
#include <kmessagebox.h>
#include <kselectaction.h>
#include <kshortcut.h>
+#include <kurl.h>
#include <kdialog.h>
#include <Solid/PowerManagement>
@@ -1454,7 +1455,8 @@ void PresentationWidget::togglePencilMode( bool on )
annElem.setAttribute( "color", colorstring );
annElem.setAttribute( "width", "2" );
m_drawingEngine = new SmoothPathEngine( root );
- setCursor( KCursor( "pencil", Qt::ArrowCursor ) );
+#pragma message("KF5 fix cursor")
+ // setCursor( QCursor( "pencil", Qt::ArrowCursor ) );
}
else
{
diff --git a/ui/propertiesdialog.cpp b/ui/propertiesdialog.cpp
index 46c2e24..5aed457 100644
--- a/ui/propertiesdialog.cpp
+++ b/ui/propertiesdialog.cpp
@@ -23,6 +23,7 @@
#include <qtimer.h>
#include <kfiledialog.h>
#include <kicon.h>
+#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <ksqueezedtextlabel.h>
@@ -42,8 +43,8 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc)
m_fontScanStarted( false )
{
setFaceType( Tabbed );
- setCaption( i18n( "Unknown File" ) );
- setButtons( Ok );
+ setWindowTitle( i18n( "Unknown File" ) );
+ setStandardButtons( QDialogButtonBox::Ok );
// PROPERTIES
QFrame *page = new QFrame();
@@ -62,7 +63,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc)
// mime name based on mimetype id
QString mimeName = info->get( "mimeType" ).section( '/', -1 ).toUpper();
- setCaption( i18n( "%1 Properties", mimeName ) );
+ setWindowTitle( i18n( "%1 Properties", mimeName ) );
QDomElement docElement = info->documentElement();
@@ -148,8 +149,9 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc)
m_fontPage = addPage(page2, i18n("&Fonts"));
m_fontPage->setIcon( KIcon( "preferences-desktop-font" ) );
page2Layout = new QVBoxLayout(page2);
- page2Layout->setMargin(marginHint());
- page2Layout->setSpacing(spacingHint());
+#pragma message("KF5 fix margin/spacing")
+// page2Layout->setMargin(marginHint());
+// page2Layout->setSpacing(spacingHint());
// add a tree view
QTreeView *view = new QTreeView(page2);
view->setContextMenuPolicy(Qt::CustomContextMenu);