summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2020-09-14 12:56:21 +0530
committerAndras Timar <andras.timar@collabora.com>2020-09-22 12:07:42 +0200
commitd5d58d3dc02267469375f06735a7d6f9a4d9f9e3 (patch)
treecce66df82542e06d588be29e5213e66fa33b40b0 /sw
parentba2b147d7fde915ff51c0cb522e768005bced1d0 (diff)
Added new command to resolve the comment thread
Change-Id: I8a4e5f63ee6ea5e560fae8a5d3602178f2b58b36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102627 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/sdi/_annotsh.sdi6
-rw-r--r--sw/sdi/_textsh.sdi5
-rw-r--r--sw/sdi/swriter.sdi17
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.cxx6
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx7
-rw-r--r--sw/source/uibase/shells/annotsh.cxx15
-rw-r--r--sw/source/uibase/shells/textfld.cxx9
-rw-r--r--sw/uiconfig/sglobal/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/sglobal/popupmenu/annotation.xml1
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swriter/popupmenu/annotation.xml1
-rw-r--r--sw/uiconfig/swriter/ui/annotationmenu.ui16
-rw-r--r--sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui7
14 files changed, 93 insertions, 0 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index e3666c9bfeb7..105afabe2927 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -740,6 +740,7 @@
#define FN_REPLY (FN_NOTES+7)
#define FN_FORMAT_ALL_NOTES (FN_NOTES+8)
#define FN_RESOLVE_NOTE (FN_NOTES+9)
+#define FN_RESOLVE_NOTE_THREAD (FN_NOTES+10)
// Region: Parameter
#define FN_PARAM_MOVE_COUNT (FN_PARAM+2)
diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index 84f3aed0b007..fa1772a4c46e 100644
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -66,6 +66,12 @@ interface _Annotation
StateMethod = GetNoteState ;
]
+ FN_RESOLVE_NOTE_THREAD
+ [
+ ExecMethod = NoteExec ;
+ StateMethod = GetNoteState ;
+ ]
+
FN_POSTIT
[
ExecMethod = NoteExec ;
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 945def69abaa..76dd10f4b329 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -962,6 +962,11 @@ interface BaseText
ExecMethod = ExecField ;
StateMethod = StateField;
]
+ FN_RESOLVE_NOTE_THREAD
+ [
+ ExecMethod = ExecField ;
+ StateMethod = StateField;
+ ]
FN_DELETE_NOTE_AUTHOR
[
ExecMethod = ExecField ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index b088189e6753..f088f6356ec0 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7193,6 +7193,23 @@ SfxVoidItem ResolveComment FN_RESOLVE_NOTE
GroupId = SfxGroupId::Edit;
]
+SfxVoidItem ResolveCommentThread FN_RESOLVE_NOTE_THREAD
+(SvxPostItIdItem Id SID_ATTR_POSTIT_ID)
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Edit;
+]
+
SfxStringItem DeleteAuthor FN_DELETE_NOTE_AUTHOR ( SfxStringItem Author FN_DELETE_NOTE_AUTHOR )
[
AutoUpdate = FALSE,
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index cdea6eb327e1..accf2e54e780 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -73,6 +73,8 @@ void AnnotationMenuButton::Select()
mrSidebarWin.ExecuteCommand(FN_REPLY);
if (sIdent == "resolve" || sIdent == "unresolve")
mrSidebarWin.ExecuteCommand(FN_RESOLVE_NOTE);
+ else if (sIdent == "resolvethread" || sIdent == "unresolvethread")
+ mrSidebarWin.ExecuteCommand(FN_RESOLVE_NOTE_THREAD);
else if (sIdent == "delete")
mrSidebarWin.ExecuteCommand(FN_DELETE_COMMENT);
else if (sIdent == "deleteby")
@@ -91,6 +93,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
pButtonPopup->EnableItem(pButtonPopup->GetItemId("reply"), false);
pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), false);
pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), false);
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolvethread"), false);
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolvethread"), false);
pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), false );
pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"), false );
pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"), false );
@@ -100,6 +104,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
{
pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), !mrSidebarWin.IsResolved());
pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), mrSidebarWin.IsResolved());
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolvethread"), !mrSidebarWin.IsThreadResolved());
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolvethread"), mrSidebarWin.IsThreadResolved());
pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), !mrSidebarWin.IsProtected());
pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"));
pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"));
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 5ac9317ecd39..243cc6997c07 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1272,6 +1272,13 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
Invalidate();
mrMgr.LayoutPostIts();
break;
+ case FN_RESOLVE_NOTE_THREAD:
+ GetTopReplyNote()->SetResolved(!IsThreadResolved());
+ mrMgr.UpdateResolvedStatus(GetTopReplyNote());
+ DoResize();
+ Invalidate();
+ mrMgr.LayoutPostIts();
+ break;
case FN_FORMAT_ALL_NOTES:
case FN_DELETE_ALL_NOTES:
case FN_HIDE_ALL_NOTES:
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index e6478adf3292..5582f669547d 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1113,6 +1113,7 @@ void SwAnnotationShell::NoteExec(SfxRequest const &rReq)
case FN_POSTIT:
case FN_DELETE_COMMENT:
case FN_RESOLVE_NOTE:
+ case FN_RESOLVE_NOTE_THREAD:
if ( pPostItMgr->HasActiveSidebarWin() )
pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
break;
@@ -1185,6 +1186,20 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
}
break;
}
+ case FN_RESOLVE_NOTE_THREAD:
+ {
+ if( !pPostItMgr
+ || !pPostItMgr->HasActiveAnnotationWin() )
+ {
+ rSet.DisableItem(nWhich);
+ }
+ else
+ {
+ SfxBoolItem aBool(nWhich, pPostItMgr->GetActiveSidebarWin()->IsThreadResolved());
+ rSet.Put( aBool );
+ }
+ break;
+ }
case FN_DELETE_NOTE_AUTHOR:
case FN_HIDE_NOTE_AUTHOR:
{
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 821d1b114689..8be81830cf09 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -356,6 +356,15 @@ void SwTextShell::ExecField(SfxRequest &rReq)
}
break;
}
+ case FN_RESOLVE_NOTE_THREAD:
+ {
+ const SvxPostItIdItem* pIdItem = rReq.GetArg<SvxPostItIdItem>(SID_ATTR_POSTIT_ID);
+ if (pIdItem && !pIdItem->GetValue().isEmpty() && GetView().GetPostItMgr())
+ {
+ GetView().GetPostItMgr()->ToggleResolvedForThread(pIdItem->GetValue().toUInt32());
+ }
+ break;
+ }
case FN_DELETE_ALL_NOTES:
if ( GetView().GetPostItMgr() )
GetView().GetPostItMgr()->Delete();
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 9fc2e154628a..993d5cbd0479 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -145,6 +145,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:ReplyComment" menu:style="text"/>
<menu:menuitem menu:id=".uno:ResolveComment" menu:style="text"/>
+ <menu:menuitem menu:id=".uno:ResolveCommentThread" menu:style="text"/>
<menu:menuitem menu:id=".uno:DeleteComment" menu:style="text"/>
<menu:menuitem menu:id=".uno:DeleteAuthor" menu:style="text"/>
<menu:menuitem menu:id=".uno:DeleteAllNotes" menu:style="text"/>
diff --git a/sw/uiconfig/sglobal/popupmenu/annotation.xml b/sw/uiconfig/sglobal/popupmenu/annotation.xml
index 4724bde64c89..1805d2d62f7c 100644
--- a/sw/uiconfig/sglobal/popupmenu/annotation.xml
+++ b/sw/uiconfig/sglobal/popupmenu/annotation.xml
@@ -20,6 +20,7 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ReplyComment"/>
<menu:menuitem menu:id=".uno:ResolveComment"/>
+ <menu:menuitem menu:id=".uno:ResolveCommentThread"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:DeleteComment"/>
<menu:menuitem menu:id=".uno:DeleteAuthor"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index f84f9c18de07..f2bde8f51e67 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -150,6 +150,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:ReplyComment" menu:style="text"/>
<menu:menuitem menu:id=".uno:ResolveComment" menu:style="text"/>
+ <menu:menuitem menu:id=".uno:ResolveCommentThread" menu:style="text"/>
<menu:menuitem menu:id=".uno:DeleteComment" menu:style="text"/>
<menu:menuitem menu:id=".uno:DeleteAuthor" menu:style="text"/>
<menu:menuitem menu:id=".uno:DeleteAllNotes" menu:style="text"/>
diff --git a/sw/uiconfig/swriter/popupmenu/annotation.xml b/sw/uiconfig/swriter/popupmenu/annotation.xml
index e455091a41b1..87a294bc50c0 100644
--- a/sw/uiconfig/swriter/popupmenu/annotation.xml
+++ b/sw/uiconfig/swriter/popupmenu/annotation.xml
@@ -21,6 +21,7 @@
<menu:menuitem menu:id=".uno:ReplyComment"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ResolveComment"/>
+ <menu:menuitem menu:id=".uno:ResolveCommentThread"/>
<menu:menuitem menu:id=".uno:DeleteComment"/>
<menu:menuitem menu:id=".uno:DeleteAuthor"/>
<menu:menuitem menu:id=".uno:DeleteAllNotes"/>
diff --git a/sw/uiconfig/swriter/ui/annotationmenu.ui b/sw/uiconfig/swriter/ui/annotationmenu.ui
index c21c6bb555a5..7e669fc13f4b 100644
--- a/sw/uiconfig/swriter/ui/annotationmenu.ui
+++ b/sw/uiconfig/swriter/ui/annotationmenu.ui
@@ -36,6 +36,22 @@
</object>
</child>
<child>
+ <object class="GtkMenuItem" id="resolvethread">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="annotationmenu|resolvethread">Resolve Thread</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="unresolvethread">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="annotationmenu|unresolvethread">Unresolve Thread</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
<object class="GtkMenuItem" id="delete">
<property name="visible">True</property>
<property name="can_focus">False</property>
diff --git a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
index 023642de8d30..bf6c61250d69 100644
--- a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
@@ -330,6 +330,13 @@
</object>
</child>
<child>
+ <object class="GtkMenuItem" id="MenuComments-ResolveCommentThread">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">.uno:ResolveCommentThread</property>
+ </object>
+ </child>
+ <child>
<object class="GtkMenuItem" id="MenuComments-DeleteAuthor">
<property name="visible">True</property>
<property name="can_focus">False</property>