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  *   Riku Leino, tsoots@gmail.com                                          *
9  ***************************************************************************/
10 #include "nftdialog.h"
11 #include <QPushButton>
12 
13 #include "scconfig.h"
14 #include "scribusapi.h"
15 #include "iconmanager.h"
16 
17 
nftdialog(QWidget * parent,const QString & lang)18 nftdialog::nftdialog(QWidget* parent, const QString& lang) : QDialog(parent)
19 {
20 	setupUi(this);
21 	setModal(true);
22 	setWindowIcon(IconManager::instance().loadIcon("AppIcon.png"));
23 	nftGui->setupSettings(lang);
24 	buttonBox->button(QDialogButtonBox::Cancel)->setDefault(true);
25 	buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true);
26 	connect(nftGui, SIGNAL(leaveOK()), this, SLOT(accept()));
27 	connect(nftGui, SIGNAL(ButtonBoxEnable(bool)), this, SLOT(enableButtonBox(bool)));
28 }
29 
isTemplateSelected()30 bool nftdialog::isTemplateSelected()
31 {
32 	return nftGui->currentDocumentTemplate != nullptr;
33 }
34 
currentTemplate()35 nfttemplate* nftdialog::currentTemplate()
36 {
37 	return (nftGui->currentDocumentTemplate);
38 }
39 
enableButtonBox(bool setter)40 void nftdialog::enableButtonBox(bool setter)
41 {
42 	buttonBox->button(QDialogButtonBox::Ok)->setEnabled(setter);
43 	buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
44 }
45