2001-07-13 14:03:48 +00:00
/**
* \ file ControlAboutlyx . C
2002-09-05 15:14:23 +00:00
* This file is part of LyX , the document processor .
* Licence details can be found in the file COPYING .
2001-07-13 14:03:48 +00:00
*
2002-09-05 14:10:50 +00:00
* \ author Edwin Leuven
* \ author Angus Leeming
*
2003-08-23 00:17:00 +00:00
* Full author contact details are available in file CREDITS .
2001-07-13 14:03:48 +00:00
*/
# include <config.h>
# include "ControlAboutlyx.h"
# include "gettext.h"
# include "version.h"
2003-09-05 17:23:11 +00:00
# include "support/std_sstream.h"
2002-10-21 17:38:09 +00:00
# include "support/filetools.h" // FileSearch
2003-07-27 21:04:02 +00:00
# include "support/path_defines.h"
2002-10-21 17:38:09 +00:00
# include <fstream>
2003-09-09 22:13:45 +00:00
using lyx : : support : : FileSearch ;
using lyx : : support : : MakeDisplayPath ;
using lyx : : support : : system_lyxdir ;
using lyx : : support : : user_lyxdir ;
2003-06-30 23:56:22 +00:00
2002-10-21 17:38:09 +00:00
using std : : ostream ;
2003-09-05 18:02:24 +00:00
using std : : ostringstream ;
2003-10-06 15:43:21 +00:00
using std : : string ;
2001-07-13 14:03:48 +00:00
2002-06-18 15:44:30 +00:00
2003-03-09 20:29:58 +00:00
ControlAboutlyx : : ControlAboutlyx ( Dialog & parent )
: Dialog : : Controller ( parent )
2002-06-18 15:44:30 +00:00
{ }
2001-07-13 14:03:48 +00:00
2002-10-21 17:38:09 +00:00
void ControlAboutlyx : : getCredits ( ostream & ss ) const
2001-07-13 14:03:48 +00:00
{
2003-07-27 21:04:02 +00:00
string const name = FileSearch ( system_lyxdir ( ) , " CREDITS " ) ;
2001-07-13 14:03:48 +00:00
bool found ( ! name . empty ( ) ) ;
if ( found ) {
std : : ifstream in ( name . c_str ( ) ) ;
2002-10-21 17:38:09 +00:00
ss < < in . rdbuf ( ) ;
found = ss . good ( ) ;
2001-07-13 14:03:48 +00:00
}
if ( ! found ) {
ss < < _ ( " ERROR: LyX wasn't able to read CREDITS file \n " )
< < _ ( " Please install correctly to estimate the great \n " )
< < _ ( " amount of work other people have done for the LyX project. " ) ;
}
}
2002-06-18 15:44:30 +00:00
2001-07-13 14:03:48 +00:00
string const ControlAboutlyx : : getCopyright ( ) const
{
return _ ( " LyX is Copyright (C) 1995 by Matthias Ettrich , \ n1995 - 2001 LyX Team " ) ;
}
2002-06-18 15:44:30 +00:00
2001-07-13 14:03:48 +00:00
string const ControlAboutlyx : : getLicense ( ) const
{
return _ ( " This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. " ) ;
}
2002-06-18 15:44:30 +00:00
2001-07-13 14:03:48 +00:00
string const ControlAboutlyx : : getDisclaimer ( ) const
{
return _ ( " LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \n See the GNU General Public License for more details. \n You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. " ) ;
}
2002-06-18 15:44:30 +00:00
2001-07-13 14:03:48 +00:00
string const ControlAboutlyx : : getVersion ( ) const
{
2002-10-21 17:38:09 +00:00
ostringstream ss ;
2001-07-13 14:03:48 +00:00
ss < < _ ( " LyX Version " )
2001-10-03 15:49:32 +00:00
< < lyx_version
2002-04-09 10:02:10 +00:00
< < _ ( " of " )
2001-10-03 15:49:32 +00:00
< < lyx_release_date
2001-07-13 14:03:48 +00:00
< < " \n "
2002-04-09 10:02:10 +00:00
< < _ ( " Library directory: " )
2003-07-27 21:04:02 +00:00
< < MakeDisplayPath ( system_lyxdir ( ) )
2001-07-13 14:03:48 +00:00
< < " \n "
< < _ ( " User directory: " )
2003-07-27 22:13:29 +00:00
< < MakeDisplayPath ( user_lyxdir ( ) ) ;
2002-03-21 21:21:28 +00:00
2003-09-15 11:00:00 +00:00
return ss . str ( ) ;
2001-07-13 14:03:48 +00:00
}