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

List:       kde-commits
Subject:    playground/pim/mailody
From:       Tom Albers <tomalbers () kde ! nl>
Date:       2008-03-16 18:43:33
Message-ID: 1205693013.098173.15183.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 786323 by toma:

Don't crash when there is no mailtransport configured, present an info box and open \
the settings. Also guard for the actual sending.


 M  +3 -2      AKONADI  
 M  +21 -5     src/composer.cpp  
 M  +2 -2      src/main.cpp  


--- trunk/playground/pim/mailody/AKONADI #786322:786323
@@ -7,11 +7,12 @@
    all the handling of tabs is pretty much broken currently. disable for first \
release?  check keys for navigation for new mail loop, next/previous message, etc
    check if local subscriptions actually do things, else disable the action
-   saving column sizes
    merge sender/receiver, probably fix that in kmime and adjust the models to allow \
                a list of fields?
-   check if view source/html/plain/external images all work as expected
    get an artist to fix the unread count in the tray to be readable 
 
+qt bugs:
+   hide/show folder bar resets its size
+
 toma:
    trigger update mailboxlist is a bit nasty on setup close and start mailody, is \
there a better way?  changing a flag results in a void ImaplibResource::itemChanged( \
const Akonadi::Item& item, const QStringList& parts ), but the parts part is empty. \
                How am i supposed to know the flags has changed.
--- trunk/playground/pim/mailody/src/composer.cpp #786322:786323
@@ -373,9 +373,9 @@
     // Statusbar stuff
     statusBar()->insertItem( QString(), 1, 10 );
     statusBar()->insertItem( m_identityBox->currentIdentityName(), 2, 1 );
-    const QString t = MailTransport::TransportManager::self()->transportById(
-                          m_transportBox->currentTransportId() )->name();
-    statusBar()->insertItem( t, 3, 1 );
+    statusBar()->insertItem( QString(), 3, 1 );
+    slotTransportChanged();
+
     connect( statusBar(), SIGNAL( pressed( int ) ),
              SLOT( slotStatusBarClicked( int ) ) );
 }
@@ -933,6 +933,13 @@
 {
     kDebug() << "start slotSend" << endl;
 
+    int current = m_transportBox->currentTransportId();
+    if ( current == -1 ) {
+        KMessageBox::information( this, i18n( "There is no outgoing mailserver \
configuration found, please set it up before sending" ) ); +        slotSetup();
+        return;
+    }
+
     if ( !m_origSubject.isEmpty() && m_origSubject != m_subject->text() &&
             !m_replyTo.isEmpty() ) {
         int i = KMessageBox::questionYesNo( 0,
@@ -1042,9 +1049,18 @@
 
 void Composer::slotTransportChanged()
 {
+    int current = m_transportBox->currentTransportId();
+    if ( current == -1 ) {
+        KMessageBox::information( this, i18n( "There is no outgoing mailserver \
configuration found, please set it up before sending" ) ); +        // as this can be \
called from the constructor, wait for the eventloop, so the mainwindow is +        // \
connected to the signal. +        QTimer::singleShot( 0, this, SLOT( slotSetup() ) );
+        statusBar()->changeItem( i18nc( "No valid mail transport is choosen","None" \
), 3 ); +        return;
+    }
+
     // set the status bar.
-    const QString t = MailTransport::TransportManager::self()->transportById(
-                          m_transportBox->currentTransportId() )->name();
+    const QString t = MailTransport::TransportManager::self()->transportById( \
current )->name();  statusBar()->changeItem( t, 3 );
 
     // the idea is that the 'sendmail' transports should be possible,
--- trunk/playground/pim/mailody/src/main.cpp #786322:786323
@@ -79,12 +79,12 @@
             }
 
             if ( args->isSet( "subject" ) ) {
-                sSubjectArgs = args->getOption("subject");
+                sSubjectArgs = args->getOption( "subject" );
                 send = true;
             }
 
             if ( args->isSet( "body" ) ) {
-                sBodyArgs = args->getOption("body");
+                sBodyArgs = args->getOption( "body" );
                 send = true;
             }
 


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

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