|
|
@ -79,8 +79,7 @@ class AttachmentListItem : public TDEIconViewItem
|
|
|
|
if ( att ) {
|
|
|
|
if ( att ) {
|
|
|
|
mAttachment = new KCal::Attachment( *att );
|
|
|
|
mAttachment = new KCal::Attachment( *att );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
mAttachment = new KCal::Attachment( TQChar('\0') ); //use the non-uri constructor
|
|
|
|
mAttachment = new KCal::Attachment( "" );
|
|
|
|
//as we want inline by default
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
readAttachment();
|
|
|
|
readAttachment();
|
|
|
|
setDragEnabled( true );
|
|
|
|
setDragEnabled( true );
|
|
|
@ -203,7 +202,7 @@ AttachmentEditDialog::AttachmentEditDialog( AttachmentListItem *item,
|
|
|
|
|
|
|
|
|
|
|
|
mInline = new TQCheckBox( i18n( "Store attachment inline" ), topFrame );
|
|
|
|
mInline = new TQCheckBox( i18n( "Store attachment inline" ), topFrame );
|
|
|
|
grid->addMultiCellWidget( mInline, 3, 3, 0, 2 );
|
|
|
|
grid->addMultiCellWidget( mInline, 3, 3, 0, 2 );
|
|
|
|
mInline->setChecked( item->isBinary() );
|
|
|
|
mInline->setChecked( item->isBinary() || item->label().isEmpty() );
|
|
|
|
TQToolTip::add( mInline, i18n( "Store the attachment file inside the calendar" ) );
|
|
|
|
TQToolTip::add( mInline, i18n( "Store the attachment file inside the calendar" ) );
|
|
|
|
TQWhatsThis::add(
|
|
|
|
TQWhatsThis::add(
|
|
|
|
mInline,
|
|
|
|
mInline,
|
|
|
@ -214,7 +213,7 @@ AttachmentEditDialog::AttachmentEditDialog( AttachmentListItem *item,
|
|
|
|
"attachments that change often or may be moved (or removed) from "
|
|
|
|
"attachments that change often or may be moved (or removed) from "
|
|
|
|
"their current location." ) );
|
|
|
|
"their current location." ) );
|
|
|
|
|
|
|
|
|
|
|
|
if ( item->attachment()->isUri() || !item->attachment()->data() ) {
|
|
|
|
if ( item->attachment()->isUri() || item->label().isEmpty() || !item->attachment()->data() ) {
|
|
|
|
label = new TQLabel( i18n( "Location:" ), topFrame );
|
|
|
|
label = new TQLabel( i18n( "Location:" ), topFrame );
|
|
|
|
grid->addWidget( label, 4, 0 );
|
|
|
|
grid->addWidget( label, 4, 0 );
|
|
|
|
mURLRequester = new KURLRequester( item->uri(), topFrame );
|
|
|
|
mURLRequester = new KURLRequester( item->uri(), topFrame );
|
|
|
@ -242,21 +241,12 @@ AttachmentEditDialog::AttachmentEditDialog( AttachmentListItem *item,
|
|
|
|
|
|
|
|
|
|
|
|
void AttachmentEditDialog::slotApply()
|
|
|
|
void AttachmentEditDialog::slotApply()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !mLabelEdit->text().isEmpty() ) {
|
|
|
|
if ( !mLabelEdit->text().isEmpty() )
|
|
|
|
mItem->setLabel( mLabelEdit->text() );
|
|
|
|
mItem->setLabel( mLabelEdit->text() );
|
|
|
|
} else {
|
|
|
|
else if ( mURLRequester && !mURLRequester->url().isEmpty() ) {
|
|
|
|
if ( mURLRequester ) {
|
|
|
|
|
|
|
|
KURL url( mURLRequester->url() );
|
|
|
|
KURL url( mURLRequester->url() );
|
|
|
|
if ( url.isLocalFile() ) {
|
|
|
|
mItem->setLabel( url.isLocalFile() ? url.fileName() : url.url() );
|
|
|
|
mItem->setLabel( url.fileName() );
|
|
|
|
} else mItem->setLabel( i18n( "New attachment" ) );
|
|
|
|
} else {
|
|
|
|
|
|
|
|
mItem->setLabel( url.url() );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( mItem->label().isEmpty() ) {
|
|
|
|
|
|
|
|
mItem->setLabel( i18n( "New attachment" ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mItem->setMimeType( mMimeType->name() );
|
|
|
|
mItem->setMimeType( mMimeType->name() );
|
|
|
|
if ( mURLRequester ) {
|
|
|
|
if ( mURLRequester ) {
|
|
|
|
KURL url( mURLRequester->url() );
|
|
|
|
KURL url( mURLRequester->url() );
|
|
|
|