Пример #1
0
/******************************************************************************
 * Name
 *  on_versehighlight_activate
 *
 * Synopsis
 *   #include "gui/main_menu.h"
 *
 *   void on_versehighlight_activate(GtkMenuItem *menuitem, gpointer user_data)
 *
 * Description
 *   toggle special current verse highlight.
 *
 * Return value
 *   void
 */
G_MODULE_EXPORT void
on_versehighlight_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
{
	settings.versehighlight = gtk_check_menu_item_get_active(menuitem);
	xml_set_value("Xiphos", "misc", "versehighlight",
		      (settings.versehighlight ? "1" : "0"));
	main_display_bible(NULL, settings.currentverse);
}
Пример #2
0
/******************************************************************************
 * Name
 *  on_read_aloud_activate
 *
 * Synopsis
 *   #include "gui/main_menu.h"
 *
 *   void on_read_aloud_activate(GtkMenuItem *menuitem, gpointer user_data)
 *
 * Description
 *   toggle reading scripture out loud.
 *
 * Return value
 *   void
 */
G_MODULE_EXPORT void
on_read_aloud_activate(GtkCheckMenuItem *menuitem, gpointer user_data)
{
	settings.readaloud = gtk_check_menu_item_get_active(menuitem);
	xml_set_value("Xiphos", "misc", "readaloud",
		      (settings.readaloud ? "1" : "0"));
	if (settings.readaloud)
		main_display_bible(NULL, settings.currentverse);
}
Пример #3
0
/******************************************************************************
 * Name
 *  on_show_verse_numbers_activate
 *
 * Synopsis
 *   #include "gui/main_menu.h"
 *
 *   void on_show_verse_numbers_activate(GtkMenuItem *menuitem, gpointer user_data)
 *
 * Description
 *   toggle showing verse numbers together.
 *
 * Return value
 *   void
 */
G_MODULE_EXPORT void
on_show_verse_numbers_activate(GtkCheckMenuItem *menuitem,
			       gpointer user_data)
{
	settings.showversenum = gtk_check_menu_item_get_active(menuitem);
	xml_set_value("Xiphos", "misc", "showversenum",
		      (settings.showversenum ? "1" : "0"));
	main_display_commentary(NULL, settings.currentverse);
	main_display_bible(NULL, settings.currentverse);
}
Пример #4
0
void on_mark_verse_response(GtkDialog *dialog,
			    gint response_id, gpointer user_data)
{
	gchar reference[100], *module, *key;

	module = (gchar *)gtk_entry_get_text(GTK_ENTRY(entry_module));
	key = (gchar *)gtk_entry_get_text(GTK_ENTRY(entry_key));

	g_snprintf(reference, 100, "%s %s", module,
		   main_get_osisref_from_key((const char *)module,
					     (const char *)key));

	switch (response_id) {
	case GTK_RESPONSE_CANCEL: /*  cancel button pressed  */
	case GTK_RESPONSE_NONE:   /*  dialog destroyed  */
		break;
	case GTK_RESPONSE_ACCEPT: /*  mark the verse  */
		xml_set_list_item("osisrefmarkedverses", "markedverse",
				  reference,
				  (note ? note : "user content"));
		marked_cache_fill(settings.MainWindowModule,
				  settings.currentverse);
		main_display_bible(NULL, settings.currentverse);
		break;
	case GTK_RESPONSE_OK: /*  unmark the verse  */
		xml_remove_node("osisrefmarkedverses", "markedverse",
				reference);
		marked_cache_fill(settings.MainWindowModule,
				  settings.currentverse);
		main_display_bible(NULL, settings.currentverse);
		break;
	}
	g_free(note);
	gtk_widget_destroy(GTK_WIDGET(dialog));
	xml_save_settings_doc(settings.fnconfigure);
}
Пример #5
0
void main_change_verse_tab_history(gint historynum)
{
	PASSAGE_TAB_INFO *tab = cur_passage_tab;
	gchar *key;

	tab->current_history_item = historynum;
	settings.addhistoryitem = tab->first_back_click;

	XI_print(("commod = %s\n", tab->history_list[historynum].commod));
	XI_print(("textmod = %s\n",
		  tab->history_list[historynum].textmod));

	key =
	    main_update_nav_controls(tab->history_list[historynum].textmod,
				     tab->history_list[historynum].verseref);
	main_display_commentary(tab->history_list[historynum].commod, key);
	main_display_bible(tab->history_list[historynum].textmod, key);
	main_keep_bibletext_dialog_in_sync(key);
	if (key)
		g_free(key);
}
Пример #6
0
void gui_notebook_main_switch_page(GtkNotebook *notebook,
				   GtkNotebookPage *page,
				   gint page_num, GList **tl)
#endif
{
	gboolean comm_showing;
	gint number_of_pages = gtk_notebook_get_n_pages(notebook);
	PASSAGE_TAB_INFO *pt;

	if (stop_refresh)
		return;

	XI_message(("on_notebook_main_switch_page"));
	page_change = TRUE;
	/* get data structure for new passage */
	/*
	 * this is needed to stop seg fault if the left tab is closed when
	 * there are only two tabs - because number_of_pages equals 2 even
	 * thought there is only 1.
	 */
	if (number_of_pages == 2 && removed_page == 0)
		pt = (PASSAGE_TAB_INFO *)g_list_nth_data(*tl, 0);
	else
		pt = (PASSAGE_TAB_INFO *)g_list_nth_data(*tl, page_num);
	removed_page = 1;
//cur_passage_tab = pt;

#ifdef USE_TREEVIEW_PATH
	if (cur_passage_tab && cur_passage_tab->book_mod)
		gui_collapse_treeview_to_book(GTK_TREE_VIEW(sidebar.module_list),
					      cur_passage_tab->book_mod);
#endif /* USE_TREEVIEW_PATH */

	if (!pt->showparallel) {
		if (cur_passage_tab && cur_passage_tab->paratab)
			gtk_widget_hide(cur_passage_tab->paratab);
		gtk_widget_show(widgets.hpaned);
	}

	set_current_tab(pt);

	companion_activity = TRUE;
	if (pt->showparallel) {
		gtk_widget_hide(widgets.hpaned);
		if (pt->paratab)
			gtk_widget_show(pt->paratab);
		companion_activity = FALSE;
		page_change = FALSE;
		settings.paratab_showing = TRUE;
		return;
	} else
		settings.paratab_showing = FALSE;

	//sets the book mod and key
	main_display_book(pt->book_mod, pt->book_offset);

#ifdef USE_TREEVIEW_PATH
	if (pt->showcomms && pt->book_mod)
		gui_expand_treeview_to_path(GTK_TREE_VIEW(sidebar.module_list),
					    pt->book_mod);
#endif /* USE_TREEVIEW_PATH */

	comm_showing = settings.comm_showing;
	settings.comm_showing = 1;
	//sets the commentary mod and key
	main_display_commentary(pt->commentary_mod,
				pt->text_commentary_key);
	settings.comm_showing = comm_showing;
	//sets the text mod and key
	main_display_bible(pt->text_mod, pt->text_commentary_key);

	navbar_versekey.module_name =
	    g_string_assign(navbar_versekey.module_name, pt->text_mod);
	navbar_versekey.key =
	    g_string_assign(navbar_versekey.key, pt->text_commentary_key);
	main_update_nav_controls(navbar_versekey.module_name->str,
				 pt->text_commentary_key);

	//sets the dictionary mod and key
	main_display_dictionary(pt->dictlex_mod, pt->dictlex_key);

	gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets.notebook_comm_book),
				      (pt->comm_showing ? 0 : 1));

	gui_recompute_view_menu_choices();

	companion_activity = FALSE;

	page_change = FALSE;
}