Patch for Adriana, implements her suggestion:

"automatically show the "Identity"-line in the composer window when one
sets up more than one identity? Otherwise, it can be a little hard to
find..."

svn path=/trunk/kdenetwork/kmail/; revision=69921
wilder-work
Don Sanders 26 years ago
parent e566928e3a
commit 5c116915d3
  1. 27
      configuredialog.cpp
  2. 21
      configuredialog.h
  3. 19
      kmcomposewin.cpp
  4. 21
      kmglobal.h

@ -464,6 +464,7 @@ ConfigureDialog::ConfigureDialog( QWidget *parent, const char *name,
setHelp( "kmail/kmail.html", QString::null );
setIconListAllVisible( true );
enableButton( Default, false );
secondIdentity = false;
connect( this, SIGNAL( cancelClicked() ), this, SLOT( slotCancelOrClose() ));
connect( this, SIGNAL( closeClicked() ), this, SLOT( slotCancelOrClose() ));
@ -497,7 +498,7 @@ void ConfigureDialog::makeIdentityPage( void )
{
QFrame *page = addPage( i18n("Identity"), i18n("Personal information"),
KGlobal::instance()->iconLoader()->loadIcon( "identity", KIcon::NoGroup,
KIcon::SizeMedium ));
KIcon::SizeMedium ));
QVBoxLayout *topLevel = new QVBoxLayout( page, 0, spacingHint() );
mIdentity.pageIndex = pageIndex(page);
@ -623,7 +624,7 @@ void ConfigureDialog::makeNetworkPage( void )
QFrame *page = addPage( i18n("Network"),
i18n("Setup for sending and receiving messages"),
KGlobal::instance()->iconLoader()->loadIcon( "network", KIcon::NoGroup,
KIcon::SizeMedium ));
KIcon::SizeMedium ));
QVBoxLayout *topLevel = new QVBoxLayout( page, 0, spacingHint() );
mNetwork.pageIndex = pageIndex(page);
@ -756,7 +757,7 @@ void ConfigureDialog::makeAppearancePage( void )
QVBox *vbox = addVBoxPage( i18n("Appearance"),
i18n("Customize visual appearance"),
KGlobal::instance()->iconLoader()->loadIcon( "appearance", KIcon::NoGroup,
KIcon::SizeMedium ));
KIcon::SizeMedium ));
QTabWidget *tabWidget = new QTabWidget( vbox, "tab" );
mAppearance.pageIndex = pageIndex(vbox);
@ -1115,7 +1116,7 @@ void ConfigureDialog::makeMimePage( void )
QFrame *page = addPage( i18n("Mime Headers"),
i18n("Define custom mime header tags for outgoing emails"),
KGlobal::instance()->iconLoader()->loadIcon( "readme", KIcon::NoGroup,
KIcon::SizeMedium ));
KIcon::SizeMedium ));
QVBoxLayout *topLevel = new QVBoxLayout( page, 0, spacingHint() );
mMime.pageIndex = pageIndex(page);
@ -1176,7 +1177,7 @@ void ConfigureDialog::makeSecurityPage( void )
QVBox *vbox = addVBoxPage( i18n("Security"),
i18n("Security Settings"),
KGlobal::instance()->iconLoader()->loadIcon( "encrypted", KIcon::NoGroup,
KIcon::SizeMedium ));
KIcon::SizeMedium ));
mSecurity.pageIndex = pageIndex(vbox);
QTabWidget *tabWidget = new QTabWidget( vbox, "tab" );
@ -1452,11 +1453,11 @@ void ConfigureDialog::setupComposerPage( void )
KConfig &config = *kapp->config();
mComposer.CurrentLanguage = NULL;
LanguageItem *l = mComposer.LanguageList;
while (mComposer.LanguageList)
{
while (mComposer.LanguageList)
{
l = mComposer.LanguageList;
mComposer.LanguageList = l->next;
delete l;
delete l;
}
mComposer.phraseLanguageCombo->clear();
@ -1748,6 +1749,12 @@ void ConfigureDialog::slotDoApply( bool everything )
{
saveActiveIdentity(); // Copy from textfields into list
mIdentityList.exportData();
if( secondIdentity ) {
config.setGroup("Composer");
long mShowHeaders = config.readNumEntry("headers", HDR_STANDARD);
mShowHeaders |= HDR_IDENTITY;
config.writeEntry("headers", mShowHeaders);
}
}
if( activePage == mNetwork.pageIndex || everything )
{
@ -2091,6 +2098,10 @@ void ConfigureDialog::slotNewIdentity( void )
QString identityText = dialog->identityText().stripWhiteSpace();
if( identityText.isEmpty() == false )
{
qDebug( "Here we are %d", list.count() );
if (list.count() == 1)
secondIdentity = true;
//
// Add the new identity. Make sure the default identity is
// first in the otherwise sorted list

@ -56,14 +56,14 @@ class NewIdentityDialog : public KDialogBase
ControlCenter,
ExistingEntry
};
NewIdentityDialog( QWidget *parent=0, const char *name=0, bool modal=true);
void setIdentities( const QStringList &list );
QString identityText( void );
QString duplicateText( void );
int duplicateMode( void );
private slots:
void radioClicked( int id );
@ -72,7 +72,7 @@ class NewIdentityDialog : public KDialogBase
private:
int mDuplicateMode;
QLineEdit *mLineEdit;
QLineEdit *mLineEdit;
QLabel *mComboLabel;
QComboBox *mComboBox;
};
@ -84,7 +84,7 @@ class RenameIdentityDialog : public KDialogBase
Q_OBJECT
public:
RenameIdentityDialog( QWidget *parent=0, const char *name=0,
RenameIdentityDialog( QWidget *parent=0, const char *name=0,
bool modal=true );
void setIdentities( const QString &current, const QStringList &list );
QString identityText( void );
@ -122,7 +122,7 @@ class IdentityEntry
void setOrganization( const QString &organization );
void setEmailAddress( const QString &emailAddress );
void setReplyToAddress( const QString &replytoAddress );
void setSignatureFileName( const QString &signatureFileName,
void setSignatureFileName( const QString &signatureFileName,
bool importIdentity=false );
void setSignatureInlineText( const QString &signatureInlineText );
void setSignatureFileIsAProgram( bool signatureFileIsAProgram );
@ -149,8 +149,8 @@ class IdentityList
QStringList identities( void );
IdentityEntry *get( const QString &identity );
IdentityEntry *get( uint index );
void importData( void ); // Load system settings
void importData( void ); // Load system settings
void exportData( void ); // Save state to system
void add( const IdentityEntry &entry );
@ -206,7 +206,7 @@ class ConfigureDialog : public KDialogBase
Q_OBJECT
private:
class ApplicationLaunch
class ApplicationLaunch
{
public:
ApplicationLaunch( const QString &cmd );
@ -226,7 +226,7 @@ class ConfigureDialog : public KDialogBase
void resizeColums( void );
void setVisibleItem( int visibleItem, bool updateSize=true );
virtual QSize sizeHint( void ) const;
virtual QSize sizeHint( void ) const;
protected:
virtual void resizeEvent( QResizeEvent *e );
@ -264,7 +264,7 @@ class ConfigureDialog : public KDialogBase
QPushButton *sendmailChooseButton;
QLineEdit *sendmailLocationEdit;
QLineEdit *smtpServerEdit;
QLineEdit *smtpPortEdit;
QLineEdit *smtpPortEdit;
QLineEdit *precommandEdit;
ListView *accountList;
QPushButton *addAccountButton;
@ -478,6 +478,7 @@ class ConfigureDialog : public KDialogBase
QGuardedPtr<KMAccount> newAccount;
};
QValueList<mModifiedAccountsType*> mModifiedAccounts;
bool secondIdentity;
};

@ -102,25 +102,6 @@ WindowList* windowList=new WindowList;
#include "kmcomposewin.moc"
#define HDR_FROM 0x01
#define HDR_REPLY_TO 0x02
#define HDR_TO 0x04
#define HDR_CC 0x08
#define HDR_BCC 0x10
#define HDR_SUBJECT 0x20
#define HDR_NEWSGROUPS 0x40
#define HDR_FOLLOWUP_TO 0x80
#define HDR_IDENTITY 0x100
#define HDR_TRANSPORT 0x200
#define HDR_ALL 0x3ff
#ifdef KRN
#define HDR_STANDARD (HDR_SUBJECT|HDR_NEWSGROUPS)
#else
#define HDR_STANDARD (HDR_SUBJECT|HDR_TO|HDR_CC)
#endif
//-----------------------------------------------------------------------------
KMComposeWin::KMComposeWin(KMMessage *aMsg, QString id )
: KMTopLevelWidget (),

@ -17,7 +17,7 @@
#include "kmkernel.h"
typedef enum
typedef enum
{
FCNTL,
procmail_lockfile,
@ -26,6 +26,25 @@ typedef enum
None
} LockType;
#define HDR_FROM 0x01
#define HDR_REPLY_TO 0x02
#define HDR_TO 0x04
#define HDR_CC 0x08
#define HDR_BCC 0x10
#define HDR_SUBJECT 0x20
#define HDR_NEWSGROUPS 0x40
#define HDR_FOLLOWUP_TO 0x80
#define HDR_IDENTITY 0x100
#define HDR_TRANSPORT 0x200
#define HDR_ALL 0x3ff
#ifdef KRN
#define HDR_STANDARD (HDR_SUBJECT|HDR_NEWSGROUPS)
#else
#define HDR_STANDARD (HDR_SUBJECT|HDR_TO|HDR_CC)
#endif
/** The "about KMail" text. */
extern const char* aboutText;
#endif

Loading…
Cancel
Save