Rev 20968 | Rev 21245 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4430 | cbradney | 1 | /* |
2 | For general Scribus (>=1.3.2) copyright and licensing information please refer |
||
3 | to the COPYING file provided with the program. Following this notice may exist |
||
4 | a copyright and/or license notice that predates the release of Scribus 1.3.2 |
||
5 | for which a new license (GPL+exception) is in place. |
||
6 | */ |
||
8508 | cbradney | 7 | #include <QApplication> |
8 | #include <QDesktopWidget> |
||
13245 | cbradney | 9 | #include <QDebug> |
8501 | cbradney | 10 | #include <QMouseEvent> |
10200 | cbradney | 11 | #include <QPainter> |
13245 | cbradney | 12 | #include <QPalette> |
10200 | cbradney | 13 | #include <QPixmap> |
14 | #include <QRegExp> |
||
15 | |||
19479 | craig | 16 | #include "scconfig.h" |
17 | Franz | 17 | #include "splash.h" |
18 | |||
10200 | cbradney | 19 | #include "util.h" |
4645 | subik | 20 | |
19479 | craig | 21 | #ifdef HAVE_SVNVERSION |
22 | #include "svnversion.h" |
||
23 | #endif |
||
10200 | cbradney | 24 | |
17869 | fschmid | 25 | ScSplashScreen::ScSplashScreen( const QPixmap & pixmap, Qt::WindowFlags f ) : QSplashScreen( pixmap, f) |
17 | Franz | 26 | { |
19479 | craig | 27 | #if defined _WIN32 |
28 | QFont font("Lucida Sans Unicode", 9); |
||
29 | #elif defined(__INNOTEK_LIBC__) |
||
30 | QFont font("WarpSans", 8); |
||
31 | #elif defined(Q_OS_MAC) |
||
32 | QFont font("Helvetica Regular", 11); |
||
33 | #else |
||
34 | QFont font("DejaVu Sans", 8); |
||
35 | if (!font.exactMatch()) |
||
36 | font.setFamily("Bitstream Vera Sans"); |
||
37 | #endif |
||
38 | setFont(font); |
||
17 | Franz | 39 | } |
40 | |||
17869 | fschmid | 41 | void ScSplashScreen::setStatus( const QString &message ) |
17 | Franz | 42 | { |
7784 | cbradney | 43 | static QRegExp rx("&\\S*"); |
44 | QString tmp(message); |
||
320 | Franz | 45 | int f = 0; |
46 | while (f != -1) |
||
47 | { |
||
10517 | cbradney | 48 | f = tmp.indexOf(rx); |
320 | Franz | 49 | if (f != -1) |
50 | { |
||
51 | tmp.remove(f, 1); |
||
52 | f = 0; |
||
53 | } |
||
54 | } |
||
13245 | cbradney | 55 | |
19479 | craig | 56 | showMessage ( tmp, Qt::AlignRight | Qt::AlignBottom, Qt::white ); |
57 | } |
||
58 | |||
59 | void ScSplashScreen::drawContents(QPainter* painter) |
||
60 | { |
||
61 | QFont f(font()); |
||
62 | QSplashScreen::drawContents(painter); |
||
63 | QRect r = rect().adjusted(0, 0, -15, -60); |
||
64 | QFont lgf(font()); |
||
7782 | jghali | 65 | #if defined _WIN32 |
19479 | craig | 66 | lgf.setPointSize(30); |
7800 | cbradney | 67 | #elif defined(__INNOTEK_LIBC__) |
19479 | craig | 68 | lgf.setPointSize(29); |
10856 | cbradney | 69 | #elif defined(Q_OS_MAC) |
19479 | craig | 70 | lgf.setPointSize(32); |
7782 | jghali | 71 | #else |
19479 | craig | 72 | lgf.setPointSize(29); |
7782 | jghali | 73 | #endif |
20979 | craig | 74 | QString versionText(VERSION); |
19479 | craig | 75 | painter->setFont(lgf); |
20979 | craig | 76 | painter->drawText(r, Qt::AlignRight | Qt::AlignBottom, versionText ); |
13245 | cbradney | 77 | |
20979 | craig | 78 | if (versionText.contains("svn")) |
19479 | craig | 79 | { |
20968 | jghali | 80 | #if defined(HAVE_SVNVERSION) && defined(SVNVERSION) |
19479 | craig | 81 | QString revText; |
82 | revText=QString("SVN Revision: %1").arg(SVNVERSION); |
||
83 | QRect r2 = rect().adjusted(0, 0, -15, -50); |
||
84 | painter->setFont(f); |
||
85 | painter->drawText(r2, Qt::AlignRight | Qt::AlignBottom, revText ); |
||
86 | #endif |
||
87 | QFont wf(font()); |
||
88 | #if defined _WIN32 |
||
20968 | jghali | 89 | wf.setPointSize(10); |
19479 | craig | 90 | #elif defined(__INNOTEK_LIBC__) |
20968 | jghali | 91 | wf.setPointSize(9); |
19479 | craig | 92 | #elif defined(Q_OS_MAC) |
20968 | jghali | 93 | wf.setPointSize(12); |
19479 | craig | 94 | #else |
20968 | jghali | 95 | wf.setPointSize(9); |
19479 | craig | 96 | #endif |
97 | painter->setFont(wf); |
||
98 | painter->setPen(QPen(Qt::red)); |
||
99 | QString warningText("UNSTABLE. For testing purposes only!"); |
||
100 | QRect r3 = rect().adjusted(0, 0, -15, -25); |
||
101 | painter->drawText(r3, Qt::AlignRight | Qt::AlignBottom, warningText ); |
||
102 | } |
||
162 | Franz | 103 | } |
19479 | craig | 104 |