Not logged in. · Lost password · Register
Forum: Community Feature Requests RSS
Formated strings
CORE feature

Announcement

11-16-2005, 12:33 by halr9000
Subject: Psi Groupchat (new address)
Join us at the Psi Groupchat (MUC)! Room name: psi@conference.psi-im.org
IceRAM (Moderator) #1
Member since 05/2003 · 1286 posts · Location: Bucharest, Romania
Group memberships: Global Moderators, Members
Show profile · Link to this post
This feature should go somewhere in the core of Psi, because lots of the features could depend on it.
I started a separate thread from the Summary of new features request for 0.9 to allow the users to comment uppon this feature request and not clutter the thread.

Idea started in:
http://psi.affinix.com/forums/index.php?ac...t=499#entry2994

> Roster items could be defined by something like: %IconUserStatus %StringUserRosterName %StringUserJID (%StringUserNoResources) %IconUserStatusString %IconUserPGP %IconUserTransport
This could be translated to:
(status icon) (user name) (userJID) (number of resources if different than 1) (PGP secured contact - icon) (info icon - the blue one I've seen as a patch around here to show status) (icon for the transport - assuming that there will be something in the future)
Result: (yellowstar) My Contact (jabber@my.contact.org) (3) (PGPicon) (infoIcon)
- of course this is kind of a paranoid over filled roster display, but it ilustrates the posibility of using these formated strings in the roster :)

> Auto-status strings could be something like: "Auto-away/XA: Last action: %TimeLastAction - Idle for %TimeIdle"

Of course, there should be some kind of dictionary for this strings or, at least, a method of building them:
%(item_category)(category)[(subcategory)](string_format_name)

item_category = {Icon, String, Time - I know this is also a string but it should be separated, VCard(?) }
category = {Status, User etc. }
string_format_name = { JID, LastActivity etc.}

Icons: IconUserStatus, IconUserStatusString, IconUserTransport, IconUserPGP
Strings: StringUserJID, StringUserRosterName, StringUserNoResources, StringStatusMessage, StringStatusType (Away, XA, DND...)
Time: TimeNowHHMMSS - this should be somehow defined, TimeLastActivity, TimeIdle

Strings with the same subcategory: StringUserStatusString, StringUserStatusType (Away, XA, DND...)

> Oh, not to metion some format specifiers like: %b (bold) %i (italic) %cRRGGBB (HTML hex style) or %c_colorname

> %n - for newline

> Now that I think of it, these formated strings could help the users define what they want to see in the tooltip when hovering over the contacts. If somebody would want a small tooltip, with little information, they will certainly have the posibility of choosing what to display in it.

Some format strings should work only in some windows/text boxes etc. to prevent crashes, unexpected behaviour etc.

(Probably these string format routines will help the development of the scripting support. As far as I know, this kind of "global/user variables" are used by mIRC in the scripting language.)

Displaying the formated strings could increase a little the CPU Usage but will bring with it a lot more functionality and versatility.
::/ my .net presence / weblog | psi
Avatar
halr9000 (Administrator) #2
User title: I work here
Member since 11/2002 · 2285 posts · Location: Atlanta
Group memberships: Administrators, Members
Show profile · Link to this post
This looks pretty cool.  The only problem I see is finding a resource to code it as infiniti said he was not interested in making the interface skinnable now, and your idea approaches that.  But I do like the ideas.
Hal Rottenberg
Webmaster, Evangelist, Co-conspirator to the Revolution
Avatar
Kev (Administrator) #3
User title: Project Lead
Member since 11/2002 · 3029 posts · Location: Exeter, UK
Group memberships: Administrators, Developers, Members
Show profile · Link to this post
I suspect this doesn't fall under the jurisdiction of skinning, so I suspect it's ok
Psi Project Leader.
Homepage, including development blog
IceRAM (Moderator) #4
Member since 05/2003 · 1286 posts · Location: Bucharest, Romania
Group memberships: Global Moderators, Members
Show profile · Link to this post
Well, I personally like the interface NOT beeing skinnable (as I mentioned in another thread).

This only reffers to the versatility part of the application, without affecting the exterior. Power users understanding the way these "masks" work will be able to "shrink" their tooltips, expand the information displayed in the roster etc.

Implemented, this would be turned into 2 functions (or maybe more, but I haven't thought of that before):

QString FormatPsiUSERStr(QString *formatstr, PsiUserObject *userinfo)
^ this would use global Psi variables and where you get User dependent variables it would include the information found in *userinfo.

QString FormatPsiStr(QString *formatstr)
^ would use only global Psi variables, user dependent variables (the ones with 'User' as category) will be replaced by an empty string.
::/ my .net presence / weblog | psi
Avatar
smoku #5
Member since 01/2003 · 101 posts · Location: Warsaw, Poland
Group memberships: Members
Show profile · Link to this post
But..
Should this be configurable per whole application (Profile)
or should it be a per roster item setting?

Second way, we could just parse the contact names to do that.
Of course it would not work in other client (producing strange contact names), but what the hell.. ;)
IceRAM (Moderator) #6
Member since 05/2003 · 1286 posts · Location: Bucharest, Romania
Group memberships: Global Moderators, Members
Show profile · Link to this post
I was thinking of it more like a per application configurable setting. It's no use messing the Roster.

As an improvement:

%ColorRosterItem, %ColorRosterBack etc.
with hex defined colors (RRGGBB)
::/ my .net presence / weblog | psi
IceRAM (Moderator) #7
Member since 05/2003 · 1286 posts · Location: Bucharest, Romania
Group memberships: Global Moderators, Members
Show profile · Link to this post
Improvement:
- allow customization of the messages displayed in ChatDlg (something like format string: "[%TimeHH:%%TimeMM] <%RosterName> %msg")

FlySpray task: #211 - Formated strings

[edit reason: corrected link (double "http://")]
::/ my .net presence / weblog | psi
This post was edited on 02-08-2004, 06:52 by Unknown user.
Avatar
spike (Administrator) #8
Member since 02/2003 · 1892 posts · Location: Leuven (Belgium)
Group memberships: Administrators, Developers, Members
Show profile · Link to this post
A detail, but the link doesn't work. (and since you seem to have editing capabilities, you might want to edit it ;))
Maybe you should also specify the relationship with #157

[edit reason: removed broken link - check the above one]
- Remko
This post was edited on 02-08-2004, 06:58 by Unknown user.
IceRAM (Moderator) #9
Member since 05/2003 · 1286 posts · Location: Bucharest, Romania
Group memberships: Global Moderators, Members
Show profile · Link to this post
Quote by spike on 02-08-2004, 00:50:
A detail, but the link doesn't work. (and since you seem to have editing capabilities, you might want to edit it ;))
Maybe you should also specify the relationship with #157
Corrected. 10x.
I was quite in a hurry (and sleepy) this morning at 2:05 AM (GMT+2)... and slipped 2 "http://" in front of the link.

Added related task to the main one.
I'm not sure, but this feature might solve quite a few tasks in the FlySpray.
::/ my .net presence / weblog | psi
IceRAM (Moderator) #10
Member since 05/2003 · 1286 posts · Location: Bucharest, Romania
Group memberships: Global Moderators, Members
Show profile · Link to this post
For a better integration with a possible tree-like structure for the config file, the variable names should not be a list concatenated strings, but a class-like representation (something like: %Color.Roster.Contact.Away - for the color of the contacts which are away).

This would help use the variables in the cofig file in the newly defined strings.

P.S. maybe the variables in the formated strings should be double-% (I mean "%" should be on both sides, to allow using the "." after a formatted string).
"%" is only a suggestion.
::/ my .net presence / weblog | psi
Close Smaller – Larger + Reply to this post:
Smilies: :mellow: :huh: ^_^ :o ;) :P :D :lol: B) :rolleyes: -_- <_< :) :wub: :angry: :( :unsure: :wacko: :blink: :ph34r:
Special characters:
Go to forum
Unclassified NewsBoard devel of 20051113 © 2003-5 by Yves Goergen
Current time: 08-20-2008, 22:41:24 (UTC -04:00)