Back to index

scribus-ng  1.3.4.dfsg+svn20071115
runscriptdialog.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #include "runscriptdialog.h"
00008 #include "runscriptdialog.moc"
00009 #include "qdir.h"
00010 #include "prefsmanager.h"
00011 
00012 RunScriptDialog::RunScriptDialog(QWidget* parent = 0, bool extEnable = false) :
00013        QFileDialog(parent, "runScriptDialog", true)
00014 {
00015        this->extEnable = extEnable;
00016        PrefsManager *prefsManager=PrefsManager::instance();
00017        setDir(!prefsManager->appPrefs.ScriptDir.isEmpty() ? prefsManager->appPrefs.ScriptDir : QDir::currentDirPath());
00018        setFilters( tr("Python Scripts (*.py *.PY);; All Files (*)"));
00019 
00020        if (extEnable)
00021        {
00022               extChk = new QCheckBox( tr("Run as Extension Script", "run script dialog"), this);
00023               extChk->setChecked(false);
00024               addWidgets(0, extChk, 0);
00025        }
00026 }
00027 
00028 RunScriptDialog::~RunScriptDialog()
00029 {
00030 }
00031 
00032 bool RunScriptDialog::extensionRequested()
00033 {
00034        if (extEnable)
00035               return extChk->isChecked();
00036        else
00037               return false;
00038 }