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

List:       kde-commits
Subject:    kdepim/ktnef/gui
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2003-04-28 15:36:43
[Download RAW message or body]

CVS commit by goffioul: 

Added RTF saving possibility and access through menu items


  M +21 -1     ktnefmain.cpp   1.8
  M +2 -0      ktnefmain.h   1.8
  M +2 -0      ktnefui.rc   1.4


--- kdepim/ktnef/gui/ktnefmain.cpp  #1.7:1.8
@@ -103,5 +103,6 @@ void KTNEFMain::setupActions()
         new KAction( i18n( "Message Properties..." ), "help", 0, this, SLOT( \
                slotShowMessageProperties() ), actionCollection(), "msg_properties" \
                );
         new KAction(i18n("Properties..."), QString("contents"), 0, this, \
                SLOT(propertiesFile()), actionCollection(), "properties_file");
-        new KAction( i18n( "Message Text..." ), "mail_generic", 0, this, SLOT( \
slotShowMessageText() ), actionCollection(), "msg_text" ); +        new KAction( \
i18n( "Show Message Text" ), "mail_generic", 0, this, SLOT( slotShowMessageText() ), \
actionCollection(), "msg_text" ); +        new KAction( i18n( "Save Message Text..." \
), "filesave", 0, this, SLOT( slotSaveMessageText() ), actionCollection(), "msg_save" \
);  actionCollection()->action("view_file")->setEnabled(false);
         actionCollection()->action("view_file_as")->setEnabled(false);
@@ -373,4 +374,23 @@ void KTNEFMain::slotShowMessageText()
 
         KRun::runURL( tmpFile.name(), "text/rtf", true );
+}
+
+void KTNEFMain::slotSaveMessageText()
+{
+        QString rtf = parser_->message()->rtfString();
+        QString filename = KFileDialog::getSaveFileName( QString::null, \
QString::null, this ); +        if ( !filename.isEmpty() )
+        {
+                QFile f( filename );
+                if ( f.open( IO_WriteOnly ) )
+                {
+                        QTextStream t( &f );
+                        t << rtf;
+                }
+                else
+                        QMessageBox::critical( this, i18n( "Error" ),
+                                        i18n( "Unable to save message text, check \
file permissions." ), +                                        \
QMessageBox::Ok|QMessageBox::Default, 0); +        }
 }
 

--- kdepim/ktnef/gui/ktnefmain.h  #1.7:1.8
@@ -51,4 +51,5 @@ protected slots:
         void slotShowMessageProperties();
         void slotShowMessageText();
+        void slotSaveMessageText();
 
         void viewSelectionChanged();
@@ -66,4 +67,5 @@ private:
         void enableSingleAction(bool on = true);
         void cleanup();
+        
         void extractTo(const QString& dirname);
         QString extractTemp(KTNEFAttach *att);

--- kdepim/ktnef/gui/ktnefui.rc  #1.3:1.4
@@ -14,4 +14,6 @@
         <Separator />
         <Action name="msg_properties" />
+        <Action name="msg_text" />
+        <Action name="msg_save" />
   </Menu>
   <Menu name="settings"><text>&amp;Settings</text>


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

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