Bug 112020 - minicli window size is as big as longest command
Summary: minicli window size is as big as longest command
Status: CLOSED FIXED
Alias: None
Product: kdesktop
Classification: Unmaintained
Component: minicli (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-04 10:51 UTC by maor
Modified: 2009-01-02 20:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maor 2005-09-04 10:51:24 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Unspecified Linux
Compiler:          gcc 4.0.1 
OS:                Linux

The minicli window grow to size of the longest command in the list .As result the width size grow ,and it isn't convenience.
Comment 1 Martin Koller 2005-09-05 19:55:45 UTC
SVN commit 457371 by mkoller:

BUG: 112020

minicli is now resizeable with the mouse and keeps the size during one session,
but does not enlarge to the max combobox content.



 M  +3 -13     minicli.cpp  
 M  +1 -1      minicli.h  
 M  +33 -8     minicli_ui.ui  


--- branches/KDE/3.5/kdebase/kdesktop/minicli.cpp #457370:457371
@@ -121,8 +121,6 @@
 
   m_dlg->leUsername->setText("root");
 
-  setMaxCommandBoxWidth();
-
   // Main widget buttons...
   connect( m_dlg->pbRun, SIGNAL(clicked()), this, SLOT(accept()) );
   connect( m_dlg->pbCancel, SIGNAL(clicked()), this, SLOT(reject()) );
@@ -163,9 +161,9 @@
   }
 }
 
-void Minicli::setMaxCommandBoxWidth()
+QSize Minicli::sizeHint() const
 {
-  int maxWidth = qApp->desktop()->screenGeometry(this).width();
+  int maxWidth = qApp->desktop()->screenGeometry((QWidget*)this).width();
   if (maxWidth < 603)
   {
     // a sensible max for smaller screens
@@ -176,19 +174,13 @@
     maxWidth = maxWidth * 2 / 5;
   }
 
-  m_dlg->cbCommand->setMaximumWidth(maxWidth);
+  return QSize(maxWidth, -1);
 }
 
 void Minicli::show()
 {
-  setMaxCommandBoxWidth();
   KWin::setState( winId(), NET::StaysOnTop );
-  setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
-  adjustSize();
-  setFixedSize(size());
   KDialog::show();
-  adjustSize();
-  setFixedSize(size());
 }
 
 void Minicli::loadConfig()
@@ -879,9 +871,7 @@
 
 void Minicli::fontChange( const QFont & )
 {
-   setMaxCommandBoxWidth();
    adjustSize();
-   setFixedSize(size());
 }
 
 // vim: set et ts=2 sts=2 sw=2:
--- branches/KDE/3.5/kdebase/kdesktop/minicli.h #457370:457371
@@ -56,6 +56,7 @@
   void clearHistory();
   
   virtual void show();
+  virtual QSize sizeHint() const;
 
 protected slots:
   virtual void accept();
@@ -83,7 +84,6 @@
   int runCommand();
   void parseLine( bool final );
   QString terminalCommand (const QString&, const QString&);
-  void setMaxCommandBoxWidth();
   QString calculate(const QString &exp);
   void notifyServiceStarted(KService::Ptr service);
 
--- branches/KDE/3.5/kdebase/kdesktop/minicli_ui.ui #457370:457371
@@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
 <class>MinicliDlgUI</class>
 <widget class="QWidget">
     <property name="name">
@@ -24,6 +24,9 @@
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
+        <property name="resizeMode">
+            <enum>FreeResize</enum>
+        </property>
         <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
             <property name="name">
                 <cstring>layout4</cstring>
@@ -56,7 +59,7 @@
                         <enum>Horizontal</enum>
                     </property>
                     <property name="sizeType">
-                        <enum>MinimumExpanding</enum>
+                        <enum>Expanding</enum>
                     </property>
                     <property name="sizeHint">
                         <size>
@@ -118,7 +121,7 @@
                         <enum>Horizontal</enum>
                     </property>
                     <property name="sizeType">
-                        <enum>Minimum</enum>
+                        <enum>Fixed</enum>
                     </property>
                     <property name="sizeHint">
                         <size>
@@ -211,7 +214,7 @@
                             </property>
                             <property name="sizePolicy">
                                 <sizepolicy>
-                                    <hsizetype>7</hsizetype>
+                                    <hsizetype>5</hsizetype>
                                     <vsizetype>0</vsizetype>
                                     <horstretch>5</horstretch>
                                     <verstretch>0</verstretch>
@@ -321,7 +324,7 @@
                             </property>
                             <property name="sizePolicy">
                                 <sizepolicy>
-                                    <hsizetype>7</hsizetype>
+                                    <hsizetype>5</hsizetype>
                                     <vsizetype>0</vsizetype>
                                     <horstretch>5</horstretch>
                                     <verstretch>0</verstretch>
@@ -382,7 +385,7 @@
                                     </property>
                                     <property name="sizePolicy">
                                         <sizepolicy>
-                                            <hsizetype>7</hsizetype>
+                                            <hsizetype>5</hsizetype>
                                             <vsizetype>0</vsizetype>
                                             <horstretch>1</horstretch>
                                             <verstretch>0</verstretch>
@@ -455,6 +458,14 @@
             <property name="name">
                 <cstring>lbCommand</cstring>
             </property>
+            <property name="sizePolicy">
+                <sizepolicy>
+                    <hsizetype>1</hsizetype>
+                    <vsizetype>5</vsizetype>
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                </sizepolicy>
+            </property>
             <property name="text">
                 <string>Com&amp;mand:</string>
             </property>
@@ -469,6 +480,14 @@
             <property name="name">
                 <cstring>lbRunIcon</cstring>
             </property>
+            <property name="sizePolicy">
+                <sizepolicy>
+                    <hsizetype>5</hsizetype>
+                    <vsizetype>5</vsizetype>
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                </sizepolicy>
+            </property>
             <property name="text">
                 <string></string>
             </property>
@@ -488,6 +507,12 @@
                     <verstretch>0</verstretch>
                 </sizepolicy>
             </property>
+            <property name="minimumSize">
+                <size>
+                    <width>388</width>
+                    <height>0</height>
+                </size>
+            </property>
             <property name="whatsThis" stdset="0">
                 <string>Enter the command you wish to execute or the address of the resource you want to open. This can be a remote URL like "www.kde.org" or a local one like "~/.kderc".</string>
             </property>
@@ -513,6 +538,8 @@
         </widget>
     </grid>
 </widget>
+<customwidgets>
+</customwidgets>
 <connections>
     <connection>
         <sender>cbPriority</sender>
@@ -592,8 +619,6 @@
     <includehint>kpushbutton.h</includehint>
     <includehint>kpushbutton.h</includehint>
     <includehint>kpassdlg.h</includehint>
-    <includehint>klineedit.h</includehint>
     <includehint>kcombobox.h</includehint>
-    <includehint>klineedit.h</includehint>
 </includehints>
 </UI>
Comment 2 FiNeX 2009-01-02 20:31:26 UTC
Bug closed. Kdesktop is no more mantained.