PATCH: KIO::RenameDlg

Dawit A. adawit at kde.org
Mon Oct 13 13:57:14 BST 2003


On Monday 13 October 2003 02:24, David Faure wrote:
> On Monday 13 October 2003 04:56, Dawit A. wrote:
> > On Sunday 12 October 2003 16:28, David Faure wrote:
> > > On Saturday 11 October 2003 03:25, Dawit A. wrote:
> > > > Hi,
> > > >
> > > > The following is one possible fix to correct the problem of an
> > > > ungainly wide rename dialog box mentioned in BR# 62736. It uses
> > > > QToolTip to show the entire name of the source file if needed.
> > >
> > > Good idea, but what about using KSqueezedLabel instead of
> > > KStringHandler::cEmSqueeze, so that resizing the dialog shows more
> > > characters?
> >
> > I wanted to do it that way first, but then I realized that we really only
> > want to squeeze long file names and not the other parts of the message,
> > no ?
>
> Yes - so what about using a QLabel, and a KSqueezedTextLabel, side by side?
> Hmm, might be a bad idea for i18n.
>
> Another idea:
> maybe KSqueezedTextLabel could have setMiniminumCharsLeft() /
> setMinimumCharsRight(), so it would not try to squeeze those chars. This
> still requires to call i18n on the string with %1, then look for %1 in the
> resulting string, deduce the numbers of chars left and right, and finally
> use arg().
> Or we could use 3 labels from the result of the above
> (QLabel/KSqueezedTextLabel/QLabel); might be simpler than enhancing
> KSqueezedTextLabel.

Also another solution to splitting the message into three lables (QLable/
KSqueezedTextLabe/QLabel) would be to redo the messages so that the filenames 
endup either at the beggining or end of the message. That way we can avoid 
the extra QLabel, but then it would put a burden on the translators...

Hmm.. well lets stick with the simplest solution for now and see if it would 
work. I commited a patch that uses KSqueezedTextLabel only and everything 
looked okay (the messages were not squeezed) even at 800x600, but I now have 
the opposite problem where the dialog box is made too small because the 
algorithm in the KSqueezedTextLabel is overly aggressive. :) See

http://members.cox.net/dawit/kde/screenshots/renamedlg2.png

Anyways, I will try fixing that by setting the mimimumWidth of the labels to 
something more reasonable...

> > > -        QLabel *lb = new QLabel( sentence1 + i18n("Do you want to use
> > > another file name?"), this ); You shouldn't remove this label, it
> > > explains the reason for the lineedit.
> >
> > I did not remove it. See the lines above it...
>
> Hmm? It wasn't visible in the screenshot...

That section of the code that causes the above message to be displayed was not 
invoked because I do not have anything that handles the mime-type of the 
downloaded file.

-- 
Regards,
Dawit A.
"Preach what you practice, practice what you preach"




More information about the kde-core-devel mailing list