Commit 36db7235 authored by David Llewellyn-Jones's avatar David Llewellyn-Jones

Fixed indentation.

parent 0c5a7269
......@@ -3468,52 +3468,50 @@ static gboolean BitmapWindowSizeToggle (GtkWidget * psWidget, gpointer psData) {
static gboolean ExportBitmapPress (GtkWidget * psWidget, gpointer psData) {
FunctyPersist * psFunctyData = (FunctyPersist * )psData;
GtkWidget * psDialogue;
GtkWindow * psParent;
char * szFilename;
char * szFolder;
bool boExported;
GtkFileFilter * psFilterPNG;
GtkFileFilter * psFilterAll;
BitmapSize sSizeWidgets;
GtkWidget * psWidgetAdd;
GtkWidget * psOptions;
GtkWidget * psAlign;
psFilterPNG = gtk_file_filter_new ();
gtk_file_filter_add_pattern (psFilterPNG, "*.png");
gtk_file_filter_add_mime_type (psFilterPNG, "image/png");
gtk_file_filter_add_mime_type (psFilterPNG, "application/png");
gtk_file_filter_set_name (psFilterPNG, "Portable Network Graphics");
psFilterAll = gtk_file_filter_new ();
gtk_file_filter_add_pattern (psFilterAll, "*");
gtk_file_filter_set_name (psFilterAll, "All Files");
GtkWidget * psDialogue;
GtkWindow * psParent;
char * szFilename;
char * szFolder;
bool boExported;
GtkFileFilter * psFilterPNG;
GtkFileFilter * psFilterAll;
BitmapSize sSizeWidgets;
GtkWidget * psWidgetAdd;
GtkWidget * psOptions;
GtkWidget * psAlign;
psFilterPNG = gtk_file_filter_new ();
gtk_file_filter_add_pattern (psFilterPNG, "*.png");
gtk_file_filter_add_mime_type (psFilterPNG, "image/png");
gtk_file_filter_add_mime_type (psFilterPNG, "application/png");
gtk_file_filter_set_name (psFilterPNG, "Portable Network Graphics");
psFilterAll = gtk_file_filter_new ();
gtk_file_filter_add_pattern (psFilterAll, "*");
gtk_file_filter_set_name (psFilterAll, "All Files");
psParent = GTK_WINDOW (GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MainWindow")));
psDialogue = gtk_file_chooser_dialog_new ("Export Bitmap", psParent,
GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
psDialogue = gtk_file_chooser_dialog_new ("Export Bitmap", psParent, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (psDialogue), TRUE);
g_object_set (G_OBJECT (psDialogue), "local-only", FALSE, NULL);
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (psDialogue), psFilterPNG);
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (psDialogue), psFilterAll);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (psDialogue), TRUE);
g_object_set (G_OBJECT (psDialogue), "local-only", FALSE, NULL);
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (psDialogue), psFilterPNG);
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (psDialogue), psFilterAll);
if (psFunctyData->boFolderSet) {
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (psDialogue), psFunctyData->szFolder->str);
}
else {
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (psDialogue), g_get_home_dir ());
}
if (psFunctyData->boFolderSet) {
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (psDialogue), psFunctyData->szFolder->str);
}
else {
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (psDialogue), g_get_home_dir ());
}
if (!psFunctyData->boExportedBitmap) {
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (psDialogue), DEFAULT_EXPORTBITMAPNAME);
}
else {
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (psDialogue), psFunctyData->szExportBitmapName->str);
}
if (!psFunctyData->boExportedBitmap) {
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (psDialogue), DEFAULT_EXPORTBITMAPNAME);
}
else {
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (psDialogue), psFunctyData->szExportBitmapName->str);
}
psOptions = gtk_hbox_new (FALSE, 8);
......@@ -3573,8 +3571,7 @@ static gboolean ExportBitmapPress (GtkWidget * psWidget, gpointer psData) {
BitmapWindowSizeToggle (sSizeWidgets.psWindowSize, (gpointer)(& sSizeWidgets));
if (gtk_dialog_run (GTK_DIALOG (psDialogue)) == GTK_RESPONSE_ACCEPT) {
if (gtk_dialog_run (GTK_DIALOG (psDialogue)) == GTK_RESPONSE_ACCEPT) {
psFunctyData->boBitmapScreenDimensions = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sSizeWidgets.psWindowSize));
if (psFunctyData->boBitmapScreenDimensions) {
......@@ -3586,34 +3583,34 @@ static gboolean ExportBitmapPress (GtkWidget * psWidget, gpointer psData) {
psFunctyData->nBitmapHeight = gtk_spin_button_get_value (GTK_SPIN_BUTTON (sSizeWidgets.psHeight));
}
szFilename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (psDialogue));
szFilename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (psDialogue));
boExported = ExportBitmapFile (szFilename, psFunctyData->nBitmapHeight, psFunctyData->nBitmapWidth, psFunctyData);
boExported = ExportBitmapFile (szFilename, psFunctyData->nBitmapHeight, psFunctyData->nBitmapWidth, psFunctyData);
if (boExported) {
g_string_assign (psFunctyData->szExportBitmapName, szFilename);
if (boExported) {
g_string_assign (psFunctyData->szExportBitmapName, szFilename);
szFolder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (psDialogue));
psFunctyData->boFolderSet = (szFolder != NULL);
if (szFolder) {
g_string_assign (psFunctyData->szFolder, szFolder);
g_free (szFolder);
szFolder = NULL;
}
}
psFunctyData->boExportedBitmap = boExported;
g_free (szFilename);
szFilename = NULL;
}
else {
szFolder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (psDialogue));
psFunctyData->boFolderSet = (szFolder != NULL);
if (szFolder) {
g_string_assign (psFunctyData->szFolder, szFolder);
g_free (szFolder);
szFolder = NULL;
}
}
psFunctyData->boExportedBitmap = boExported;
g_free (szFilename);
szFilename = NULL;
}
else {
psFunctyData->boBitmapScreenDimensions = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sSizeWidgets.psWindowSize));
psFunctyData->nBitmapWidth = gtk_spin_button_get_value (GTK_SPIN_BUTTON (sSizeWidgets.psWidth));
psFunctyData->nBitmapHeight = gtk_spin_button_get_value (GTK_SPIN_BUTTON (sSizeWidgets.psHeight));
}
}
gtk_widget_destroy (psDialogue);
gtk_widget_destroy (psDialogue);
return TRUE;
return TRUE;
}
void PauseAnimationModal (bool boPauseModal, FunctyPersist * psFunctyData) {
......
......@@ -73,11 +73,11 @@ struct _FunctyPersist {
BUTTONBARSTYLE eButtonBarStyle;
bool boShowPanelLeft;
bool boShowPanelBottom;
bool boExportedBitmap;
GString * szExportBitmapName;
bool boBitmapScreenDimensions;
int nBitmapWidth;
int nBitmapHeight;
bool boExportedBitmap;
GString * szExportBitmapName;
bool boBitmapScreenDimensions;
int nBitmapWidth;
int nBitmapHeight;
};
///////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment