Subversion Repositories Scribus

Rev

Rev 3 | Rev 68 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 paul 1
/****************************************************************************
2
** Form implementation generated from reading ui file 'Help.ui'
3
**
4
** Created: Tue Jul 3 21:51:52 2001
5
**      by:  The User Interface Compiler (uic)
6
**
7
** WARNING! All changes made in this file will be lost!
8
****************************************************************************/
9
#include "helpbrowser.h"
10
#include "helpbrowser.moc"
11
#include <qpushbutton.h>
12
#include <qtextbrowser.h>
13
#include <qtoolbutton.h>
14
#include <qlayout.h>
15
#include <qvariant.h>
16
#include <qtooltip.h>
17
#include <qimage.h>
18
#include <qpixmap.h>
19
#include <qtextcodec.h>
20
#include <qfileinfo.h>
21
#include <config.h>
22
extern QPixmap loadIcon(QString nam);
23
 
24
/*
25
 *  Constructs a HelpBrowser which is a child of 'parent', with the
26
 *  name 'name' and widget flags set to 'f'
27
 *
28
 *  The dialog will by default be modeless, unless you set 'modal' to
29
 *  TRUE to construct a modal dialog.
30
 */
31
HelpBrowser::HelpBrowser( QWidget* parent, QString Capt, QString Datei )
32
    : QWidget( parent, "Help", WType_TopLevel | WDestructiveClose )
33
{
34
    resize( 547, 450 );
35
    setCaption( Capt );
36
        setIcon(loadIcon("AppIcon.xpm"));
37
    HelpBrowserLayout = new QVBoxLayout( this );
38
    HelpBrowserLayout->setSpacing( 2 );
39
    HelpBrowserLayout->setMargin( 2 );
40
 
41
    Layout13 = new QHBoxLayout;
42
    Layout13->setSpacing( 6 );
43
    Layout13->setMargin( 0 );
44
 
45
    HomeB = new QToolButton( this, "HomeB" );
46
    HomeB->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, HomeB->sizePolicy().hasHeightForWidth() ) );
47
    HomeB->setMinimumSize( QSize( 0, 0 ) );
48
    HomeB->setMaximumSize( QSize( 32767, 32767 ) );
49
    HomeB->setText( tr( "" ) );
23 Franz 50
    HomeB->setPixmap(loadIcon("gohome.png"));
3 paul 51
    Layout13->addWidget( HomeB );
52
 
53
    BackB = new QToolButton( this, "BackB" );
54
    BackB->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, BackB->sizePolicy().hasHeightForWidth() ) );
55
    BackB->setMinimumSize( QSize( 0, 0 ) );
56
    BackB->setMaximumSize( QSize( 32767, 32767 ) );
23 Franz 57
    BackB->setPixmap(loadIcon("back.png"));
3 paul 58
    Layout13->addWidget( BackB );
59
 
60
    ForwB = new QToolButton( this, "ForwB" );
61
    ForwB->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, ForwB->sizePolicy().hasHeightForWidth() ) );
62
    ForwB->setMinimumSize( QSize( 0, 0 ) );
63
    ForwB->setMaximumSize( QSize( 32767, 32767 ) );
23 Franz 64
    ForwB->setPixmap(loadIcon("forward.png"));
3 paul 65
    Layout13->addWidget( ForwB );
66
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
67
    Layout13->addItem( spacer );
68
    HelpBrowserLayout->addLayout( Layout13 );
69
 
70
    Anzeige = new QTextBrowser( this, "Anzeige" );
71
    Anzeige->setFrameShape( QTextBrowser::StyledPanel );
72
        QString pfad = PREL;
73
        QString pfad2;
74
        bool Avail = true;
75
                if (Datei == "")
76
                pfad2 = pfad + "/lib/scribus/doc/"+QString(QTextCodec::locale()).left(2)+"/index.html";
77
                else
78
                        pfad2 = Datei;
79
        QFileInfo fi;
80
        fi = QFileInfo(pfad2);
81
        if (!fi.exists())
82
                {
83
                pfad2 = pfad + "/lib/scribus/doc/en/index.html";
84
                fi = QFileInfo(pfad2);
85
                if (!fi.exists())
86
                        {
87
                        Anzeige->setText("<h2>"+tr("Sorry, no Manual available!")+"</h2>");
88
                        Avail = false;
89
                        }
90
                }
91
        if (Avail)
92
        Anzeige->setSource(pfad2);
93
    HelpBrowserLayout->addWidget( Anzeige );
94
 
95
    // signals and slots connections
96
    connect( HomeB, SIGNAL( clicked() ), Anzeige, SLOT( home() ) );
97
    connect( ForwB, SIGNAL( clicked() ), Anzeige, SLOT( forward() ) );
98
    connect( BackB, SIGNAL( clicked() ), Anzeige, SLOT( backward() ) );
99
}
100