After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621827 - Change addin categories to constants
Change addin categories to constants
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
git master
Other Linux
: Normal normal
: ---
Assigned To: Aurimas Černius
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-16 21:48 UTC by Aurimas Černius
Modified: 2010-10-18 19:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed feature. (5.58 KB, patch)
2010-06-16 21:48 UTC, Aurimas Černius
rejected Details | Review
Turn addin categories into integer constants (13.82 KB, patch)
2010-09-30 18:46 UTC, Aurimas Černius
needs-work Details | Review
Change addin categories to constants (13.64 KB, patch)
2010-10-16 18:13 UTC, Aurimas Černius
accepted-commit_now Details | Review

Description Aurimas Černius 2010-06-16 21:48:28 UTC
Created attachment 163872 [details] [review]
Proposed feature.

Bug 620402 makes addin categories visible to user.
This patch makes them localizable.
Comment 1 Hubert Figuiere (:hub) 2010-09-22 15:45:54 UTC
The problem with the patch is that it confuse identifiers with human readable labels. The reason the strings where not translated is because they are identifiers.

The translation should be dealt with by mapping identifiers with labels in the UI. To ensure there is not typo with identifiers I also suggest to make them constants and have the addins only use that.
Comment 2 Aurimas Černius 2010-09-22 20:08:57 UTC
> The problem with the patch is that it confuse identifiers with human readable
> labels. The reason the strings where not translated is because they are
> identifiers.

I noticed this problem too. It's not big as each of them seems to appear only once in POT file. But it surely may become a bigger issue, if they get used more widely, so you are right.


> The translation should be dealt with by mapping identifiers with labels in the
> UI. To ensure there is not typo with identifiers I also suggest to make them
> constants and have the addins only use that.

I support the idea of identifiers being constants. I'll try to rewrite the patch this way.
Comment 3 Aurimas Černius 2010-09-30 18:46:16 UTC
Created attachment 171449 [details] [review]
Turn addin categories into integer constants

I have defined constants for addin categories and changed all addins to return them.
Comment 4 Hubert Figuiere (:hub) 2010-10-14 15:41:55 UTC
The change in void ExportToHtmlNoteAddin::export_button_clicked() seems to be unrelated. Was it intentional?
Comment 5 Aurimas Černius 2010-10-14 15:49:37 UTC
(In reply to comment #4)
> The change in void ExportToHtmlNoteAddin::export_button_clicked() seems to be
> unrelated. Was it intentional?


This modification is unrelated. It is actually already committed in order to fix the other bug.
I see one more accidental change at the very bottom of the patch (change of formatting).

Excluding these two, are there any more notes?
Comment 6 Hubert Figuiere (:hub) 2010-10-14 20:07:56 UTC
Also it would be preferrable to have the category be an enum {} rather than "const int". There is no reason to populate the symbol table with them.

Also they don't belong to src/sharp/dynamicmodule.hpp as this file isn't meant to be gnote specific.
Comment 7 Aurimas Černius 2010-10-16 18:13:31 UTC
Created attachment 172499 [details] [review]
Change addin categories to constants

Defined addin categories alongside the AbstractAddin.
Comment 8 Hubert Figuiere (:hub) 2010-10-18 01:49:50 UTC
Comment on attachment 172499 [details] [review]
Change addin categories to constants

Looks good to me.
Comment 9 Aurimas Černius 2010-10-18 19:12:54 UTC
Review of attachment 163872 [details] [review]:

This solution was rejected in favor to other.