[Kde-pim] KDE/kdepimlibs

Christoph Feck christoph at maxiom.de
Sat Aug 8 19:35:55 BST 2009


SVN commit 1008949 by cfeck:

Layout fixes

* remove hardcoded margin and spacings
* QLayout::addItem -> QLayout::addLayout
* some QGridLayout -> QFormLayout
* fix double margin issues

I hope I did not break anything, as it is often not obvious for me
how I can invoke all these dialogs. If you find regressions, CC me,
as I am not subscribed to kde-pim or kde-commits.

CCMAIL:kde-pim at kde.org


 M  +1 -1      akonadi/collectionrequester.cpp  
 M  +0 -1      kabc/addresseedialog.cpp  
 M  +0 -1      kabc/distributionlistdialog.cpp  
 M  +4 -10     kabc/plugins/dir/resourcedirconfig.cpp  
 M  +5 -11     kabc/plugins/file/resourcefileconfig.cpp  
 M  +1 -2      kabc/plugins/ldapkio/resourceldapkioconfig.cpp  
 M  +4 -10     kabc/plugins/net/resourcenetconfig.cpp  
 M  +1 -3      kabc/tests/testlock.cpp  
 M  +0 -1      kcal/confirmsavedialog.cpp  
 M  +0 -1      kioslave/smtp/tests/interactivesmtpserver.cpp  
 M  +0 -1      kldap/ldapconfigwidget.cpp  
 M  +0 -3      kpimidentities/signatureconfigurator.cpp  
 M  +0 -4      kresources/configdialog.cpp  
 M  +1 -2      kresources/configpage.cpp  
 M  +1 -0      kresources/kcmkresources.cpp  
 M  +0 -3      kresources/selectdialog.cpp  
 M  +0 -6      mailtransport/sendmailsettings.ui  
 M  +0 -6      mailtransport/transportmanagementwidget.ui  


--- trunk/KDE/kdepimlibs/akonadi/collectionrequester.cpp #1008948:1008949
@@ -73,7 +73,7 @@
   button->setFixedSize( buttonSize, buttonSize );
   button->setToolTip( i18n( "Open collection dialog" ) );
 
-  q->setSpacing( KDialog::spacingHint() );
+  q->setSpacing( -1 );
 
   edit->installEventFilter( q );
   q->setFocusProxy( edit );
--- trunk/KDE/kdepimlibs/kabc/addresseedialog.cpp #1008948:1008949
@@ -141,7 +141,6 @@
   if ( d->mMultiple ) {
     QBoxLayout *selectedLayout = new QVBoxLayout;
     topLayout->addLayout( selectedLayout );
-    topLayout->setSpacing( spacingHint() );
 
     QGroupBox *selectedGroup =
       new QGroupBox( i18nc( "@title:group selected addressees", "Selected" ), topWidget );
--- trunk/KDE/kdepimlibs/kabc/distributionlistdialog.cpp #1008948:1008949
@@ -198,7 +198,6 @@
   kDebug();
 
   QBoxLayout *topLayout = new QVBoxLayout( this );
-  topLayout->setSpacing( KDialog::spacingHint() );
 
   QBoxLayout *nameLayout = new QHBoxLayout();
   topLayout->addLayout( topLayout );
--- trunk/KDE/kdepimlibs/kabc/plugins/dir/resourcedirconfig.cpp #1008948:1008949
@@ -29,30 +29,24 @@
 #include <kstandarddirs.h>
 #include <kdialog.h>
 
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
+#include <QtGui/QFormLayout>
 
 using namespace KABC;
 
 ResourceDirConfig::ResourceDirConfig( QWidget *parent )
     : KRES::ConfigWidget( parent )
 {
-  QGridLayout *mainLayout = new QGridLayout( this );
+  QFormLayout *mainLayout = new QFormLayout( this );
   mainLayout->setMargin( 0 );
-  mainLayout->setSpacing( KDialog::spacingHint() );
 
-  QLabel *label = new QLabel( i18n( "Format:" ), this );
   mFormatBox = new KComboBox( this );
 
-  mainLayout->addWidget( label, 0, 0 );
-  mainLayout->addWidget( mFormatBox, 0, 1 );
+  mainLayout->addRow( i18n( "Format:" ), mFormatBox );
 
-  label = new QLabel( i18n( "Location:" ), this );
   mFileNameEdit = new KUrlRequester( this );
   mFileNameEdit->setMode( KFile::Directory );
 
-  mainLayout->addWidget( label, 1, 0 );
-  mainLayout->addWidget( mFileNameEdit, 1, 1 );
+  mainLayout->addRow( i18n( "Location:" ), mFileNameEdit );
 
   FormatFactory *factory = FormatFactory::self();
   QStringList formats = factory->formats();
--- trunk/KDE/kdepimlibs/kabc/plugins/file/resourcefileconfig.cpp #1008948:1008949
@@ -29,8 +29,7 @@
 #include <kstandarddirs.h>
 #include <kdialog.h>
 
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
+#include <QtGui/QFormLayout>
 
 #include <unistd.h>
 
@@ -39,26 +38,21 @@
 ResourceFileConfig::ResourceFileConfig( QWidget *parent )
     : ConfigWidget( parent )
 {
-  QGridLayout *mainLayout = new QGridLayout( this );
+  QFormLayout *mainLayout = new QFormLayout( this );
   mainLayout->setMargin( 0 );
-  mainLayout->setSpacing( KDialog::spacingHint() );
 
-  QLabel *label = new QLabel( i18n( "Format:" ), this );
   mFormatBox = new KComboBox( this );
 
-  mainLayout->addWidget( label, 0, 0 );
-  mainLayout->addWidget( mFormatBox, 0, 1 );
+  mainLayout->addRow( i18n( "Format:" ), mFormatBox );
 
-  label = new QLabel( i18n( "Location:" ), this );
   mFileNameEdit = new KUrlRequester( this );
   mFileNameEdit->setMode( KFile::File | KFile::LocalOnly );
 
+  mainLayout->addRow( i18n( "Location:" ), mFileNameEdit );
+
   connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ),
            SLOT( checkFilePermissions( const QString & ) ) );
 
-  mainLayout->addWidget( label, 1, 0 );
-  mainLayout->addWidget( mFileNameEdit, 1, 1 );
-
   FormatFactory *factory = FormatFactory::self();
   QStringList formats = factory->formats();
   QStringList::Iterator it;
--- trunk/KDE/kdepimlibs/kabc/plugins/ldapkio/resourceldapkioconfig.cpp #1008948:1008949
@@ -47,7 +47,6 @@
 {
   QBoxLayout *mainLayout = new QVBoxLayout( this );
   mainLayout->setMargin( 0 );
-  mainLayout->setSpacing( KDialog::spacingHint() );
 
   KPageWidget *pageWidget = new KPageWidget( this );
   pageWidget->setFaceType( KPageView::Tabbed );
@@ -79,7 +78,7 @@
 
   mSubTree = new QCheckBox( i18n( "Sub-tree query" ), this );
   KHBox *box = new KHBox( this );
-  box->setSpacing( KDialog::spacingHint() );
+  box->setSpacing( -1 );
   mEditButton = new QPushButton( i18n( "Edit Attributes..." ), box );
   mCacheButton = new QPushButton( i18n( "Offline Use..." ), box );
 
--- trunk/KDE/kdepimlibs/kabc/plugins/net/resourcenetconfig.cpp #1008948:1008949
@@ -28,30 +28,24 @@
 #include <klocale.h>
 #include <kdialog.h>
 
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
+#include <QtGui/QFormLayout>
 
 using namespace KABC;
 
 ResourceNetConfig::ResourceNetConfig( QWidget *parent )
     : ConfigWidget( parent ), mInEditMode( false )
 {
-  QGridLayout *mainLayout = new QGridLayout( this );
+  QFormLayout *mainLayout = new QFormLayout( this );
   mainLayout->setMargin( 0 );
-  mainLayout->setSpacing( KDialog::spacingHint() );
 
-  QLabel *label = new QLabel( i18n( "Format:" ), this );
   mFormatBox = new KComboBox( this );
 
-  mainLayout->addWidget( label, 0, 0 );
-  mainLayout->addWidget( mFormatBox, 0, 1 );
+  mainLayout->addRow( i18n( "Format:" ), mFormatBox );
 
-  label = new QLabel( i18n( "Location:" ), this );
   mUrlEdit = new KUrlRequester( this );
   mUrlEdit->setMode( KFile::File );
 
-  mainLayout->addWidget( label, 1, 0 );
-  mainLayout->addWidget( mUrlEdit, 1, 1 );
+  mainLayout->addRow( i18n( "Location:" ), mUrlEdit );
 
   FormatFactory *factory = FormatFactory::self();
   QStringList formats = factory->formats();
--- trunk/KDE/kdepimlibs/kabc/tests/testlock.cpp #1008948:1008949
@@ -49,8 +49,6 @@
 LockWidget::LockWidget( const QString &identifier )
 {
   QVBoxLayout *topLayout = new QVBoxLayout( this );
-  topLayout->setMargin( KDialog::marginHint() );
-  topLayout->setSpacing( KDialog::spacingHint() );
 
   if ( identifier.isEmpty() ) {
     mLock = 0;
@@ -65,7 +63,7 @@
 
     QHBoxLayout *identifierLayout = new QHBoxLayout();
     identifierLayout->setParent( topLayout );
-    topLayout->addItem( identifierLayout );
+    topLayout->addLayout( identifierLayout );
 
     QLabel *resourceLabel = new QLabel( QLatin1String( "Identifier:" ), this );
     identifierLayout->addWidget( resourceLabel );
--- trunk/KDE/kdepimlibs/kcal/confirmsavedialog.cpp #1008948:1008949
@@ -56,7 +56,6 @@
   setMainWidget( topFrame );
 
   QBoxLayout *topLayout = new QVBoxLayout( topFrame );
-  topLayout->setSpacing( spacingHint() );
 
   QLabel *label = new QLabel(
       i18n( "You have requested to save the following objects to '%1':",
--- trunk/KDE/kdepimlibs/kioslave/smtp/tests/interactivesmtpserver.cpp #1008948:1008949
@@ -133,7 +133,6 @@
   Q_ASSERT( socket );
 
   QVBoxLayout * vlay = new QVBoxLayout( this );
-  vlay->setSpacing( 6 );
 
   mTextEdit = new QTextEdit( this );
   vlay->addWidget( mTextEdit, 1 );
--- trunk/KDE/kdepimlibs/kldap/ldapconfigwidget.cpp #1008948:1008949
@@ -48,7 +48,6 @@
     {
       mainLayout = new QGridLayout( mParent );
       mainLayout->setMargin( 0 );
-      mainLayout->setSpacing( KDialog::spacingHint() );
     }
 
     void setLDAPPort();
--- trunk/KDE/kdepimlibs/kpimidentities/signatureconfigurator.cpp #1008948:1008949
@@ -76,7 +76,6 @@
 
     vlay = new QVBoxLayout( this );
     vlay->setObjectName( "main layout" );
-    vlay->setSpacing( KDialog::spacingHint() );
     vlay->setMargin( 0 );
 
     // "enable signatue" checkbox:
@@ -197,7 +196,6 @@
     widgetStack->insertWidget( pageno, page ); // force sequential numbers (play safe)
     page_vlay = new QVBoxLayout( page );
     page_vlay->setMargin( 0 );
-    page_vlay->setSpacing( KDialog::spacingHint() );
     hlay = new QHBoxLayout(); // inherits spacing
     page_vlay->addLayout( hlay );
     mFileRequester = new KUrlRequester( page );
@@ -226,7 +224,6 @@
     widgetStack->insertWidget( pageno,page );
     page_vlay = new QVBoxLayout( page  );
     page_vlay->setMargin( 0 );
-    page_vlay->setSpacing( KDialog::spacingHint() );
     hlay = new QHBoxLayout(); // inherits spacing
     page_vlay->addLayout( hlay );
     mCommandEdit = new KLineEdit( page );
--- trunk/KDE/kdepimlibs/kresources/configdialog.cpp #1008948:1008949
@@ -72,12 +72,10 @@
   setMainWidget( main );
 
   QVBoxLayout *mainLayout = new QVBoxLayout( main );
-  mainLayout->setSpacing( spacingHint() );
   mainLayout->setMargin( 0 );
 
   QGroupBox *generalGroupBox = new QGroupBox( main );
   QGridLayout *gbLayout = new QGridLayout;
-  gbLayout->setSpacing( spacingHint() );
   generalGroupBox->setLayout( gbLayout );
 
   generalGroupBox->setTitle( i18nc( "@title:group", "General Settings" ) );
@@ -100,8 +98,6 @@
 
   QGroupBox *resourceGroupBox = new QGroupBox( main );
   QGridLayout *resourceLayout = new QGridLayout;
-  resourceLayout->setSpacing( spacingHint() );
-  resourceLayout->setMargin( marginHint() );
   resourceGroupBox->setLayout( resourceLayout );
 
   resourceGroupBox->setTitle( i18nc( "@title:group", "%1 Resource Settings",
--- trunk/KDE/kdepimlibs/kresources/configpage.cpp #1008948:1008949
@@ -144,12 +144,11 @@
   setWindowTitle( i18n( "Resource Configuration" ) );
 
   QVBoxLayout *mainLayout = new QVBoxLayout( this );
+  mainLayout->setMargin( 0 );
 
   QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this );
   QGridLayout *groupBoxLayout = new QGridLayout();
   groupBox->setLayout( groupBoxLayout );
-  groupBoxLayout->setSpacing( 6 );
-  groupBoxLayout->setMargin( 11 );
 
   d->mFamilyCombo = new KComboBox( false, groupBox );
   groupBoxLayout->addWidget( d->mFamilyCombo, 0, 0, 1, 2 );
--- trunk/KDE/kdepimlibs/kresources/kcmkresources.cpp #1008948:1008949
@@ -38,6 +38,7 @@
   Q_UNUSED( l );
   KGlobal::locale()->insertCatalog( "libkresources" );
   QVBoxLayout *layout = new QVBoxLayout( this );
+  layout->setMargin( 0 );
   mConfigPage = new KRES::ConfigPage( this );
   layout->addWidget( mConfigPage );
   connect( mConfigPage, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
--- trunk/KDE/kdepimlibs/kresources/selectdialog.cpp #1008948:1008949
@@ -55,12 +55,9 @@
 
   QVBoxLayout *mainLayout = new QVBoxLayout( widget );
   mainLayout->setMargin( 0 );
-  mainLayout->setSpacing( spacingHint() );
 
   QGroupBox *groupBox = new QGroupBox( widget );
   QGridLayout *grid = new QGridLayout;
-  grid->setMargin( marginHint() );
-  grid->setSpacing( spacingHint() );
   groupBox->setLayout( grid );
   groupBox->setTitle( i18n( "Resources" ) );
 
--- trunk/KDE/kdepimlibs/mailtransport/sendmailsettings.ui #1008948:1008949
@@ -11,12 +11,6 @@
    </rect>
   </property>
   <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
    <item row="4" column="1" >
     <spacer>
      <property name="orientation" >
--- trunk/KDE/kdepimlibs/mailtransport/transportmanagementwidget.ui #1008948:1008949
@@ -10,12 +10,6 @@
    </rect>
   </property>
   <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
    <item row="4" column="1" >
     <spacer>
      <property name="orientation" >
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list