Subversion Repositories Scribus

Rev

Rev 104 | Rev 164 | 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"
138 Franz 4
#include <qmessagebox.h>
82 Franz 5
 
6
PyObject *scribus_newdocdia(PyObject *self, PyObject* args)
7
{
8
        if (!PyArg_ParseTuple(args, ""))
9
                return NULL;
10
        bool ret = Carrier->slotFileNew();
11
        if (ret)
12
                doc = Carrier->doc;
13
        return PyInt_FromLong(static_cast<long>(ret));
14
}
15
 
16
PyObject *scribus_filedia(PyObject *self, PyObject* args)
17
{
18
        char *caption;
19
        char *filter;
20
        char *defName;
21
        int pre = 0;
22
        int mode = 0;
87 Franz 23
        return !PyArg_ParseTuple(args, "sss|ii", &caption, &filter, &defName, &pre, &mode) ? NULL :
24
                PyString_FromString(Carrier->CFileDialog(caption, filter, defName, static_cast<bool>(pre), static_cast<bool>(mode), 0, 0));
82 Franz 25
}
26
 
138 Franz 27
PyObject *scribus_mess(PyObject *self, PyObject* args)
28
{
29
        char *caption;
30
        if (!PyArg_ParseTuple(args, "s", &caption))
31
                return NULL;
32
        Carrier->FMess->setText(caption);
33
        return Py_None;
34
}
35
 
36
PyObject *scribus_messdia(PyObject *self, PyObject* args)
37
{
38
        char *caption = "";
39
        char *message = "";
40
        QMessageBox::Icon ico = QMessageBox::NoIcon;
41
        int butt1 = QMessageBox::NoButton;
42
        int butt2 = QMessageBox::NoButton;
43
        int butt3 = QMessageBox::NoButton;
44
        if (!PyArg_ParseTuple(args, "ssii|ii", &caption, &message, &ico, &butt1, &butt2, &butt3))
45
                return NULL;
46
        QMessageBox mb(caption, message, ico, butt1, butt2, butt3, Carrier);
47
        return PyInt_FromLong(static_cast<long>(mb.exec()));
48
}
49