We nowadays have a very nice drop-down menu for adding headers and footers in writer. The menu contains a few items; I'd like to add: "Add Page Number" - to make it easy for newbies that don't know that a page-number is a field (etc.) to trivially add a page number to their documents =) The code to add these items is here: sw/source/uibase/docvw/HeaderFooterWin.cxx // Create and set the PopupMenu m_pPopupMenu = new PopupMenu(SW_RES(MN_HEADERFOOTER_BUTTON)); // Rewrite the menu entries' text if (m_bIsHeader) { m_pPopupMenu->SetItemText(FN_HEADERFOOTER_EDIT, SW_RESSTR(STR_FORMAT_HEADER)); m_pPopupMenu->SetItemText(FN_HEADERFOOTER_DELETE, SW_RESSTR(STR_DELETE_HEADER)); } It might be great to add an: "Insert PageNumber" menu there to make this common case much simpler. Of course, that would also require a new string: $ git grep STR_FORMAT_HEADER And a new slot for that (cf. FN_HEADERFOOTER_EDIT) which is perhaps a pain - and some code to actually create and insert the field - and then we can argue if a sub-menu with left/right/center is required ;-) and what to do if the header has something in it already ;-) but ... An idea to play with.
Kendy - can we poke the UX team to see if this might be worth turning into an easy-hack ? I didn't add the keywords yet =)
Changing the component to ux-advise to collect the UX input :-)
I'm not really convinced of having Insert>Header>Default followed by Insert>Field>Page Number in one 'function' (i.e. menu item). Insert>Header>Page Number (below a separator to the styles in this submenu) mixes styles with functions and it would be a duplicate of the fields menu. However I agree with the use case. Two ideas: if the header/footer was a clearly different area we could show options context sensitive in the sidebar. And the simple but not really obvious alternative is to provide fields in the context menu or the toolbar - but please only when the header/footer is active.
We're replacing our use of the 'ux-advise' component with a keyword: Component -> LibreOffice Add Keyword: needsUXEval [NinjaEdit]
Created attachment 137235 [details] Current header context menu Ignore comment 3; the idea is to have "Add page number" in the header context menu. Code pointers in comment 0.
I could not find the callback function of the button "Insert|Page Number" within the menu bar, would you like to tell me some clues? I plan to add that to the public function SwHeaderFooterWin::ExecuteCommand(), Thanks. :)
If you checkout sw/uiconfig/swriter/menubar/menubar.xml you can see all the menu commands and their UNO names: <menu:menuitem menu:id=".uno:InsertPageNumberField"/> if you git grep for that UNO name 'InsertPageNumberField' you should find what you need. Thanks for working on this !
Anybody working on this bug? I am a beginner and would like to work on this if no one's working on this.
(In reply to Himanshu Ranjan from comment #8) > Anybody working on this bug? > I am a beginner and would like to work on this if no one's working on this. To my knowledge and what is stated on the ticket nobody is currently working on it. You are very welcome, feel free to ask any question.
Where can I find the code for the menu drop-down button of Header which is shown in the attachment above ( https://bug-attachments.documentfoundation.org/attachment.cgi?id=137235 ) ? Moreover, can anyone tell what is required to add a field in the Header menu drop-down? I mean, is any language required other than c++ or is any software needed to do this. I was thinking to write a similar code as of (Insert->Page Number) in the file where the code for Header menu drop-down is given. Also any advice on how to understand this code would be really great.
Gulsah Kose committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=463ca11b764dfdf48d0422b0a392a462bf6681a3 [Pardus] tdf#92685 Add insert page number option to header menu. It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
@Gulsah Kose, I'm wondering if the 'insert page number' option should disappear once the page number has been added? @Heike, what do you think?
(In reply to Xisco Faulí from comment #12) > @Gulsah Kose, I'm wondering if the 'insert page number' option should > disappear once the page number has been added? > > @Heike, what do you think? Sounds reasonable though some users may want to insert a page number at left and at right. Okay, likely less then "some". If we do so, depending on the effort for Gulsah, the menu entry should rather be disabled.
@Xisco and @Heiko, I am going to do it today. o/
I'm not in favor of disappearing Page Number. IMHO way to go is to extend menu Insert-Page Number (via submenu) to create Header or Footer with Page Number (possibly offering another submenu for left, center or right position). And that's a new bug. In that case we should not have disappearing menu but rather changing page number position if another option in menu is chosen. Related to this bug, I'd rather see submenu on this new "Insert Page Number" in header/footer to offer left, center or right position.
I'm not in favor of disappearing Page Number. IMHO way to go is to extend menu Insert-Page Number (via submenu) to create Header or Footer with Page Number (possibly offering another submenu for left, center or right position). And that's a bug 86630. In that case we should not have disappearing menu but rather changing page number position if another option in menu is chosen. Related to this bug, I'd rather see submenu on this new "Insert Page Number" in header/footer to offer left, center or right position.
(In reply to Timur from comment #16) > I'm not in favor of disappearing Page Number. > IMHO way to go is to extend menu Insert-Page Number (via submenu) to create > Header or Footer with Page Number (possibly offering another submenu for > left, center or right position). And that's a bug 86630. > In that case we should not have disappearing menu but rather changing page > number position if another option in menu is chosen. > Related to this bug, I'd rather see submenu on this new "Insert Page Number" > in header/footer to offer left, center or right position. Well, we could go with radio buttons Page Number > (o) None ( ) Left ( ) Right, if this isn't an overkill.
@Heike @Xisco and @Timur. I think it should be new bug report or edit bug 86630.I will continue to work when you make your final decision.
I have received a request for this bug from Pardus team. They also want like "1/10" page number option. I am prepearing a new patch for this. Please let me know if there is a problem.
Patch is ready https://gerrit.libreoffice.org/#/c/54687/ . Waiting your ideas and reviews.
Gulsah Kose committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2a93d2a4af7bb72b155f91e18239cc1b5bc90a4e [Pardus] tdf#92685 Add insert page count option to header menu It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I've just submit to master now. Still if there is a problem here i can revert orchange it again.
(In reply to Gülşah Köse from comment #22) > I've just submit to master now. Still if there is a problem here i can > revert orchange it again. @Gülşah: Do you plan to also apply the same patch also for the Footer? It seems that the patch was only for the Header, but the feature would IMHO make also sense for the Footer.
@Gerry: seems like you were reading, not trying this? Because both header and footer menu have Insert Page Number and Insert Page Count options. @Gülşah: Is is feasible to have submenu on these new options to offer left, center or right position?
@Timur I recommend that we do not crowd the menu any more, as it is very easy to do with Tab.
(In reply to Timur from comment #24) > @Gerry: seems like you were reading, not trying this? Because both header > and footer menu have Insert Page Number and Insert Page Count options. @Timur: Thanks for your reply. Is then the description in the 6.1 release notes incomplete? Should "Add insert page number option to header menu." correctly be "Add insert page number option to header or footer menu."? https://wiki.documentfoundation.org/ReleaseNotes/6.1#General
Yes, I corrected that. Thank you.