texteditor.cpp
changeset 106 4083860dd82e
parent 95 f688a9913724
child 123 09edde7ae30e
     1.1 --- a/texteditor.cpp	Mon Jun 06 20:27:42 2005 +0000
     1.2 +++ b/texteditor.cpp	Tue Jun 14 09:41:37 2005 +0000
     1.3 @@ -114,6 +114,7 @@
     1.4  		actionSettingsFonthintDefault->setOn (false);
     1.5  		e->setCurrentFont (varFont);
     1.6  	}	
     1.7 +	filenameHint="";
     1.8  }
     1.9  
    1.10  
    1.11 @@ -206,6 +207,16 @@
    1.12  	return filename;
    1.13  }
    1.14  
    1.15 +void TextEditor::setFilenameHint(const QString &fnh)
    1.16 +{
    1.17 +	filenameHint=fnh;
    1.18 +}
    1.19 +
    1.20 +QString TextEditor::getFilenameHint()
    1.21 +{
    1.22 +	return filenameHint;
    1.23 +}
    1.24 +
    1.25  bool TextEditor::findText(const QString &t, const bool &cs)
    1.26  {
    1.27  	bool wo=false;	// word matches
    1.28 @@ -693,8 +704,16 @@
    1.29  void TextEditor::textExportAsASCII()
    1.30  {
    1.31  	QString text = textConvertToASCII( e->text());
    1.32 -    QString fn = QFileDialog::getSaveFileName( QString::null, "VYM Note (ASCII) (*.txt);;All files (*)",
    1.33 -					       this,"export note dialog",tr("Export Note to single file (ASCII)") );
    1.34 +	QString fn,s;
    1.35 +	if (!filenameHint.isEmpty())
    1.36 +	{
    1.37 +		if (!filenameHint.contains (".txt"))
    1.38 +			s=filenameHint+".txt";
    1.39 +		else	
    1.40 +			s=filenameHint;
    1.41 +	} else	
    1.42 +		s=QString::null;
    1.43 +	fn = QFileDialog::getSaveFileName( s, "VYM Note (ASCII) (*.txt);;All files (*)", this,"export note dialog",tr("Export Note to single file (ASCII)") );
    1.44  	int ret=-1;
    1.45  
    1.46      if ( !fn.isEmpty() )