officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 8 ++++ sfx2/source/control/unoctitm.cxx | 1 sw/inc/cmdid.h | 1 sw/sdi/_annotsh.sdi | 6 +++ sw/sdi/_textsh.sdi | 5 ++ sw/sdi/swriter.sdi | 17 ++++++++++ sw/source/uibase/docvw/AnnotationMenuButton.cxx | 6 +++ sw/source/uibase/docvw/AnnotationWin2.cxx | 8 ++++ sw/source/uibase/shells/annotsh.cxx | 16 ++++++++- sw/source/uibase/shells/textfld.cxx | 9 +++++ sw/uiconfig/sglobal/menubar/menubar.xml | 1 sw/uiconfig/sglobal/popupmenu/annotation.xml | 1 sw/uiconfig/swriter/menubar/menubar.xml | 1 sw/uiconfig/swriter/popupmenu/annotation.xml | 1 sw/uiconfig/swriter/ui/annotationmenu.ui | 16 +++++++++ sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui | 7 ++++ 16 files changed, 102 insertions(+), 2 deletions(-)
New commits: commit 0351db5774bfde36cc7730912de863ad7f54daa7 Author: Scott Clarke <scott.cla...@codethink.co.uk> AuthorDate: Wed Jun 19 16:29:54 2019 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Aug 27 17:50:28 2019 +0200 tdf#119228 Add UI elements to resolve and unresolve comments Co-authored-by: Jim MacArthur <jim.macart...@codethink.co.uk> (cherry picked from commit 6986ebd4a0020e515a115acbe7f1f738a4fd83f4) Conflicts: sw/uiconfig/sglobal/menubar/menubar.xml sw/uiconfig/swriter/menubar/menubar.xml Change-Id: I22403299d034a638724077744070b3add64cacf2 Reviewed-on: https://gerrit.libreoffice.org/78184 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 63835b385892..160290b46242 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -6270,6 +6270,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:ResolveComment" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Resolved</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:CellVertTop" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Top</value> diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 35ae00b2631d..fdc52138f8a9 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1058,6 +1058,7 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "SelectAll" || aEvent.FeatureURL.Path == "InsertAnnotation" || aEvent.FeatureURL.Path == "DeleteAnnotation" || + aEvent.FeatureURL.Path == "ResolveAnnotation" || aEvent.FeatureURL.Path == "InsertRowsBefore" || aEvent.FeatureURL.Path == "InsertRowsAfter" || aEvent.FeatureURL.Path == "InsertColumnsBefore" || diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 8a71956b3619..8e0ec469d648 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -727,6 +727,7 @@ #define FN_DELETE_COMMENT (FN_NOTES+6) #define FN_REPLY (FN_NOTES+7) #define FN_FORMAT_ALL_NOTES (FN_NOTES+8) +#define FN_RESOLVE_NOTE (FN_NOTES+9) // Region: Parameter #define FN_PARAM_MOVE_COUNT (FN_PARAM+2) diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi index 323d5d06b8b1..84f3aed0b007 100644 --- a/sw/sdi/_annotsh.sdi +++ b/sw/sdi/_annotsh.sdi @@ -60,6 +60,12 @@ interface _Annotation StateMethod = GetNoteState ; ] + FN_RESOLVE_NOTE + [ + ExecMethod = NoteExec ; + StateMethod = GetNoteState ; + ] + FN_POSTIT [ ExecMethod = NoteExec ; diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 466b02c5e0bb..5d975daa74f4 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -946,6 +946,11 @@ interface BaseText ExecMethod = ExecField ; StateMethod = StateField; ] + FN_RESOLVE_NOTE + [ + ExecMethod = ExecField ; + StateMethod = StateField; + ] FN_DELETE_NOTE_AUTHOR [ ExecMethod = ExecField ; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 69edddb1571d..5f03b7d9799c 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -7067,6 +7067,23 @@ SfxVoidItem DeleteComment FN_DELETE_COMMENT GroupId = SfxGroupId::Edit; ] +SfxVoidItem ResolveComment FN_RESOLVE_NOTE +(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 1b4a19171f28..ad523ec5f822 100644 --- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx +++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx @@ -70,6 +70,8 @@ void AnnotationMenuButton::Select() OString sIdent = GetCurItemIdent(); if (sIdent == "reply") mrSidebarWin.ExecuteCommand(FN_REPLY); + if (sIdent == "resolve" || sIdent == "unresolve") + mrSidebarWin.ExecuteCommand(FN_RESOLVE_NOTE); else if (sIdent == "delete") mrSidebarWin.ExecuteCommand(FN_DELETE_COMMENT); else if (sIdent == "deleteby") @@ -86,6 +88,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt ) if (mrSidebarWin.IsReadOnly()) { pButtonPopup->EnableItem(pButtonPopup->GetItemId("reply"), false); + pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), false); + pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), false); pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), false ); pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"), false ); pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"), false ); @@ -93,6 +97,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt ) } else { + pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), !mrSidebarWin.IsResolved()); + pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), mrSidebarWin.IsResolved()); 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 c504bef5c5e1..500a839f0f06 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -1238,10 +1238,16 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot) break; } case FN_DELETE_COMMENT: - //Delete(); // do not kill the parent of our open popup menu mnEventId = Application::PostUserEvent( LINK( this, SwAnnotationWin, DeleteHdl), nullptr, true ); break; + case FN_RESOLVE_NOTE: + GetTopReplyNote()->ToggleResolved(); + 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 caadf19e45e8..31d71d98a23b 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -1108,10 +1108,10 @@ void SwAnnotationShell::NoteExec(SfxRequest const &rReq) case FN_REPLY: case FN_POSTIT: case FN_DELETE_COMMENT: + case FN_RESOLVE_NOTE: if ( pPostItMgr->HasActiveSidebarWin() ) pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot); break; - case FN_DELETE_ALL_NOTES: pPostItMgr->Delete(); break; @@ -1167,6 +1167,20 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet) } break; } + case FN_RESOLVE_NOTE: + { + if( !pPostItMgr + || !pPostItMgr->HasActiveAnnotationWin() ) + { + rSet.DisableItem(nWhich); + } + else + { + SfxBoolItem aBool(nWhich, pPostItMgr->GetActiveSidebarWin()->IsResolved()); + 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 28d4d7762594..8fd310a47510 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -342,6 +342,15 @@ void SwTextShell::ExecField(SfxRequest &rReq) } } break; + case FN_RESOLVE_NOTE: + { + 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 60bdac3aaa45..bddfdf9ab9d7 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -147,6 +147,7 @@ <menu:menu menu:id=".uno:EditCommentsMenu"> <menu:menupopup> <menu:menuitem menu:id=".uno:ReplyComment"/> + <menu:menuitem menu:id=".uno:ResolveComment"/> <menu:menuitem menu:id=".uno:DeleteComment"/> <menu:menuitem menu:id=".uno:DeleteAuthor"/> <menu:menuitem menu:id=".uno:DeleteAllNotes"/> diff --git a/sw/uiconfig/sglobal/popupmenu/annotation.xml b/sw/uiconfig/sglobal/popupmenu/annotation.xml index 2ddcf03e8591..4724bde64c89 100644 --- a/sw/uiconfig/sglobal/popupmenu/annotation.xml +++ b/sw/uiconfig/sglobal/popupmenu/annotation.xml @@ -19,6 +19,7 @@ </menu:menu> <menu:menuseparator/> <menu:menuitem menu:id=".uno:ReplyComment"/> + <menu:menuitem menu:id=".uno:ResolveComment"/> <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 ffe3e4e7ada7..c26df564b5ff 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -147,6 +147,7 @@ <menu:menu menu:id=".uno:EditCommentsMenu"> <menu:menupopup> <menu:menuitem menu:id=".uno:ReplyComment"/> + <menu:menuitem menu:id=".uno:ResolveComment"/> <menu:menuitem menu:id=".uno:DeleteComment"/> <menu:menuitem menu:id=".uno:DeleteAuthor"/> <menu:menuitem menu:id=".uno:DeleteAllNotes"/> diff --git a/sw/uiconfig/swriter/popupmenu/annotation.xml b/sw/uiconfig/swriter/popupmenu/annotation.xml index 2ddcf03e8591..e455091a41b1 100644 --- a/sw/uiconfig/swriter/popupmenu/annotation.xml +++ b/sw/uiconfig/swriter/popupmenu/annotation.xml @@ -20,6 +20,7 @@ <menu:menuseparator/> <menu:menuitem menu:id=".uno:ReplyComment"/> <menu:menuseparator/> + <menu:menuitem menu:id=".uno:ResolveComment"/> <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 edec7f13542a..c21c6bb555a5 100644 --- a/sw/uiconfig/swriter/ui/annotationmenu.ui +++ b/sw/uiconfig/swriter/ui/annotationmenu.ui @@ -20,6 +20,22 @@ </object> </child> <child> + <object class="GtkMenuItem" id="resolve"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="annotationmenu|resolve">Resolve</property> + <property name="use_underline">True</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="unresolve"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="annotationmenu|unresolve">Unresolve</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 dde4c70452a5..bd6b2fa0ca72 100644 --- a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui +++ b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui @@ -323,6 +323,13 @@ </object> </child> <child> + <object class="GtkMenuItem" id="MenuComments-ResolveComment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="action_name">.uno:ResolveComment</property> + </object> + </child> + <child> <object class="GtkMenuItem" id="MenuComments-DeleteAuthor"> <property name="visible">True</property> <property name="can_focus">False</property> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits