Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
411 Franz 1
#include "sxwdia.h"
2
 
3
#ifdef HAVE_XML
4
 
5
#include "sxwdia.moc"
6
#include <qtooltip.h>
7
 
8
extern QPixmap loadIcon(QString nam);
9
 
415 Franz 10
SxwDialog::SxwDialog(bool update, bool prefix) : QDialog(0, "sxwdia", true, 0)
411 Franz 11
{
12
        setCaption(tr("OO.o Writer Importer Options"));
13
        setIcon(loadIcon("AppIcon.png"));
14
 
15
        QBoxLayout* layout = new QVBoxLayout(this);
16
 
17
        QBoxLayout* hlayout = new QHBoxLayout(0, 5, 5, "hlayout");
18
        updateCheck = new QCheckBox(tr("Update paragraph styles"), this, "updateCheck");
19
        updateCheck->setChecked(update);
20
        QToolTip::add(updateCheck, tr("If there already exists a paragraph style with the same\n"
21
                                      "name than current OO.o document's paragraph should the style\n"
22
                                      "in Scribus be edited to match the one being imported\n"
23
                                      "or left untouched"));
24
        hlayout->addWidget(updateCheck);
25
        layout->addLayout(hlayout);
26
 
415 Franz 27
        QBoxLayout* playout = new QHBoxLayout(0, 5, 5, "playout");
28
        prefixCheck = new QCheckBox(tr("Use document name as a prefix for paragraph styles"), this, "prefixCheck");
29
        prefixCheck->setChecked(prefix);
30
        QToolTip::add(prefixCheck, tr("Should importer add the name of the document\n"
442 tsoots 31
                                      "on front of the paragraph style name in Scribus"));
415 Franz 32
        playout->addWidget(prefixCheck);
33
        layout->addLayout(playout);
411 Franz 34
 
415 Franz 35
        QBoxLayout* dlayout = new QHBoxLayout(0, 5, 5, "dlayout");
36
        doNotAskCheck = new QCheckBox(tr("Do not ask again"), this, "doNotAskCheck");
37
        doNotAskCheck->setChecked(false);
38
        QToolTip::add(doNotAskCheck, tr("Should the importer always use currently\n"
39
                                        "set value when importing OO.o document and\n"
40
                                        "never ask your confirmation again"));
41
        dlayout->addStretch(10);
42
        dlayout->addWidget(doNotAskCheck);
43
        layout->addLayout(dlayout);
44
 
411 Franz 45
        QBoxLayout* blayout = new QHBoxLayout(0, 5, 5, "blayout");
46
        blayout->addStretch(10);
47
        okButton = new QPushButton(tr("OK"), this, "okButton");
48
        blayout->addWidget(okButton);
49
        layout->addLayout(blayout);
50
 
51
        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
52
}
53
 
54
bool SxwDialog::shouldUpdate()
55
{
56
        return updateCheck->isChecked();
57
}
58
 
415 Franz 59
bool SxwDialog::usePrefix()
60
{
61
        return prefixCheck->isChecked();
62
}
63
 
411 Franz 64
bool SxwDialog::askAgain()
65
{
66
        return !(doNotAskCheck->isChecked());
67
}
68
 
69
SxwDialog::~SxwDialog()
70
{
71
 
72
}
73
 
74
#endif // HAVE_XML