Subversion Repositories Scribus

Rev

Rev 8495 | Rev 8521 | 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>
8501 cbradney 33
//Added by qt3to4:
34
#include <Q3VBoxLayout>
35
#include <QPixmap>
36
#include <Q3HBoxLayout>
2986 craig 37
#include "scribusapi.h"
1579 tsoots 38
 
2986 craig 39
extern QPixmap SCRIBUS_API loadIcon(QString nam);
1579 tsoots 40
 
41
OdtDialog::OdtDialog(bool update, bool prefix, bool pack) : QDialog(0, "sxwdia", true, 0)
42
{
6260 fschmid 43
        setCaption( tr("OpenDocument Importer Options"));
1579 tsoots 44
        setIcon(loadIcon("AppIcon.png"));
45
 
8501 cbradney 46
        Q3BoxLayout* layout = new Q3VBoxLayout(this);
1579 tsoots 47
 
8501 cbradney 48
        Q3BoxLayout* hlayout = new Q3HBoxLayout(0, 5, 5, "hlayout");
6260 fschmid 49
        updateCheck = new QCheckBox( tr("Overwrite Paragraph Styles"), this,
2077 tsoots 50
"updateCheck");
1579 tsoots 51
        updateCheck->setChecked(update);
2126 cbradney 52
        QToolTip::add(updateCheck, "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>");
1579 tsoots 53
        hlayout->addWidget(updateCheck);
54
        layout->addLayout(hlayout);
55
 
8501 cbradney 56
        Q3BoxLayout* palayout = new Q3HBoxLayout(0,5,5, "palayout");
6260 fschmid 57
        packCheck = new QCheckBox( tr("Merge Paragraph Styles"), this, "packCheck");
1579 tsoots 58
        packCheck->setChecked(pack);
2063 mrdocs 59
        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 60
        palayout->addWidget(packCheck);
61
        layout->addLayout(palayout);
62
 
8501 cbradney 63
        Q3BoxLayout* playout = new Q3HBoxLayout(0, 5, 5, "playout");
6260 fschmid 64
        prefixCheck = new QCheckBox( tr("Use document name as a prefix for paragraph styles"), this, "prefixCheck");
1579 tsoots 65
        prefixCheck->setChecked(prefix);
2063 mrdocs 66
        QToolTip::add(prefixCheck, "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus.") +"</qt>");
1579 tsoots 67
        playout->addWidget(prefixCheck);
68
        layout->addLayout(playout);
69
 
8501 cbradney 70
        Q3BoxLayout* dlayout = new Q3HBoxLayout(0, 5, 5, "dlayout");
6260 fschmid 71
        doNotAskCheck = new QCheckBox( tr("Do not ask again"), this,
2077 tsoots 72
"doNotAskCheck");
1579 tsoots 73
        doNotAskCheck->setChecked(false);
2063 mrdocs 74
        QToolTip::add(doNotAskCheck, "<qt>" + tr("Make these settings the default and do not prompt again when importing an OASIS OpenDocument.") +"</qt>");
2166 cbradney 75
        //dlayout->addStretch(10);
1579 tsoots 76
        dlayout->addWidget(doNotAskCheck);
77
        layout->addLayout(dlayout);
78
 
8501 cbradney 79
        Q3BoxLayout* blayout = new Q3HBoxLayout(0, 5, 5, "blayout");
1579 tsoots 80
        blayout->addStretch(10);
6260 fschmid 81
        okButton = new QPushButton( tr("OK"), this, "okButton");
1579 tsoots 82
        blayout->addWidget(okButton);
6260 fschmid 83
        cancelButton = new QPushButton( tr("Cancel"), this, "cancelButton");
3970 tsoots 84
        blayout->addWidget(cancelButton);
1579 tsoots 85
        layout->addLayout(blayout);
86
 
87
        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
3970 tsoots 88
        connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
1579 tsoots 89
}
90
 
91
bool OdtDialog::shouldUpdate()
92
{
93
        return updateCheck->isChecked();
94
}
95
 
96
bool OdtDialog::usePrefix()
97
{
98
        return prefixCheck->isChecked();
99
}
100
 
101
bool OdtDialog::askAgain()
102
{
103
        return !(doNotAskCheck->isChecked());
104
}
105
 
106
bool OdtDialog::packStyles()
107
{
108
        return packCheck->isChecked();
109
}
110
 
111
OdtDialog::~OdtDialog()
112
{
113
 
114
}
115
 
116
#endif // HAVE_XML