Changeset View
Changeset View
Standalone View
Standalone View
ui/annotationpropertiesdialog.cpp
| 1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
|---|---|---|---|---|---|
| 2 | * Copyright (C) 2006 by Chu Xiaodong <xiaodongchu@gmail.com> * | 2 | * Copyright (C) 2006 by Chu Xiaodong <xiaodongchu@gmail.com> * | ||
| 3 | * * | 3 | * * | ||
| 4 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 6 | * the Free Software Foundation; either version 2 of the License, or * | ||
| 7 | * (at your option) any later version. * | 7 | * (at your option) any later version. * | ||
| 8 | ***************************************************************************/ | 8 | ***************************************************************************/ | ||
| 9 | 9 | | |||
| 10 | #include "annotationpropertiesdialog.h" | 10 | #include "annotationpropertiesdialog.h" | ||
| 11 | 11 | | |||
| 12 | // qt/kde includes | 12 | // qt/kde includes | ||
| 13 | #include <QFormLayout> | ||||
| 13 | #include <qframe.h> | 14 | #include <qframe.h> | ||
| 14 | #include <qlayout.h> | 15 | #include <qlayout.h> | ||
| 15 | #include <qlabel.h> | 16 | #include <qlabel.h> | ||
| 16 | #include <qheaderview.h> | 17 | #include <qheaderview.h> | ||
| 17 | #include <qpushbutton.h> | 18 | #include <qpushbutton.h> | ||
| 18 | #include <qtextedit.h> | 19 | #include <qtextedit.h> | ||
| 19 | #include <QIcon> | 20 | #include <QIcon> | ||
| 20 | #include <klineedit.h> | 21 | #include <klineedit.h> | ||
| Show All 35 Lines | 54 | //1. Appearance | |||
| 56 | appearanceWidget->setEnabled( canEditAnnotations ); | 57 | appearanceWidget->setEnabled( canEditAnnotations ); | ||
| 57 | addPage( appearanceWidget, i18n( "&Appearance" ) ); | 58 | addPage( appearanceWidget, i18n( "&Appearance" ) ); | ||
| 58 | //END tab1 | 59 | //END tab1 | ||
| 59 | 60 | | |||
| 60 | //BEGIN tab 2 | 61 | //BEGIN tab 2 | ||
| 61 | QFrame* page = new QFrame( this ); | 62 | QFrame* page = new QFrame( this ); | ||
| 62 | addPage( page, i18n( "&General" ) ); | 63 | addPage( page, i18n( "&General" ) ); | ||
| 63 | // m_tabitem[1]->setIcon( QIcon::fromTheme( "fonts" ) ); | 64 | // m_tabitem[1]->setIcon( QIcon::fromTheme( "fonts" ) ); | ||
| 64 | QGridLayout* gridlayout = new QGridLayout( page ); | 65 | QFormLayout * gridlayout = new QFormLayout( page ); | ||
| 65 | tmplabel = new QLabel( i18n( "&Author:" ), page ); | | |||
| 66 | AuthorEdit = new KLineEdit( ann->author(), page ); | 66 | AuthorEdit = new KLineEdit( ann->author(), page ); | ||
| 67 | AuthorEdit->setEnabled( canEditAnnotations ); | 67 | AuthorEdit->setEnabled( canEditAnnotations ); | ||
| 68 | tmplabel->setBuddy( AuthorEdit ); | 68 | gridlayout->addRow( i18n( "&Author:" ), AuthorEdit ); | ||
| 69 | gridlayout->addWidget( tmplabel, 0, 0, Qt::AlignRight ); | | |||
| 70 | gridlayout->addWidget( AuthorEdit, 0, 1 ); | | |||
| 71 | 69 | | |||
| 72 | tmplabel = new QLabel( page ); | 70 | tmplabel = new QLabel( page ); | ||
| 73 | tmplabel->setText( i18n( "Created: %1", QLocale().toString( ann->creationDate(), QLocale::LongFormat ) ) ); | 71 | tmplabel->setText( QLocale().toString( ann->creationDate(), QLocale::LongFormat ) ); | ||
| 74 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | 72 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | ||
| 75 | gridlayout->addWidget( tmplabel, 1, 0, 1, 2 ); | 73 | gridlayout->addRow( i18n( "Created:" ), tmplabel ); | ||
| 76 | 74 | | |||
| 77 | m_modifyDateLabel = new QLabel( page ); | 75 | m_modifyDateLabel = new QLabel( page ); | ||
| 78 | m_modifyDateLabel->setText( i18n( "Modified: %1", QLocale().toString( ann->modificationDate(), QLocale::LongFormat ) ) ); | 76 | m_modifyDateLabel->setText( QLocale().toString( ann->modificationDate(), QLocale::LongFormat ) ); | ||
| 79 | m_modifyDateLabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | 77 | m_modifyDateLabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | ||
| 80 | gridlayout->addWidget( m_modifyDateLabel, 2, 0, 1, 2 ); | 78 | gridlayout->addRow( i18n( "Modified:" ), m_modifyDateLabel ); | ||
| 81 | 79 | | |||
| 82 | gridlayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ), 3, 0 ); | | |||
| 83 | //END tab 2 | 80 | //END tab 2 | ||
| 84 | 81 | | |||
| 85 | QWidget * extraWidget = m_annotWidget->extraWidget(); | 82 | QWidget * extraWidget = m_annotWidget->extraWidget(); | ||
| 86 | if ( extraWidget ) | 83 | if ( extraWidget ) | ||
| 87 | { | 84 | { | ||
| 88 | addPage( extraWidget, extraWidget->windowTitle() ); | 85 | addPage( extraWidget, extraWidget->windowTitle() ); | ||
| 89 | } | 86 | } | ||
| 90 | 87 | | |||
| ▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines | |||||