Korganizer: Appending anniversary tooltips in the Month View, Improving dialogs of the attachments and categories

Signed-off-by: Roman Savochenko <roman@home.home>
feat/korganizer
Roman Savochenko 1 year ago
parent d470e73134
commit a569a96a1d

@ -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() );

@ -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 );
}

@ -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 */

@ -29,6 +29,7 @@
#include <tdelocale.h>
#include "kpimprefs.h"
#include "categoryselectdialog.h"
#include "categoryeditdialog.h"
@ -177,6 +178,9 @@ void CategoryEditDialog::slotApply()
mPrefs->writeConfig();
emit categoryConfigChanged();
if(dynamic_cast<CategorySelectDialog*>(mPrefs->toNotify))
((CategorySelectDialog*)mPrefs->toNotify)->updateCategoryConfig();
}
void CategoryEditDialog::slotCancel()

@ -48,6 +48,8 @@ CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, TQWidget* parent,
TQT_SIGNAL(editCategories()) );
connect( mWidget->mButtonClear, TQT_SIGNAL(clicked()),
TQT_SLOT(clear()) );
mPrefs->toNotify = this;
}
void CategorySelectDialog::setCategories( const TQStringList &categoryList )
@ -69,6 +71,7 @@ void CategorySelectDialog::setCategories( const TQStringList &categoryList )
CategorySelectDialog::~CategorySelectDialog()
{
mPrefs->toNotify = NULL;
}
void CategorySelectDialog::setSelected(const TQStringList &selList)

@ -36,7 +36,7 @@
#include "kpimprefs.h"
KPimPrefs::KPimPrefs( const TQString &name )
: TDEConfigSkeleton( name )
: TDEConfigSkeleton( name ), toNotify(NULL)
{
}

@ -78,6 +78,7 @@ class KDE_EXPORT KPimPrefs : public TDEConfigSkeleton
public:
TQStringList mCustomCategories;
TQObject *toNotify;
protected:
virtual void setCategoryDefaults() {}

Loading…
Cancel
Save