summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Savochenko <roman@home.home>2023-11-22 10:13:36 +0200
committerRoman Savochenko <roman@home.home>2023-11-22 10:13:36 +0200
commita569a96a1dccf036b6b8ca0eb3580ece996bf183 (patch)
tree4eb0cd91fd8363dbeba6731b8d2e6d0053fdf003
parentd470e73134c09daf33a87bd80920fc278bf2b3c2 (diff)
downloadtdepim-feat/korganizer.tar.gz
tdepim-feat/korganizer.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>
-rw-r--r--korganizer/koeditorattachments.cpp26
-rw-r--r--korganizer/komonthview.cpp8
-rw-r--r--korganizer/komonthview.h6
-rw-r--r--libtdepim/categoryeditdialog.cpp4
-rw-r--r--libtdepim/categoryselectdialog.cpp3
-rw-r--r--libtdepim/kpimprefs.cpp2
-rw-r--r--libtdepim/kpimprefs.h3
7 files changed, 28 insertions, 24 deletions
diff --git a/korganizer/koeditorattachments.cpp b/korganizer/koeditorattachments.cpp
index 6f46ac5f..bf57cb22 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 9000361c..b4921a5a 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 706a2e9f..c7537c2f 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 */
diff --git a/libtdepim/categoryeditdialog.cpp b/libtdepim/categoryeditdialog.cpp
index 26abbc07..f4dc38c2 100644
--- a/libtdepim/categoryeditdialog.cpp
+++ b/libtdepim/categoryeditdialog.cpp
@@ -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()
diff --git a/libtdepim/categoryselectdialog.cpp b/libtdepim/categoryselectdialog.cpp
index cf1b2ac6..b4d9060d 100644
--- a/libtdepim/categoryselectdialog.cpp
+++ b/libtdepim/categoryselectdialog.cpp
@@ -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)
diff --git a/libtdepim/kpimprefs.cpp b/libtdepim/kpimprefs.cpp
index d58ca447..933bd98d 100644
--- a/libtdepim/kpimprefs.cpp
+++ b/libtdepim/kpimprefs.cpp
@@ -36,7 +36,7 @@
#include "kpimprefs.h"
KPimPrefs::KPimPrefs( const TQString &name )
- : TDEConfigSkeleton( name )
+ : TDEConfigSkeleton( name ), toNotify(NULL)
{
}
diff --git a/libtdepim/kpimprefs.h b/libtdepim/kpimprefs.h
index b67d2491..b3346dad 100644
--- a/libtdepim/kpimprefs.h
+++ b/libtdepim/kpimprefs.h
@@ -78,7 +78,8 @@ class KDE_EXPORT KPimPrefs : public TDEConfigSkeleton
public:
TQStringList mCustomCategories;
-
+ TQObject *toNotify;
+
protected:
virtual void setCategoryDefaults() {}
};