Bug 54691 - Displayed forms don't resize the window correctly
Summary: Displayed forms don't resize the window correctly
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Jabber Plugin (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-15 22:07 UTC by Till Gerken
Modified: 2004-02-20 02:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Till Gerken 2003-02-15 22:07:09 UTC
Version:           0.6.0cvs >= 20030209 (using KDE 3.1.9)
Compiler:          gcc version 3.2.3 20030210 (Debian prerelease)
OS:          Linux (i686) release 2.4.20-pre11

When registering with a service (partially also for browsing services), the window that contains the form is not correctly resized to display all contents. I tried adjustSize() but this didn't help. No known fix yet.
Comment 1 Martijn Klingens 2003-11-09 16:26:37 UTC
Till, How can I reproduce this? (Where is this 'registering' hidden in the GUI?) Do you mean creating a new account? That seems to work here, might have been fixed during the move to KopeteAccounts during Kopete 0.7.x development.

Martijn
Comment 2 Stefan Gehn 2003-11-09 16:34:34 UTC
It's the jabber services stuff. Both the search and the register window allow being resized to something smaller than their actual contents.
I have the same problem with Noatun tag editor and no fix either :(
Comment 3 Till Gerken 2003-11-09 18:16:33 UTC
Not only that, most of the times the default window size is too small to display the form contents. Thus, after all widgets have been instantiated, the window shows only part of its contents.
Comment 4 Martijn Klingens 2003-11-09 18:24:39 UTC
Subject: Re: [Kopete-devel]  Displayed forms don't resize the window correctly

On Sunday 09 November 2003 18:16, Till Gerken wrote:
> Not only that, most of the times the default window size is too small to
> display the form contents. Thus, after all widgets have been instantiated,
> the window shows only part of its contents.

I can't reproduce any of this.

I right-click my Jabber account's status bar icon and click 'Services...' and 
then hit the Query Server button. Whatever I try, the window has the right 
minimum size hint and never shrinks beyond what it should do.

Comment 5 Till Gerken 2003-11-10 01:32:44 UTC
You need to register with a service from the query window. The query window itself is fine.
Comment 6 Martijn Klingens 2003-11-10 09:57:39 UTC
Subject: Re: [Kopete-devel]  Displayed forms don't resize the window correctly

On Monday 10 November 2003 01:32, Till Gerken wrote:
> You need to register with a service from the query window. The query window
> itself is fine.

Hmm, I'm not sure if I _want_ to register with public chat rooms...

Is there a way for me to test without actually registering? Or is the 
registration per Kopete session rather than forever?

Comment 7 Till Gerken 2003-11-10 12:41:43 UTC
Martijn, sometimes it would be easier if you just went ahead and tried it. :) You don't need to press the "register" button, you only need to have a look at the window to see what's wrong. :)

Jabber services use dynamic registration forms. If a user wants to register with a service, the client first requests the necessary form and displays it (XML -> Qt widget transformation). The display step is where it goes wrong.

Whether you actually fill the form with data and send it to the server is a totally different question, and really works fine already. :)
Comment 8 Martijn Klingens 2003-11-10 14:40:08 UTC
Subject: Re: [Kopete-devel]  Displayed forms don't resize the window correctly

On Monday 10 November 2003 12:41, Till Gerken wrote:
> Whether you actually fill the form with data and send it to the server is a
> totally different question, and really works fine already. :)

Yes, and *that* is the reason for my comment, I don't _WANT_ to register 
myself on public chat forums...

Anyway, will try tonight, without actually registering that is.

Comment 9 Martijn Klingens 2003-11-10 23:41:52 UTC
Subject: Re: [Kopete-devel]  Displayed forms don't resize the window correctly

Ok, I could reproduce the problem. Also, adding a call to updateGeometry() 
together with updateSize() helps to get the geometry straight, but doesn't 
avoid the resize bug that you can resize to a way to small size.

Another interesting note: due to a problem with the Jabber server right now I 
noticed that the ORIGINAL window (please wait while querying the server) 
behaves as expected!

Currently I can't try the effect of just updateGeometry without the 
updateSize, perhaps it works, but I think something is still broken with the 
widgets you add.

I can also reproduce the problem with the search dialog, but didn't try to fix 
it there yet.

Comment 10 Martijn Klingens 2003-11-10 23:43:06 UTC
Ok, I could reproduce the problem. Also, adding a call to updateGeometry() together with updateSize() helps to get the geometry straight, but doesn't avoid the resize bug that you can resize to a way to small size.

Another interesting note: due to a problem with the Jabber server right now I noticed that the ORIGINAL window (please wait while querying the server) behaves as expected!

Currently I can't try the effect of just updateGeometry without the updateSize, perhaps it works, but I think something is still broken with the widgets you add.

I can also reproduce the problem with the search dialog, but didn't try to fix it there yet.

Martijn
Comment 11 Richard Smith 2004-02-20 02:51:57 UTC
CVS commit by lilachaze: 

Fix bug 54691. The QLabel was causing all the problems; if you change its
vertical size policy to Minimum, for instance, the problem returns - it
seems Qt has problems stopping the resize of dialogs containing
height-for-width components...
This isn't perfect - the label will never be less tall than it is when it's
just been created, which depends on how wide the dialog is at that time - in
particular, you can't make the dialog any narrower than it was when the
register form was created.
I also added a little spacing between the widgets so the dialogs don't look
so crowded, and added a spacer at the bottom for good measure.
CCMAIL: 54691-done@bugs.kde.org


  M +5 -3      jabberformtranslator.cpp   1.13.2.1


--- kdenetwork/kopete/protocols/jabber/jabberformtranslator.cpp  #1.13:1.13.2.1
@@ -38,11 +38,11 @@ void JabberFormTranslator::translate (co
         /* Add instructions to layout. */
         if (widget->layout ())
-                innerLayout = new QVBoxLayout (widget->layout ());
+                innerLayout = new QVBoxLayout (widget->layout (), 4);
         else
-                innerLayout = new QVBoxLayout (widget);
+                innerLayout = new QVBoxLayout (widget, 0, 4);
 
 
         QLabel *label = new QLabel (form.instructions (), parentWidget (), "InstructionLabel");
-
+        label->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Fixed, true);
         innerLayout->addWidget (label, 0, 0);
         label->setAlignment (int (QLabel::WordBreak | QLabel::AlignVCenter));
@@ -73,4 +73,6 @@ void JabberFormTranslator::translate (co
                 row++;
         }
+
+        innerLayout->addStretch ();
 }