|
SVN commit 1012412 by aclemens:
New utility: ManualRename This utility will replace the old ManualRenameInput widget. The goal of this utility is to have a more flexible parser that can be expanded quite easily. To create a new parser, inherit from Digikam::ManualRename::Parser and overwrite the parse() method (and, if needed, slotTokenTriggered()). A parser can register a button or menu in the client widget, right now the only client widget is ManualRenameWidget, that behaves like the old ManualRenameInput widget. These buttons and menus can be used to access a token, so that the user doesn't have to type in the actual parse string. Every parser has one or more token objects. The token information can be used to create the menu actions or the button. In the ManualRenameWidget, this information is also used to create the tooltip helper button. So if you add a new parser, the button, menu and tooltip is automatically created, to minimize coding efforts. Some parsers might want to provide additional dialogs, to show / use them overwrite the slotTokenTriggered() method and create the dialog in there. The parse information has to be provided to the parse() method with a ParseInformation object. If you create a new parser and need additional information (right now filename, cameraName, dateTime and index is provided), add the extra information to the ParseInformation class and make sure the client fills in the correct values. The layout of the ManualRenameWidget can be controlled with flags (TokenInputStyle): - None: No control buttons or toolbutton with menu is shown - BigButtons: the widget uses big buttons below the KLineInput widget. The column number can be set in the registerParsers(int columns) method. (used in CameraUI) - ToolButton: a small toolbutton is shown next to the KLineInput widget. This is normally useful if you don't have much space in the client. (used in BQM) The TokenInputStyle can be combined, if needed: setTokenInputStyle(BigButtons|ToolButton) In the future we might even remove the "Custom" rename widgets from the camera import dialog, because it actually is less powerful and you are not able to change the order of the added information. What do you think? I guess with the quick-access buttons, the ManualRenameWidget is quite user friendly now, so the custom widget can be removed. CCMAIL:[hidden email] M +60 -48 CMakeLists.txt M +4 -0 digikam/CMakeLists.txt D libs/widgets/common/manualrenameinput.cpp D libs/widgets/common/manualrenameinput.h M +3 -1 tests/CMakeLists.txt D tests/manualrenameinputtest.cpp D tests/manualrenameinputtest.h A tests/manualrenametest.cpp [License: GPL (v2+)] A tests/manualrenametest.h tests/manualrenameinputtest.h#1012228 [License: GPL (v2+)] M +28 -26 utilities/cameragui/renamecustomizer.cpp A utilities/manualrename (directory) A utilities/manualrename/manualrenameparser.cpp [License: GPL (v2+)] A utilities/manualrename/manualrenameparser.h [License: GPL (v2+)] A utilities/manualrename/manualrenamewidget.cpp [License: GPL (v2+)] A utilities/manualrename/manualrenamewidget.h libs/widgets/common/manualrenameinput.h#1012228 [License: GPL (v2+)] A utilities/manualrename/parsers (directory) A utilities/manualrename/parsers/authorparser.cpp [License: GPL (v2+)] A utilities/manualrename/parsers/authorparser.h tests/manualrenameinputtest.h#1012228 [License: GPL (v2+)] A utilities/manualrename/parsers/cameranameparser.cpp [License: GPL (v2+)] A utilities/manualrename/parsers/cameranameparser.h tests/manualrenameinputtest.h#1012228 [License: GPL (v2+)] A utilities/manualrename/parsers/dateparser.cpp [License: GPL (v2+)] A utilities/manualrename/parsers/dateparser.h [License: GPL (v2+)] A utilities/manualrename/parsers/dateparserdialogwidget.ui A utilities/manualrename/parsers/filenameparser.cpp [License: GPL (v2+)] A utilities/manualrename/parsers/filenameparser.h tests/manualrenameinputtest.h#1012228 [License: GPL (v2+)] A utilities/manualrename/parsers/metadataparser.cpp [License: GPL (v2+)] A utilities/manualrename/parsers/metadataparser.h tests/manualrenameinputtest.h#1012228 [License: GPL (v2+)] A utilities/manualrename/parsers/parser.cpp [License: GPL (v2+)] A utilities/manualrename/parsers/parser.h [License: GPL (v2+)] A utilities/manualrename/parsers/sequencenumberparser.cpp [License: GPL (v2+)] A utilities/manualrename/parsers/sequencenumberparser.h [License: GPL (v2+)] A utilities/manualrename/parsers/token.cpp tests/manualrenameinputtest.h#1012228 [License: GPL (v2+)] A utilities/manualrename/parsers/token.h tests/manualrenameinputtest.h#1012228 [License: GPL (v2+)] M +11 -2 utilities/queuemanager/queuelist.cpp M +4 -3 utilities/queuemanager/queuesettingsview.cpp http://websvn.kde.org/?view=rev&revision=1012412 _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
| Free forum by Nabble | Edit this page |
