Changeset 6322


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

The warning dialog can now be told to use the word message rather than warning

File:
1 edited

Legend:

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

    r6155 r6322  
     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 Project, NZDL, University of Waikato
     9 *
     10 * Copyright (C) 2003 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
     
    733import org.greenstone.gatherer.Dictionary;
    834import org.greenstone.gatherer.Gatherer;
     35import org.greenstone.gatherer.gui.GLIButton;
    936import org.greenstone.gatherer.util.Utility;
    1037
     
    93120    Dictionary.setText(show_check, "WarningDialog.Dont_Show_Again");
    94121    JPanel control_pane = new JPanel();
    95     ok_button = new JButton();
     122    ok_button = new GLIButton();
     123    ok_button.setMnemonic(KeyEvent.VK_O);
    96124    Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
    97     cancel_button = new JButton();
     125    cancel_button = new GLIButton();
     126    cancel_button.setMnemonic(KeyEvent.VK_C);
    98127    Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    99128
     
    186215    }
    187216
    188 
    189217    /** Gives notification of key events on the buttons */
    190218    public void keyPressed(KeyEvent e) {
     
    204232
    205233    public int display() {
    206     ///ystem.err.println("Show " + full_property + ": " + Gatherer.config.get(full_property, false));
    207234    if(Gatherer.config == null || Gatherer.config.get(full_property, false)) {
    208         // Create and run the shortlived move focus thread
    209         //FocusChangerTask task = null;
    210         //if(affected_property != null) {
    211         //  task = new FocusChangerTask(value_field);
    212         //}
    213         //else {
    214         //  task = new FocusChangerTask(ok_button);
    215         //}
    216         //task.start();
    217         //show();
    218235        setVisible(true);
    219236    }
     
    223240    }
    224241    return result;
     242    }
     243
     244    /** Allows you to specify whether this dialog is a warning dialog, or only a message dialog.
     245     * @param message_only true if this dialog shows a message, false for a warning
     246     */
     247    public void setMessageOnly(boolean message_only) {
     248    // If this is a message then change the checkbox
     249    if(message_only) {
     250        Dictionary.setText(show_check, "WarningDialog.Dont_Show_Again_Message");
     251    }
     252    // And if its a warning, change them back
     253    else {
     254        Dictionary.setText(show_check, "WarningDialog.Dont_Show_Again");
     255    }
    225256    }
    226257
Note: See TracChangeset for help on using the changeset viewer.