/* ==================================================================== * Copyright (c) 2003-2006, Martin Hauner * http://subcommander.tigris.org * * Subcommander is licensed as described in the file doc/COPYING, which * you should have received as part of this distribution. * ==================================================================== */ // sc #include "config.h" #include "AboutDialog.h" #include "Gui.h" #include "version.out.h" #include "LogoBanner.cpp" #include "Utility.h" // qt #include #include #include #include #include #include // svn #include // apr #include #include #ifdef _WIN32 #include #endif #include #ifdef HAVE_DB_H // berkeley db #include #define DB_VER_NUM STRINGIFY(DB_VERSION_MAJOR) \ "." STRINGIFY(DB_VERSION_MINOR) \ "." STRINGIFY(DB_VERSION_PATCH) #endif // HAVE_DB_H /////////////////////////////////////////////////////////////////////////////// QString getOpenSSLVersion() { unsigned long openssl = OPENSSL_VERSION_NUMBER; // MNNFFPPS: major minor fix patch status int major = (openssl & 0xf0000000) >> 28; int minor = (openssl & 0x0ff00000) >> 20; int fix = (openssl & 0x000ff000) >> 12; int patch = ((openssl & 0x00000ff0) >> 4) + 0x60; //int status = (openssl & 0x0000000f); return QString("%1.%2.%3%4").arg(major).arg(minor).arg(fix).arg((char)patch); } /////////////////////////////////////////////////////////////////////////////// AboutDialog::AboutDialog( QWidget *parent, const char *name ) : super( parent, name, true, Qt::WStyle_Customize | Qt::WStyle_Dialog | Qt::WStyle_NormalBorder | Qt::WStyle_Title | Qt::WStyle_SysMenu ) { QPixmap logo; QString sname; if( getLongAppName() == "subcommander" ) { sname = _q("subcommander"); setCaption( _q("subcommander:about") ); const QImage* image = &qembed_findImage("LogoBanner_400x80_subcommander"); logo.convertFromImage( *image ); } else { sname = _q("submerge"); setCaption( _q("submerge:about") ); const QImage* image = &qembed_findImage("LogoBanner_400x80_submerge"); logo.convertFromImage( *image ); } QVBoxLayout *vbl = new QVBoxLayout(this,0,5); vbl->setMargin(3); { QLabel *lp = new QLabel(this); vbl->addWidget(lp,0); { lp->setPixmap(logo); lp->setFixedSize(logo.size()); } QString about; about += sname + " " SUBCOMMANDER_VERSION "\n\n"; #ifdef SUBCOMMANDER_SPECIALBUILD about += SUBCOMMANDER_SPECIALBUILD_DESCRIPTION "\n\n"; #endif // SUBCOMMANDER_SPECIALBUILD about += _q("Copyright 2003-2006 Martin Hauner"); about += "\n"; about += "http://subcommander.tigris.org" "\n\n"; about += _q("for feedback or questions write to""\n" "dev@subcommander.tigris.org"); QLabel *l = new QLabel(this); vbl->addWidget(l,0); l->setMargin(10); l->setText( about ); l->setFrameStyle( QFrame::Box | QFrame::Sunken ); l->setAlignment( Qt::AlignCenter | Qt::WordBreak ); l->setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed) ); QString about2 = ""; QString gnu = "
"; about2 += "" "" "" "" "" " " "" "" "" "" "
"; about2 += _q("License"); about2 += "
"; about2 += gnu + "
" "

"; about2 += _q( "Subcommander 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."); about2 += "

" "

"; about2 += _q( "You should have received a copy of the GNU General Public License along " "with Subcommander; if not, write to the Free Software Foundation, Inc., " "59 Temple Place - Suite 330, Boston, MA 02111-1307, USA."); about2 += "

" "

"; about2 += _q( "Subcommander 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. See the GNU " "General Public License for more details."); about2 += "

" "

"; about2 += _q( "In addition, as a special exception, the copyright holder gives " "permission to link the code of this program with the Qt library (or " "with modified versions of Qt that use the same license as Qt), and " "distribute linked combinations including the two. You must obey the " "GNU General Public License in all respects for all of the code used " "other than Qt. "); about2 += "

" "
"; about2 += ""; #if 0 "" "" "" "" "" "" //"""""" """""" //"""""" // add contributors here.. """""" """""" "" """" "" """""" #endif // my current understanding of the open source lincenses is that you // do not have to include the "This product includes software developed by ..." // clause if you only use the api and do not copy any source from it to your // own project. about2 += "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""; if( getLongAppName() == "subcommander" ) { #ifdef HAVE_DB_H about2 += "" "" "" "" ""; #endif // HAVE_DB_H } if( getLongAppName() == "subcommander" ) { about2 += "" "" "" "" ""; } about2 += "" "" "" "" "" "" "" "" #ifdef _WIN32 "" "" "" "" #endif ""; if( getLongAppName() == "subcommander" ) { about2 += "" "" "" "" ""; } about2 += "" "" "" "" ""; about2 += "
" +sname+ "
Author
"/*"written by"*/"
Martin Hauner
"/*" * * * "*/"
with contributions from:
any volunteers?
namecontributions
* * *
"; about2 += _q("Libraries"); about2 += "
"; if( getLongAppName() == "subcommander" ) { about2 += _q("subcommander is using the following libraries:"); } else { about2 += _q("submerge is using the following libraries:"); } about2 += "
* * *
" "This product includes software developed by
" "CollabNet (http://www.Collab.Net/):" "
" "subversion " SVN_VERSION "" "http://subversion.tigris.org" "
* * *
" "Berkeley DB " DB_VER_NUM "" "http://www.sleepycat.com" "
* * *
" "OpenSSL "; about2 += getOpenSSLVersion(); about2 += "" "http://www.openssl.org" "
* * *
" "apr " APR_VERSION_STRING "" "http://apr.apache.org" "
" "apr-util " APU_VERSION_STRING "" "http://apr.apache.org" "
" "apr-iconv " API_VERSION_STRING "" "http://apr.apache.org" "
* * *
"; about2 += getNeonVersion(); about2 += "" "http://www.webdav.org" "
* * *
"; about2 += _q("nuvola (and crystal) icons"); about2 += "" "http://www.kdelook.org" "
* * *

" "
"; QTextEdit* qtv = new QTextEdit(this); //qtv->setFocusPolicy(QWidget::NoFocus); vbl->addWidget(qtv,3); qtv->setText( about2 ); qtv->setLineWidth(1); qtv->setMargin(3); qtv->setReadOnly(true); qtv->setFrameStyle( QFrame::Box | QFrame::Sunken ); #ifndef _MACOSX // great, without it the bg is white on Windows and Linux, with it the bg is // black on MacOSX... qtv->setPaper( backgroundColor() ); #endif // _MACOSX qtv->setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding) ); qtv->setMinimumHeight( (int)(2.5 * lp->height()) ); setFixedWidth( 406 /* 2*margin + logo width */ ); } QHBoxLayout* hu = new QHBoxLayout; vbl->addLayout(hu); { QPushButton *b = new QPushButton(this); b->setDefault(true); b->setFocus(); hu->addWidget(b); b->setText(qtf8(_("&Ok"))); hu->addSpacing(getSizeGripSpacing()); QObject::connect( b, SIGNAL(released()), this, SLOT(accept()) ); } } AboutDialog::~AboutDialog() { }