23#include <tqlineedit.h>
24#include <tqpushbutton.h>
26#include "KoImportStyleDia.h"
31KoImportStyleDia::KoImportStyleDia(
KoStyleCollection* currentCollection, TQWidget *parent,
const char *name )
34 setCaption( i18n(
"Import Styles") );
35 m_currentCollection = currentCollection;
36 TQVBox *page = makeVBoxMainWidget();
37 new TQLabel(i18n(
"Select styles to import:"), page);
38 m_listStyleName =
new TQListBox( page );
39 m_listStyleName->setSelectionMode( TQListBox::Multi );
40 enableButtonOK( m_listStyleName->count() != 0 );
42 connect(
this, TQ_SIGNAL( user1Clicked() ),
this, TQ_SLOT(slotLoadFile()));
43 setInitialSize( TQSize( 300, 400 ) );
47KoImportStyleDia::~KoImportStyleDia()
51void KoImportStyleDia::generateStyleList()
53 for (uint i = 0; i< m_listStyleName->count();i++)
55 if ( !m_listStyleName->isSelected( i ) )
59 updateFollowingStyle( style );
60 m_styleList.removeStyle( style );
66void KoImportStyleDia::updateFollowingStyle(
KoParagStyle* removedStyle )
68 TQValueList<KoUserStyle *> lst = m_styleList.styleList();
69 for( TQValueList<KoUserStyle *>::Iterator it = lst.begin(); it != lst.end(); ++it ) {
71 if ( style->followingStyle() == removedStyle )
73 style->setFollowingStyle( style );
78void KoImportStyleDia::slotLoadFile()
81 enableButtonOK( m_listStyleName->count() != 0 );
84void KoImportStyleDia::initList()
86 m_listStyleName->insertStringList( m_styleList.displayNameList() );
89void KoImportStyleDia::slotOk()
95TQString KoImportStyleDia::generateStyleName(
const TQString & templateName )
const
101 name = templateName.arg( num );
102 exists = m_currentCollection->findStyle( name ) != 0;
108TQString KoImportStyleDia::generateStyleDisplayName(
const TQString & templateName )
const
114 name = templateName.arg( num );
115 exists = m_currentCollection->findStyleByDisplayName( name ) != 0;
121void KoImportStyleDia::clear()
126#include "KoImportStyleDia.moc"
A paragraph style is a combination of a character style and paragraph-layout attributes,...
TODO rename to KoParagStyleCollection - or should char styles be part of it too?
const char * name(StdAction id)