[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: [PATCH] fixes for new ConfigureDialog: PGP tab layout, transports problem
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2001-12-01 0:21:12
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 30 November 2001 21:24, Michael Häckel wrote:
> On Friday 30 November 2001 22:23, Marc Mutz wrote:
> > With -W -Wall -pedantic or without?
>
> With.

Fixed.

> > Sorry, it compiles here even when applied to a clean checkout. Can
> > you send me the log of "make -k configuredialog{,_p}.o"?
>
> After adding:
> #include <stdlib.h>
> #include "kmtransport.h"
> to configuredialog_p.cpp it indeed compiles.

OK.

> Ok, what I see:
> - The width of the dialog is a bit big. That mainly seems to come
> from the subject prefix configuration and the German translation.

This was an experiment. I can make them vertiaclly stacked again, just 
thought I'd see if they can be placed together with the phrases on a 
single tab "replying".

> - The box that explains the adressbooks has a bit much empty space.

I think this is the QLabel Qt bug.

> - The font configuration has a startup problem. It shows Arial,
> although I have configured Courier.

Should be fixed now. Please retest. I also fixed the long-standing bug 
that the quoted-text[123] font shown in the preview didn't match the 
message-body one.

> - The profiles configuration shows a horizontal scrollbar without
> good reason.

I know. I don't know how to make QListView adjust the size of the 
columns. It seems to dumbly choose equal sizes. I haven't found a way 
to make the first column have minimal space and the second one grabbing 
all the rest...

> - The Reply phrases configuration now uses Russian, if I
> select German. If I want to have German, I have to select Lithuanian.

This is actually a feature. Since 9/11 the different cultures don't get 
along with each other as they should. The KMail developers feel that it 
would be an efficient measure in spreading understanding among the 
peoples of his world if the reply phrases used randomly selected 
languages. Now, if only KDE was available in Pashto, Farsi, Hazaragi 
and Uzbek... :-)
But as you don't seem to like this idea, I have reverted it to the old, 
boring mode of operation (at least if you meant the bug where the 
combobox was sorted reverse w.r.t. to the config file and the internal 
list.

> - Enabling/Disabling the global threading option doesn't seem to work
> anymore.

If you're talking about Appearance->Layout->Thread list...:
This works fine here. Maybe you have tested with a folder that has a 
local setting?

> - This looks like a bug:
>   QObject::connect: No such signal
>   NetworkPageSendingTab::transportListChanged()
>   QObject::connect:  (sender name:   'unnamed')
>   QObject::connect:  (receiver name: 'unnamed')

Fixed (missed signature of signal).

> - I think the plugins page should be at least invisible until there
> is really a plugin, unless you volunteer to answer all the questions
> of curios beta testers, that want to know what's about with this
> page.

It's just there so that it is there :-) For the beta, I'll #ifdef it 
out.

Patch relative to the last one attached.

Marc

- -- 
I am Bush of USA. You will be pacified. Resistance is futile.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8CD9n3oWD+L2/6DgRAlX/AJ4rUOD7qcG4B80+4XOdUlY+J+ncIgCdFM6+
OId+cualCrs/Nm7EPBWe8tQ=
=JIhY
-----END PGP SIGNATURE-----

["even-more-configuredialog-fixes.diff" (text/x-diff)]

--- configuredialog.cpp.orig	Fri Nov 30 13:45:32 2001
+++ configuredialog.cpp	Sat Dec  1 02:57:06 2001
@@ -754,7 +755,7 @@ compiler warning fix
 
       // change the name
       int index = mIdentityCombo->currentItem();
-      assert( index < mIdentities.count() );
+      assert( index < (int)mIdentities.count() );
       IdentityEntry & entry = mIdentities[ index ];
       assert( entry.identityName() == oldName );
       entry.setIdentityName( newName );
@@ -903,8 +904,8 @@ wrong signature of signal
   //
   mSendingTab = new SendingTab();
   addTab( mSendingTab, mSendingTab->title() );
-  connect( mSendingTab, SIGNAL(transportListChanged()),
-	   this, SIGNAL(transportListChanged()) );
+  connect( mSendingTab, SIGNAL(transportListChanged(const QStringList&)),
+	   this, SIGNAL(transportListChanged(const QStringList&)) );
 
   //
   // "Receiving" tab:
@@ -1171,13 +1172,14 @@ compiler warning fix
   // item:
   QStringList transportNames;
   QPtrListIterator<KMTransportInfo> jt( mTransportInfoList );
-  int entryLocation;
+  int entryLocation = -1;
   for ( jt.toFirst() ; jt.current() ; ++jt )
     if ( jt != it )
       transportNames << (*jt)->name;
     else 
       entryLocation = transportNames.count();
-  
+  assert( entryLocation >= 0 );
+
   // make the new name unique by appending a high enough number:
   (*it)->name = uniqueName( transportNames, (*it)->name );
   // change the list item to the new name
@@ -1813,14 +1813,16 @@ compiler warning fixes
 }
   
 static const struct {
-  const char * const configName;
-  const char * const displayName;
-  const bool enableFamilyAndSize;
+  char * configName;
+  char * displayName;
+  bool   enableFamilyAndSize;
 } fontNames[] = {
   { "body-font", I18N_NOOP("Message body"), true },
   { "list-font", I18N_NOOP("Message list"), true },
   { "list-date-font", I18N_NOOP("Message list - date field"), true },
   { "folder-font", I18N_NOOP("Folder list"), true },
+  // these three must be last or you have to change
+  // slotFontSelectionChanged, too:
   { "quote1-font", I18N_NOOP("Quoted text - first level"), false },
   { "quote2-font", I18N_NOOP("Quoted text - second level"), false },
   { "quote3-font", I18N_NOOP("Quoted text - third level"), false },
@@ -1879,13 +1881,26 @@ fix font settings
 
 void AppearancePage::FontsTab::slotFontSelectorChanged( int index )
 {
+  kdDebug() << "slotFontSelectorChanged() called" << endl;
   if( index < 0 || index >= mFontLocationCombo->count() )
     return; // Should never happen, but it is better to check.
 
   // Save current fontselector setting before we install the new:
-  if( mActiveFontIndex >= 0 )
+  if( mActiveFontIndex == 0 ) {
+    mFont[0] = mFontChooser->font();
+    // hardcode the family and size of "message body" dependant fonts:
+    for ( int i = 0 ; i < numFontNames ; i++ )
+      if ( !fontNames[i].enableFamilyAndSize ) {
+	// ### shall we copy the font and set the save and re-set
+	// {regular,italic,bold,bold italic} property or should we
+	// copy only family and pointSize?
+	mFont[i].setFamily( mFont[0].family() );
+	mFont[i].setPointSize/*Float?*/( mFont[0].pointSize/*Float?*/() );
+      }
+  } else if ( mActiveFontIndex > 0 )
     mFont[ mActiveFontIndex ] = mFontChooser->font();
   mActiveFontIndex = index;
+  
 
   // Display the new setting:
   mFontChooser->setFont( mFont[index] );
@@ -1903,7 +1918,11 @@ fix font settings
     mFont[i] = fonts.readFontEntry( fontNames[i].configName, &mFont[0] );
   
   mCustomFontCheck->setChecked( !fonts.readBoolEntry( "defaultFonts", true ) );
-  mFontLocationCombo->setCurrentItem( 0 ); // ### hopfully triggers slotBlahChanged()
+  kdDebug() << "----> About to call mFontLocationCombo->setCurrentItem(0)"
+	    << endl;
+  mFontLocationCombo->setCurrentItem( 0 );
+  // ### FIXME: possible Qt bug: setCurrentItem doesn't emit activated(int).
+  slotFontSelectorChanged( 0 );
 }
 
 void AppearancePage::FontsTab::apply() {
@@ -1933,8 +1952,8 @@ compiler warning fix
 
   
 static const struct {
-  const char * const configName;
-  const char * const displayName;
+  char * configName;
+  char * displayName;
 } colorNames[] = { // adjust setup() if you change this:
   { "BackgroundColor", I18N_NOOP("Composer background") },
   { "ForegroundColor", I18N_NOOP("Normal text") },
@@ -1969,7 +1988,6 @@ compiler warning fix
   // color list box:
   mColorList = new ColorListBox( this );
   mColorList->setEnabled( false ); // since !mCustomColorCheck->isChecked()
-  QStringList::Iterator it;
   QStringList modeList;
   for ( int i = 0 ; i < numColorNames ; i++ )
     mColorList->insertItem( new ColorListItem( i18n( colorNames[i].displayName ) ) );
@@ -2456,7 +2469,6 @@ compiler warning fix
 {
   // tmp. vars:
   QGridLayout *glay;
-  QLabel      *label;
   QPushButton *button;
 
   glay = new QGridLayout( this, 7, 3, KDialog::spacingHint() );
@@ -2524,7 +2536,7 @@ compiler warning fix
 
 
 void ComposerPage::PhrasesTab::setLanguageItemInformation( int index ) {
-  assert( 0 <= index && index < mLanguageList.count() );
+  assert( 0 <= index && index < (int)mLanguageList.count() );
 
   LanguageItem &l = *mLanguageList.at( index );
 
@@ -2536,7 +2548,7 @@ compiler warning fix
 
 void ComposerPage::PhrasesTab::saveActiveLanguageItem() {
   int index = mActiveLanguageItem;
-  assert( 0 <= index && index < mLanguageList.count() );
+  assert( 0 <= index && index < (int)mLanguageList.count() );
   
   LanguageItem &l = *mLanguageList.at( index );
 
@@ -2574,13 +2586,13 @@ compiler warning fix
 {
   assert( mPhraseLanguageCombo->count() > 1 );
   int index = mPhraseLanguageCombo->currentItem();
-  assert( 0 <= index && index < mLanguageList.count() );
+  assert( 0 <= index && index < (int)mLanguageList.count() );
 
   // remove current item from internal list and combobox:
   mLanguageList.remove( mLanguageList.at( index ) );
   mPhraseLanguageCombo->removeItem( index );
 
-  if ( index >= mLanguageList.count() ) index--;
+  if ( index >= (int)mLanguageList.count() ) index--;
 
   mActiveLanguageItem = index;
   setLanguageItemInformation( index );
@@ -2590,7 +2602,7 @@ compiler warning fix
 void ComposerPage::PhrasesTab::slotLanguageChanged( const QString& )
 {
   int index = mPhraseLanguageCombo->currentItem();
-  assert( index < mLanguageList.count() );
+  assert( index < (int)mLanguageList.count() );
   saveActiveLanguageItem();
   mActiveLanguageItem = index;
   setLanguageItemInformation( index );
@@ -2607,11 +2619,11 @@ fix reply strings
   int currentNr = general.readNumEntry( "reply-current-language" ,0 );
 
   // build mLanguageList and mPhraseLanguageCombo:
-  for ( int i = num - 1 ; i >= 0 ; i-- ) {
+  for ( int i = 0 ; i < num ; i++ ) {
     KConfigGroup config( kapp->config(),
 			 QCString("KMMessage #") + QCString().setNum(i) );
     QString lang = config.readEntry( "language" );
-    mLanguageList.prepend(
+    mLanguageList.append(
          LanguageItem( lang,
 		       config.readEntry( "phrase-reply" ),
 		       config.readEntry( "phrase-reply-all" ),
@@ -2666,10 +2678,7 @@ compiler warning fix
 {
   // tmp. vars:
   QHBoxLayout *hlay;
-  QHBoxLayout *inner_hlay;
-  QVBoxLayout *vlay;
   QGroupBox   *group;
-  QPushButton *button;
 
 
   // ### OK, let's try to set them side-by-side:
@@ -3391,8 +3403,8 @@ compiler warning fix
 
 
 static const struct {
-  const char * const label;
-  const char * const description;
+  char * label;
+  char * description;
 } addressBooks[] = {
   { I18N_NOOP("Traditional KMail"),
     I18N_NOOP("The traditional KMail graphical interface using the "
--- configuredialog_p.cpp.orig	Fri Nov 30 22:08:40 2001
+++ configuredialog_p.cpp	Sat Dec  1 00:33:33 2001
@@ -1,5 +1,4 @@
 #define QT_NO_CAST_ASCII
-#define QT_NO_COMPAT
 // configuredialog_p.cpp: classes internal to ConfigureDialog
 // see configuredialog.cpp for details.
 
@@ -18,6 +17,7 @@ compile fix
 
 // other KDE headers:
 #include <kemailsettings.h> // for IdentityEntry::fromControlCenter()
+#include <kmtransport.h>
 #include <kmessagebox.h>
 #include <kglobal.h>
 #include <ksimpleconfig.h>
@@ -34,6 +34,7 @@ compile fix
 // Other headers:
 #include <assert.h>
 #include <signal.h>
+#include <stdlib.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
--- simplestringlisteditor.cpp.orig	Fri Nov 30 00:33:54 2001
+++ simplestringlisteditor.cpp	Fri Nov 30 22:43:22 2001
@@ -47,10 +47,10 @@ compiler warning fix
 						const QString & modifyLabel,
 						const QString & addDialogLabel )
   : QWidget( parent, name ),
-    mAddDialogLabel( addDialogLabel.isEmpty() ?
-		     i18n("New entry:") : addDialogLabel ),
     mAddButton(0), mRemoveButton(0), mModifyButton(0),
-    mUpButton(0), mDownButton(0)
+    mUpButton(0), mDownButton(0),
+    mAddDialogLabel( addDialogLabel.isEmpty() ?
+		     i18n("New entry:") : addDialogLabel )
 {
   QHBoxLayout * hlay = new QHBoxLayout( this, 0, KDialog::spacingHint() );
   

_______________________________________________
kmail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic