diff options
author | Russ Allbery <rra@debian.org> | 2012-01-27 13:49:47 -0800 |
---|---|---|
committer | Russ Allbery <rra@debian.org> | 2012-01-27 13:49:47 -0800 |
commit | e1a65d98e1b8c3beb93cb0f7388f94153bcb235b (patch) | |
tree | 1e1a0e8bea4f7bc128ab0dfb983c87bacfc0e267 /gtkexport.c | |
parent | 2dc6c06022f278f944c8b502fbe8ced1c73811e4 (diff) |
Imported Upstream version 0.90+20120127
Diffstat (limited to 'gtkexport.c')
-rw-r--r-- | gtkexport.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/gtkexport.c b/gtkexport.c index febb79c..8c4ab07 100644 --- a/gtkexport.c +++ b/gtkexport.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: gtkexport.c,v 1.45 2009/03/02 23:01:28 Superfly_Jon Exp $ + * $Id: gtkexport.c,v 1.49 2011/09/03 18:19:32 mdpetch Exp $ */ #include "config.h" @@ -34,6 +34,7 @@ #include "gtkexport.h" #include "boarddim.h" #include "gtkwindows.h" +#include "gtklocdefs.h" static char *aszInclude[] = { N_("Annotations"), @@ -129,7 +130,7 @@ ExportGetValues ( exportwidget *pew, exportsetup *pexs ) { /* board */ - pexs->fDisplayBoard = (int)pew->padjDisplayBoard->value; + pexs->fDisplayBoard = (int)gtk_adjustment_get_value( pew->padjDisplayBoard ); pexs->fSide = 0; for ( i = 0; i < 2; i++ ) @@ -138,7 +139,7 @@ ExportGetValues ( exportwidget *pew, exportsetup *pexs ) { /* moves */ - pexs->nMoves = (int)pew->padjMoves->value; + pexs->nMoves = (int)gtk_adjustment_get_value( pew->padjMoves ); pexs->fMovesDetailProb = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( @@ -184,8 +185,8 @@ ExportGetValues ( exportwidget *pew, exportsetup *pexs ) { pexs->hecss = (htmlexportcss)gtk_combo_box_get_active (GTK_COMBO_BOX (pew->pwHTMLCSS)); /* sizes */ - pexs->nPNGSize = (int)pew->adjPNGSize->value; - pexs->nHtmlSize = (int)pew->adjHtmlSize->value; + pexs->nPNGSize = (int)gtk_adjustment_get_value( pew->adjPNGSize ); + pexs->nHtmlSize = (int)gtk_adjustment_get_value( pew->adjHtmlSize ); } #define CHECKVALUE(orig,new,flag,text,format) \ @@ -325,6 +326,7 @@ SetExportCommands ( const exportsetup *pexsOrig, UserCommand ( sz ); g_free ( sz ); } + UserCommand("save settings"); } @@ -428,7 +430,7 @@ ExportSet ( exportwidget *pew ) { static void SizeChanged ( GtkAdjustment *adj, GtkWidget *pwSize ) { - int n = (int) adj->value; + int n = (int) gtk_adjustment_get_value( adj ); char *sz = g_strdup_printf ( _("%dx%d pixels"), n * BOARD_WIDTH, n * BOARD_HEIGHT ); @@ -495,6 +497,7 @@ static void ExportHTMLImages(void) expfolder, "\"", NULL); UserCommand(command); g_free(command); + UserCommand("save settings"); } g_free(expfolder); g_free(folder); @@ -515,6 +518,8 @@ extern void GTKShowExport ( exportsetup *pexs ) { GtkWidget *pwDialog; + GtkWidget *pwNotebook; + GtkWidget *pwVBox; GtkWidget *pwFrame; GtkWidget *pwTable; @@ -538,9 +543,16 @@ extern void GTKShowExport ( exportsetup *pexs ) pwDialog = GTKCreateDialog ( _("GNU Backgammon - Export Settings"), DT_QUESTION, NULL, DIALOG_FLAG_MODAL, G_CALLBACK ( ExportOK ), pew ); - pwTable = gtk_table_new ( 3, 2, FALSE ); - gtk_container_add ( GTK_CONTAINER ( DialogArea ( pwDialog, DA_MAIN ) ), - pwTable ); + gtk_container_add( GTK_CONTAINER( DialogArea( pwDialog, DA_MAIN ) ), + pwNotebook = gtk_notebook_new() ); + gtk_container_set_border_width( GTK_CONTAINER( pwNotebook ), 4 ); + + /* first tab */ + + pwTable = gtk_table_new ( 2, 2, FALSE ); + + gtk_notebook_append_page( GTK_NOTEBOOK( pwNotebook ), pwTable, + gtk_label_new ( _("Content" ) ) ); /* include stuff */ @@ -739,13 +751,20 @@ extern void GTKShowExport ( exportsetup *pexs ) } + /* second tab */ + + pwTable = gtk_table_new ( 1, 2, FALSE ); + + gtk_notebook_append_page( GTK_NOTEBOOK( pwNotebook ), pwTable, + gtk_label_new ( _("Style" ) ) ); + /* html */ pwFrame = gtk_frame_new ( _("HTML export options") ); gtk_container_set_border_width ( GTK_CONTAINER ( pwFrame ), 8 ); gtk_table_attach ( GTK_TABLE ( pwTable ), pwFrame, - 0, 1, 2, 3, + 0, 1, 0, 1, GTK_FILL, GTK_FILL, 2, 2 ); @@ -770,11 +789,11 @@ extern void GTKShowExport ( exportsetup *pexs ) gtk_label_new ( _("HTML board type:") ), TRUE, TRUE, 0 ); - pew->pwHTMLType = gtk_combo_box_new_text (); + pew->pwHTMLType = gtk_combo_box_text_new (); gtk_box_pack_start (GTK_BOX (pwHBox), pew->pwHTMLType, FALSE, FALSE, 0); - gtk_combo_box_append_text(GTK_COMBO_BOX(pew->pwHTMLType), _("GNU Backgammon")); - gtk_combo_box_append_text(GTK_COMBO_BOX(pew->pwHTMLType), _("BBS")); - gtk_combo_box_append_text(GTK_COMBO_BOX(pew->pwHTMLType), _("fibs2html")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(pew->pwHTMLType), _("GNU Backgammon")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(pew->pwHTMLType), _("BBS")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(pew->pwHTMLType), _("fibs2html")); gtk_combo_box_set_active(GTK_COMBO_BOX (pew->pwHTMLType), 0); gtk_container_set_border_width (GTK_CONTAINER (pwHBox), 4); @@ -787,11 +806,11 @@ extern void GTKShowExport ( exportsetup *pexs ) gtk_label_new ( _("CSS Style sheet:") ), TRUE, TRUE, 0 ); - pew->pwHTMLCSS = gtk_combo_box_new_text(); + pew->pwHTMLCSS = gtk_combo_box_text_new(); gtk_box_pack_start (GTK_BOX (pwHBox), pew->pwHTMLCSS, FALSE, FALSE, 0); - gtk_combo_box_append_text(GTK_COMBO_BOX(pew->pwHTMLCSS), _("In <head>")); - gtk_combo_box_append_text(GTK_COMBO_BOX(pew->pwHTMLCSS), _("Inline (in tags)")); - gtk_combo_box_append_text(GTK_COMBO_BOX(pew->pwHTMLCSS), _("External file")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(pew->pwHTMLCSS), _("In <head>")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(pew->pwHTMLCSS), _("Inline (in tags)")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(pew->pwHTMLCSS), _("External file")); gtk_combo_box_set_active(GTK_COMBO_BOX (pew->pwHTMLCSS), 0); gtk_container_set_border_width (GTK_CONTAINER (pwHBox), 4); @@ -803,7 +822,7 @@ extern void GTKShowExport ( exportsetup *pexs ) gtk_container_set_border_width ( GTK_CONTAINER ( pwFrame ), 8 ); gtk_table_attach ( GTK_TABLE ( pwTable ), pwFrame, - 1, 2, 2, 3, + 1, 2, 0, 1, GTK_FILL, GTK_FILL, 2, 2 ); |