Overhaul author profile and author profile saving and loading.
ClosedPublic

Authored by woltherav on Aug 2 2017, 4:13 PM.

Details

Summary

See T6627 for the details.

This adds firstname and last name as well as a editable list in the contact info so that people can just add whatever entries.

This is what it looks like now:

Test Plan

I have saved and loaded an image and can confirm it shows up properly in the document info widget. I have not managed to test a document with the old metadata yet.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
woltherav updated this revision to Diff 21920.Nov 5 2017, 4:21 PM
woltherav added a subscriber: Krita.

Uhm, I updated this so it works with scott's changes to the preferences.

I had some more ambitious ideas for this, but it seems I forgot that my primary problem is that author profiles are stored in the kritarc and thus I need to simplyify how they are expressed.

woltherav edited the summary of this revision. (Show Details)Nov 5 2017, 4:25 PM
rempt added a subscriber: rempt.Nov 5 2017, 4:26 PM
I had some more ambitious ideas for this, but it seems I forgot that my primary problem is that author profiles are stored in the kritarc and thus I need to simplyify how they are expressed.

Should we make them resources?

Maybe, yes, but how? I don't know enough about resources to understand how to do that...

Deevad added subscribers: scottpetrovic, Deevad.EditedNov 5 2017, 11:39 PM

I really like the visual changes @scottpetrovic ! The list/tree view of main category on left sidebar looks easier to navigate.

@woltherav : very interesting panel! ( <property name="buddy"> xD ) I like the large field "Contact" with the possibility to add more informations like email/adress/website/social-network/phone. Very cool.

januz awarded a token.Nov 6 2017, 12:18 AM
woltherav updated this revision to Diff 21992.Nov 6 2017, 7:42 PM

Now with 100% more local xml saving courtesy of @rempt
What this accomplishes, outside of not losing your author profiles when deleting the kritarc, is that we can have a little bit more data, such as whether a contact mode is email or a webpage or something.

This allows us to get the following gui+xml output:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document-info PUBLIC '-//KDE//DTD document-info 1.1//EN' 'http://www.calligra.org/DTD/document-info-1.1.dtd'>
<document-info xmlns="http://www.calligra.org/DTD/document-info">
 <about>
  <title>meeo</title>
  <description></description>
  <subject></subject>
  <abstract><![CDATA[]]></abstract>
  <keyword></keyword>
  <initial-creator>Unknown</initial-creator>
  <editing-cycles>8</editing-cycles>
  <editing-time></editing-time>
  <date>2017-11-06T20:21:15</date>
  <creation-date>2017-11-06T19:42:13</creation-date>
  <language></language>
 </about>
 <author>
  <full-name>JohnnyAwesome</full-name>
  <creator-first-name>John</creator-first-name>
  <creator-last-name>Doe</creator-last-name>
  <initial>B.</initial>
  <author-title>Mr.</author-title>
  <position>Artist</position>
  <company>Awesomecomp</company>
  <contact type="telephone">000 000 000 000</contact>
  <contact type="homepage">http:cool.cool</contact>
 </author>
</document-info>

This can be improved with some beauty changes, but first it needs review and testing.

rempt added a comment.Nov 7 2017, 9:36 AM

Maybe the Add contact info button should be disabled if it cannot be used, for instance if the author is "Default"?

Oh, and the tab order in the widget is a bit weird :-)

I am not even sure if we should keep a default author, but the code for this is a wee bit convoluted.

I am not sure how to fix the tab order, previous times it was determine dby the order in whcih the widgets were made, but I have no idea how that works with qt designer.

rempt added a comment.Nov 7 2017, 1:20 PM
I am not sure how to fix the tab order, previous times it was determine dby the order in whcih the widgets were made, but I have no idea how that works with qt designer.

There is a miniscule button in the toolbar that allows you to set the tab order by clicking on widgets in order. It's the fourth button and it's gray with some kind of blueish thing that I cannot make out in front.

woltherav updated this revision to Diff 22029.Nov 7 2017, 2:25 PM

Updated with tab changes and the default author profile is disabled, gui-wise.

rempt added a comment.Nov 8 2017, 10:18 AM

Yes, that works fine now! I'm wondering whether it wouldn't be better to switch the two columns in the the contact info list: so it becomes

homepage http://www.valdyas.org

instead of

http://www.valdyas.org homepage

In D7076#165649, @rempt wrote:

Yes, that works fine now! I'm wondering whether it wouldn't be better to switch the two columns in the the contact info list: so it becomes

homepage http://www.valdyas.org

instead of

http://www.valdyas.org homepage

I'm completely neutral on that, so others should chime in(or not...)

rempt accepted this revision.Nov 24 2017, 1:45 PM
This revision is now accepted and ready to land.Nov 24 2017, 1:45 PM
This revision was automatically updated to reflect the committed changes.