Port UI: dialog buttons and friends

frameworks
Frederik Gladhorn 12 years ago
parent b32d815301
commit fc73cbf886
  1. 15
      ui/annotationpropertiesdialog.cpp
  2. 4
      ui/pagepainter.cpp
  3. 12
      ui/pageview.cpp
  4. 4
      ui/presentationwidget.cpp
  5. 12
      ui/propertiesdialog.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"

@ -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

@ -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);

@ -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
{

@ -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);

Loading…
Cancel
Save