zxdaa217 / tortoisesvn

Automatically exported from code.google.com/p/tortoisesvn
0 stars 1 forks source link

custom properties with custom property dialogs #151

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We already have the tsvn:userfileproperties and tsvn:userdirproperties, but 
these only populate the combo box where the user can select a property to 
edit/add.

To make it even easier to use custom properties, we should define a way to also 
specify how the dialog to edit/set those properties should look like.

At least three specific situations should be handled:

* boolean properties
  this dialog would show a checkbox with a custom text
* state properties
  this dialog would show radio buttons with custom texts
* text properties
  this dialog would show first a label explaining the property, then and edit box where the text can be entered. Either single-line or multi-line.

Original issue reported on code.google.com by tortoisesvn on 4 Dec 2011 at 11:28

GoogleCodeExporter commented 8 years ago
Both tsvn:userfileproperties and tsvn:userdirproperties containe a newline 
separated list of custom properties. We can simply extend those existing 
properties:

boolean properties:
propertyname=bool(YES;NO;checkboxtext)labeltext

with
propertyname      : the name of the custom property
bool              : dialog to use, here 'boolean' with one checkbox
YES               : value to set the property to when checked
NO                : value to set the property to when unchecked
checkboxtext      : text to show for the checkbox
labeltext         : text explaining the property, shown in a label above the 
checkbox

state properties:
propertyname=radio=DEFVAL(VAL1;radiotext1;VAL2;radiotext2;VAL3;radiotext3;VAL4;r
adiotext4;VAL5;radiotext5)labeltext

with
propertyname      : the name of the custom property
radio             : dialog to use, here 'radio buttons' with up to five radio 
buttons
DEFVAL            : which one of the radio buttons is the default one, one of 
VAL1, VAL2, ...
VALx              : value to set the property to when checked
radiotextx        : text to show for the radio button
labeltext         : text explaining the property, shown in a label above the 
radio buttons

text properties single line:
propertyname=singletext;labeltext;regex

with
propertyname      : the name of the custom property
singletext        : dialog to use, here the one with the single line edit box
labeltext         : text explaining the property
regex             : a regex match string to use to validate the entered text.

text properties multi line:
propertyname=multitext;labeltext;regex

with
propertyname      : the name of the custom property
multitext         : dialog to use, here the one with the multi line edit box
labeltext         : text explaining the property
regex             : a regex match string to use to validate the entered text.

Original comment by tortoisesvn on 4 Dec 2011 at 11:43

GoogleCodeExporter commented 8 years ago
thinking a little bit further:
instead of just providing a dialog with radio buttons, the same syntax could be 
used to show a dialog with a combo listbox, or even a list control with 
checkboxes. There the number of choseable items would not be limited to 5.

Original comment by tortoisesvn on 4 Dec 2011 at 11:45

GoogleCodeExporter commented 8 years ago

Original comment by tortoisesvn on 29 Dec 2011 at 9:45

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r22423.

Add class which handles custom user properties.

Original comment by tortoisesvn on 29 Dec 2011 at 3:41

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r22424.

Implement custom dialogs for user properties according to their specified type.

Original comment by tortoisesvn on 29 Dec 2011 at 3:43

GoogleCodeExporter commented 8 years ago
Property formats are now:
propertyname=bool;labeltext(YESVALUE;NOVALUE;Checkboxtext)
propertyname=state;labeltext(DEFVAL;VAL1;TEXT1;VAL2;TEXT2;VAL3;TEXT3;...)
propertyname=singleline;labeltext(regex)
propertyname=multiline;labeltext(regex)

Original comment by tortoisesvn on 29 Dec 2011 at 4:02

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r22425.

User properties that are set with tsvn:userdirproperties are only set on 
folders, i.e. they're treated the same way as tsvn:, webviewer:, bugtraq: 
properties.

Original comment by tortoisesvn on 29 Dec 2011 at 4:16

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r22426.

Prevent an exception when parsing an invalid user property

Original comment by tortoisesvn on 29 Dec 2011 at 4:17

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r22427.

Cut off the config part of the user props for the generic edit prop dialog.

Original comment by tortoisesvn on 29 Dec 2011 at 4:18

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r22428.

Use a vector instead of a map for the state pairs: the map is sorted which 
resulted in having the values not in the order the user specified them.

Original comment by tortoisesvn on 29 Dec 2011 at 5:04

GoogleCodeExporter commented 8 years ago
Some screenshots of the custom dialogs.
The dialogs were made with the following tsvn:userdirproperties value:

my:boolprop=bool;This is a bool type property. Either check or uncheck 
it.(true;false;my bool prop)
my:stateprop1=state;This is a state property. Select one of the two 
states.(true;true;true value;false;false value)
my:stateprop2=state;This is a state property. Select one of the three 
states.(maybe;true;answer is correct;false;answer is wrong;maybe;not answered)
my:stateprop3=state;Specify the day to set this 
property.(1;1;Monday;2;Tuesday;3;Wednesday;4;Thursday;5;Friday;6;Saturday;7;Sund
ay)
my:singlelineprop=singleline;enter a small comment(.*)
my:multilineprop=multiline;copy and paste a full chapter here(.*)

Original comment by tortoisesvn on 29 Dec 2011 at 5:10

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r22429.

Original comment by tortoisesvn on 29 Dec 2011 at 6:03