diff options
author | Roman Savochenko <roman@home.home> | 2023-11-22 10:13:36 +0200 |
---|---|---|
committer | Roman Savochenko <roman@home.home> | 2023-11-22 10:13:36 +0200 |
commit | a569a96a1dccf036b6b8ca0eb3580ece996bf183 (patch) | |
tree | 4eb0cd91fd8363dbeba6731b8d2e6d0053fdf003 /korganizer | |
parent | d470e73134c09daf33a87bd80920fc278bf2b3c2 (diff) | |
download | tdepim-a569a96a1dccf036b6b8ca0eb3580ece996bf183.tar.gz tdepim-a569a96a1dccf036b6b8ca0eb3580ece996bf183.zip |
Korganizer: Appending anniversary tooltips in the Month View, Improving dialogs of the attachments and categoriesfeat/korganizer
Signed-off-by: Roman Savochenko <roman@home.home>
Diffstat (limited to 'korganizer')
-rw-r--r-- | korganizer/koeditorattachments.cpp | 26 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 8 | ||||
-rw-r--r-- | korganizer/komonthview.h | 6 |
3 files changed, 18 insertions, 22 deletions
diff --git a/korganizer/koeditorattachments.cpp b/korganizer/koeditorattachments.cpp index 6f46ac5f1..bf57cb222 100644 --- a/korganizer/koeditorattachments.cpp +++ b/korganizer/koeditorattachments.cpp @@ -79,8 +79,7 @@ class AttachmentListItem : public TDEIconViewItem if ( att ) { mAttachment = new KCal::Attachment( *att ); } else { - mAttachment = new KCal::Attachment( TQChar('\0') ); //use the non-uri constructor - //as we want inline by default + mAttachment = new KCal::Attachment( "" ); } readAttachment(); setDragEnabled( true ); @@ -203,7 +202,7 @@ AttachmentEditDialog::AttachmentEditDialog( AttachmentListItem *item, mInline = new TQCheckBox( i18n( "Store attachment inline" ), topFrame ); 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" ) ); TQWhatsThis::add( mInline, @@ -214,7 +213,7 @@ AttachmentEditDialog::AttachmentEditDialog( AttachmentListItem *item, "attachments that change often or may be moved (or removed) from " "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 ); grid->addWidget( label, 4, 0 ); mURLRequester = new KURLRequester( item->uri(), topFrame ); @@ -242,21 +241,12 @@ AttachmentEditDialog::AttachmentEditDialog( AttachmentListItem *item, void AttachmentEditDialog::slotApply() { - if ( !mLabelEdit->text().isEmpty() ) { + if ( !mLabelEdit->text().isEmpty() ) mItem->setLabel( mLabelEdit->text() ); - } else { - if ( mURLRequester ) { - KURL url( mURLRequester->url() ); - if ( url.isLocalFile() ) { - mItem->setLabel( url.fileName() ); - } else { - mItem->setLabel( url.url() ); - } - } - } - if ( mItem->label().isEmpty() ) { - mItem->setLabel( i18n( "New attachment" ) ); - } + else if ( mURLRequester && !mURLRequester->url().isEmpty() ) { + KURL url( mURLRequester->url() ); + mItem->setLabel( url.isLocalFile() ? url.fileName() : url.url() ); + } else mItem->setLabel( i18n( "New attachment" ) ); mItem->setMimeType( mMimeType->name() ); if ( mURLRequester ) { KURL url( mURLRequester->url() ); diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9000361cf..b4921a5ac 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -64,8 +64,9 @@ KOMonthCellToolTip::KOMonthCellToolTip( TQWidget *parent, Calendar *calendar, const TQDate &date, - KNoScrollListBox *lv ) - : TQToolTip( parent ), mCalendar( calendar ), mDate( date ) + KNoScrollListBox *lv, + MonthViewCell* cl ) + : TQToolTip( parent ), mCalendar( calendar ), mDate( date ), cell(cl) { eventlist = lv; } @@ -81,6 +82,7 @@ void KOMonthCellToolTip::maybeTip( const TQPoint &pos ) r=eventlist->itemRect( it ); /* Show the tip */ TQString tipText( IncidenceFormatter::toolTipStr( mCalendar, i->incidence(), mDate ) ); + if(tipText.isEmpty()) tipText = cell->holidayString(); if ( !tipText.isEmpty() ) { tip( r, tipText ); } @@ -438,7 +440,7 @@ void MonthViewCell::setDate( const TQDate &date ) new KOMonthCellToolTip( mItemList->viewport(), monthView()->calendar(), mDate, - static_cast<KNoScrollListBox *>( mItemList ) ); + static_cast<KNoScrollListBox *>( mItemList ), this ); resizeEvent( 0 ); } diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 706a2e9fb..c7537c2fb 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -32,11 +32,12 @@ #include "koeventview.h" class KNoScrollListBox; +class MonthViewCell; class KOMonthCellToolTip : public TQToolTip { public: - KOMonthCellToolTip (TQWidget* parent, Calendar *calendar, const TQDate &date, KNoScrollListBox* lv ); + KOMonthCellToolTip (TQWidget* parent, Calendar *calendar, const TQDate &date, KNoScrollListBox* lv, MonthViewCell* cl); protected: void maybeTip( const TQPoint & pos); @@ -45,6 +46,7 @@ class KOMonthCellToolTip : public TQToolTip Calendar *mCalendar; TQDate mDate; KNoScrollListBox* eventlist; + MonthViewCell* cell; }; @@ -140,6 +142,8 @@ class MonthViewCell : public TQWidget class CreateItemVisitor; MonthViewCell( KOMonthView * ); + TQString holidayString( ) { return mHolidayString; } + /** Sets the date of the cell */ void setDate( const TQDate & ); /** @return Date of cell */ |