Commit ae75dfe1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to implement enable/disable dnd folder

parent 55cfb6c6
Pipeline #99904 passed with stage
in 24 minutes and 20 seconds
......@@ -65,7 +65,7 @@ option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branc
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets)
set(LIBGRAVATAR_VERSION "5.19.40")
set(MAILCOMMON_LIB_VERSION "5.19.41")
set(MAILCOMMON_LIB_VERSION "5.19.42")
set(MESSAGELIB_LIB_VERSION "5.19.40")
set(LIBKLEO_LIB_VERSION "5.19.40")
set(PIMCOMMON_LIB_VERSION "5.19.40")
......
......@@ -74,10 +74,12 @@ MiscPageFolderTab::MiscPageFolderTab(QWidget *parent)
connect(mMMTab.mStartUpFolderCheck, &QCheckBox::toggled, this, &MiscPageFolderTab::slotEmitChanged);
connect(mMMTab.mStartUpFolderCheck, &QCheckBox::toggled, mOnStartupOpenFolder, &MailCommon::FolderRequester::setEnabled);
connect(mMMTab.mDeleteMessagesWithoutConfirmation, &QCheckBox::toggled, this, &MiscPageFolderTab::slotEmitChanged);
connect(mMMTab.mEnableFolderDragAndDrop, &QCheckBox::toggled, this, &MiscPageFolderTab::slotEmitChanged);
}
void MiscPageFolderTab::doLoadFromGlobalSettings()
{
loadWidget(mMMTab.mEnableFolderDragAndDrop, KMailSettings::self()->enableFolderDnDItem());
loadWidget(mMMTab.mExcludeImportantFromExpiry, KMailSettings::self()->excludeImportantMailFromExpiryItem());
// default = "Loop in current folder"
loadWidget(mMMTab.mLoopOnGotoUnread, KMailSettings::self()->loopOnGotoUnreadItem());
......@@ -113,6 +115,7 @@ void MiscPageFolderTab::save()
saveCheckBox(mMMTab.mShowPopupAfterDnD, KMailSettings::self()->showPopupAfterDnDItem());
saveCheckBox(mMMTab.mStartUpFolderCheck, KMailSettings::self()->startSpecificFolderAtStartupItem());
saveCheckBox(mMMTab.mDeleteMessagesWithoutConfirmation, KMailSettings::self()->deleteMessageWithoutConfirmationItem());
saveCheckBox(mMMTab.mEnableFolderDragAndDrop, KMailSettings::self()->enableFolderDnDItem());
}
MiscPageInviteTab::MiscPageInviteTab(QWidget *parent)
......
......@@ -827,6 +827,7 @@ void KMMainWidget::refreshFavoriteFoldersViewProperties()
Q_ASSERT(false); // we should never get here in hidden mode
}
mFavoriteCollectionsView->setDropActionMenuEnabled(kmkernel->showPopupAfterDnD());
mFolderTreeWidget->folderTreeView()->setEnableDragDrop(KMailSettings::self()->enableFolderDnD());
mFavoriteCollectionsView->setWordWrap(true);
mFavoriteCollectionsView->updateMode();
}
......@@ -1013,6 +1014,7 @@ void KMMainWidget::createWidgets()
opt |= FolderTreeWidget::ShowCollectionStatisticAnimation;
opt |= FolderTreeWidget::DontKeyFilter;
mFolderTreeWidget = new FolderTreeWidget(this, mGUIClient, opt);
mFolderTreeWidget->folderTreeView()->setEnableDragDrop(KMailSettings::self()->enableFolderDnD());
connect(mFolderTreeWidget->folderTreeView(),
qOverload<const Akonadi::Collection &>(&EntityTreeView::currentChanged),
......
......@@ -40,6 +40,11 @@
</choices>
<default>DontLoop</default>
</entry>
<entry name="EnableFolderDnD" type="Bool">
<label></label>
<whatsthis></whatsthis>
<default>true</default>
</entry>
<entry name="ShowPopupAfterDnD" type="Bool">
<label></label>
<whatsthis></whatsthis>
......
......@@ -13,10 +13,17 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="mExcludeImportantFromExpiry">
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="mShowPopupAfterDnD">
<property name="text">
<string>E&amp;xclude important messages from expiry</string>
<string>&amp;Ask for action after dragging messages to another folder</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="mEmptyTrashCheck">
<property name="text">
<string>Empty local &amp;trash folder on program exit</string>
</property>
</widget>
</item>
......@@ -39,48 +46,6 @@
<item row="6" column="1">
<widget class="QWidget" name="mOnStartupOpenFolder" native="true"/>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="mLoopOnGotoUnread">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string comment="what's this help">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;https://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When jumping to the next unread message, it may occur that no more unread messages are below the current message.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Do not loop:&lt;/span&gt; The search will stop at the last message in the current folder.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Loop in current folder:&lt;/span&gt; The search will continue at the top of the message list, but not go to another folder.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Loop in all folders:&lt;/span&gt; The search will continue at the top of the message list. If no unread messages are found it will then continue to the next folder.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Similarly, when searching for the previous unread message, the search will start from the bottom of the message list and continue to the previous folder depending on which option is selected.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Loop in all marked folders: &lt;/span&gt;This is the same as &quot;Loop in all folders&quot; except that only folders are taken into account which have been marked with the folder property &quot;Act on new/unread mail in this folder&quot;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Do not Loop</string>
</property>
</item>
<item>
<property name="text">
<string>Loop in Current Folder</string>
</property>
</item>
<item>
<property name="text">
<string>Loop in All Folders</string>
</property>
</item>
<item>
<property name="text">
<string>Loop in All Marked Folders</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mEnterFolderLabel">
<property name="sizePolicy">
......@@ -97,6 +62,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="mExcludeImportantFromExpiry">
<property name="text">
<string>E&amp;xclude important messages from expiry</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="mActionEnterFolder">
<item>
......@@ -134,6 +106,48 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="mLoopOnGotoUnread">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string comment="what's this help">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;https://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When jumping to the next unread message, it may occur that no more unread messages are below the current message.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Do not loop:&lt;/span&gt; The search will stop at the last message in the current folder.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Loop in current folder:&lt;/span&gt; The search will continue at the top of the message list, but not go to another folder.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Loop in all folders:&lt;/span&gt; The search will continue at the top of the message list. If no unread messages are found it will then continue to the next folder.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Similarly, when searching for the previous unread message, the search will start from the bottom of the message list and continue to the previous folder depending on which option is selected.&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Loop in all marked folders: &lt;/span&gt;This is the same as &quot;Loop in all folders&quot; except that only folders are taken into account which have been marked with the folder property &quot;Act on new/unread mail in this folder&quot;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Do not Loop</string>
</property>
</item>
<item>
<property name="text">
<string>Loop in Current Folder</string>
</property>
</item>
<item>
<property name="text">
<string>Loop in All Folders</string>
</property>
</item>
<item>
<property name="text">
<string>Loop in All Marked Folders</string>
</property>
</item>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="mDelayedMarkTime">
<property name="enabled">
......@@ -147,20 +161,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="mShowPopupAfterDnD">
<property name="text">
<string>&amp;Ask for action after dragging messages to another folder</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="mEmptyTrashCheck">
<property name="text">
<string>Empty local &amp;trash folder on program exit</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="mStartUpFolderCheck">
<property name="sizePolicy">
......@@ -181,6 +181,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="mEnableFolderDragAndDrop">
<property name="text">
<string>Enable folders drag and drop</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
......
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