Ignore:
Timestamp:
2003-12-19T14:47:38+13:00 (20 years ago)
Author:
jmt12
Message:

A new configuration setting - recursion depth, after which gli suspects a cyclic loop. FileQueue makes use of this setting, along with a method of finding folder depth, to make this judgement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java

    r6051 r6319  
     1/**
     2 *#########################################################################
     3 *
     4 * A component of the Gatherer application, part of the Greenstone digital
     5 * library suite from the New Zealand Digital Library Project at the
     6 * University of Waikato, New Zealand.
     7 *
     8 * Author: John Thompson, Greenstone Digital Library, University of Waikato
     9 *
     10 * Copyright (C) 1999 New Zealand Digital Library Project
     11 *
     12 * This program is free software; you can redistribute it and/or modify
     13 * it under the terms of the GNU General Public License as published by
     14 * the Free Software Foundation; either version 2 of the License, or
     15 * (at your option) any later version.
     16 *
     17 * This program is distributed in the hope that it will be useful,
     18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     20 * GNU General Public License for more details.
     21 *
     22 * You should have received a copy of the GNU General Public License
     23 * along with this program; if not, write to the Free Software
     24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     25 *########################################################################
     26 */
    127package org.greenstone.gatherer.gui;
    228
     
    1440import org.greenstone.gatherer.checklist.Entry;
    1541import org.greenstone.gatherer.gui.EmailField;
     42import org.greenstone.gatherer.gui.GLIButton;
    1643import org.greenstone.gatherer.gui.ModalDialog;
    1744import org.greenstone.gatherer.gui.SimpleMenuBar;
     
    4774    private JLabel proxy_host_label;
    4875    private JLabel proxy_port_label;
     76    private JLabel recursion_depth_label;
    4977    private JLabel title_label;
    5078    private JTabbedPane tab_pane;
     
    5280    private JTextField proxy_host_field;
    5381    private JSpinner proxy_port_field;
     82    private JSpinner recursion_depth_spinner;
    5483    private Preferences self;
    5584
     
    78107
    79108    JPanel button_pane = new JPanel();
    80     ok_button = new JButton();
     109    ok_button = new GLIButton();
     110    ok_button.setMnemonic(KeyEvent.VK_O);
    81111    Dictionary.registerBoth(ok_button, "General.OK", "General.OK_Tooltip");
    82     apply_button = new JButton();
     112    apply_button = new GLIButton();
     113    apply_button.setMnemonic(KeyEvent.VK_A);
    83114    Dictionary.registerBoth(apply_button, "General.Apply", "General.Apply_Tooltip");
    84     cancel_button = new JButton();
     115    cancel_button = new GLIButton();
     116    cancel_button.setMnemonic(KeyEvent.VK_C);
    85117    Dictionary.registerBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip");
    86118
     
    263295    Dictionary.registerTooltip(language_combobox, "Preferences.General.Interface_Language_Tooltip");
    264296
     297    // Recursion
     298    JPanel recursion_depth_pane = new JPanel();
     299    recursion_depth_label = new JLabel();
     300    recursion_depth_label.setPreferredSize(LABEL_SIZE);
     301    Dictionary.registerText(recursion_depth_label, "Preferences.General.Recursion_Depth");
     302    recursion_depth_spinner = new JSpinner(new SpinnerNumberModel(Gatherer.config.getInt("general.max_folder_depth", Configuration.COLLECTION_SPECIFIC), 0, Integer.MAX_VALUE, 1));
     303    Dictionary.registerTooltip(recursion_depth_spinner, "Preferences.General.Recursion_Depth_Tooltip");
     304
    265305    // Connect
    266306    language_combobox.addActionListener(new LanguageComboboxListener());
     
    275315    language_pane.add(language_combobox, BorderLayout.CENTER);
    276316
     317    recursion_depth_pane.setLayout(new BorderLayout());
     318    recursion_depth_pane.add(recursion_depth_label, BorderLayout.WEST);
     319    recursion_depth_pane.add(recursion_depth_spinner, BorderLayout.CENTER);
     320
    277321    general_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    278322    general_pane.setLayout(new GridLayout(5,1,0,5));
    279323    general_pane.add(email_pane);
    280324    general_pane.add(language_pane);
     325    general_pane.add(recursion_depth_pane);
    281326    general_pane.add(view_extracted_metadata_checkbox);
    282327    general_pane.add(show_file_size_checkbox);
     
    456501
    457502        Gatherer.config.setLocale("general.locale", Configuration.GENERAL_SETTING, ((DictionaryEntry)language_combobox.getSelectedItem()).getLocale());
     503
     504        Gatherer.config.setInt("general.max_folder_depth", Configuration.COLLECTION_SPECIFIC, ((Integer)recursion_depth_spinner.getValue()).intValue());
    458505
    459506        // Warning preferences
Note: See TracChangeset for help on using the changeset viewer.