From 2bd7907aef02530680cfd795f3f757613777c064 Mon Sep 17 00:00:00 2001 From: Stanislav Ochotnicky Date: Sat, 10 Jul 2010 15:50:13 +0200 Subject: [PATCH] Remove MacOS GUI references --- src/phex/gui/common/FileDialogHandler.java | 45 +-------------------------- src/phex/gui/common/GUIRegistry.java | 5 --- 2 files changed, 2 insertions(+), 48 deletions(-) diff --git a/src/phex/gui/common/FileDialogHandler.java b/src/phex/gui/common/FileDialogHandler.java index a5ee4f7..530f374 100644 --- a/src/phex/gui/common/FileDialogHandler.java +++ b/src/phex/gui/common/FileDialogHandler.java @@ -34,7 +34,6 @@ import javax.swing.filechooser.FileFilter; import org.apache.commons.lang.SystemUtils; -import phex.gui.macosx.MacOsxGUIUtils; import phex.utils.DirectoryOnlyFileFilter; public class FileDialogHandler @@ -45,7 +44,7 @@ public class FileDialogHandler { if ( SystemUtils.IS_OS_MAC_OSX ) { - return openMacDirectoryChooser( title, null, null ); + return null; } else { @@ -71,10 +70,7 @@ public class FileDialogHandler { if ( SystemUtils.IS_OS_MAC_OSX ) { - return new File[] - { - openMacDirectoryChooser( title, notifyPopupTitle, notifyPopupShortMessage ) - }; + return null; } else { @@ -85,43 +81,6 @@ public class FileDialogHandler } } - private static File openMacDirectoryChooser( String title, - String notifyPopupTitle, String notifyPopupShortMessage ) - { - // create folder dialog through other class this prevents - // NoClassDefFoundError on Windows systems since the import of the - // required OS X classes is elsewhere. - FileDialog dia = MacOsxGUIUtils.createFolderDialog(); - dia.setTitle(title); - - // unfortunatly its not possible to display notification popup - // besides heavy weight dialog. - //if ( notifyPopupTitle != null || notifyPopupShortMessage != null ) - //{ - //displayMacNotificationPopup( dia, notifyPopupTitle, - // notifyPopupShortMessage ); - //} - - DirectoryOnlyFileFilter filter = new DirectoryOnlyFileFilter(); - dia.setFilenameFilter( new FileFilterWrapper( - filter) ); - dia.setVisible( true ); - String dirStr = dia.getDirectory(); - String fileStr = dia.getFile(); - - if( dirStr == null || fileStr == null ) - { - return null; - } - File file = new File(dirStr, fileStr); - // validate filter - if( !filter.accept(file) ) - { - return null; - } - return file; - } - private static JFileChooser initDefaultChooser( String title, String approveBtnText, char approveBtnMnemonic, FileFilter filter, int mode, File currentDirectory, String notifyPopupTitle, diff --git a/src/phex/gui/common/GUIRegistry.java b/src/phex/gui/common/GUIRegistry.java index 852722e..3c28f2e 100644 --- a/src/phex/gui/common/GUIRegistry.java +++ b/src/phex/gui/common/GUIRegistry.java @@ -47,7 +47,6 @@ import phex.gui.actions.FWAction; import phex.gui.actions.NewDownloadAction; import phex.gui.actions.SwitchNetworkAction; import phex.gui.chat.ChatFrameManager; -import phex.gui.macosx.MacOsxGUIUtils; import phex.gui.prefs.InterfacePrefs; import phex.update.UpdateCheckRunner; import phex.utils.Localizer; @@ -119,10 +118,6 @@ public final class GUIRegistry implements GUIRegistryConstants } } - if ( SystemUtils.IS_OS_MAC_OSX ) - { - MacOsxGUIUtils.installEventHandlers(); - } initializeGlobalActions(); chatFrameManager = new ChatFrameManager(); try -- 1.7.1