~ubuntu-branches/ubuntu/trusty/xiphos/trusty

« back to all changes in this revision

Viewing changes to src/gnome2/mod_mgr.c

  • Committer: Bazaar Package Importer
  • Author(s): Dmitrijs Ledkovs
  • Date: 2009-08-12 19:21:05 UTC
  • Revision ID: james.westby@ubuntu.com-20090812192105-dw40gql5mdqvgx84
Tags: 3.1.1-1
* New upstream release (bugfix)

* debian/copyright updates:
  - help/* is GFDL and referencing license file as per policy 3.8.2
  - updated copyright holders (Gnomesword -> Xiphos)

* debian/control:
  - Bumped standards version (Changed debian/copyright as above)
  - Updated VCS-Bzr field to point to a working URL
  - Fixed typo in debian/control (Closes: #539190)
  - Updated extended description of xiphos package (Closes: #539880)
  - Significantly improved wording of all descriptions
  - Added Conflicts: xiphos-svn - upstream deb package name for svn builds

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Xiphos Bible Study Tool
3
3
 * gnome2/mod_mgr.c 
4
4
 *
5
 
 * Copyright (C) 2000-2008 Xiphos Developer Team
 
5
 * Copyright (C) 2000-2009 Xiphos Developer Team
6
6
 *
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
31
31
#include <string.h>
32
32
#include <stdio.h>
33
33
#include <errno.h>
 
34
#include <time.h>
34
35
 
35
36
#include <bonobo.h>
36
37
#include <gnome.h>
59
60
#define GTK_RESPONSE_ARCHIVE 304
60
61
#define GTK_RESPONSE_FASTMOD 305
61
62
#define GTK_RESPONSE_DELFAST 306
 
63
#define GTK_RESPONSE_SOURCES 307
62
64
/* see these codes' use in ui/module-manager.glade. */
63
65
 
64
66
enum {
90
92
        COLUMN_CAPTION,
91
93
        COLUMN_SOURCE,
92
94
        COLUMN_DIRECTORY,
 
95
        COLUMN_USER,
 
96
        COLUMN_PASS,
 
97
        COLUMN_UID,
93
98
        NUM_REMOTE_COLUMNS
94
99
};
95
100
 
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)
331
337
        {
332
338
        case INSTALL:
333
 
                verb = _("Install these modules:"); break;
 
339
                verb = _("Install these modules?"); break;
334
340
        case REMOVE:
335
 
                verb = _("Remove these modules:"); break;
 
341
                verb = _("Remove these modules?"); break;
336
342
        case ARCHIVE:
337
 
                verb = _("Archive these modules:"); break;
 
343
                verb = _("Archive these modules?"); break;
338
344
        case FASTMOD:
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;
340
346
        case DELFAST:
341
 
                verb = _("Delete fast-search index for these modules:"); break;
 
347
                verb = _("Delete fast-search index for these modules?"); break;
342
348
        }
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);
574
582
                break;
575
583
                case 4:
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);
580
589
                break;          
581
590
        }
582
591
}
913
922
        else
914
923
               gtk_tree_view_expand_row ( GTK_TREE_VIEW(data), path, FALSE );
915
924
        gtk_tree_path_free ( path );
916
 
        return TRUE;
 
925
        return FALSE;
917
926
}
918
927
 
919
928
 
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);
989
1001
                                g_free(mms);
990
1002
                                tmp = g_list_next(tmp);
991
1003
                        }
1256
1268
                remote_source = g_strdup(gtk_combo_box_get_active_text(
1257
1269
                                             GTK_COMBO_BOX(combo_entry2)));
1258
1270
 
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);
1261
1273
        g_free(buf);
1262
1274
        gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar_refresh), 0);
1267
1279
        
1268
1280
        if (failed) {
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;
1273
1285
                return;
1283
1295
                gtk_widget_hide(button_arch);
1284
1296
                gtk_widget_hide(button_idx);
1285
1297
                gtk_widget_hide(button_delidx);
 
1298
                gtk_widget_hide(button_sources);
1286
1299
        }
1287
1300
 
1288
1301
        working = FALSE;
1649
1662
                                                     NULL);
1650
1663
        gtk_tree_view_append_column(treeview, column);
1651
1664
 
 
1665
        renderer = gtk_cell_renderer_text_new();
 
1666
        column =
 
1667
            gtk_tree_view_column_new_with_attributes(_("User"),
 
1668
                                                     renderer, "text",
 
1669
                                                     COLUMN_USER,
 
1670
                                                     NULL);
 
1671
        gtk_tree_view_append_column(treeview, column);
 
1672
 
 
1673
        renderer = gtk_cell_renderer_text_new();
 
1674
        column =
 
1675
            gtk_tree_view_column_new_with_attributes(_("Password"),
 
1676
                                                     renderer, "text",
 
1677
                                                     COLUMN_PASS,
 
1678
                                                     NULL);
 
1679
        gtk_tree_view_append_column(treeview, column);
 
1680
 
 
1681
        renderer = gtk_cell_renderer_text_new();
 
1682
        column =
 
1683
            gtk_tree_view_column_new_with_attributes(_("UID"),
 
1684
                                                     renderer, "text",
 
1685
                                                     COLUMN_UID,
 
1686
                                                     NULL);
 
1687
        gtk_tree_view_append_column(treeview, column);
1652
1688
}
1653
1689
 
1654
1690
static GtkTreeModel *
1727
1763
        store = gtk_list_store_new(NUM_REMOTE_COLUMNS,
1728
1764
                                   G_TYPE_STRING,
1729
1765
                                   G_TYPE_STRING,
1730
 
                                   G_TYPE_STRING, G_TYPE_STRING);
 
1766
                                   G_TYPE_STRING,
 
1767
                                   G_TYPE_STRING,
 
1768
                                   G_TYPE_STRING,
 
1769
                                   G_TYPE_STRING,
 
1770
                                   G_TYPE_STRING);
1731
1771
 
1732
1772
        return GTK_TREE_MODEL(store);
1733
1773
}
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,
1766
1809
                                   -1);
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);
1777
1823
                g_free(mms);
1778
1824
                tmp = g_list_next(tmp);
1779
1825
        }
1793
1839
                                   COLUMN_CAPTION,   mms->caption,
1794
1840
                                   COLUMN_SOURCE,    " ", // mms->source - eh.
1795
1841
                                   COLUMN_DIRECTORY, mms->directory,
 
1842
                                   COLUMN_USER,      "",
 
1843
                                   COLUMN_PASS,      "",
 
1844
                                   COLUMN_UID,       "",
1796
1845
                                   -1);
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);
1807
1859
                g_free(mms);
1808
1860
                tmp = g_list_next(tmp);
1809
1861
        }
1982
2034
        gchar *caption = NULL;
1983
2035
        gchar *source = NULL;
1984
2036
        gchar *directory = NULL;
 
2037
        gchar *user = NULL;
 
2038
        gchar *pass = NULL;
 
2039
        gchar *uid = NULL;
1985
2040
        gboolean valid;
1986
2041
        GtkTreeIter iter;
1987
2042
        GtkTreeModel *remote_model =
1997
2052
                                   COLUMN_TYPE, &type,
1998
2053
                                   COLUMN_CAPTION, &caption,
1999
2054
                                   COLUMN_SOURCE, &source,
2000
 
                                   COLUMN_DIRECTORY, &directory, -1);
 
2055
                                   COLUMN_DIRECTORY, &directory,
 
2056
                                   COLUMN_USER, &user,
 
2057
                                   COLUMN_PASS, &pass,
 
2058
                                   COLUMN_UID, &uid,
 
2059
                                   -1);
2001
2060
 
2002
2061
                mod_mgr_add_source("FTPSource",
2003
 
                                   type, caption, source, directory);
 
2062
                                   type, caption, source, directory,
 
2063
                                   user, pass, uid);
2004
2064
                g_free(type);
2005
2065
                g_free(caption);
2006
2066
                g_free(source);
2007
2067
                g_free(directory);
 
2068
                g_free(user);
 
2069
                g_free(pass);
 
2070
                g_free(uid);
2008
2071
                valid = gtk_tree_model_iter_next(remote_model, &iter);
2009
2072
        }
2010
2073
 
2014
2077
                                   COLUMN_TYPE, &type,
2015
2078
                                   COLUMN_CAPTION, &caption,
2016
2079
                                   COLUMN_SOURCE, &source,
2017
 
                                   COLUMN_DIRECTORY, &directory, -1);
 
2080
                                   COLUMN_DIRECTORY, &directory,
 
2081
                                   COLUMN_USER, &user,
 
2082
                                   COLUMN_PASS, &pass,
 
2083
                                   COLUMN_UID, &uid,
 
2084
                                   -1);
2018
2085
 
2019
2086
                mod_mgr_add_source("DIRSource",
2020
 
                                   type, caption, "[local]", directory);
 
2087
                                   type, caption, "[local]", directory,
 
2088
                                   "", "", "");
2021
2089
                g_free(type);
2022
2090
                g_free(caption);
2023
2091
                g_free(source);
2024
2092
                g_free(directory);
 
2093
                g_free(user);
 
2094
                g_free(pass);
 
2095
                g_free(uid);
2025
2096
                valid = gtk_tree_model_iter_next(local_model, &iter);
2026
2097
        }
2027
2098
 
2069
2140
                                   COLUMN_TYPE, "DIR",
2070
2141
                                   COLUMN_CAPTION, filename, 
2071
2142
                                   COLUMN_SOURCE, "[local]",
2072
 
                                   COLUMN_DIRECTORY,filename, 
 
2143
                                   COLUMN_DIRECTORY, filename, 
 
2144
                                   COLUMN_USER, "", 
 
2145
                                   COLUMN_PASS, "", 
 
2146
                                   COLUMN_UID,  "", 
2073
2147
                                   -1);
2074
2148
                save_sources();
2075
2149
                g_free (filename);
2128
2202
        g_list_free(tmp);
2129
2203
 
2130
2204
        working = FALSE;
2131
 
 
 
2205
        is_running = FALSE;
2132
2206
        if (first_time_user) return;    /* no deeper analysis, first time around. */
2133
2207
 
2134
2208
        /*
2205
2279
}
2206
2280
 
2207
2281
void
 
2282
on_load_sources_clicked(GtkButton * button, gpointer  user_data)
 
2283
{
 
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();
 
2288
}
 
2289
 
 
2290
void
2208
2291
on_cancel_clicked(GtkButton * button, gpointer  user_data)
2209
2292
{
2210
2293
        mod_mgr_terminate();
2261
2344
        case GTK_RESPONSE_DELFAST:
2262
2345
                remove_install_wrapper(DELFAST);
2263
2346
                break;
 
2347
        case GTK_RESPONSE_SOURCES:
 
2348
                on_load_sources_clicked(NULL, NULL);
 
2349
                break;
2264
2350
        }
2265
2351
}
2266
2352
 
2301
2387
 * Synopsis
2302
2388
 *   #include "gui/mod_mgr.h"
2303
2389
 *
2304
 
 *   void on_button2_clicked(GtkButton * button, gpointer user_data)
 
2390
 *   void on_button6_clicked(GtkButton * button, gpointer user_data)
2305
2391
 *
2306
2392
 * Description
2307
2393
 *   remove local source
2321
2407
        gchar *type = NULL;
2322
2408
        gchar *source = NULL;
2323
2409
        gchar *directory = NULL;
 
2410
        gchar *user = NULL;
 
2411
        gchar *pass = NULL;
 
2412
        gchar *uid = NULL;
2324
2413
        gchar *str;
2325
2414
        GtkTreeModel *model;
2326
2415
 
2338
2427
                           COLUMN_TYPE, &type,
2339
2428
                           COLUMN_CAPTION, &caption,
2340
2429
                           COLUMN_SOURCE, &source,
2341
 
                           COLUMN_DIRECTORY, &directory, -1);
 
2430
                           COLUMN_DIRECTORY, &directory,
 
2431
                           COLUMN_USER, &user,
 
2432
                           COLUMN_PASS, &pass,
 
2433
                           COLUMN_UID, &uid,
 
2434
                           -1);
2342
2435
        name_string = caption;
2343
2436
 
2344
2437
        str = g_strdup_printf("<span weight=\"bold\">%s</span>\n\n%s|%s|%s|%s",
2353
2446
        g_free(caption);
2354
2447
        g_free(source);
2355
2448
        g_free(directory);
 
2449
        g_free(user);
 
2450
        g_free(pass);
 
2451
        g_free(uid);
2356
2452
        g_free(str);
2357
2453
 
2358
2454
        working = FALSE;
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):");
 
2509
#endif
 
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");
2420
2520
                g_free(dialog->text2);
2421
2521
                g_free(dialog->text3);
2422
2522
                g_free(dialog->text4);
 
2523
                g_free(dialog->text5);
 
2524
                g_free(dialog->text6);
2423
2525
                g_free(dialog);
2424
2526
                g_string_free(str, TRUE);
2425
2527
                goto out;
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);
2441
2546
                g_free(mms);
2442
2547
        }
2443
2548
        g_list_free(tmp2);
2444
2549
 
2445
2550
        if (!name_conflict) {
 
2551
                /* timestamped UID field */
 
2552
                time_t now = time(NULL);
 
2553
                struct tm *local = localtime(&now);
 
2554
                /*
 
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.
 
2558
                 */
 
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,
 
2563
                                             local->tm_sec);
 
2564
 
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,
 
2573
                                   COLUMN_UID,       uid,
 
2574
                                   -1);
 
2575
                g_free(uid);
2452
2576
                save_sources();
2453
2577
 
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);
2467
2594
                        g_free(mms);
2468
2595
                }
2469
2596
                g_list_free(tmp2);
2477
2604
        g_free(dialog->text2);
2478
2605
        g_free(dialog->text3);
2479
2606
        g_free(dialog->text4);
 
2607
        g_free(dialog->text5);
 
2608
        g_free(dialog->text6);
2480
2609
        g_free(dialog);
2481
2610
        g_string_free(str, TRUE);
2482
2611
 
2521
2650
        gchar *type = NULL;
2522
2651
        gchar *source = NULL;
2523
2652
        gchar *directory = NULL;
 
2653
        gchar *user = NULL;
 
2654
        gchar *pass = NULL;
 
2655
        gchar *uid = NULL;
2524
2656
        GtkTreeModel *model;
2525
2657
        GString *str;
2526
2658
 
2540
2672
                           COLUMN_TYPE, &type,
2541
2673
                           COLUMN_CAPTION, &caption,
2542
2674
                           COLUMN_SOURCE, &source,
2543
 
                           COLUMN_DIRECTORY, &directory, -1);
 
2675
                           COLUMN_DIRECTORY, &directory,
 
2676
                           COLUMN_USER, &user,
 
2677
                           COLUMN_PASS, &pass,
 
2678
                           COLUMN_UID, &uid,
 
2679
                           -1);
2544
2680
        name_string = caption;
2545
2681
 
2546
2682
        yes_no_dialog = gui_new_dialog();
2565
2701
        g_free(caption);
2566
2702
        g_free(source);
2567
2703
        g_free(directory);
 
2704
        g_free(user);
 
2705
        g_free(pass);
 
2706
        g_free(uid);
2568
2707
        g_string_free(str, TRUE);
2569
2708
 
2570
2709
        working = FALSE;
2584
2723
 * Description
2585
2724
 *   button release in main treeview 
2586
2725
 *   change notebook page to 'sel' returned from selection
2587
 
 *   show/hide dialog responce buttons as needed
 
2726
 *   show/hide dialog response buttons as needed
2588
2727
 *
2589
2728
 * Return value
2590
2729
 *   void
2621
2760
                                gtk_widget_hide(button_arch);
2622
2761
                                gtk_widget_hide(button_idx);
2623
2762
                                gtk_widget_hide(button_delidx);
 
2763
                                gtk_widget_show(button_sources);
2624
2764
                                break;
2625
2765
                        case 2:
2626
2766
                                if (GTK_TOGGLE_BUTTON(radiobutton2)->
2633
2773
                                gtk_widget_hide(button_arch);
2634
2774
                                gtk_widget_hide(button_idx);
2635
2775
                                gtk_widget_hide(button_delidx);
 
2776
                                gtk_widget_hide(button_sources);
2636
2777
                                break;
2637
2778
                        case 3:
2638
2779
                                if (GTK_TOGGLE_BUTTON(radiobutton2)->
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);
2648
2790
                                break;
2649
2791
                        case 4:
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);
2656
2799
                                break;
2729
2872
        gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
2730
2873
 
2731
2874
        /*
2732
 
         * responce buttons
 
2875
         * response buttons
2733
2876
         */
2734
2877
        /* close */     
2735
2878
        button_close = gtk_button_new_from_stock ("gtk-close");
2763
2906
        gtk_widget_show (label1);
2764
2907
        gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
2765
2908
 
2766
 
  
2767
 
        /* remove */    
 
2909
        /* remove */
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);
2771
2913
 
2772
 
        /* archive */   
 
2914
        /* archive */
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);
2776
2918
 
2777
 
        /* index */     
 
2919
        /* index */
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);
2781
2923
 
2782
 
        /* index */     
 
2924
        /* delete index */
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);
2786
2928
 
2787
 
        /* cancel */    
 
2929
        /* load sources */
 
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);
 
2933
 
 
2934
        /* cancel */
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)));
2873
3020
}
2874
3021
 
2875
 
/*
2876
 
static void on_install_selection_changed_cb (GtkTreeSelection * selection,
2877
 
                                             gpointer data)
2878
 
{
2879
 
        GtkTreeModel *model;
2880
 
        GtkTreeIter selected;
2881
 
        GtkTreePath *path;
2882
 
        GS_message(("\n\non_install_selection_changed_cb\n\n"));
2883
 
        if (!gtk_tree_selection_get_selected(selection, &model, &selected))
2884
 
                return;
2885
 
        
2886
 
        if(!gtk_tree_model_iter_has_child (model, &selected))
2887
 
                return;
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 );
2895
 
        else
2896
 
               gtk_tree_view_expand_row ( GTK_TREE_VIEW(data), path, FALSE );
2897
 
        gtk_tree_path_free ( path );
2898
 
 
2899
 
        
2900
 
}
2901
 
*/
2902
 
 
2903
3022
static GtkWidget *
2904
3023
create_module_manager_dialog(gboolean first_run)
2905
3024
{
2944
3063
                setup_dialog_action_area(GTK_DIALOG (dialog));
2945
3064
        } else {
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 */
2956
3076
        }
2957
3077
                
2958
3078
        g_signal_connect(dialog, "response",