Subversion Repositories Scribus

Rev

Rev 2126 | Rev 2763 | Go to most recent revision | Details | Compare with Previous | 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");
2077 tsoots 38
        updateCheck = new QCheckBox(tr("Overwrite Paragraph Styles"), this,
39
"updateCheck");
1579 tsoots 40
        updateCheck->setChecked(update);
2126 cbradney 41
        QToolTip::add(updateCheck, "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>");
1579 tsoots 42
        hlayout->addWidget(updateCheck);
43
        layout->addLayout(hlayout);
44
 
45
        QBoxLayout* palayout = new QHBoxLayout(0,5,5, "palayout");
2063 mrdocs 46
        packCheck = new QCheckBox(tr("Merge Paragraph Styles"), this, "packCheck");
1579 tsoots 47
        packCheck->setChecked(pack);
2063 mrdocs 48
        QToolTip::add(packCheck, "<qt>" + tr("Merge paragraph styles by attributes. This will result in fewer similar paragraph styles, will retain style attributes, even if the original document's styles are named differently.") +"</qt>");
1579 tsoots 49
        palayout->addWidget(packCheck);
50
        layout->addLayout(palayout);
51
 
52
        QBoxLayout* playout = new QHBoxLayout(0, 5, 5, "playout");
53
        prefixCheck = new QCheckBox(tr("Use document name as a prefix for paragraph styles"), this, "prefixCheck");
54
        prefixCheck->setChecked(prefix);
2063 mrdocs 55
        QToolTip::add(prefixCheck, "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus.") +"</qt>");
1579 tsoots 56
        playout->addWidget(prefixCheck);
57
        layout->addLayout(playout);
58
 
59
        QBoxLayout* dlayout = new QHBoxLayout(0, 5, 5, "dlayout");
2077 tsoots 60
        doNotAskCheck = new QCheckBox(tr("Do not ask again"), this,
61
"doNotAskCheck");
1579 tsoots 62
        doNotAskCheck->setChecked(false);
2063 mrdocs 63
        QToolTip::add(doNotAskCheck, "<qt>" + tr("Make these settings the default and do not prompt again when importing an OASIS OpenDocument.") +"</qt>");
2166 cbradney 64
        //dlayout->addStretch(10);
1579 tsoots 65
        dlayout->addWidget(doNotAskCheck);
66
        layout->addLayout(dlayout);
67
 
68
        QBoxLayout* blayout = new QHBoxLayout(0, 5, 5, "blayout");
69
        blayout->addStretch(10);
70
        okButton = new QPushButton(tr("OK"), this, "okButton");
71
        blayout->addWidget(okButton);
72
        layout->addLayout(blayout);
73
 
74
        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
75
}
76
 
77
bool OdtDialog::shouldUpdate()
78
{
79
        return updateCheck->isChecked();
80
}
81
 
82
bool OdtDialog::usePrefix()
83
{
84
        return prefixCheck->isChecked();
85
}
86
 
87
bool OdtDialog::askAgain()
88
{
89
        return !(doNotAskCheck->isChecked());
90
}
91
 
92
bool OdtDialog::packStyles()
93
{
94
        return packCheck->isChecked();
95
}
96
 
97
OdtDialog::~OdtDialog()
98
{
99
 
100
}
101
 
102
#endif // HAVE_XML