Subversion Repositories Scribus

Rev

Rev 3970 | Rev 6260 | 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
*/
1579 tsoots 7
 /***************************************************************************
8
  *   Copyright (C) 2004 by Riku Leino                                      *
9
  *   tsoots@gmail.com                                                      *
10
  *                                                                         *
11
  *   This program is free software; you can redistribute it and/or modify  *
12
  *   it under the terms of the GNU General Public License as published by  *
13
  *   the Free Software Foundation; either version 2 of the License, or     *
14
  *   (at your option) any later version.                                   *
15
  *                                                                         *
16
  *   This program is distributed in the hope that it will be useful,       *
17
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19
  *   GNU General Public License for more details.                          *
20
  *                                                                         *
21
  *   You should have received a copy of the GNU General Public License     *
22
  *   along with this program; if not, write to the                         *
23
  *   Free Software Foundation, Inc.,                                       *
24
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
25
 ***************************************************************************/
26
 
27
#include "odtdia.h"
28
 
29
#ifdef HAVE_XML
30
 
31
#include "odtdia.moc"
32
#include <qtooltip.h>
2986 craig 33
#include "scribusapi.h"
1579 tsoots 34
 
2986 craig 35
extern QPixmap SCRIBUS_API loadIcon(QString nam);
1579 tsoots 36
 
37
OdtDialog::OdtDialog(bool update, bool prefix, bool pack) : QDialog(0, "sxwdia", true, 0)
38
{
2763 mrdocs 39
        setCaption(tr("OpenDocument Importer Options"));
1579 tsoots 40
        setIcon(loadIcon("AppIcon.png"));
41
 
42
        QBoxLayout* layout = new QVBoxLayout(this);
43
 
44
        QBoxLayout* hlayout = new QHBoxLayout(0, 5, 5, "hlayout");
2077 tsoots 45
        updateCheck = new QCheckBox(tr("Overwrite Paragraph Styles"), this,
46
"updateCheck");
1579 tsoots 47
        updateCheck->setChecked(update);
2126 cbradney 48
        QToolTip::add(updateCheck, "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>");
1579 tsoots 49
        hlayout->addWidget(updateCheck);
50
        layout->addLayout(hlayout);
51
 
52
        QBoxLayout* palayout = new QHBoxLayout(0,5,5, "palayout");
2063 mrdocs 53
        packCheck = new QCheckBox(tr("Merge Paragraph Styles"), this, "packCheck");
1579 tsoots 54
        packCheck->setChecked(pack);
2063 mrdocs 55
        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 56
        palayout->addWidget(packCheck);
57
        layout->addLayout(palayout);
58
 
59
        QBoxLayout* playout = new QHBoxLayout(0, 5, 5, "playout");
60
        prefixCheck = new QCheckBox(tr("Use document name as a prefix for paragraph styles"), this, "prefixCheck");
61
        prefixCheck->setChecked(prefix);
2063 mrdocs 62
        QToolTip::add(prefixCheck, "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus.") +"</qt>");
1579 tsoots 63
        playout->addWidget(prefixCheck);
64
        layout->addLayout(playout);
65
 
66
        QBoxLayout* dlayout = new QHBoxLayout(0, 5, 5, "dlayout");
2077 tsoots 67
        doNotAskCheck = new QCheckBox(tr("Do not ask again"), this,
68
"doNotAskCheck");
1579 tsoots 69
        doNotAskCheck->setChecked(false);
2063 mrdocs 70
        QToolTip::add(doNotAskCheck, "<qt>" + tr("Make these settings the default and do not prompt again when importing an OASIS OpenDocument.") +"</qt>");
2166 cbradney 71
        //dlayout->addStretch(10);
1579 tsoots 72
        dlayout->addWidget(doNotAskCheck);
73
        layout->addLayout(dlayout);
74
 
75
        QBoxLayout* blayout = new QHBoxLayout(0, 5, 5, "blayout");
76
        blayout->addStretch(10);
77
        okButton = new QPushButton(tr("OK"), this, "okButton");
78
        blayout->addWidget(okButton);
3970 tsoots 79
        cancelButton = new QPushButton(tr("Cancel"), this, "cancelButton");
80
        blayout->addWidget(cancelButton);
1579 tsoots 81
        layout->addLayout(blayout);
82
 
83
        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
3970 tsoots 84
        connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
1579 tsoots 85
}
86
 
87
bool OdtDialog::shouldUpdate()
88
{
89
        return updateCheck->isChecked();
90
}
91
 
92
bool OdtDialog::usePrefix()
93
{
94
        return prefixCheck->isChecked();
95
}
96
 
97
bool OdtDialog::askAgain()
98
{
99
        return !(doNotAskCheck->isChecked());
100
}
101
 
102
bool OdtDialog::packStyles()
103
{
104
        return packCheck->isChecked();
105
}
106
 
107
OdtDialog::~OdtDialog()
108
{
109
 
110
}
111
 
112
#endif // HAVE_XML