gschem

x_fileselect.c File Reference

#include <config.h>
#include "gschem.h"
Include dependency graph for x_fileselect.c:

Go to the source code of this file.

Functions

static void x_fileselect_setup_filechooser_filters (GtkFileChooser *filechooser)
 Creates filter for file chooser.
static void x_fileselect_callback_update_preview (GtkFileChooser *chooser, gpointer user_data)
 Updates the preview when the selection changes.
static void x_fileselect_add_preview (GtkFileChooser *filechooser)
 Adds a preview to a file chooser.
void x_fileselect_open (GSCHEM_TOPLEVEL *w_current)
 Opens a file chooser for opening one or more schematics.
void x_fileselect_save (GSCHEM_TOPLEVEL *w_current)
 Opens a file chooser for saving the current page.
int x_fileselect_load_backup (void *user_data, GString *message)
 Load/Backup selection dialog.

Function Documentation

static void x_fileselect_setup_filechooser_filters ( GtkFileChooser *  filechooser) [static]
Function Description
This function adds file filters to filechooser.
Parameters:
[in]filechooserThe file chooser to add filter to.

Definition at line 36 of file x_fileselect.c.

static void x_fileselect_callback_update_preview ( GtkFileChooser *  chooser,
gpointer  user_data 
) [static]
Function Description
This is the callback function connected to the 'update-preview' signal of the GtkFileChooser.

It updates the preview widget with the name of the newly selected file.

Parameters:
[in]chooserThe file chooser to add the preview to.
[in]user_dataA pointer on the preview widget.

Definition at line 76 of file x_fileselect.c.

static void x_fileselect_add_preview ( GtkFileChooser *  filechooser) [static]
Function Description
This function adds a preview section to the stock GtkFileChooser.

The Preview object is inserted in a frame and alignment widget for accurate positionning.

Other widgets can be added to this preview area for example to enable/disable the preview. Currently, the preview is always active.

Function x_fileselect_callback_update_preview() is connected to the signal 'update-preview' of GtkFileChooser so that it redraws the preview area every time a new file is selected.

Parameters:
[in]filechooserThe file chooser to add the preview to.

Definition at line 117 of file x_fileselect.c.

Here is the call graph for this function:

void x_fileselect_open ( GSCHEM_TOPLEVEL w_current)
Function Description
This function opens a file chooser dialog and wait for the user to select at least one file to load as w_current's new pages.

The function updates the user interface.

At the end of the function, the w_current->toplevel's current page is set to the page of the last loaded page.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL environment.

Definition at line 166 of file x_fileselect.c.

Here is the call graph for this function:

void x_fileselect_save ( GSCHEM_TOPLEVEL w_current)
Function Description
This function opens a file chooser dialog and wait for the user to select a file where the toplevel's current page will be saved.

If the user cancels the operation (with the cancel button), the page is not saved.

The function updates the user interface.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL environment.

Definition at line 226 of file x_fileselect.c.

Here is the call graph for this function:

int x_fileselect_load_backup ( void *  user_data,
GString *  message 
)
Function Description
This function opens a message dialog and wait for the user to choose if load the backup or the original file.
Todo:
Make this a registered callback function with user data, as we'd rather be passed a GSCHEM_TOPLEVEL than a TOPLEVEL.
Parameters:
[in]user_dataThe TOPLEVEL object.
[in]messageMessage to display to user.
Returns:
TRUE if the user wants to load the backup file, FALSE otherwise.

Definition at line 320 of file x_fileselect.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines