Added insertFile() function

svn path=/trunk/kdenetwork/kmail/; revision=377
wilder-work
Markus Wuebben 29 years ago
parent 60b5092b03
commit a5bbd674df
  1. 25
      kmcomposewin.cpp
  2. 1
      kmcomposewin.h

@ -459,6 +459,30 @@ void KMComposeView::detachFile(int index, int col)
}
void KMComposeView::insertFile()
{
QString iFileString;
QString textString;
QFile *iFileName;
char buf[255];
int col, line;
QFileDialog *d=new QFileDialog(".","*",this,NULL,TRUE);
d->setCaption("Insert File");
if (d->exec())
{iFileString = d->selectedFile();
iFileName = new QFile(iFileString);
iFileName->open(IO_ReadOnly);
iFileName->at(0);
while(iFileName->readLine(buf,254) != 0)
textString.append(buf);
iFileName->close();
editor->getCursorPosition(&line,&col);
editor->insertAt(textString,line,col);
editor->update();
editor->repaint();
}
}
void KMComposeView::toDo()
{
KMsgBox::message(this,"Ouch",
@ -680,6 +704,7 @@ void KMComposeWin::setupMenuBar()
QPopupMenu *mmenu = new QPopupMenu();
mmenu->insertItem("Recip&ients...",composeView,SLOT(toDo()),ALT+Key_I);
mmenu->insertItem("Insert &File", composeView,SLOT(insertFile()),ALT+Key_F);
mmenu->insertSeparator();
QPopupMenu *menv = new QPopupMenu();
menv->insertItem("High");

@ -77,6 +77,7 @@ private slots:
void replyMessage();
void replyAll();
void detachFile(int,int);
void insertFile();
protected:
virtual void resizeEvent(QResizeEvent *);
};

Loading…
Cancel
Save