DumpDialog

DumpDialog — Defines a widget to export into different file formats.

Synopsis

                    DumpDialog;
GtkWidget*          dumpDialog_new                      (VisuData *dataObj,
                                                         GtkWindow *parent,
                                                         const gchar *suggestedFilename);
gchar*              dumpDialogGet_fileName              (DumpDialog *dialog);
FileFormat*         dumpDialogGet_fileFormat            (DumpDialog *dialog);
DumpType*           dumpDialogGet_dumpType              (DumpDialog *dialog);
GtkButton*          dumpDialogGet_cancelButton          (DumpDialog *dialog);
GtkProgressBar*     dumpDialogGet_progressBar           (DumpDialog *dialog);
gint                dumpDialogGet_widthValue            (DumpDialog *dialog);
gint                dumpDialogGet_heightValue           (DumpDialog *dialog);
void                dumpDialogStart                     (DumpDialog *dialog);
void                dumpDialogStop                      (DumpDialog *dialog);

Description

This widget is based on the GtkFileChooser in the save mode. It proposes the user to choose a file to save to. In addition, it automatically build a list of filters, corresponding to the available export routines in V_Sim. By default, the filter is set on 'auto', which means that the filter method is selected with the file extension. The dialog also has a progress bar.

This widget is also a dialog, and should be used with gtk_dialog_run(). After the response GTK_RESPONSE_ACCEPT has been recieved, one can grep the selected filename with dumpDialogGet_fileName(). The dialog does not call the exporting routine by itself, the calling method should take care of that. When doing it, the filechoosing part should be made insensitive, using dumpDialogStart() and the progress bar should be updated accordingly (get it with dumpDialogGet_progressBar()).

The user interface propose also to change the size (see dumpDialogGet_heightValue() and dumpDialogGet_widthValue()) and if some options are associated to a file format, these options are displayed.

Details

DumpDialog

typedef struct _DumpDialog DumpDialog;

Private structure to store informations of a DumpDialog object.


dumpDialog_new ()

GtkWidget*          dumpDialog_new                      (VisuData *dataObj,
                                                         GtkWindow *parent,
                                                         const gchar *suggestedFilename);

A DumpDialog widget is complete dialog window widget, but it is already prepared for dumping, proposing known file formats. It is usefull to get an filename to export to. It has also a progress bar that can illustrate the process. The given dataObj argument is used to initialize some values related to the data to be dumped (such as the default size).

dataObj :

a VisuData object (can be NULL) ;

parent :

the parent window ;

suggestedFilename :

a string or NULL.

Returns :

a newly created DumpDialog widget.

dumpDialogGet_fileName ()

gchar*              dumpDialogGet_fileName              (DumpDialog *dialog);

Retrieve the chosen filename.

dialog :

a DumpDialog object.

Returns :

a read-only string.

dumpDialogGet_fileFormat ()

FileFormat*         dumpDialogGet_fileFormat            (DumpDialog *dialog);

Retrieve the chosen fileFormat.

dialog :

a DumpDialog object.

Returns :

the selected format, only FileFormat.

dumpDialogGet_dumpType ()

DumpType*           dumpDialogGet_dumpType              (DumpDialog *dialog);

Retrieve the chosen DumpType.

dialog :

a DumpDialog object.

Returns :

the selected format (FileFormat and write method).

dumpDialogGet_cancelButton ()

GtkButton*          dumpDialogGet_cancelButton          (DumpDialog *dialog);

Retrieve interesting widget.

dialog :

a DumpDialog object.

Returns :

a pointer to the cancel button.

dumpDialogGet_progressBar ()

GtkProgressBar*     dumpDialogGet_progressBar           (DumpDialog *dialog);

Retrieve interesting widget.

dialog :

a DumpDialog object.

Returns :

a pointer to the progress bar.

dumpDialogGet_widthValue ()

gint                dumpDialogGet_widthValue            (DumpDialog *dialog);

Retrieve request image size.

dialog :

a DumpDialog object.

Returns :

the width value.

dumpDialogGet_heightValue ()

gint                dumpDialogGet_heightValue           (DumpDialog *dialog);

Retrieve request image size.

dialog :

a DumpDialog object.

Returns :

the height value.

dumpDialogStart ()

void                dumpDialogStart                     (DumpDialog *dialog);

Make the file chooser part insensitive during dump, only the progress bar and the abort button are kept sensitive.

dialog :

a DumpDialog object.

dumpDialogStop ()

void                dumpDialogStop                      (DumpDialog *dialog);

Return the filechooser to a sensitive state.

dialog :

a DumpDialog object.