Example #1
0
/**
 * Callback function to select previous page.
 * \param widget Widget (button).
 */
static void export_html_next( GtkWidget *widget ) {
	gint pageNum;

	pageNum = gtk_notebook_get_current_page( GTK_NOTEBOOK(exphtml_dlg.notebook) );
	if( pageNum == PAGE_FILE_INFO ) {
		/* Goto format page */
		if( exp_html_move_file() ) {
			gtk_notebook_set_current_page(
				GTK_NOTEBOOK(exphtml_dlg.notebook), PAGE_FORMAT );
			gtk_widget_set_sensitive( exphtml_dlg.btnPrev, TRUE );
		}
		export_html_message();
	}
	else if( pageNum == PAGE_FORMAT ) {
		/* Goto finish page */
		if( exp_html_move_format() ) {
			gtk_notebook_set_current_page(
				GTK_NOTEBOOK(exphtml_dlg.notebook), PAGE_FINISH );
			gtk_button_set_label(GTK_BUTTON(exphtml_dlg.btnCancel),
				GTK_STOCK_CLOSE);
			exp_html_finish_show();
			exporthtml_save_settings( _exportCtl_ );
			export_html_message();
		}
	}
}
Example #2
0
/**
 * Process export address dialog.
 * \param cache Address book/data source cache.
 */
void addressbook_exp_html( AddressCache *cache ) {
	/* Set references to control data */
	_addressCache_ = cache;

	_exportCtl_ = exporthtml_create();
	exporthtml_load_settings( _exportCtl_ );

	/* Setup GUI */
	if( ! exphtml_dlg.window )
		export_html_create();
	exphtml_dlg.cancelled = FALSE;
	gtk_widget_show(exphtml_dlg.window);
	manage_window_set_transient(GTK_WINDOW(exphtml_dlg.window));

	gtk_label_set_text( GTK_LABEL(exphtml_dlg.labelBook), cache->name );
	gtk_label_set_text( GTK_LABEL(exphtml_dlg.labelOutBook), cache->name );
	export_html_fill_fields( _exportCtl_ );

	gtk_widget_grab_default(exphtml_dlg.btnNext);
	gtk_notebook_set_page( GTK_NOTEBOOK(exphtml_dlg.notebook), PAGE_FILE_INFO );
	gtk_widget_set_sensitive( exphtml_dlg.btnPrev, FALSE );
	gtk_widget_set_sensitive( exphtml_dlg.btnNext, TRUE );

	export_html_message();
	gtk_widget_grab_focus(exphtml_dlg.entryHtml);

	gtk_main();
	gtk_widget_hide(exphtml_dlg.window);
	exporthtml_free( _exportCtl_ );
	_exportCtl_ = NULL;

	_addressCache_ = NULL;
}
Example #3
0
/**
 * Callback function to select previous page.
 * \param widget Widget (button).
 */
static void export_html_prev( GtkWidget *widget ) {
	gint pageNum;

	pageNum = gtk_notebook_current_page( GTK_NOTEBOOK(exphtml_dlg.notebook) );
	if( pageNum == PAGE_FORMAT ) {
		/* Goto file page stuff */
		gtk_notebook_set_page(
			GTK_NOTEBOOK(exphtml_dlg.notebook), PAGE_FILE_INFO );
		gtk_widget_set_sensitive( exphtml_dlg.btnPrev, FALSE );
	}
	else if( pageNum == PAGE_FINISH ) {
		/* Goto format page */
		gtk_notebook_set_page(
			GTK_NOTEBOOK(exphtml_dlg.notebook), PAGE_FORMAT );
		gtk_widget_set_sensitive( exphtml_dlg.btnNext, TRUE );
	}
	export_html_message();
}