Subversion Repositories Scribus

Rev

Rev 2063 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1579 tsoots 1
 /***************************************************************************
2
  *   Copyright (C) 2004 by Riku Leino                                      *
3
  *   tsoots@gmail.com                                                      *
4
  *                                                                         *
5
  *   This program is free software; you can redistribute it and/or modify  *
6
  *   it under the terms of the GNU General Public License as published by  *
7
  *   the Free Software Foundation; either version 2 of the License, or     *
8
  *   (at your option) any later version.                                   *
9
  *                                                                         *
10
  *   This program is distributed in the hope that it will be useful,       *
11
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
  *   GNU General Public License for more details.                          *
14
  *                                                                         *
15
  *   You should have received a copy of the GNU General Public License     *
16
  *   along with this program; if not, write to the                         *
17
  *   Free Software Foundation, Inc.,                                       *
18
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 ***************************************************************************/
20
 
21
#include "odtdia.h"
22
 
23
#ifdef HAVE_XML
24
 
25
#include "odtdia.moc"
26
#include <qtooltip.h>
27
 
28
extern QPixmap loadIcon(QString nam);
29
 
30
OdtDialog::OdtDialog(bool update, bool prefix, bool pack) : QDialog(0, "sxwdia", true, 0)
31
{
32
        setCaption(tr("OpenOffice.org Writer Importer Options"));
33
        setIcon(loadIcon("AppIcon.png"));
34
 
35
        QBoxLayout* layout = new QVBoxLayout(this);
36
 
37
        QBoxLayout* hlayout = new QHBoxLayout(0, 5, 5, "hlayout");
38
        updateCheck = new QCheckBox(tr("Update paragraph styles"), this, "updateCheck");
39
        updateCheck->setChecked(update);
40
        QToolTip::add(updateCheck, tr("If a paragraph style already exists with the same name as the current\n"
41
                                      "OpenOffice.org document's paragraph, should the style in Scribus be\n"
42
                                      "edited to match the one being imported, or left untouched"));
43
        hlayout->addWidget(updateCheck);
44
        layout->addLayout(hlayout);
45
 
46
        QBoxLayout* palayout = new QHBoxLayout(0,5,5, "palayout");
47
        packCheck = new QCheckBox(tr("Pack paragraph styles"), this, "packCheck");
48
        packCheck->setChecked(pack);
49
        QToolTip::add(packCheck, tr("Group paragraph styles by attributes.\n"
50
                                    "Less paragraph styles but controlling them may be hard.\n"
51
                                    "Should be used if it is known that text must not be edited\n"
52
                                    "after importing."));
53
        palayout->addWidget(packCheck);
54
        layout->addLayout(palayout);
55
 
56
        QBoxLayout* playout = new QHBoxLayout(0, 5, 5, "playout");
57
        prefixCheck = new QCheckBox(tr("Use document name as a prefix for paragraph styles"), this, "prefixCheck");
58
        prefixCheck->setChecked(prefix);
59
        QToolTip::add(prefixCheck, tr("Should importer add the name of the document\n"
60
                                      "on front of the paragraph style name in Scribus"));
61
        playout->addWidget(prefixCheck);
62
        layout->addLayout(playout);
63
 
64
        QBoxLayout* dlayout = new QHBoxLayout(0, 5, 5, "dlayout");
65
        doNotAskCheck = new QCheckBox(tr("Do not ask again"), this, "doNotAskCheck");
66
        doNotAskCheck->setChecked(false);
67
        QToolTip::add(doNotAskCheck, tr("Should the importer always use currently\n"
68
                                        "set value when importing OpenOffice.org document and\n"
69
                                        "never ask your confirmation again"));
70
        dlayout->addStretch(10);
71
        dlayout->addWidget(doNotAskCheck);
72
        layout->addLayout(dlayout);
73
 
74
        QBoxLayout* blayout = new QHBoxLayout(0, 5, 5, "blayout");
75
        blayout->addStretch(10);
76
        okButton = new QPushButton(tr("OK"), this, "okButton");
77
        blayout->addWidget(okButton);
78
        layout->addLayout(blayout);
79
 
80
        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
81
}
82
 
83
bool OdtDialog::shouldUpdate()
84
{
85
        return updateCheck->isChecked();
86
}
87
 
88
bool OdtDialog::usePrefix()
89
{
90
        return prefixCheck->isChecked();
91
}
92
 
93
bool OdtDialog::askAgain()
94
{
95
        return !(doNotAskCheck->isChecked());
96
}
97
 
98
bool OdtDialog::packStyles()
99
{
100
        return packCheck->isChecked();
101
}
102
 
103
OdtDialog::~OdtDialog()
104
{
105
 
106
}
107
 
108
#endif // HAVE_XML