Subversion Repositories Scribus

Rev

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