Commit 1793d903 authored by David Faure's avatar David Faure
Browse files

KOrganizer: remove "Disable Color", simplify contextmenu structure

Summary: The action that remains is now called "Set Folder Color..."

Test Plan: Testing the contextmenu for KOrganizer's calendar list

Reviewers: winterz, ochurlaud

Reviewed By: winterz

Differential Revision: https://phabricator.kde.org/D28943
parent ad9aaee2
......@@ -414,7 +414,6 @@ AkonadiCollectionView::AkonadiCollectionView(CalendarView *view, bool hasContext
, mBaseModel(nullptr)
, mSelectionProxyModel(nullptr)
, mAssignColor(nullptr)
, mDisableColor(nullptr)
, mDefaultCalendar(nullptr)
, mServerSideSubscription(nullptr)
, mNotSendAddRemoveSignal(false)
......@@ -566,15 +565,8 @@ AkonadiCollectionView::AkonadiCollectionView(CalendarView *view, bool hasContext
Akonadi::StandardActionManager::CollectionProperties), &QAction::triggered, mManagerShowCollectionProperties,
&ManageShowCollectionProperties::showCollectionProperties);
mDisableColor = new QAction(mCollectionView);
mDisableColor->setText(i18n("&Disable Color"));
mDisableColor->setEnabled(false);
xmlclient->actionCollection()->addAction(QStringLiteral("disable_color"),
mDisableColor);
connect(mDisableColor, &QAction::triggered, this, &AkonadiCollectionView::disableColor);
mAssignColor = new QAction(mCollectionView);
mAssignColor->setText(i18n("&Assign Color..."));
mAssignColor->setText(i18n("&Set Folder Color..."));
mAssignColor->setEnabled(false);
xmlclient->actionCollection()->addAction(QStringLiteral("assign_color"), mAssignColor);
connect(mAssignColor, &QAction::triggered, this, &AkonadiCollectionView::assignColor);
......@@ -680,18 +672,6 @@ void AkonadiCollectionView::assignColor()
}
}
void AkonadiCollectionView::disableColor()
{
QModelIndex index = mCollectionView->selectionModel()->currentIndex(); //selectedRows()
Q_ASSERT(index.isValid());
const Akonadi::Collection collection = CalendarSupport::collectionFromIndex(index);
Q_ASSERT(collection.isValid());
KOHelper::setResourceColor(collection, QColor());
updateMenu();
updateView();
Q_EMIT colorsChanged();
}
void AkonadiCollectionView::setCollectionSelectionProxyModel(KCheckableProxyModel *m)
{
if (mSelectionProxyModel == m) {
......@@ -749,7 +729,6 @@ void AkonadiCollectionView::updateMenu()
mAssignColor->setEnabled(enableAction);
}
mDisableColor->setEnabled(enableAction);
mDefaultCalendar->setEnabled(
!KOHelper::isStandardCalendar(collection.id()) &&
(collection.rights() & Akonadi::Collection::CanCreateItem) &&
......@@ -764,7 +743,6 @@ void AkonadiCollectionView::updateMenu()
mServerSideSubscription->setEnabled(false);
}
if (disableStuff) {
mDisableColor->setEnabled(false);
mDefaultCalendar->setEnabled(false);
mAssignColor->setEnabled(false);
}
......
......@@ -102,7 +102,6 @@ private Q_SLOTS:
void deleteCalendarDone(KJob *);
void rowsInserted(const QModelIndex &, int, int);
void assignColor();
void disableColor();
void setDefaultCalendar();
void onSearchIsActive(bool);
void onAction(const QModelIndex &index, int action);
......@@ -116,7 +115,6 @@ private:
QAbstractProxyModel *mBaseModel = nullptr;
KCheckableProxyModel *mSelectionProxyModel = nullptr;
QAction *mAssignColor = nullptr;
QAction *mDisableColor = nullptr;
QAction *mDefaultCalendar = nullptr;
QAction *mServerSideSubscription = nullptr;
bool mNotSendAddRemoveSignal;
......
<!DOCTYPE gui>
<gui name="korganizer" version="434" translationDomain="korganizer">
<gui name="korganizer" version="435" translationDomain="korganizer">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
<Merge/>
......@@ -174,11 +174,7 @@
<Menu name="akonadi_collectionview_contextmenu">
<Action name="akonadi_collection_create"/>
<Action name="akonadi_collection_delete"/>
<Separator/>
<Menu name="calendar_color"><text>Calendar Colors</text>
<Action name="assign_color"/>
<Action name="disable_color"/>
</Menu>
<Action name="assign_color"/>
<Separator/>
<Action name="set_standard_calendar"/>
<Separator/>
......
<!DOCTYPE gui>
<gui name="korganizer" version="433" translationDomain="korganizer">
<gui name="korganizer" version="434" translationDomain="korganizer">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
<Menu name="import"><text>&amp;Import</text>
......@@ -159,11 +159,7 @@
<Menu name="akonadi_collectionview_contextmenu">
<Action name="akonadi_collection_create"/>
<Action name="akonadi_collection_delete"/>
<Separator/>
<Menu name="calendar_color"><text>Calendar Colors</text>
<Action name="assign_color"/>
<Action name="disable_color"/>
</Menu>
<Action name="assign_color"/>
<Separator/>
<Action name="set_standard_calendar"/>
<Separator/>
......
Markdown is supported
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