Commit 3e691090 authored by Volker Krause's avatar Volker Krause
Browse files

Use KDatePickerPopup from KWidgetAddons

parent d806a57b
Pipeline #177630 passed with stage
in 3 minutes and 35 seconds
......@@ -28,11 +28,11 @@
#include <Akonadi/IncidenceTreeModel>
#include <CalendarSupport/KCalPrefs>
#include <CalendarSupport/KDatePickerPopup>
#include <KCalendarCore/CalFormat>
#include <KConfig>
#include <KDatePickerPopup>
#include <KJob>
#include <KMessageBox>
......@@ -373,26 +373,20 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs, bool sidebarView, QWidget
mItemPopupMenu->addSeparator();
mCopyPopupMenu = new CalendarSupport::KDatePickerPopup(CalendarSupport::KDatePickerPopup::NoDate | CalendarSupport::KDatePickerPopup::DatePicker
| CalendarSupport::KDatePickerPopup::Words,
QDate::currentDate(),
this);
mCopyPopupMenu = new KDatePickerPopup(KDatePickerPopup::NoDate | KDatePickerPopup::DatePicker | KDatePickerPopup::Words, QDate::currentDate(), this);
mCopyPopupMenu->setTitle(i18nc("@title:menu", "&Copy To"));
connect(mCopyPopupMenu, &CalendarSupport::KDatePickerPopup::dateChanged, this, &TodoView::copyTodoToDate);
connect(mCopyPopupMenu, &KDatePickerPopup::dateChanged, this, &TodoView::copyTodoToDate);
connect(mCopyPopupMenu, &CalendarSupport::KDatePickerPopup::dateChanged, mItemPopupMenu, &QMenu::hide);
connect(mCopyPopupMenu, &KDatePickerPopup::dateChanged, mItemPopupMenu, &QMenu::hide);
mMovePopupMenu = new CalendarSupport::KDatePickerPopup(CalendarSupport::KDatePickerPopup::NoDate | CalendarSupport::KDatePickerPopup::DatePicker
| CalendarSupport::KDatePickerPopup::Words,
QDate::currentDate(),
this);
mMovePopupMenu = new KDatePickerPopup(KDatePickerPopup::NoDate | KDatePickerPopup::DatePicker | KDatePickerPopup::Words, QDate::currentDate(), this);
mMovePopupMenu->setTitle(i18nc("@title:menu", "&Move To"));
connect(mMovePopupMenu, &CalendarSupport::KDatePickerPopup::dateChanged, this, &TodoView::setNewDate);
connect(mView->startPopupMenu(), &CalendarSupport::KDatePickerPopup::dateChanged, this, &TodoView::setStartDate);
connect(mMovePopupMenu, &KDatePickerPopup::dateChanged, this, &TodoView::setNewDate);
connect(mView->startPopupMenu(), &KDatePickerPopup::dateChanged, this, &TodoView::setStartDate);
connect(mMovePopupMenu, &CalendarSupport::KDatePickerPopup::dateChanged, mItemPopupMenu, &QMenu::hide);
connect(mMovePopupMenu, &KDatePickerPopup::dateChanged, mItemPopupMenu, &QMenu::hide);
mItemPopupMenu->insertMenu(nullptr, mCopyPopupMenu);
mItemPopupMenu->insertMenu(nullptr, mMovePopupMenu);
......
......@@ -23,11 +23,6 @@ class TodoViewQuickSearch;
class TodoViewSortFilterProxyModel;
class TodoViewView;
namespace CalendarSupport
{
class KDatePickerPopup;
}
namespace Akonadi
{
class ETMViewStateSaver;
......@@ -39,6 +34,7 @@ class QModelIndex;
class QToolButton;
class QTimer;
class KConfig;
class KDatePickerPopup;
namespace EventViews
{
/**
......@@ -160,8 +156,8 @@ private:
QToolButton *mFlatViewButton = nullptr;
QMenu *mItemPopupMenu = nullptr;
CalendarSupport::KDatePickerPopup *mCopyPopupMenu = nullptr;
CalendarSupport::KDatePickerPopup *mMovePopupMenu = nullptr;
KDatePickerPopup *mCopyPopupMenu = nullptr;
KDatePickerPopup *mMovePopupMenu = nullptr;
QMenu *mPriorityPopupMenu = nullptr;
QMenu *mPercentageCompletedPopupMenu = nullptr;
QList<QAction *> mItemPopupMenuItemOnlyEntries;
......
......@@ -8,8 +8,7 @@
#include "todoviewview.h"
#include <CalendarSupport/KDatePickerPopup>
#include <KDatePickerPopup>
#include <KLocalizedString>
#include <QMenu>
......@@ -30,9 +29,7 @@ TodoViewView::TodoViewView(QWidget *parent)
connect(&mExpandTimer, &QTimer::timeout, this, &TodoViewView::expandParent);
mExpandTimer.setInterval(1s);
header()->setStretchLastSection(false);
mStartPopupMenu = new CalendarSupport::KDatePickerPopup(
CalendarSupport::KDatePickerPopup::NoDate | CalendarSupport::KDatePickerPopup::DatePicker | CalendarSupport::KDatePickerPopup::Words,
QDate::currentDate(), this);
mStartPopupMenu = new KDatePickerPopup(KDatePickerPopup::NoDate | KDatePickerPopup::DatePicker | KDatePickerPopup::Words, QDate::currentDate(), this);
}
bool TodoViewView::isEditing(const QModelIndex &index) const
......@@ -72,7 +69,7 @@ bool TodoViewView::eventFilter(QObject *watched, QEvent *event)
return false;
}
CalendarSupport::KDatePickerPopup *TodoViewView::startPopupMenu()
KDatePickerPopup *TodoViewView::startPopupMenu()
{
return mStartPopupMenu;
}
......
......@@ -11,13 +11,9 @@
#include <QTimer>
#include <QTreeView>
class KDatePickerPopup;
class QMenu;
namespace CalendarSupport
{
class KDatePickerPopup;
}
class TodoViewView : public QTreeView
{
Q_OBJECT
......@@ -28,7 +24,7 @@ public:
Q_REQUIRED_RESULT bool isEditing(const QModelIndex &index) const;
Q_REQUIRED_RESULT bool eventFilter(QObject *watched, QEvent *event) override;
Q_REQUIRED_RESULT CalendarSupport::KDatePickerPopup *startPopupMenu();
Q_REQUIRED_RESULT KDatePickerPopup *startPopupMenu();
protected:
QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
......@@ -45,7 +41,7 @@ private:
bool mIgnoreNextMouseRelease = false;
// TODO KF6: move this next to TodoView::mMovePopupMenu.
CalendarSupport::KDatePickerPopup *mStartPopupMenu = nullptr;
KDatePickerPopup *mStartPopupMenu = nullptr;
Q_SIGNALS:
void visibleColumnCountChanged();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment