2
2
* Xiphos Bible Study Tool
5
* Copyright (C) 2000-2008 Xiphos Developer Team
5
* Copyright (C) 2000-2009 Xiphos Developer Team
7
7
* This program is free software; you can redistribute it and/or modify
8
8
* it under the terms of the GNU General Public License as published by
105
110
static GtkWidget *button_arch;
106
111
static GtkWidget *button_idx;
107
112
static GtkWidget *button_delidx;
113
static GtkWidget *button_sources;
108
114
static GtkWidget *label_home;
109
115
static GtkWidget *label_system;
110
116
//static GtkWidget *progressbar;
330
336
switch (activity)
333
verb = _("Install these modules:"); break;
339
verb = _("Install these modules?"); break;
335
verb = _("Remove these modules:"); break;
341
verb = _("Remove these modules?"); break;
337
verb = _("Archive these modules:"); break;
343
verb = _("Archive these modules?"); break;
339
verb = _("Build fast-search index for these\nmodules (may take minutes/module):"); break;
345
verb = _("Build fast-search index for these\nmodules (may take minutes/module)?"); break;
341
verb = _("Delete fast-search index for these modules:"); break;
347
verb = _("Delete fast-search index for these modules?"); break;
343
349
dialog_text = g_strdup_printf("<span weight=\"bold\">%s</span>\n\n%s",
344
350
verb, mods->str);
380
386
gtk_widget_hide(button_arch);
381
387
gtk_widget_hide(button_idx);
382
388
gtk_widget_hide(button_delidx);
389
gtk_widget_hide(button_sources);
383
390
gtk_widget_show(button_cancel);
384
391
while (gtk_events_pending())
385
392
gtk_main_iteration();
571
578
gtk_widget_hide(button_arch);
572
579
gtk_widget_hide(button_idx);
573
580
gtk_widget_hide(button_delidx);
581
gtk_widget_hide(button_sources);
576
584
gtk_widget_show(button3);
577
585
gtk_widget_show(button_arch);
578
586
gtk_widget_show(button_idx);
579
587
gtk_widget_show(button_delidx);
588
gtk_widget_hide(button_sources);
986
995
g_free((gchar*)mms->caption);
987
996
g_free((gchar*)mms->source);
988
997
g_free((gchar*)mms->directory);
998
g_free((gchar*)mms->user);
999
g_free((gchar*)mms->pass);
1000
g_free((gchar*)mms->uid);
990
1002
tmp = g_list_next(tmp);
1256
1268
remote_source = g_strdup(gtk_combo_box_get_active_text(
1257
1269
GTK_COMBO_BOX(combo_entry2)));
1259
buf = g_strdup_printf("%s: %s", _("Refreshing remote"), remote_source);
1271
buf = g_strdup_printf("%s: %s", _("Refreshing from remote source"), remote_source);
1260
1272
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar_refresh), buf);
1262
1274
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar_refresh), 0);
1269
1281
gtk_progress_bar_set_text(
1270
GTK_PROGRESS_BAR(progressbar_refresh), _("Remote not found"));
1282
GTK_PROGRESS_BAR(progressbar_refresh), _("Remote source not found"));
1271
1283
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar_refresh), 0);
1272
1284
working = FALSE;
1650
1663
gtk_tree_view_append_column(treeview, column);
1665
renderer = gtk_cell_renderer_text_new();
1667
gtk_tree_view_column_new_with_attributes(_("User"),
1671
gtk_tree_view_append_column(treeview, column);
1673
renderer = gtk_cell_renderer_text_new();
1675
gtk_tree_view_column_new_with_attributes(_("Password"),
1679
gtk_tree_view_append_column(treeview, column);
1681
renderer = gtk_cell_renderer_text_new();
1683
gtk_tree_view_column_new_with_attributes(_("UID"),
1687
gtk_tree_view_append_column(treeview, column);
1654
1690
static GtkTreeModel *
1763
1803
COLUMN_CAPTION, mms->caption,
1764
1804
COLUMN_SOURCE, mms->source,
1765
1805
COLUMN_DIRECTORY, mms->directory,
1806
COLUMN_USER, mms->user,
1807
COLUMN_PASS, mms->pass,
1808
COLUMN_UID, mms->uid,
1767
1810
gtk_list_store_append(GTK_LIST_STORE(module_box_remote), &combo_iter);
1768
1811
gtk_list_store_set(GTK_LIST_STORE(module_box_remote),
1774
1817
g_free((gchar*)mms->caption);
1775
1818
g_free((gchar*)mms->source);
1776
1819
g_free((gchar*)mms->directory);
1820
g_free((gchar*)mms->user);
1821
g_free((gchar*)mms->pass);
1822
g_free((gchar*)mms->uid);
1778
1824
tmp = g_list_next(tmp);
1793
1839
COLUMN_CAPTION, mms->caption,
1794
1840
COLUMN_SOURCE, " ", // mms->source - eh.
1795
1841
COLUMN_DIRECTORY, mms->directory,
1797
1846
gtk_list_store_append(GTK_LIST_STORE(module_box_local), &combo_iter);
1798
1847
gtk_list_store_set(GTK_LIST_STORE(module_box_local),
1804
1853
g_free((gchar*)mms->caption);
1805
1854
g_free((gchar*)mms->source);
1806
1855
g_free((gchar*)mms->directory);
1856
g_free((gchar*)mms->user);
1857
g_free((gchar*)mms->pass);
1858
g_free((gchar*)mms->uid);
1808
1860
tmp = g_list_next(tmp);
1997
2052
COLUMN_TYPE, &type,
1998
2053
COLUMN_CAPTION, &caption,
1999
2054
COLUMN_SOURCE, &source,
2000
COLUMN_DIRECTORY, &directory, -1);
2055
COLUMN_DIRECTORY, &directory,
2002
2061
mod_mgr_add_source("FTPSource",
2003
type, caption, source, directory);
2062
type, caption, source, directory,
2005
2065
g_free(caption);
2006
2066
g_free(source);
2007
2067
g_free(directory);
2008
2071
valid = gtk_tree_model_iter_next(remote_model, &iter);
2014
2077
COLUMN_TYPE, &type,
2015
2078
COLUMN_CAPTION, &caption,
2016
2079
COLUMN_SOURCE, &source,
2017
COLUMN_DIRECTORY, &directory, -1);
2080
COLUMN_DIRECTORY, &directory,
2019
2086
mod_mgr_add_source("DIRSource",
2020
type, caption, "[local]", directory);
2087
type, caption, "[local]", directory,
2022
2090
g_free(caption);
2023
2091
g_free(source);
2024
2092
g_free(directory);
2025
2096
valid = gtk_tree_model_iter_next(local_model, &iter);
2069
2140
COLUMN_TYPE, "DIR",
2070
2141
COLUMN_CAPTION, filename,
2071
2142
COLUMN_SOURCE, "[local]",
2072
COLUMN_DIRECTORY,filename,
2143
COLUMN_DIRECTORY, filename,
2074
2148
save_sources();
2075
2149
g_free (filename);
2282
on_load_sources_clicked(GtkButton * button, gpointer user_data)
2284
gui_generic_warning((mod_mgr_init_config_extras() == 0)
2285
? _("Standard remote sources have been loaded.")
2286
: _("Could not load standard sources from CrossWire."));
2287
load_source_treeviews();
2208
2291
on_cancel_clicked(GtkButton * button, gpointer user_data)
2210
2293
mod_mgr_terminate();
2338
2427
COLUMN_TYPE, &type,
2339
2428
COLUMN_CAPTION, &caption,
2340
2429
COLUMN_SOURCE, &source,
2341
COLUMN_DIRECTORY, &directory, -1);
2430
COLUMN_DIRECTORY, &directory,
2342
2435
name_string = caption;
2344
2437
str = g_strdup_printf("<span weight=\"bold\">%s</span>\n\n%s|%s|%s|%s",
2407
2503
dialog->label2 = _("Type:");
2408
2504
dialog->label3 = _("Host:");
2409
2505
dialog->label4 = _("Directory:");
2410
dialog->text1 = g_strdup("Crosswire");
2506
#ifdef SWORD_MULTIVERSE
2507
dialog->label5 = _("User (optional):");
2508
dialog->label6 = _("Password (optional):");
2510
dialog->text1 = g_strdup("CrossWire");
2411
2511
dialog->text2 = g_strdup("FTP");
2412
2512
dialog->text3 = g_strdup("ftp.crosswire.org");
2413
2513
dialog->text4 = g_strdup("/pub/sword/raw");
2438
2540
g_free((gchar*)mms->caption);
2439
2541
g_free((gchar*)mms->source);
2440
2542
g_free((gchar*)mms->directory);
2543
g_free((gchar*)mms->user);
2544
g_free((gchar*)mms->pass);
2545
g_free((gchar*)mms->uid);
2443
2548
g_list_free(tmp2);
2445
2550
if (!name_conflict) {
2551
/* timestamped UID field */
2552
time_t now = time(NULL);
2553
struct tm *local = localtime(&now);
2555
* who is the psychotic moron who gave us tm_year as "# yrs
2556
* since 1900" and tm_mon as "# months since january, [0-11]"?
2557
* flensing, trepanation, and hari-kari all apply.
2559
gchar *uid = g_strdup_printf("%d%02d%02d%02d%02d%02d",
2560
local->tm_year+1900,
2561
local->tm_mon+1, local->tm_mday,
2562
local->tm_hour, local->tm_min,
2446
2565
gtk_list_store_append(GTK_LIST_STORE(model), &iter);
2447
2566
gtk_list_store_set(GTK_LIST_STORE(model), &iter,
2448
COLUMN_TYPE, dialog->text2,
2449
COLUMN_CAPTION, dialog->text1,
2450
COLUMN_SOURCE, dialog->text3,
2451
COLUMN_DIRECTORY, dialog->text4, -1);
2567
COLUMN_TYPE, dialog->text2,
2568
COLUMN_CAPTION, dialog->text1,
2569
COLUMN_SOURCE, dialog->text3,
2570
COLUMN_DIRECTORY, dialog->text4,
2571
COLUMN_USER, dialog->text5,
2572
COLUMN_PASS, dialog->text6,
2452
2576
save_sources();
2454
2578
/* set the new item's index as active */
2464
2588
g_free((gchar*)mms->caption);
2465
2589
g_free((gchar*)mms->source);
2466
2590
g_free((gchar*)mms->directory);
2591
g_free((gchar*)mms->user);
2592
g_free((gchar*)mms->pass);
2593
g_free((gchar*)mms->uid);
2469
2596
g_list_free(tmp2);
2540
2672
COLUMN_TYPE, &type,
2541
2673
COLUMN_CAPTION, &caption,
2542
2674
COLUMN_SOURCE, &source,
2543
COLUMN_DIRECTORY, &directory, -1);
2675
COLUMN_DIRECTORY, &directory,
2544
2680
name_string = caption;
2546
2682
yes_no_dialog = gui_new_dialog();
2645
2786
gtk_widget_hide(button_arch);
2646
2787
gtk_widget_hide(button_idx);
2647
2788
gtk_widget_hide(button_delidx);
2789
gtk_widget_hide(button_sources);
2650
2792
gtk_widget_show(button3);
2651
2793
gtk_widget_show(button_arch);
2652
2794
gtk_widget_show(button_idx);
2653
2795
gtk_widget_show(button_delidx);
2796
gtk_widget_hide(button_sources);
2654
2797
gtk_widget_hide(button1);
2655
2798
gtk_widget_hide(button2);
2763
2906
gtk_widget_show (label1);
2764
2907
gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
2768
2910
button3 = gtk_button_new_from_stock ("gtk-remove");
2769
2911
gtk_box_pack_start(GTK_BOX(dialog_action_area1),button3,FALSE, FALSE,0);
2770
2912
g_signal_connect(button3, "clicked", G_CALLBACK(on_remove_clicked), NULL);
2773
2915
button_arch = gtk_button_new_from_stock ("gtk-save");
2774
2916
gtk_box_pack_start(GTK_BOX(dialog_action_area1),button_arch,FALSE, FALSE,0);
2775
2917
g_signal_connect(button_arch, "clicked", G_CALLBACK(on_archive_clicked), NULL);
2778
2920
button_idx = gtk_button_new_from_stock ("gtk-save-as");
2779
2921
gtk_box_pack_start(GTK_BOX(dialog_action_area1),button_idx,FALSE, FALSE,0);
2780
2922
g_signal_connect(button_idx, "clicked", G_CALLBACK(on_index_clicked), NULL);
2783
2925
button_delidx = gtk_button_new_from_stock ("edit-delete");
2784
2926
gtk_box_pack_start(GTK_BOX(dialog_action_area1),button_delidx,FALSE, FALSE,0);
2785
2927
g_signal_connect(button_delidx, "clicked", G_CALLBACK(on_delete_index_clicked), NULL);
2930
button_sources = gtk_button_new_from_stock ("gtk-execute");
2931
gtk_box_pack_start(GTK_BOX(dialog_action_area1),button_sources,FALSE, FALSE,0);
2932
g_signal_connect(button_sources, "clicked", G_CALLBACK(on_load_sources_clicked), NULL);
2788
2935
button_cancel = gtk_button_new_from_stock ("gtk-cancel");
2789
2936
gtk_box_pack_start(GTK_BOX(dialog_action_area1),button_cancel,FALSE, FALSE,0);
2790
2937
g_signal_connect(button_cancel, "clicked", G_CALLBACK(on_cancel_clicked), NULL);
2872
3019
remote_source = g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_BIN(combobox)->child)));
2876
static void on_install_selection_changed_cb (GtkTreeSelection * selection,
2879
GtkTreeModel *model;
2880
GtkTreeIter selected;
2882
GS_message(("\n\non_install_selection_changed_cb\n\n"));
2883
if (!gtk_tree_selection_get_selected(selection, &model, &selected))
2886
if(!gtk_tree_model_iter_has_child (model, &selected))
2888
//uncomment the following two lines if you want to see how it looks without
2889
//triangls or plus symbols
2890
//gtk_tree_view_set_show_expanders(GTK_TREE_VIEW(sidebar.module_list), FALSE);
2891
//gtk_tree_view_set_level_indentation(GTK_TREE_VIEW(sidebar.module_list), 12);
2892
path = gtk_tree_model_get_path(model, &selected);
2893
if (gtk_tree_view_row_expanded (GTK_TREE_VIEW(data), path))
2894
gtk_tree_view_collapse_row ( GTK_TREE_VIEW(data), path );
2896
gtk_tree_view_expand_row ( GTK_TREE_VIEW(data), path, FALSE );
2897
gtk_tree_path_free ( path );
2903
3022
static GtkWidget *
2904
3023
create_module_manager_dialog(gboolean first_run)
2944
3063
setup_dialog_action_area(GTK_DIALOG (dialog));
2946
3065
dialog = glade_xml_get_widget (gxml, "dialog");
2947
/* responce buttons */
3066
/* response buttons */
2948
3067
button_close = glade_xml_get_widget (gxml, "button1"); /* close */
2949
3068
button_cancel = glade_xml_get_widget (gxml, "button12"); /* close */
2950
3069
button1 = glade_xml_get_widget (gxml, "button2"); /* refresh */
2953
3072
button_arch = glade_xml_get_widget (gxml, "button13"); /* archive */
2954
3073
button_idx = glade_xml_get_widget (gxml, "button14"); /* index */
2955
3074
button_delidx = glade_xml_get_widget (gxml, "button15"); /* delete index */
3075
button_sources = glade_xml_get_widget (gxml, "button0"); /* load sources */
2958
3078
g_signal_connect(dialog, "response",