Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
104 Franz 1
#include <Python.h>
103 Franz 2
#include "cmddialog.h"
82 Franz 3
#include "cmdvar.h"
332 Franz 4
#include "cmdutil.h"
138 Franz 5
#include <qmessagebox.h>
82 Franz 6
 
7
PyObject *scribus_newdocdia(PyObject *self, PyObject* args)
8
{
9
        if (!PyArg_ParseTuple(args, ""))
332 Franz 10
        {
11
                PyErr_SetString(PyExc_Exception, ERRPARAM + QString("NewDocDialog()"));
82 Franz 12
                return NULL;
332 Franz 13
        }
82 Franz 14
        bool ret = Carrier->slotFileNew();
173 Franz 15
//      qApp->processEvents();
82 Franz 16
        return PyInt_FromLong(static_cast<long>(ret));
17
}
18
 
19
PyObject *scribus_filedia(PyObject *self, PyObject* args)
20
{
21
        char *caption;
22
        char *filter;
23
        char *defName;
24
        int pre = 0;
25
        int mode = 0;
332 Franz 26
        if (!PyArg_ParseTuple(args, "sss|ii", &caption, &filter, &defName, &pre, &mode))
27
        {
28
                PyErr_SetString(PyExc_Exception, ERRPARAM + QString("FileDialog(caption, filter, defaultname, pre, mode)"));
29
                return NULL;
30
        }
31
        PyString_FromString(Carrier->CFileDialog(caption, filter, defName, static_cast<bool>(pre), static_cast<bool>(mode), 0, 0));
82 Franz 32
}
33
 
138 Franz 34
PyObject *scribus_mess(PyObject *self, PyObject* args)
35
{
36
        char *caption;
37
        if (!PyArg_ParseTuple(args, "s", &caption))
332 Franz 38
        {
39
                PyErr_SetString(PyExc_Exception, ERRPARAM + QString("StatusMessage(text)"));
138 Franz 40
                return NULL;
332 Franz 41
        }
138 Franz 42
        Carrier->FMess->setText(caption);
43
        return Py_None;
44
}
45
 
46
PyObject *scribus_messdia(PyObject *self, PyObject* args)
47
{
48
        char *caption = "";
49
        char *message = "";
50
        QMessageBox::Icon ico = QMessageBox::NoIcon;
51
        int butt1 = QMessageBox::NoButton;
52
        int butt2 = QMessageBox::NoButton;
53
        int butt3 = QMessageBox::NoButton;
54
        if (!PyArg_ParseTuple(args, "ssii|ii", &caption, &message, &ico, &butt1, &butt2, &butt3))
332 Franz 55
        {
56
                PyErr_SetString(PyExc_Exception, ERRPARAM + QString("MessageBox(caption, message, ico, butt1, butt2, butt3)"));
138 Franz 57
                return NULL;
332 Franz 58
        }
138 Franz 59
        QMessageBox mb(caption, message, ico, butt1, butt2, butt3, Carrier);
60
        return PyInt_FromLong(static_cast<long>(mb.exec()));
61
}
62