Skip to content

Commit

Permalink
Reorganized preferences storage in preparation for preferences dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Luc Paour committed Aug 13, 2002
1 parent b29cf8e commit a8453f1
Show file tree
Hide file tree
Showing 4 changed files with 346 additions and 88 deletions.
5 changes: 2 additions & 3 deletions com/gallery/GalleryRemote/AddFileDialog.java
Expand Up @@ -28,8 +28,6 @@

public class AddFileDialog
{
public static File currentDirectory = null;

static File[] addFiles(Component parent)
{
JFileChooser fc = new JFileChooser();
Expand All @@ -38,6 +36,7 @@ static File[] addFiles(Component parent)
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setMultiSelectionEnabled(true);

File currentDirectory = GalleryRemote.getInstance().properties.getCurrentDirectory();
if (currentDirectory != null)
{
fc.setCurrentDirectory(currentDirectory);
Expand All @@ -46,7 +45,7 @@ static File[] addFiles(Component parent)
int retval = fc.showDialog(parent, "Add");
if (retval != JFileChooser.CANCEL_OPTION)
{
currentDirectory = fc.getCurrentDirectory();
GalleryRemote.getInstance().properties.setCurrentDirectory(fc.getCurrentDirectory());

File[] files = fc.getSelectedFiles();

Expand Down
100 changes: 67 additions & 33 deletions com/gallery/GalleryRemote/GalleryRemote.java
@@ -1,58 +1,92 @@
/*
* Gallery Remote - a File Upload Utility for Gallery
* Gallery Remote - a File Upload Utility for Gallery
*
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2001 Bharat Mediratta
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2001 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

package com.gallery.GalleryRemote;
import javax.swing.*;
import java.io.*;
import javax.swing.*;

public class GalleryRemote {
public GalleryRemote() {
try {
/**
* Main class and entry point of Gallery Remote
*
*@author paour
*@created 11 août 2002
*/
public class GalleryRemote
{
private static GalleryRemote singleton = null;

public MainFrame mainFrame = null;
public PropertiesFile properties = null;
public PropertiesFile defaults = null;

private GalleryRemote() {}

private void run()
{
try
{
// For native Look and Feel, uncomment the following code.
/// *
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e) {
try
{
UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
}
catch ( Exception e )
{
}
//* /
MainFrame frame = new MainFrame();
frame.initComponents();
frame.setVisible(true);

defaults = new PropertiesFile("defaults");
properties = new PropertiesFile(defaults, "remote");

mainFrame = new MainFrame();
mainFrame.initComponents();
mainFrame.setVisible( true );
}
catch (Exception e) {
catch ( Exception e )
{
e.printStackTrace();
}
}

public static GalleryRemote getInstance()
{
return singleton;
}

// Main entry point
static public void main(String[] args) {
new GalleryRemote();
public static void main( String[] args )
{
singleton = new GalleryRemote();

singleton.run();

//-- check for updated version of the app, using InstallAnywhere's --
//-- PowerUpdate service ---
try{
Runtime.getRuntime().exec("update -whisper");
} catch (IOException e) {
try
{
Runtime.getRuntime().exec( "update -whisper" );
}
catch ( IOException e )
{
}
}

}

0 comments on commit a8453f1

Please sign in to comment.