Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 459 → Rev 460

/trunk/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp
4,6 → 4,7
#include "cmdutil.h"
#include "valuedialog.h"
#include <qmessagebox.h>
#include <qcursor.h>
 
PyObject *scribus_newdocdia(PyObject *self, PyObject* args)
{
12,7 → 13,9
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("newDocDialog()"));
return NULL;
}
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
bool ret = Carrier->slotFileNew();
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
// qApp->processEvents();
return PyInt_FromLong(static_cast<long>(ret));
}
22,6 → 25,7
char *caption;
char *filter;
char *defName;
QString fName;
int pre = 0;
int mode = 0;
if (!PyArg_ParseTuple(args, "sss|ii", &caption, &filter, &defName, &pre, &mode))
29,7 → 33,10
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("fileDialog(caption, filter, defaultname, pre, mode)"));
return NULL;
}
return PyString_FromString(Carrier->CFileDialog(".", caption, filter, defName, static_cast<bool>(pre), static_cast<bool>(mode), 0, 0));
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
fName = Carrier->CFileDialog(".", caption, filter, defName, static_cast<bool>(pre), static_cast<bool>(mode), 0, 0);
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
return PyString_FromString(fName.utf8());
}
 
PyObject *scribus_mess(PyObject *self, PyObject* args)
48,6 → 55,7
{
char *caption = "";
char *message = "";
uint result;
QMessageBox::Icon ico = QMessageBox::NoIcon;
int butt1 = QMessageBox::NoButton;
int butt2 = QMessageBox::NoButton;
57,8 → 65,11
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("messageBox(caption, message, ico, butt1, butt2, butt3)"));
return NULL;
}
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
QMessageBox mb(caption, message, ico, butt1, butt2, butt3, Carrier);
return PyInt_FromLong(static_cast<long>(mb.exec()));
result = mb.exec();
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
return PyInt_FromLong(static_cast<long>(result));
}
 
PyObject *scribus_valdialog(PyObject *self, PyObject* args)
71,10 → 82,12
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("valueDialog(caption, message [,defaultvalue])"));
return NULL;
}
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
ValueDialog *d = new ValueDialog(Carrier, "d", TRUE, 0);
d->dialogLabel->setText(message);
d->valueEdit->setText(value);
d->setCaption(caption);
d->exec();
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
return PyString_FromString(d->valueEdit->text().utf8());
}
/trunk/Scribus/scribus/plugins/scriptplugin/valuedialog.cpp
15,20 → 15,20
if ( !name )
setName( "ValueDialog" );
setModal( TRUE );
ScripterValueLayout = new QGridLayout( this, 1, 1, 11, 6, "ScripterValueLayout");
ScripterValueLayout = new QGridLayout( this, 1, 1, 11, 6, "ScripterValueLayout");
 
layout3 = new QVBoxLayout( 0, 0, 6, "layout3");
layout3 = new QVBoxLayout( 0, 0, 6, "layout3");
 
dialogLabel = new QLabel( this, "dialogLabel" );
dialogLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, dialogLabel->sizePolicy().hasHeightForWidth() ) );
layout3->addWidget( dialogLabel );
 
layout2 = new QVBoxLayout( 0, 0, 6, "layout2");
layout2 = new QVBoxLayout( 0, 0, 6, "layout2");
 
valueEdit = new QLineEdit( this, "valueEdit" );
layout2->addWidget( valueEdit );
 
layout1 = new QHBoxLayout( 0, 0, 6, "layout1");
layout1 = new QHBoxLayout( 0, 0, 6, "layout1");
QSpacerItem* spacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout1->addItem( spacer );
 
39,7 → 39,7
 
ScripterValueLayout->addLayout( layout3, 0, 0 );
languageChange();
resize( QSize(315, 101).expandedTo(minimumSizeHint()) );
//resize( QSize(315, 101).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
 
// signals and slots connections