@ -2,7 +2,7 @@
knowitpref . cpp - description
- - - - - - - - - - - - - - - - - - -
begin : czw lis 28 2002
copyright : ( C ) 2002 - 2004 by Micha ³ Rudolf
copyright : ( C ) 2002 - 2004 by Micha <EFBFBD> Rudolf
email : mrudolf @ kdewebdev . org
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@ -18,16 +18,16 @@
# include "knowitpref.h"
# include < qcheckbox.h>
# include < qcolor.h>
# include < qtoolbutton.h>
# include < qspinbox.h>
# include < qdatetime.h>
# include < qlayout.h>
# include < qwhatsthis.h>
# include < qstring.h>
# include < qlabel.h>
# include < qvbox.h>
# include < t qcheckbox.h>
# include < t qcolor.h>
# include < t qtoolbutton.h>
# include < t qspinbox.h>
# include < t qdatetime.h>
# include < t qlayout.h>
# include < t qwhatsthis.h>
# include < t qstring.h>
# include < t qlabel.h>
# include < t qvbox.h>
# include <kconfig.h>
# include <kcombobox.h>
@ -95,7 +95,7 @@ void KnowitOptions::read(KConfig* config)
horizontalSplit = config - > readNumEntry ( " HorizontalSplit " , true ) ;
defaultName = config - > readEntry ( " DefaultName " , i18n ( " New note " ) ) ;
alternateTree = config - > readBoolEntry ( " AlternateTree " , false ) ;
alternateColor = config - > readEntry ( " AlternateColor " , QString( " LightYellow " ) ) ;
alternateColor = config - > readEntry ( " AlternateColor " , T QString( " LightYellow " ) ) ;
autoCollapse = config - > readBoolEntry ( " AutoCollapse " , false ) ;
unconditionalSave = config - > readBoolEntry ( " UnconditionalSave " , false ) ;
backup = config - > readBoolEntry ( " Backup " , true ) ;
@ -109,15 +109,15 @@ void KnowitOptions::read(KConfig* config)
enterBreakLine = config - > readBoolEntry ( " EnterBreakLine " , true ) ;
tabfocus = config - > readBoolEntry ( " TabFocus " , false ) ;
customColors = config - > readBoolEntry ( " CustomColors " , false ) ;
foreEditColor = config - > readEntry ( " ForeEditColor " , QString( " Black " ) ) ;
backEditColor = config - > readEntry ( " BackEditColor " , QString( " White " ) ) ;
foreEditColor = config - > readEntry ( " ForeEditColor " , T QString( " Black " ) ) ;
backEditColor = config - > readEntry ( " BackEditColor " , T QString( " White " ) ) ;
customFont = config - > readBoolEntry ( " CustomFont " , false ) ;
fontFamily = config - > readEntry ( " FontFamily " , QString( " Helvetica " ) ) ;
fontFamily = config - > readEntry ( " FontFamily " , T QString( " Helvetica " ) ) ;
fontSize = config - > readNumEntry ( " FontSize " , 10 ) ; // KDE-Default?
config - > setGroup ( " Templates " ) ;
insertDateFormat = config - > readEntry ( " InsertDateFormatString " , QString( " ddd d MMM yyyy, hh:mm:ss " ) ) ;
insertDateColor = config - > readEntry ( " InsertDateColor " , QString( " Blue " ) ) ;
insertDateFormat = config - > readEntry ( " InsertDateFormatString " , T QString( " ddd d MMM yyyy, hh:mm:ss " ) ) ;
insertDateColor = config - > readEntry ( " InsertDateColor " , T QString( " Blue " ) ) ;
insertDateBold = config - > readBoolEntry ( " InsertDateBold " , false ) ;
insertDateItalic = config - > readBoolEntry ( " InsertDateItalic " , true ) ;
insertDateUnderline = config - > readBoolEntry ( " InsertDateUnderline " , false ) ;
@ -131,118 +131,118 @@ void KnowitOptions::read(KConfig* config)
KnowitPreferences : : KnowitPreferences ( )
: KDialogBase ( IconList , i18n ( " KnowIt Preferences " ) , Ok | Cancel , Ok )
{
QFrame* page ;
QVBoxLayout* layout;
T QFrame* page ;
T QVBoxLayout* tq layout;
/* first page: General */
page = addPage ( i18n ( " General " ) , i18n ( " General options " ) ,
KGlobal : : iconLoader ( ) - > loadIcon ( QString( " configure " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
layout = new QVBoxLayout( page , 0 , spacingHint ( ) ) ;
layout- > addWidget ( docked = new QCheckBox( i18n ( " &Dock in System tray " ) , page , " Dock " ) ) ;
layout- > addWidget ( reopen = new QCheckBox( i18n ( " Open &last file on startup " ) , page , " Reopen " ) ) ;
QHBox* autosaveBox = new QHBox( page ) ;
layout- > addWidget ( autosaveBox ) ;
new QLabel( i18n ( " Autosave: " ) , autosaveBox ) ;
autosave = new QSpinBox( 0 , 120 , 5 , autosaveBox , " Autosave " ) ;
KGlobal : : iconLoader ( ) - > loadIcon ( T QString( " configure " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
tq layout = new T QVBoxLayout( page , 0 , spacingHint ( ) ) ;
tq layout- > addWidget ( docked = new T QCheckBox( i18n ( " &Dock in System tray " ) , page , " Dock " ) ) ;
tq layout- > addWidget ( reopen = new T QCheckBox( i18n ( " Open &last file on startup " ) , page , " Reopen " ) ) ;
T QHBox* autosaveBox = new T QHBox( page ) ;
tq layout- > addWidget ( autosaveBox ) ;
new T QLabel( i18n ( " Autosave: " ) , autosaveBox ) ;
autosave = new T QSpinBox( 0 , 120 , 5 , autosaveBox , " Autosave " ) ;
autosave - > setPrefix ( i18n ( " every " ) ) ;
autosave - > setSuffix ( i18n ( " min. " ) ) ;
autosave - > setSpecialValueText ( i18n ( " Never " ) ) ;
QWhatsThis: : add ( autosave , i18n ( " Current file will be automatically saved "
T QWhatsThis: : add ( autosave , i18n ( " Current file will be automatically saved "
" after the specified interval. Set to <i>never</i> to disable autosave. " ) ) ;
layout- > addWidget ( unconditionalSave = new QCheckBox( i18n ( " Automatically save file on e&xit " ) ,
tq layout- > addWidget ( unconditionalSave = new T QCheckBox( i18n ( " Automatically save file on e&xit " ) ,
page , " UnconditionalSave " ) ) ;
QWhatsThis: : add ( unconditionalSave , i18n ( " Current file will be automatically saved "
T QWhatsThis: : add ( unconditionalSave , i18n ( " Current file will be automatically saved "
" on exit without confirmation. " ) ) ;
layout- > addWidget ( backup = new QCheckBox( i18n ( " Create &backups " ) ,
tq layout- > addWidget ( backup = new T QCheckBox( i18n ( " Create &backups " ) ,
page , " Backup " ) ) ;
QWhatsThis: : add ( backup , i18n ( " Create backup of current document before it is saved. " ) ) ;
layout- > addWidget ( multipleInstances = new QCheckBox( i18n ( " Allow &multiple instances of KnowIt " ) ,
T QWhatsThis: : add ( backup , i18n ( " Create backup of current document before it is saved. " ) ) ;
tq layout- > addWidget ( multipleInstances = new T QCheckBox( i18n ( " Allow &multiple instances of KnowIt " ) ,
page , " Instances " ) ) ;
QWhatsThis: : add ( multipleInstances , i18n ( " If this option is disabled, only one "
T QWhatsThis: : add ( multipleInstances , i18n ( " If this option is disabled, only one "
" instance of KnowIt will be allowed. If there is another instance already running, "
" it will be automatically activated instead of running new one. " ) ) ;
layout- > addStretch ( 1 ) ;
tq layout- > addStretch ( 1 ) ;
/* second page: Interface */
page = addPage ( i18n ( " Interface " ) , i18n ( " Interface options " ) ,
KGlobal : : iconLoader ( ) - > loadIcon ( QString( " misc " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
layout = new QVBoxLayout( page , 0 , spacingHint ( ) ) ;
layout- > addWidget ( horizontalSplit = new QCheckBox( i18n ( " Split window &horizontally " ) , page , " Split " ) ) ;
QWhatsThis: : add ( horizontalSplit , i18n ( " If this option is set, notes tree will "
KGlobal : : iconLoader ( ) - > loadIcon ( T QString( " misc " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
tq layout = new T QVBoxLayout( page , 0 , spacingHint ( ) ) ;
tq layout- > addWidget ( horizontalSplit = new T QCheckBox( i18n ( " Split window &horizontally " ) , page , " Split " ) ) ;
T QWhatsThis: : add ( horizontalSplit , i18n ( " If this option is set, notes tree will "
" be displayed on the left and the editor on the right (this is default).<br> "
" Otherwise notes tree will be displayed at the top and the editor at the bottom. " ) ) ;
QHBox* defaultNameBox = new QHBox( page ) ;
layout- > addWidget ( defaultNameBox ) ;
new QLabel( i18n ( " Default note name: " ) , defaultNameBox ) ;
T QHBox* defaultNameBox = new T QHBox( page ) ;
tq layout- > addWidget ( defaultNameBox ) ;
new T QLabel( i18n ( " Default note name: " ) , defaultNameBox ) ;
defaultName = new KLineEdit ( defaultNameBox , " DefaultName " ) ;
QWhatsThis: : add ( defaultName , i18n ( " Default name for new notes. It would be "
T QWhatsThis: : add ( defaultName , i18n ( " Default name for new notes. It would be "
" autoselected, so if you often copy text using mouse selection, you may "
" consider setting default name to none. " ) ) ;
QHBox* linkBox = new QHBox( page ) ;
layout- > addWidget ( linkBox ) ;
new QLabel( i18n ( " Link format: " ) , linkBox ) ;
T QHBox* linkBox = new T QHBox( page ) ;
tq layout- > addWidget ( linkBox ) ;
new T QLabel( i18n ( " Link format: " ) , linkBox ) ;
linkFormat = new KComboBox ( linkBox , " LinkFormat " ) ;
linkFormat - > insertItem ( i18n ( " Description (link) " ) ) ;
linkFormat - > insertItem ( i18n ( " Link (description) " ) ) ;
linkFormat - > insertItem ( i18n ( " Link only " ) ) ;
linkFormat - > insertItem ( i18n ( " Description only " ) ) ;
QHBox* alternateBox = new QHBox( page ) ;
layout- > addWidget ( alternateBox ) ;
alternateTree = new QCheckBox( i18n ( " Alternate colors in tree " ) , alternateBox , " Alternate " ) ;
alternateColor = new KColorButton ( QColor( " White " ) , alternateBox , " AlternateColor " ) ;
T QHBox* alternateBox = new T QHBox( page ) ;
tq layout- > addWidget ( alternateBox ) ;
alternateTree = new T QCheckBox( i18n ( " Alternate colors in tree " ) , alternateBox , " Alternate " ) ;
alternateColor = new KColorButton ( T QColor( " White " ) , alternateBox , " AlternateColor " ) ;
layout- > addWidget ( autoCollapse = new QCheckBox( i18n ( " Automatically collapse other notes " ) , page , " AutoCollapse " ) ) ;
QWhatsThis: : add ( autoCollapse , i18n ( " If this option is set, only current subtree "
tq layout- > addWidget ( autoCollapse = new T QCheckBox( i18n ( " Automatically collapse other notes " ) , page , " AutoCollapse " ) ) ;
T QWhatsThis: : add ( autoCollapse , i18n ( " If this option is set, only current subtree "
" will be visible, other notes will be automatically collapsed. " ) ) ;
layout- > addStretch ( 1 ) ;
tq layout- > addStretch ( 1 ) ;
/* third page: Editor */
page = addPage ( i18n ( " Editor " ) , i18n ( " Editor options " ) ,
KGlobal : : iconLoader ( ) - > loadIcon ( QString( " edit " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
layout = new QVBoxLayout( page , 0 , spacingHint ( ) ) ;
layout- > addWidget ( wordwrap = new QCheckBox( i18n ( " Use &word wrap " ) ,
KGlobal : : iconLoader ( ) - > loadIcon ( T QString( " edit " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
tq layout = new T QVBoxLayout( page , 0 , spacingHint ( ) ) ;
tq layout- > addWidget ( wordwrap = new T QCheckBox( i18n ( " Use &word wrap " ) ,
page , " WordWrap " ) ) ;
layout- > addWidget ( enterBreakLine = new QCheckBox( i18n ( " 'Enter' ends current line, not paragraph " ) ,
tq layout- > addWidget ( enterBreakLine = new T QCheckBox( i18n ( " 'Enter' ends current line, not paragraph " ) ,
page , " EnterLineBreak " ) ) ;
layout- > addWidget ( tabfocus = new QCheckBox( i18n ( " 'Tab' in editor changes focus " ) ,
tq layout- > addWidget ( tabfocus = new T QCheckBox( i18n ( " 'Tab' in editor changes focus " ) ,
page , " TabFocus " ) ) ;
# if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR < 1
tabfocus - > hide ( ) ;
# endif
QHBox* colorBox = new QHBox( page ) ;
layout- > addWidget ( colorBox ) ;
customColors = new QCheckBox( i18n ( " Use &custom colors " ) , colorBox , " CustomColors " ) ;
T QHBox* colorBox = new T QHBox( page ) ;
tq layout- > addWidget ( colorBox ) ;
customColors = new T QCheckBox( i18n ( " Use &custom colors " ) , colorBox , " CustomColors " ) ;
editColors = new KDualColorButton ( colorBox ) ;
const char fontSizes [ ] = { 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 22 , 24 , 26 , 28 , 32 , 48 , 64 , 0 } ;
QStringList fontList ;
T QStringList fontList ;
KFontChooser : : getFontList ( fontList , false ) ;
QHBox* fontBox = new QHBox( page ) ;
layout- > addWidget ( fontBox ) ;
customFont = new QCheckBox( i18n ( " Use custom font: " ) , fontBox , " customFont " ) ;
T QHBox* fontBox = new T QHBox( page ) ;
tq layout- > addWidget ( fontBox ) ;
customFont = new T QCheckBox( i18n ( " Use custom font: " ) , fontBox , " customFont " ) ;
fontFamily = new KComboBox ( true , fontBox ) ;
fontFamily - > insertStringList ( fontList ) ;
fontSize = new KComboBox ( true , fontBox ) ;
for ( int i = 0 ; fontSizes [ i ] ! = 0 ; i + + ) {
fontSize - > insertItem ( QString( ) . setNum ( fontSizes [ i ] ) , i ) ;
fontSize - > insertItem ( TQString( T QString( ) . setNum ( fontSizes [ i ] ) ) , i ) ;
}
layout- > addStretch ( 1 ) ;
tq layout- > addStretch ( 1 ) ;
/* fourth page: Templates */
page = addPage ( i18n ( " Templates " ) , i18n ( " Templates configuration " ) ,
KGlobal : : iconLoader ( ) - > loadIcon ( QString( " wizard " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
layout = new QVBoxLayout( page , 0 , spacingHint ( ) ) ;
QWhatsThis: : add ( page , i18n ( " <html> \n "
KGlobal : : iconLoader ( ) - > loadIcon ( T QString( " wizard " ) , KIcon : : Toolbar , KIcon : : SizeMedium ) ) ;
tq layout = new T QVBoxLayout( page , 0 , spacingHint ( ) ) ;
T QWhatsThis: : add ( page , i18n ( " <html> \n "
" <p>These expressions may be used: </p> \n "
" <table> \n "
" <tr><th>d</th><td>the day as number without a leading zero (1-31)</td></tr> \n "
@ -265,28 +265,28 @@ KnowitPreferences::KnowitPreferences()
" <tr><th>AP</th><td>use am/pm display</td></tr> \n "
" </table></html> " ) ) ;
QHBox* topBox = new QHBox( page ) ;
layout- > addWidget ( topBox ) ;
QLabel * label1 = new QLabel( i18n ( " Date Format: " ) , topBox ) ;
label1 - > setFixedSize ( label1 - > sizeHint( ) ) ;
insertDatePreview = new QLabel( " " , topBox ) ;
T QHBox* topBox = new T QHBox( page ) ;
tq layout- > addWidget ( topBox ) ;
T QLabel * label1 = new T QLabel( i18n ( " Date Format: " ) , topBox ) ;
label1 - > setFixedSize ( label1 - > tq sizeHint( ) ) ;
insertDatePreview = new T QLabel( " " , topBox ) ;
QHBox * tmpBox = new QHBox( page ) ;
layout- > addWidget ( tmpBox ) ;
insertDateColorButton = new KColorButton ( QColor( " Blue " ) , tmpBox , " InsertDateColorButton " ) ;
T QHBox * tmpBox = new T QHBox( page ) ;
tq layout- > addWidget ( tmpBox ) ;
insertDateColorButton = new KColorButton ( T QColor( " Blue " ) , tmpBox , " InsertDateColorButton " ) ;
insertDateFormatEdit = new KLineEdit ( tmpBox , " InsertDateFormatEdit " ) ;
insertDateItalicButton = new QToolButton( tmpBox , " InsertDateItalicButton " ) ;
insertDateItalicButton - > setIconSet ( QIconSet( KGlobal : : iconLoader ( ) - > loadIcon ( " text_italic " , KIcon : : Toolbar ) ) ) ;
insertDateItalicButton = new T QToolButton( tmpBox , " InsertDateItalicButton " ) ;
insertDateItalicButton - > setIconSet ( T QIconSet( KGlobal : : iconLoader ( ) - > loadIcon ( " text_italic " , KIcon : : Toolbar ) ) ) ;
insertDateItalicButton - > setToggleButton ( true ) ;
insertDateBoldButton = new QToolButton( tmpBox , " InsertDateBoldButton " ) ;
insertDateBoldButton - > setIconSet ( QIconSet( KGlobal : : iconLoader ( ) - > loadIcon ( " text_bold " , KIcon : : Toolbar ) ) ) ;
insertDateBoldButton = new T QToolButton( tmpBox , " InsertDateBoldButton " ) ;
insertDateBoldButton - > setIconSet ( T QIconSet( KGlobal : : iconLoader ( ) - > loadIcon ( " text_bold " , KIcon : : Toolbar ) ) ) ;
insertDateBoldButton - > setToggleButton ( true ) ;
insertDateUnderlineButton = new QToolButton( tmpBox , " InsertDateUnderlineButton " ) ;
insertDateUnderlineButton - > setIconSet ( QIconSet( KGlobal : : iconLoader ( ) - > loadIcon ( " text_under " , KIcon : : Toolbar ) ) ) ;
insertDateUnderlineButton = new T QToolButton( tmpBox , " InsertDateUnderlineButton " ) ;
insertDateUnderlineButton - > setIconSet ( T QIconSet( KGlobal : : iconLoader ( ) - > loadIcon ( " text_under " , KIcon : : Toolbar ) ) ) ;
insertDateUnderlineButton - > setToggleButton ( true ) ;
insertDateColorButton - > setFixedSize ( insertDateBoldButton - > sizeHint( ) ) ;
insertDateFormatEdit - > setMinimumWidth ( 6 * insertDateBoldButton - > sizeHint( ) . width ( ) ) ;
layout- > addStretch ( 1 ) ;
insertDateColorButton - > setFixedSize ( insertDateBoldButton - > tq sizeHint( ) ) ;
insertDateFormatEdit - > setMinimumWidth ( 6 * insertDateBoldButton - > tq sizeHint( ) . width ( ) ) ;
tq layout- > addStretch ( 1 ) ;
setIconListAllVisible ( true ) ;
}
@ -303,7 +303,7 @@ void KnowitPreferences::setOptions(const KnowitOptions& Options)
horizontalSplit - > setChecked ( Options . horizontalSplit ) ;
defaultName - > setText ( Options . defaultName ) ;
alternateTree - > setChecked ( Options . alternateTree ) ;
alternateColor - > setColor ( QColor( Options . alternateColor ) ) ;
alternateColor - > setColor ( T QColor( Options . alternateColor ) ) ;
autoCollapse - > setChecked ( Options . autoCollapse ) ;
linkFormat - > setCurrentItem ( Options . linkFormat ) ;
@ -311,23 +311,23 @@ void KnowitPreferences::setOptions(const KnowitOptions& Options)
enterBreakLine - > setChecked ( Options . enterBreakLine ) ;
tabfocus - > setChecked ( Options . tabfocus ) ;
customColors - > setChecked ( Options . customColors ) ;
editColors - > setForeground ( QColor( Options . foreEditColor ) ) ;
editColors - > setBackground ( QColor( Options . backEditColor ) ) ;
editColors - > setForeground ( T QColor( Options . foreEditColor ) ) ;
editColors - > setBackground ( T QColor( Options . backEditColor ) ) ;
customFont - > setChecked ( Options . customFont ) ;
fontFamily - > setCurrentText ( Options . fontFamily ) ;
fontSize - > setCurrentText ( QString( ) . setNum ( Options . fontSize ) ) ;
fontSize - > setCurrentText ( T QString( ) . setNum ( Options . fontSize ) ) ;
insertDateFormatEdit - > setText ( Options . insertDateFormat ) ;
insertDateColorButton - > setColor ( QColor( Options . insertDateColor ) ) ;
insertDateColorButton - > setColor ( T QColor( Options . insertDateColor ) ) ;
insertDateBoldButton - > setOn ( Options . insertDateBold ) ;
insertDateItalicButton - > setOn ( Options . insertDateItalic ) ;
insertDateUnderlineButton - > setOn ( Options . insertDateUnderline ) ;
slotUpdateDatePreview ( ) ;
connect ( insertDateColorButton , SIGNAL( clicked ( ) ) , this , SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateFormatEdit , SIGNAL( textChanged ( const QString & ) ) , this , SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateItalicButton , SIGNAL( toggled ( bool ) ) , this , SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateBoldButton , SIGNAL( toggled ( bool ) ) , this , SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateUnderlineButton , SIGNAL( toggled ( bool ) ) , this , SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateColorButton , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateFormatEdit , TQT_ SIGNAL( textChanged ( const T QString & ) ) , this , TQT_ SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateItalicButton , TQT_ SIGNAL( toggled ( bool ) ) , this , TQT_ SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateBoldButton , TQT_ SIGNAL( toggled ( bool ) ) , this , TQT_ SLOT( slotUpdateDatePreview ( ) ) ) ;
connect ( insertDateUnderlineButton , TQT_ SIGNAL( toggled ( bool ) ) , this , TQT_ SLOT( slotUpdateDatePreview ( ) ) ) ;
/* non-GUI options */
firstLink = Options . firstLink ;
@ -374,18 +374,18 @@ KnowitOptions KnowitPreferences::getOptions() const
void KnowitPreferences : : slotUpdateDatePreview ( )
{
QString str = " <html><p align= \" center \" > " ;
T QString str = " <html><p align= \" center \" > " ;
if ( insertDateBoldButton - > isOn ( ) ) str + = " <b> " ;
if ( insertDateItalicButton - > isOn ( ) ) str + = " <i> " ;
if ( insertDateUnderlineButton - > isOn ( ) ) str + = " <u> " ;
str + = " <font COLOR= \" " + insertDateColorButton - > color ( ) . name ( ) + " \" > " ;
str + = QString( " %1 " ) . arg( QDateTime: : currentDateTime( ) . toString ( insertDateFormatEdit - > text ( ) ) ) ;
str + = T QString( " %1 " ) . tq arg( T QDateTime: : tq currentDateTime( ) . toString ( insertDateFormatEdit - > text ( ) ) ) ;
str + = " </font> " ;
if ( insertDateUnderlineButton - > isOn ( ) ) str + = " </u> " ;
if ( insertDateItalicButton - > isOn ( ) ) str + = " </i> " ;
if ( insertDateBoldButton - > isOn ( ) ) str + = " </b> " ;
str + = " </p></html> " ;
insertDatePreview - > setPaletteBackgroundColor ( QColor( " White " ) ) ;
insertDatePreview - > setPaletteBackgroundColor ( T QColor( " White " ) ) ;
insertDatePreview - > setText ( str ) ;
}