* [gentoo-commits] gentoo-x86 commit in net-p2p/phex/files: 0001-Remove-MacOS-GUI-references.patch
@ 2010-06-18 21:10 Stanislav Ochotnicky (sochotnicky)
0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Ochotnicky (sochotnicky) @ 2010-06-18 21:10 UTC (permalink / raw
To: gentoo-commits
sochotnicky 10/06/18 21:10:52
Added: 0001-Remove-MacOS-GUI-references.patch
Log:
Remove MacOS GUI related calls (#298698)
(Portage version: 2.1.8.3/cvs/Linux i686)
Revision Changes Path
1.1 net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch?rev=1.1&content-type=text/plain
Index: 0001-Remove-MacOS-GUI-references.patch
===================================================================
From 49f223f74e5557321afdefebd48cdec4f625b97d Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@gmail.com>
Date: Fri, 18 Jun 2010 23:01:32 +0200
Subject: [PATCH] Remove MacOS GUI references
---
src/phex/gui/common/FileDialogHandler.java | 45 +---------
src/phex/gui/common/GUIRegistry.java | 5 -
src/phex/gui/macosx/MacOsxGUIUtils.java | 140 ----------------------------
3 files changed, 2 insertions(+), 188 deletions(-)
delete mode 100644 src/phex/gui/macosx/MacOsxGUIUtils.java
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
diff --git a/src/phex/gui/macosx/MacOsxGUIUtils.java b/src/phex/gui/macosx/MacOsxGUIUtils.java
deleted file mode 100644
index bc6f1d9..0000000
--- a/src/phex/gui/macosx/MacOsxGUIUtils.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * PHEX - The pure-java Gnutella-servent.
- * Copyright (C) 2001 - 2006 Phex Development Group
- *
- * 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.
- *
- * 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
- *
- * Created on 28.08.2005
- * --- CVS Information ---
- * $Id: 0001-Remove-MacOS-GUI-references.patch,v 1.1 2010/06/18 21:10:52 sochotnicky Exp $
- */
-package phex.gui.macosx;
-
-import java.awt.FileDialog;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
-import net.roydesign.event.ApplicationEvent;
-import net.roydesign.mac.MRJAdapter;
-import net.roydesign.ui.FolderDialog;
-import phex.gui.actions.ExitPhexAction;
-import phex.gui.actions.NewDownloadAction;
-import phex.gui.common.GUIRegistry;
-import phex.gui.dialogs.AboutDialog;
-import phex.gui.dialogs.options.OptionsDialog;
-import phex.utils.NLogger;
-import phex.utils.NLoggerNames;
-
-public class MacOsxGUIUtils
-{
- public static final void installEventHandlers()
- {
- MRJAdapter.addQuitApplicationListener( new ActionListener()
- {
- public void actionPerformed( ActionEvent evt )
- {
- try
- {
- NLogger.debug( NLoggerNames.NATIV_MACOSX,
- "Called MacOsX quit handler." );
- ExitPhexAction.performCloseGUIAction();
- }
- catch (Throwable th)
- {
- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
- }
- }
- } );
-
- MRJAdapter.setPreferencesEnabled( true );
- MRJAdapter.addPreferencesListener( new ActionListener()
- {
- public void actionPerformed( ActionEvent evt )
- {
- try
- {
- NLogger.debug( NLoggerNames.NATIV_MACOSX,
- "Called MacOsX preferences handler." );
- OptionsDialog dialog = new OptionsDialog();
- dialog.show();
- }
- catch (Throwable th)
- {
- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
- }
- }
- } );
-
- MRJAdapter.addAboutListener( new ActionListener()
- {
- public void actionPerformed( ActionEvent evt )
- {
- try
- {
- AboutDialog dialog = new AboutDialog();
- dialog.setVisible( true );
- }
- catch (Throwable th)
- {
- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
- }
- }
- } );
-
- MRJAdapter.addOpenDocumentListener( new ActionListener()
- {
- public void actionPerformed( ActionEvent evt )
- {
- try
- {
- File file = ((ApplicationEvent) evt).getFile();
- NLogger.debug( NLoggerNames.NATIV_MACOSX,
- "Called MacOsX open file handler: " + file );
-
- String absFileName = file.getAbsolutePath();
- if ( absFileName.endsWith( ".magma" ) )
- {
- NewDownloadAction action = (NewDownloadAction) GUIRegistry
- .getInstance().getGlobalAction(
- GUIRegistry.NEW_DOWNLOAD_ACTION );
- action.incommingMagmaDownload( absFileName );
- }
- if ( absFileName.endsWith( ".xml" ) )
- {
- NewDownloadAction action = (NewDownloadAction) GUIRegistry
- .getInstance().getGlobalAction(
- GUIRegistry.NEW_DOWNLOAD_ACTION );
- action.incommingRSSDownload( absFileName );
- }
- }
- catch (Throwable th)
- {
- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
- }
- }
- } );
- }
-
- /**
- * Create folder dialog here. This prevents
- * NoClassDefFoundError on Windows systems since the import of the
- * required OS X classes is elsewhere.
- */
- public static final FileDialog createFolderDialog()
- {
- return new FolderDialog( GUIRegistry.getInstance().getMainFrame() );
- }
-}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in net-p2p/phex/files: 0001-Remove-MacOS-GUI-references.patch
@ 2010-07-10 15:18 Stanislav Ochotnicky (sochotnicky)
0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Ochotnicky (sochotnicky) @ 2010-07-10 15:18 UTC (permalink / raw
To: gentoo-commits
sochotnicky 10/07/10 15:18:22
Modified: 0001-Remove-MacOS-GUI-references.patch
Log:
Move file removal from patch to ebuild to prevent failure on some
systems
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Revision Changes Path
1.2 net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch?r1=1.1&r2=1.2
Index: 0001-Remove-MacOS-GUI-references.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0001-Remove-MacOS-GUI-references.patch 18 Jun 2010 21:10:52 -0000 1.1
+++ 0001-Remove-MacOS-GUI-references.patch 10 Jul 2010 15:18:22 -0000 1.2
@@ -1,14 +1,12 @@
-From 49f223f74e5557321afdefebd48cdec4f625b97d Mon Sep 17 00:00:00 2001
+From 2bd7907aef02530680cfd795f3f757613777c064 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@gmail.com>
-Date: Fri, 18 Jun 2010 23:01:32 +0200
+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 -
- src/phex/gui/macosx/MacOsxGUIUtils.java | 140 ----------------------------
- 3 files changed, 2 insertions(+), 188 deletions(-)
- delete mode 100644 src/phex/gui/macosx/MacOsxGUIUtils.java
+ 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
@@ -110,152 +108,6 @@
initializeGlobalActions();
chatFrameManager = new ChatFrameManager();
try
-diff --git a/src/phex/gui/macosx/MacOsxGUIUtils.java b/src/phex/gui/macosx/MacOsxGUIUtils.java
-deleted file mode 100644
-index bc6f1d9..0000000
---- a/src/phex/gui/macosx/MacOsxGUIUtils.java
-+++ /dev/null
-@@ -1,140 +0,0 @@
--/*
-- * PHEX - The pure-java Gnutella-servent.
-- * Copyright (C) 2001 - 2006 Phex Development Group
-- *
-- * 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.
-- *
-- * 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
-- *
-- * Created on 28.08.2005
-- * --- CVS Information ---
-- * $Id: 0001-Remove-MacOS-GUI-references.patch,v 1.1 2010/06/18 21:10:52 sochotnicky Exp $
-- */
--package phex.gui.macosx;
--
--import java.awt.FileDialog;
--import java.awt.event.ActionEvent;
--import java.awt.event.ActionListener;
--import java.io.File;
--
--import net.roydesign.event.ApplicationEvent;
--import net.roydesign.mac.MRJAdapter;
--import net.roydesign.ui.FolderDialog;
--import phex.gui.actions.ExitPhexAction;
--import phex.gui.actions.NewDownloadAction;
--import phex.gui.common.GUIRegistry;
--import phex.gui.dialogs.AboutDialog;
--import phex.gui.dialogs.options.OptionsDialog;
--import phex.utils.NLogger;
--import phex.utils.NLoggerNames;
--
--public class MacOsxGUIUtils
--{
-- public static final void installEventHandlers()
-- {
-- MRJAdapter.addQuitApplicationListener( new ActionListener()
-- {
-- public void actionPerformed( ActionEvent evt )
-- {
-- try
-- {
-- NLogger.debug( NLoggerNames.NATIV_MACOSX,
-- "Called MacOsX quit handler." );
-- ExitPhexAction.performCloseGUIAction();
-- }
-- catch (Throwable th)
-- {
-- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
-- }
-- }
-- } );
--
-- MRJAdapter.setPreferencesEnabled( true );
-- MRJAdapter.addPreferencesListener( new ActionListener()
-- {
-- public void actionPerformed( ActionEvent evt )
-- {
-- try
-- {
-- NLogger.debug( NLoggerNames.NATIV_MACOSX,
-- "Called MacOsX preferences handler." );
-- OptionsDialog dialog = new OptionsDialog();
-- dialog.show();
-- }
-- catch (Throwable th)
-- {
-- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
-- }
-- }
-- } );
--
-- MRJAdapter.addAboutListener( new ActionListener()
-- {
-- public void actionPerformed( ActionEvent evt )
-- {
-- try
-- {
-- AboutDialog dialog = new AboutDialog();
-- dialog.setVisible( true );
-- }
-- catch (Throwable th)
-- {
-- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
-- }
-- }
-- } );
--
-- MRJAdapter.addOpenDocumentListener( new ActionListener()
-- {
-- public void actionPerformed( ActionEvent evt )
-- {
-- try
-- {
-- File file = ((ApplicationEvent) evt).getFile();
-- NLogger.debug( NLoggerNames.NATIV_MACOSX,
-- "Called MacOsX open file handler: " + file );
--
-- String absFileName = file.getAbsolutePath();
-- if ( absFileName.endsWith( ".magma" ) )
-- {
-- NewDownloadAction action = (NewDownloadAction) GUIRegistry
-- .getInstance().getGlobalAction(
-- GUIRegistry.NEW_DOWNLOAD_ACTION );
-- action.incommingMagmaDownload( absFileName );
-- }
-- if ( absFileName.endsWith( ".xml" ) )
-- {
-- NewDownloadAction action = (NewDownloadAction) GUIRegistry
-- .getInstance().getGlobalAction(
-- GUIRegistry.NEW_DOWNLOAD_ACTION );
-- action.incommingRSSDownload( absFileName );
-- }
-- }
-- catch (Throwable th)
-- {
-- NLogger.error( NLoggerNames.USER_INTERFACE, th, th );
-- }
-- }
-- } );
-- }
--
-- /**
-- * Create folder dialog here. This prevents
-- * NoClassDefFoundError on Windows systems since the import of the
-- * required OS X classes is elsewhere.
-- */
-- public static final FileDialog createFolderDialog()
-- {
-- return new FolderDialog( GUIRegistry.getInstance().getMainFrame() );
-- }
--}
--
1.7.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-10 15:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-10 15:18 [gentoo-commits] gentoo-x86 commit in net-p2p/phex/files: 0001-Remove-MacOS-GUI-references.patch Stanislav Ochotnicky (sochotnicky)
-- strict thread matches above, loose matches on Subject: below --
2010-06-18 21:10 Stanislav Ochotnicky (sochotnicky)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox