compile
[kdegraphics.git] / okular / ui / annotationwidgets.cpp
blob7cc030224141b1e0312430806f789bf1288f7ec6
1 /***************************************************************************
2 * Copyright (C) 2006 by Pino Toscano <pino@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #include "annotationwidgets.h"
12 // qt/kde includes
13 #include <qcheckbox.h>
14 #include <qgroupbox.h>
15 #include <qlabel.h>
16 #include <qlayout.h>
17 #include <qspinbox.h>
18 #include <qvariant.h>
19 #include <kcolorbutton.h>
20 #include <kcombobox.h>
21 #include <kfontrequester.h>
22 #include <kicon.h>
23 #include <kiconloader.h>
24 #include <klocale.h>
25 #include <kdebug.h>
27 #include "core/document.h"
28 #include "guiutils.h"
30 #define FILEATTACH_ICONSIZE 48
32 PixmapPreviewSelector::PixmapPreviewSelector( QWidget * parent )
33 : QWidget( parent )
35 QHBoxLayout * mainlay = new QHBoxLayout( this );
36 mainlay->setMargin( 0 );
37 m_comboItems = new KComboBox( this );
38 mainlay->addWidget( m_comboItems );
39 m_iconLabel = new QLabel( this );
40 mainlay->addWidget( m_iconLabel );
41 m_iconLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
42 m_iconLabel->setAlignment( Qt::AlignCenter );
43 m_iconLabel->setFrameStyle( QFrame::StyledPanel );
44 setPreviewSize( 32 );
46 connect( m_comboItems, SIGNAL( currentIndexChanged( const QString& ) ), this, SLOT( iconComboChanged( const QString& ) ) );
47 connect( m_comboItems, SIGNAL( editTextChanged( const QString& ) ), this, SLOT( iconComboChanged( const QString& ) ) );
50 PixmapPreviewSelector::~PixmapPreviewSelector()
54 void PixmapPreviewSelector::setIcon( const QString& icon )
56 int id = m_comboItems->findData( QVariant( icon ), Qt::UserRole, Qt::MatchFixedString );
57 if ( id == -1 )
58 id = m_comboItems->findText( icon, Qt::MatchFixedString );
59 if ( id > -1 )
61 m_comboItems->setCurrentIndex( id );
63 else if ( m_comboItems->isEditable() )
65 m_comboItems->addItem( icon, QVariant( icon ) );
66 m_comboItems->setCurrentIndex( m_comboItems->findText( icon, Qt::MatchFixedString ) );
70 QString PixmapPreviewSelector::icon() const
72 return m_icon;
75 void PixmapPreviewSelector::addItem( const QString& item, const QString& id )
77 m_comboItems->addItem( item, QVariant( id ) );
78 setIcon( m_icon );
81 void PixmapPreviewSelector::setPreviewSize( int size )
83 m_previewSize = size;
84 m_iconLabel->setFixedSize( m_previewSize + 8, m_previewSize + 8 );
85 iconComboChanged( m_icon );
88 int PixmapPreviewSelector::previewSize() const
90 return m_previewSize;
93 void PixmapPreviewSelector::setEditable( bool editable )
95 m_comboItems->setEditable( editable );
98 void PixmapPreviewSelector::iconComboChanged( const QString& icon )
100 int id = m_comboItems->findText( icon, Qt::MatchFixedString );
101 if ( id >= 0 )
103 m_icon = m_comboItems->itemData( id ).toString();
105 else
107 m_icon = icon;
110 QPixmap pixmap = GuiUtils::loadStamp( m_icon, QSize(), m_previewSize );
111 const QRect cr = m_iconLabel->contentsRect();
112 if ( pixmap.width() > cr.width() || pixmap.height() > cr.height() )
113 pixmap = pixmap.scaled( cr.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation );
114 m_iconLabel->setPixmap( pixmap );
116 emit iconChanged( m_icon );
120 AnnotationWidget * AnnotationWidgetFactory::widgetFor( Okular::Annotation * ann )
122 switch ( ann->subType() )
124 case Okular::Annotation::AStamp:
125 return new StampAnnotationWidget( ann );
126 break;
127 case Okular::Annotation::AText:
128 return new TextAnnotationWidget( ann );
129 break;
130 case Okular::Annotation::ALine:
131 return new LineAnnotationWidget( ann );
132 break;
133 case Okular::Annotation::AHighlight:
134 return new HighlightAnnotationWidget( ann );
135 break;
136 case Okular::Annotation::AGeom:
137 return new GeomAnnotationWidget( ann );
138 break;
139 case Okular::Annotation::AFileAttachment:
140 return new FileAttachmentAnnotationWidget( ann );
141 break;
142 case Okular::Annotation::ACaret:
143 return new CaretAnnotationWidget( ann );
144 break;
145 // shut up gcc
146 default:
149 // cases not covered yet
150 return 0;
154 AnnotationWidget::AnnotationWidget( Okular::Annotation * ann )
155 : QObject(), m_ann( ann ), m_styleWidget( 0 ), m_extraWidget( 0 )
159 AnnotationWidget::~AnnotationWidget()
163 Okular::Annotation::SubType AnnotationWidget::annotationType() const
165 return m_ann->subType();
168 QWidget * AnnotationWidget::styleWidget()
170 if ( m_styleWidget )
171 return m_styleWidget;
173 m_styleWidget = createStyleWidget();
174 return m_styleWidget;
177 QWidget * AnnotationWidget::extraWidget()
179 if ( m_extraWidget )
180 return m_extraWidget;
182 m_extraWidget = createExtraWidget();
183 return m_extraWidget;
186 QWidget * AnnotationWidget::createExtraWidget()
188 return 0;
192 TextAnnotationWidget::TextAnnotationWidget( Okular::Annotation * ann )
193 : AnnotationWidget( ann ), m_pixmapSelector( 0 )
195 m_textAnn = static_cast< Okular::TextAnnotation * >( ann );
198 QWidget * TextAnnotationWidget::createStyleWidget()
200 QWidget * widget = new QWidget();
201 QVBoxLayout * lay = new QVBoxLayout( widget );
202 lay->setMargin( 0 );
204 if ( m_textAnn->textType() == Okular::TextAnnotation::Linked )
206 QGroupBox * gb = new QGroupBox( widget );
207 lay->addWidget( gb );
208 gb->setTitle( i18n( "Icon" ) );
209 QHBoxLayout * gblay = new QHBoxLayout( gb );
210 m_pixmapSelector = new PixmapPreviewSelector( gb );
211 gblay->addWidget( m_pixmapSelector );
213 m_pixmapSelector->addItem( i18n( "Comment" ), "Comment" );
214 m_pixmapSelector->addItem( i18n( "Help" ), "Help" );
215 m_pixmapSelector->addItem( i18n( "Insert" ), "Insert" );
216 m_pixmapSelector->addItem( i18n( "Key" ), "Key" );
217 m_pixmapSelector->addItem( i18n( "New Paragraph" ), "NewParagraph" );
218 m_pixmapSelector->addItem( i18n( "Note" ), "Note" );
219 m_pixmapSelector->addItem( i18n( "Paragraph" ), "Paragraph" );
220 m_pixmapSelector->setIcon( m_textAnn->textIcon() );
222 connect( m_pixmapSelector, SIGNAL( iconChanged( const QString& ) ), this, SIGNAL( dataChanged() ) );
225 QHBoxLayout * fontlay = new QHBoxLayout();
226 QLabel * tmplabel = new QLabel( i18n( "Font:" ), widget );
227 fontlay->addWidget( tmplabel );
228 m_fontReq = new KFontRequester( widget );
229 fontlay->addWidget( m_fontReq );
230 lay->addLayout( fontlay );
232 m_fontReq->setFont( m_textAnn->textFont() );
234 connect( m_fontReq, SIGNAL( fontSelected( const QFont& ) ), this, SIGNAL( dataChanged() ) );
236 return widget;
239 void TextAnnotationWidget::applyChanges()
241 if ( m_textAnn->textType() == Okular::TextAnnotation::Linked )
243 m_textAnn->setTextIcon( m_pixmapSelector->icon() );
245 m_textAnn->setTextFont( m_fontReq->font() );
249 StampAnnotationWidget::StampAnnotationWidget( Okular::Annotation * ann )
250 : AnnotationWidget( ann ), m_pixmapSelector( 0 )
252 m_stampAnn = static_cast< Okular::StampAnnotation * >( ann );
255 QWidget * StampAnnotationWidget::createStyleWidget()
257 QWidget * widget = new QWidget();
258 QVBoxLayout * lay = new QVBoxLayout( widget );
259 lay->setMargin( 0 );
260 QGroupBox * gb = new QGroupBox( widget );
261 lay->addWidget( gb );
262 gb->setTitle( i18n( "Stamp Symbol" ) );
263 QHBoxLayout * gblay = new QHBoxLayout( gb );
264 m_pixmapSelector = new PixmapPreviewSelector( gb );
265 gblay->addWidget( m_pixmapSelector );
266 m_pixmapSelector->setEditable( true );
268 // FIXME!!! use the standard names instead (when we'll have the artwork)
269 m_pixmapSelector->addItem( i18n( "Okular" ), "okular" );
270 m_pixmapSelector->addItem( i18n( "Bookmark" ), "bookmarks" );
271 m_pixmapSelector->addItem( i18n( "KDE" ), "kde" );
272 m_pixmapSelector->addItem( i18n( "Information" ), "help-about" );
273 m_pixmapSelector->addItem( i18n( "Approved" ), "stamp-approved" );
274 #if 0
275 m_pixmapSelector->addItem( i18n( "As Is" ), "AsIs" );
276 m_pixmapSelector->addItem( i18n( "Confidential" ), "Confidential" );
277 m_pixmapSelector->addItem( i18n( "Departmental" ), "Departmental" );
278 m_pixmapSelector->addItem( i18n( "Draft" ), "Draft" );
279 m_pixmapSelector->addItem( i18n( "Experimental" ), "Experimental" );
280 m_pixmapSelector->addItem( i18n( "Expired" ), "Expired" );
281 m_pixmapSelector->addItem( i18n( "Final" ), "Final" );
282 m_pixmapSelector->addItem( i18n( "For Comment" ), "ForComment" );
283 m_pixmapSelector->addItem( i18n( "For Public Release" ), "ForPublicRelease" );
284 m_pixmapSelector->addItem( i18n( "Not Approved" ), "NotApproved" );
285 m_pixmapSelector->addItem( i18n( "Not For Public Release" ), "NotForPublicRelease" );
286 m_pixmapSelector->addItem( i18n( "Sold" ), "Sold" );
287 m_pixmapSelector->addItem( i18n( "Top Secret" ), "TopSecret" );
288 #endif
289 m_pixmapSelector->setIcon( m_stampAnn->stampIconName() );
290 m_pixmapSelector->setPreviewSize( 64 );
292 connect( m_pixmapSelector, SIGNAL( iconChanged( const QString& ) ), this, SIGNAL( dataChanged() ) );
294 return widget;
297 void StampAnnotationWidget::applyChanges()
299 m_stampAnn->setStampIconName( m_pixmapSelector->icon() );
304 LineAnnotationWidget::LineAnnotationWidget( Okular::Annotation * ann )
305 : AnnotationWidget( ann )
307 m_lineAnn = static_cast< Okular::LineAnnotation * >( ann );
308 if ( m_lineAnn->linePoints().count() == 2 )
309 m_lineType = 0; // line
310 else if ( m_lineAnn->lineClosed() )
311 m_lineType = 1; // polygon
312 else
313 m_lineType = 2; // polyline
316 QWidget * LineAnnotationWidget::createStyleWidget()
318 QWidget * widget = new QWidget();
319 QVBoxLayout * lay = new QVBoxLayout( widget );
320 lay->setMargin( 0 );
321 if ( m_lineType == 0 )
323 QGroupBox * gb = new QGroupBox( widget );
324 lay->addWidget( gb );
325 gb->setTitle( i18n( "Line Extensions" ) );
326 QGridLayout * gridlay = new QGridLayout( gb );
327 QLabel * tmplabel = new QLabel( i18n( "Leader Line Length:" ), gb );
328 gridlay->addWidget( tmplabel, 0, 0, Qt::AlignRight );
329 m_spinLL = new QDoubleSpinBox( gb );
330 gridlay->addWidget( m_spinLL, 0, 1 );
331 tmplabel->setBuddy( m_spinLL );
332 tmplabel = new QLabel( i18n( "Leader Line Extensions Length:" ), gb );
333 gridlay->addWidget( tmplabel, 1, 0, Qt::AlignRight );
334 m_spinLLE = new QDoubleSpinBox( gb );
335 gridlay->addWidget( m_spinLLE, 1, 1 );
336 tmplabel->setBuddy( m_spinLLE );
339 QGroupBox * gb2 = new QGroupBox( widget );
340 lay->addWidget( gb2 );
341 gb2->setTitle( i18n( "Style" ) );
342 QGridLayout * gridlay2 = new QGridLayout( gb2 );
343 QLabel * tmplabel2 = new QLabel( i18n( "&Size:" ), gb2 );
344 gridlay2->addWidget( tmplabel2, 0, 0, Qt::AlignRight );
345 m_spinSize = new QDoubleSpinBox( gb2 );
346 gridlay2->addWidget( m_spinSize, 0, 1 );
347 tmplabel2->setBuddy( m_spinSize );
349 if ( m_lineType == 0 )
351 m_spinLL->setRange( -500, 500 );
352 m_spinLL->setValue( m_lineAnn->lineLeadingForwardPoint() );
353 m_spinLLE->setRange( 0, 500 );
354 m_spinLLE->setValue( m_lineAnn->lineLeadingBackwardPoint() );
356 m_spinSize->setRange( 1, 100 );
357 m_spinSize->setValue( m_lineAnn->style().width() );
359 if ( m_lineType == 0 )
361 connect( m_spinLL, SIGNAL( valueChanged( double ) ), this, SIGNAL( dataChanged() ) );
362 connect( m_spinLLE, SIGNAL( valueChanged( double ) ), this, SIGNAL( dataChanged() ) );
364 connect( m_spinSize, SIGNAL( valueChanged( double ) ), this, SIGNAL( dataChanged() ) );
366 return widget;
369 void LineAnnotationWidget::applyChanges()
371 if ( m_lineType == 0 )
373 m_lineAnn->setLineLeadingForwardPoint( m_spinLL->value() );
374 m_lineAnn->setLineLeadingBackwardPoint( m_spinLLE->value() );
376 m_lineAnn->style().setWidth( m_spinSize->value() );
381 HighlightAnnotationWidget::HighlightAnnotationWidget( Okular::Annotation * ann )
382 : AnnotationWidget( ann )
384 m_hlAnn = static_cast< Okular::HighlightAnnotation * >( ann );
387 QWidget * HighlightAnnotationWidget::createStyleWidget()
389 QWidget * widget = new QWidget();
390 QVBoxLayout * lay = new QVBoxLayout( widget );
391 lay->setMargin( 0 );
392 QHBoxLayout * typelay = new QHBoxLayout();
393 lay->addLayout( typelay );
394 QLabel * tmplabel = new QLabel( i18n( "Type:" ), widget );
395 typelay->addWidget( tmplabel, 0, Qt::AlignRight );
396 m_typeCombo = new KComboBox( widget );
397 tmplabel->setBuddy( m_typeCombo );
398 typelay->addWidget( m_typeCombo );
400 m_typeCombo->addItem( i18n( "Highlight" ) );
401 m_typeCombo->addItem( i18n( "Squiggly" ) );
402 m_typeCombo->addItem( i18n( "Underline" ) );
403 m_typeCombo->addItem( i18n( "Strike out" ) );
404 m_typeCombo->setCurrentIndex( m_hlAnn->highlightType() );
406 connect( m_typeCombo, SIGNAL( currentIndexChanged ( int ) ), this, SIGNAL( dataChanged() ) );
408 return widget;
411 void HighlightAnnotationWidget::applyChanges()
413 m_hlAnn->setHighlightType( (Okular::HighlightAnnotation::HighlightType)m_typeCombo->currentIndex() );
418 GeomAnnotationWidget::GeomAnnotationWidget( Okular::Annotation * ann )
419 : AnnotationWidget( ann )
421 m_geomAnn = static_cast< Okular::GeomAnnotation * >( ann );
424 QWidget * GeomAnnotationWidget::createStyleWidget()
426 QWidget * widget = new QWidget();
427 QGridLayout * lay = new QGridLayout( widget );
428 lay->setMargin( 0 );
429 QLabel * tmplabel = new QLabel( i18n( "Type:" ), widget );
430 lay->addWidget( tmplabel, 0, 0, Qt::AlignRight );
431 m_typeCombo = new KComboBox( widget );
432 tmplabel->setBuddy( m_typeCombo );
433 lay->addWidget( m_typeCombo, 0, 1 );
434 m_useColor = new QCheckBox( i18n( "Inner color:" ), widget );
435 lay->addWidget( m_useColor, 1, 0 );
436 m_innerColor = new KColorButton( widget );
437 lay->addWidget( m_innerColor, 1, 1 );
438 tmplabel = new QLabel( i18n( "&Size:" ), widget );
439 lay->addWidget( tmplabel, 2, 0, Qt::AlignRight );
440 m_spinSize = new QDoubleSpinBox( widget );
441 lay->addWidget( m_spinSize, 2, 1 );
442 tmplabel->setBuddy( m_spinSize );
444 m_typeCombo->addItem( i18n( "Rectangle" ) );
445 m_typeCombo->addItem( i18n( "Ellipse" ) );
446 m_typeCombo->setCurrentIndex( m_geomAnn->geometricalType() );
447 m_innerColor->setColor( m_geomAnn->geometricalInnerColor() );
448 if ( m_geomAnn->geometricalInnerColor().isValid() )
450 m_useColor->setChecked( true );
452 else
454 m_innerColor->setEnabled( false );
456 m_spinSize->setRange( 0, 100 );
457 m_spinSize->setValue( m_geomAnn->style().width() );
459 connect( m_typeCombo, SIGNAL( currentIndexChanged ( int ) ), this, SIGNAL( dataChanged() ) );
460 connect( m_innerColor, SIGNAL( changed( const QColor & ) ), this, SIGNAL( dataChanged() ) );
461 connect( m_useColor, SIGNAL( toggled( bool ) ), this, SIGNAL( dataChanged() ) );
462 connect( m_useColor, SIGNAL( toggled( bool ) ), m_innerColor, SLOT( setEnabled( bool ) ) );
463 connect( m_spinSize, SIGNAL( valueChanged( double ) ), this, SIGNAL( dataChanged() ) );
465 return widget;
468 void GeomAnnotationWidget::applyChanges()
470 m_geomAnn->setGeometricalType( (Okular::GeomAnnotation::GeomType)m_typeCombo->currentIndex() );
471 if ( !m_useColor->isChecked() )
473 m_geomAnn->setGeometricalInnerColor( QColor() );
475 else
477 m_geomAnn->setGeometricalInnerColor( m_innerColor->color() );
479 m_geomAnn->style().setWidth( m_spinSize->value() );
484 FileAttachmentAnnotationWidget::FileAttachmentAnnotationWidget( Okular::Annotation * ann )
485 : AnnotationWidget( ann ), m_pixmapSelector( 0 )
487 m_attachAnn = static_cast< Okular::FileAttachmentAnnotation * >( ann );
490 QWidget * FileAttachmentAnnotationWidget::createStyleWidget()
492 QWidget * widget = new QWidget();
493 QVBoxLayout * lay = new QVBoxLayout( widget );
494 lay->setMargin( 0 );
495 QGroupBox * gb = new QGroupBox( widget );
496 lay->addWidget( gb );
497 gb->setTitle( i18n( "File Attachment Symbol" ) );
498 QHBoxLayout * gblay = new QHBoxLayout( gb );
499 m_pixmapSelector = new PixmapPreviewSelector( gb );
500 gblay->addWidget( m_pixmapSelector );
501 m_pixmapSelector->setEditable( true );
503 m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Graph" ), "graph" );
504 m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Push Pin" ), "pushpin" );
505 m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Paperclip" ), "paperclip" );
506 m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Tag" ), "tag" );
507 m_pixmapSelector->setIcon( m_attachAnn->fileIconName() );
509 connect( m_pixmapSelector, SIGNAL( iconChanged( const QString& ) ), this, SIGNAL( dataChanged() ) );
511 return widget;
514 QWidget * FileAttachmentAnnotationWidget::createExtraWidget()
516 QWidget * widget = new QWidget();
517 widget->setWindowTitle( i18nc( "'File' as normal file, that can be opened, saved, etc..", "File" ) );
519 Okular::EmbeddedFile *ef = m_attachAnn->embeddedFile();
520 const int size = ef->size();
521 const QString sizeString = size <= 0 ? i18nc( "Not available size", "N/A" ) : KGlobal::locale()->formatByteSize( size );
522 const QString descString = ef->description().isEmpty() ? i18n( "No description available." ) : ef->description();
524 QGridLayout * lay = new QGridLayout( widget );
525 lay->setMargin( 0 );
526 QLabel * tmplabel = new QLabel( i18n( "Name: %1", ef->name() ), widget );
527 tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
528 lay->addWidget( tmplabel, 0, 0 );
530 tmplabel = new QLabel( i18n( "Size: %1", sizeString ), widget );
531 tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
532 lay->addWidget( tmplabel, 1, 0 );
534 tmplabel = new QLabel( i18n( "Description:" ), widget );
535 lay->addWidget( tmplabel, 2, 0 );
536 tmplabel = new QLabel( widget );
537 tmplabel->setTextFormat( Qt::PlainText );
538 tmplabel->setWordWrap( true );
539 tmplabel->setText( descString );
540 tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
541 lay->addWidget( tmplabel, 3, 0, 1, 2 );
543 KMimeType::Ptr mime = KMimeType::findByPath( ef->name(), 0, true );
544 if ( mime )
546 tmplabel = new QLabel( widget );
547 tmplabel->setPixmap( KIcon( mime->iconName() ).pixmap( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE ) );
548 tmplabel->setFixedSize( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE );
549 lay->addWidget( tmplabel, 0, 1, 3, 1, Qt::AlignTop );
552 lay->addItem( new QSpacerItem( 5, 5, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ), 4, 0 );
554 return widget;
557 void FileAttachmentAnnotationWidget::applyChanges()
559 m_attachAnn->setFileIconName( m_pixmapSelector->icon() );
564 static QString caretSymbolToIcon( Okular::CaretAnnotation::CaretSymbol symbol )
566 switch ( symbol )
568 case Okular::CaretAnnotation::None:
569 return QString::fromLatin1( "caret-none" );
570 case Okular::CaretAnnotation::P:
571 return QString::fromLatin1( "caret-p" );
573 return QString();
576 static Okular::CaretAnnotation::CaretSymbol caretSymbolFromIcon( const QString &icon )
578 if ( icon == QLatin1String( "caret-none" ) )
579 return Okular::CaretAnnotation::None;
580 else if ( icon == QLatin1String( "caret-p" ) )
581 return Okular::CaretAnnotation::P;
582 return Okular::CaretAnnotation::None;
585 CaretAnnotationWidget::CaretAnnotationWidget( Okular::Annotation * ann )
586 : AnnotationWidget( ann ), m_pixmapSelector( 0 )
588 m_caretAnn = static_cast< Okular::CaretAnnotation * >( ann );
591 QWidget * CaretAnnotationWidget::createStyleWidget()
593 QWidget * widget = new QWidget();
594 QVBoxLayout * lay = new QVBoxLayout( widget );
595 lay->setMargin( 0 );
596 QGroupBox * gb = new QGroupBox( widget );
597 lay->addWidget( gb );
598 gb->setTitle( i18n( "Caret Symbol" ) );
599 QHBoxLayout * gblay = new QHBoxLayout( gb );
600 m_pixmapSelector = new PixmapPreviewSelector( gb );
601 gblay->addWidget( m_pixmapSelector );
603 m_pixmapSelector->addItem( i18nc( "Symbol for caret annotations", "None" ), "caret-none" );
604 m_pixmapSelector->addItem( i18nc( "Symbol for caret annotations", "P" ), "caret-p" );
605 m_pixmapSelector->setIcon( caretSymbolToIcon( m_caretAnn->caretSymbol() ) );
607 connect( m_pixmapSelector, SIGNAL( iconChanged( const QString& ) ), this, SIGNAL( dataChanged() ) );
609 return widget;
612 void CaretAnnotationWidget::applyChanges()
614 m_caretAnn->setCaretSymbol( caretSymbolFromIcon( m_pixmapSelector->icon() ) );
619 #include "annotationwidgets.moc"