Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
14472 fschmid 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
*/
7
 /***************************************************************************
8
  *   Copyright (C) 2009 by Jain Basil Aliyas                               *
9
  *   jainbasil@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 "xtgdialog.h"
28
 
29
#include <QToolTip>
30
#include <QBoxLayout>
31
#include <QVBoxLayout>
32
#include <QPixmap>
33
#include <QHBoxLayout>
34
#include <QCheckBox>
35
#include <QPushButton>
36
 
37
#include "scribusapi.h"
38
#include <QToolTip>
39
#include "util_icon.h"
40
 
41
XtgDialog::XtgDialog(bool prefix) : QDialog(0)
42
{
43
        setModal(true);
44
        setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
45
        setWindowTitle( tr("Quark XPress Tags Importer Options"));
46
 
47
        QBoxLayout* layout = new QVBoxLayout(this);
48
        layout->setMargin(0);
49
        layout->setSpacing(0);
50
 
51
        QBoxLayout* playout = new QHBoxLayout;
52
        playout->setMargin(5);
53
        playout->setSpacing(5);
54
        prefixCheck = new QCheckBox( tr("Use document name as a prefix for Styles"), this);
55
        prefixCheck->setChecked(prefix);
56
        prefixCheck->setToolTip( "<qt>" + tr("Prepend the document name to the Style name in Scribus.") +"</qt>");
57
        playout->addWidget(prefixCheck);
58
        layout->addLayout(playout);
59
 
60
        QBoxLayout* dlayout = new QHBoxLayout;
61
        dlayout->setMargin(5);
62
        dlayout->setSpacing(5);
63
        doNotAskCheck = new QCheckBox( tr("Do not ask again"), this);
64
        doNotAskCheck->setChecked(false);
65
        doNotAskCheck->setToolTip( "<qt>" + tr("Make these settings the default and do not prompt again when importing an XPress Tags document.") +"</qt>");
66
        //dlayout->addStretch(10);
67
        dlayout->addWidget(doNotAskCheck);
68
        layout->addLayout(dlayout);
69
 
70
        QBoxLayout* blayout = new QHBoxLayout;
71
        blayout->setMargin(5);
72
        blayout->setSpacing(5);
73
        blayout->addStretch(10);
74
        okButton = new QPushButton( tr("OK"), this);
75
        blayout->addWidget(okButton);
76
        cancelButton = new QPushButton( tr("Cancel"), this);
77
        blayout->addWidget(cancelButton);
78
        layout->addLayout(blayout);
79
 
80
        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
81
        connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
82
}
83
 
84
bool XtgDialog::usePrefix()
85
{
86
        return prefixCheck->isChecked();
87
}
88
 
89
bool XtgDialog::askAgain()
90
{
91
        return !(doNotAskCheck->isChecked());
92
}
93
 
94
XtgDialog::~XtgDialog()
95
{
96
 
97
}
98