public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Have Prefix.gladeFile(String) return a file. Date: Thu, 17 Apr 2008 16:54:00 -0000 [thread overview] Message-ID: <20080417165417.4244.qmail@sourceware.org> (raw) The branch, master has been updated via ea5482585eee09d4637c028700283bc5bbf0b940 (commit) from f3f9eddf68ae48f414d20539f4ed80d897a36c14 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit ea5482585eee09d4637c028700283bc5bbf0b940 Author: Andrew Cagney <cagney@redhat.com> Date: Thu Apr 17 12:52:15 2008 -0400 Have Prefix.gladeFile(String) return a file. frysk-gui/frysk/gui/ChangeLog 2008-04-17 Andrew Cagney <cagney@redhat.com> * disassembler/DisassemblyWindowFactory.java: Use frysk.config.Prefix.gladeFile(String) * test/TestWindowFactorization.java: Ditto. * register/RegisterWindowFactory.java: Ditto. * Gui.java: Ditto. * memory/MemoryWindowFactory.java: Ditto. * TestGlade.java: Ditto. frysk-gui/frysk/gui/srcwin/ChangeLog 2008-04-17 Andrew Cagney <cagney@redhat.com> * SourceWindowFactory.java: Use frysk.config.Prefix's .gladeFile(String). * SourceWindow.java: Ditto. frysk-sys/frysk/config/ChangeLog 2008-04-17 Andrew Cagney <cagney@redhat.com> * Prefix.java (gladeFile(String)): Replace gladeDir(). * TestPrefix.java: Update. * PrefixFactory.java: Update * Config.java (getGladeDir()): Delete. ----------------------------------------------------------------------- Summary of changes: frysk-gui/frysk/gui/ChangeLog | 8 + frysk-gui/frysk/gui/Gui.java | 21 +-- frysk-gui/frysk/gui/TestGlade.java | 21 +-- .../gui/disassembler/DisassemblyWindowFactory.java | 12 +- .../frysk/gui/memory/MemoryWindowFactory.java | 15 +- .../frysk/gui/register/RegisterWindowFactory.java | 15 +- frysk-gui/frysk/gui/srcwin/ChangeLog | 6 + frysk-gui/frysk/gui/srcwin/SourceWindow.java | 61 ++---- .../frysk/gui/srcwin/SourceWindowFactory.java | 213 ++++++++------------ .../frysk/gui/test/TestWindowFactorization.java | 6 +- frysk-sys/frysk/config/ChangeLog | 5 + frysk-sys/frysk/config/Config.java | 10 - frysk-sys/frysk/config/Prefix.java | 8 +- frysk-sys/frysk/config/PrefixFactory.java | 9 +- frysk-sys/frysk/config/TestPrefix.java | 2 +- 15 files changed, 167 insertions(+), 245 deletions(-) First 500 lines of diff: diff --git a/frysk-gui/frysk/gui/ChangeLog b/frysk-gui/frysk/gui/ChangeLog index f93a9dc..5a855e9 100644 --- a/frysk-gui/frysk/gui/ChangeLog +++ b/frysk-gui/frysk/gui/ChangeLog @@ -1,5 +1,13 @@ 2008-04-17 Andrew Cagney <cagney@redhat.com> + * disassembler/DisassemblyWindowFactory.java: Use + frysk.config.Prefix.gladeFile(String) + * test/TestWindowFactorization.java: Ditto. + * register/RegisterWindowFactory.java: Ditto. + * Gui.java: Ditto. + * memory/MemoryWindowFactory.java: Ditto. + * TestGlade.java: Ditto. + * FryskHelpManager.java: Use frysk.config.Prefix. * disassembler/DisassemblyWindowFactory.java: Use diff --git a/frysk-gui/frysk/gui/Gui.java b/frysk-gui/frysk/gui/Gui.java index d471637..2b0c4dc 100644 --- a/frysk-gui/frysk/gui/Gui.java +++ b/frysk-gui/frysk/gui/Gui.java @@ -69,6 +69,7 @@ import org.gnu.gtk.event.MenuItemListener; import org.gnu.pango.Style; import org.gnu.pango.Weight; import frysk.config.Config; +import frysk.config.Prefix; import frysk.EventLogger; import frysk.event.SignalEvent; import frysk.gui.common.IconManager; @@ -419,19 +420,13 @@ public class Gui implements LifeCycleListener, Saveable { Gui() throws GladeXMLException, FileNotFoundException, IOException { - glade = new LibGlade(Config.getGladeDir () + GLADE_FILE, this); - create_session_glade = new LibGlade(Config.getGladeDir () - + CREATE_SESSION_GLADE, this); - register_window = new LibGlade(Config.getGladeDir () - + "registerwindow.glade", null); - memory_window = new LibGlade(Config.getGladeDir () - + "memorywindow.glade", null); - disassembler_window = new LibGlade(Config.getGladeDir () - + "disassemblywindow.glade", null); - session_glade = new LibGlade(Config.getGladeDir () - + SESSION_MANAGER_GLADE, this); - process_picker_glade = new LibGlade(Config.getGladeDir () - + "/processpicker.glade", null); + glade = new LibGlade(Prefix.gladeFile(GLADE_FILE).getAbsolutePath(), this); + create_session_glade = new LibGlade(Prefix.gladeFile(CREATE_SESSION_GLADE).getAbsolutePath(), this); + register_window = new LibGlade(Prefix.gladeFile("registerwindow.glade").getAbsolutePath(), null); + memory_window = new LibGlade(Prefix.gladeFile("memorywindow.glade").getAbsolutePath(), null); + disassembler_window = new LibGlade(Prefix.gladeFile("disassemblywindow.glade").getAbsolutePath(), null); + session_glade = new LibGlade(Prefix.gladeFile(SESSION_MANAGER_GLADE).getAbsolutePath(), this); + process_picker_glade = new LibGlade(Prefix.gladeFile("processpicker.glade").getAbsolutePath(), null); WindowManager.theManager.initLegacyProcpopWindows(glade); WindowManager.theManager.initSessionDruidWindow(create_session_glade); WindowManager.theManager.initSessionManagerWindow(session_glade); diff --git a/frysk-gui/frysk/gui/TestGlade.java b/frysk-gui/frysk/gui/TestGlade.java index 1489c59..1efa289 100644 --- a/frysk-gui/frysk/gui/TestGlade.java +++ b/frysk-gui/frysk/gui/TestGlade.java @@ -41,14 +41,11 @@ package frysk.gui; import java.io.FileNotFoundException; import java.io.IOException; - import frysk.junit.TestCase; - import org.gnu.glade.GladeXMLException; import org.gnu.glade.LibGlade; import org.gnu.gtk.Gtk; - -import frysk.config.Config; +import frysk.config.Prefix; import frysk.gui.common.IconManager; import frysk.gui.monitor.WindowManager; @@ -87,17 +84,11 @@ public class TestGlade public void testGladeLoading () throws FileNotFoundException, GladeXMLException, IOException { - // The location of the glade file may need to be modified - // here, depending on where the program is being run from. If - // the directory that the src directory is in is used as the - // root, this should work without modification - String GLADE_PREFIX = Config.getGladeDir (); - - LibGlade glade = new LibGlade (GLADE_PREFIX + GLADE_FILE, this); - LibGlade create_session_glade = new LibGlade(GLADE_PREFIX + CREATE_SESSION_GLADE, this); - LibGlade register_window = new LibGlade(GLADE_PREFIX + REGISTER_WINDOW, null); - LibGlade memory_window = new LibGlade(GLADE_PREFIX + MEMORY_WINDOW, null); - LibGlade session_glade = new LibGlade(GLADE_PREFIX + SESSION_MANAGER_GLADE, this); + LibGlade glade = new LibGlade (Prefix.gladeFile(GLADE_FILE).getAbsolutePath(), this); + LibGlade create_session_glade = new LibGlade(Prefix.gladeFile(CREATE_SESSION_GLADE).getAbsolutePath(), this); + LibGlade register_window = new LibGlade(Prefix.gladeFile(REGISTER_WINDOW).getAbsolutePath(), null); + LibGlade memory_window = new LibGlade(Prefix.gladeFile(MEMORY_WINDOW).getAbsolutePath(), null); + LibGlade session_glade = new LibGlade(Prefix.gladeFile(SESSION_MANAGER_GLADE).getAbsolutePath(), this); // Checking that the LibGlade's variables are not empty. If they are // then bad things happened during load. diff --git a/frysk-gui/frysk/gui/disassembler/DisassemblyWindowFactory.java b/frysk-gui/frysk/gui/disassembler/DisassemblyWindowFactory.java index 6be622d..c6ad64c 100644 --- a/frysk-gui/frysk/gui/disassembler/DisassemblyWindowFactory.java +++ b/frysk-gui/frysk/gui/disassembler/DisassemblyWindowFactory.java @@ -92,14 +92,12 @@ public class DisassemblyWindowFactory } LibGlade glade; - try - { - glade = new LibGlade(Prefix.gladeDir() + DIS_GLADE, null); - } - catch (Exception e) - { + try { + glade = new LibGlade(Prefix.gladeFile(DIS_GLADE).getAbsolutePath(), + null); + } catch (Exception e) { throw new RuntimeException(e); - } + } dw = new DisassemblyWindow(glade); steppingEngine.addObserver(dw.getLockObserver()); diff --git a/frysk-gui/frysk/gui/memory/MemoryWindowFactory.java b/frysk-gui/frysk/gui/memory/MemoryWindowFactory.java index bc173a2..496dfd2 100644 --- a/frysk-gui/frysk/gui/memory/MemoryWindowFactory.java +++ b/frysk-gui/frysk/gui/memory/MemoryWindowFactory.java @@ -41,12 +41,10 @@ package frysk.gui.memory; import java.util.HashMap; - import org.gnu.glade.LibGlade; import org.gnu.gtk.event.LifeCycleEvent; import org.gnu.gtk.event.LifeCycleListener; - -import frysk.config.Config; +import frysk.config.Prefix; import frysk.proc.Proc; import frysk.proc.Task; import frysk.stepping.SteppingEngine; @@ -91,14 +89,11 @@ public class MemoryWindowFactory } LibGlade glade; - try - { - glade = new LibGlade(Config.getGladeDir() + MEM_GLADE, null); - } - catch (Exception e) - { + try { + glade = new LibGlade(Prefix.gladeFile(MEM_GLADE).getAbsolutePath(), null); + } catch (Exception e) { throw new RuntimeException(e); - } + } mw = new MemoryWindow(glade); steppingEngine.addObserver(mw.getLockObserver()); diff --git a/frysk-gui/frysk/gui/register/RegisterWindowFactory.java b/frysk-gui/frysk/gui/register/RegisterWindowFactory.java index 5570d3d..41733c5 100644 --- a/frysk-gui/frysk/gui/register/RegisterWindowFactory.java +++ b/frysk-gui/frysk/gui/register/RegisterWindowFactory.java @@ -41,15 +41,13 @@ package frysk.gui.register; import java.util.HashMap; - import org.gnu.glade.LibGlade; import org.gnu.gtk.event.LifeCycleEvent; import org.gnu.gtk.event.LifeCycleListener; - import frysk.proc.Proc; import frysk.proc.Task; import frysk.stepping.SteppingEngine; -import frysk.config.Config; +import frysk.config.Prefix; /** * Factory for creating RegisterWindows - allows multiple RegisterWindows to be @@ -92,14 +90,11 @@ public class RegisterWindowFactory } LibGlade glade; - try - { - glade = new LibGlade(Config.getGladeDir() + REG_GLADE, null); - } - catch (Exception e) - { + try { + glade = new LibGlade(Prefix.gladeFile(REG_GLADE).getAbsolutePath(), null); + } catch (Exception e) { throw new RuntimeException(e); - } + } rw = new RegisterWindow(glade); steppingEngine.addObserver(rw.getLockObserver()); diff --git a/frysk-gui/frysk/gui/srcwin/ChangeLog b/frysk-gui/frysk/gui/srcwin/ChangeLog index c628123..857b916 100644 --- a/frysk-gui/frysk/gui/srcwin/ChangeLog +++ b/frysk-gui/frysk/gui/srcwin/ChangeLog @@ -1,3 +1,9 @@ +2008-04-17 Andrew Cagney <cagney@redhat.com> + + * SourceWindowFactory.java: Use frysk.config.Prefix's + .gladeFile(String). + * SourceWindow.java: Ditto. + 2008-03-17 Andrew Cagney <cagney@redhat.com> * SourceWindowFactory.java: Update; using TaskAttachedObserverXXX. diff --git a/frysk-gui/frysk/gui/srcwin/SourceWindow.java b/frysk-gui/frysk/gui/srcwin/SourceWindow.java index 2424971..94e126a 100644 --- a/frysk-gui/frysk/gui/srcwin/SourceWindow.java +++ b/frysk-gui/frysk/gui/srcwin/SourceWindow.java @@ -108,7 +108,7 @@ import org.gnu.gtk.event.MenuItemEvent; import org.gnu.gtk.event.MenuItemListener; import org.gnu.gtk.event.MouseEvent; import org.gnu.gtk.event.MouseListener; -import frysk.config.Config; +import frysk.config.Prefix; import frysk.debuginfo.DebugInfoFrame; import frysk.debuginfo.DebugInfoStackFactory; import frysk.dom.DOMFactory; @@ -155,8 +155,6 @@ public class SourceWindow extends Window { * GLADE CONSTANTS */ - private String gladePath; - private LibGlade glade; private LibGlade glade_fc; @@ -336,25 +334,23 @@ public class SourceWindow extends Window { */ /** - * Creates a new source window with the given properties. This - * constructor should not be called explicitly, SourceWindow objects - * should be created through the {@link SourceWindowFactory} class. - * - * @param glade - * The LibGlade object that contains the window for this - * instance - * @param gladePath - * The path that the .glade file for the LibGlade was on - * @param proc - * The Proc to have this SourceWindow observe - */ - public SourceWindow(LibGlade glade, String gladePath, Proc proc) { + * Creates a new source window with the given properties. This + * constructor should not be called explicitly, SourceWindow + * objects should be created through the {@link + * SourceWindowFactory} class. + * + * @param glade + * The LibGlade object that contains the window for this + * instance + * @param proc + * The Proc to have this SourceWindow observe + */ + public SourceWindow(LibGlade glade, Proc proc) { super(((Window) glade.getWidget(SOURCE_WINDOW)).getHandle()); this.setIcon(IconManager.windowIcon); this.glade = glade; - this.gladePath = gladePath; this.swProc = new Proc[this.numProcs]; this.swProc[this.current] = proc; this.frames = new DebugInfoFrame[1][]; @@ -373,19 +369,16 @@ public class SourceWindow extends Window { * @param glade * The LibGlade object that contains the window for this * instance - * @param gladePath - * The path that the .glade file for the LibGlade was on * @param procs * The array of Procs to have this new SourceWindow * observes */ - public SourceWindow(LibGlade glade, String gladePath, Proc[] procs) { + public SourceWindow(LibGlade glade, Proc[] procs) { super(((Window) glade.getWidget(SOURCE_WINDOW)).getHandle()); this.setIcon(IconManager.windowIcon); this.glade = glade; - this.gladePath = gladePath; this.numProcs = procs.length; this.swProc = procs; this.frames = new DebugInfoFrame[this.numProcs][]; @@ -405,19 +398,16 @@ public class SourceWindow extends Window { * @param glade * The LibGlade object that contains the window for this * instance - * @param gladePath - * The path that the .glade file for the LibGlade was on * @param trace * The stack frame that represents the current state of * execution */ - public SourceWindow(LibGlade glade, String gladePath, DebugInfoFrame trace) { + public SourceWindow(LibGlade glade, DebugInfoFrame trace) { super(((Window) glade.getWidget(SOURCE_WINDOW)).getHandle()); this.setIcon(IconManager.windowIcon); this.glade = glade; - this.gladePath = gladePath; this.swProc = new Proc[1]; this.swProc[this.current] = trace.getTask().getProc(); this.steppingEngine = new SteppingEngine(); @@ -450,19 +440,16 @@ public class SourceWindow extends Window { * @param glade * The LibGlade object that contains the window for this * instance - * @param gladePath - * The path that the .glade file for the LibGlade was on * @param traces * The stack frames that represents the current state of * execution */ - public SourceWindow(LibGlade glade, String gladePath, DebugInfoFrame[] traces) { + public SourceWindow(LibGlade glade, DebugInfoFrame[] traces) { super(((Window) glade.getWidget(SOURCE_WINDOW)).getHandle()); this.setIcon(IconManager.windowIcon); this.glade = glade; - this.gladePath = gladePath; this.swProc = new Proc[1]; this.swProc[this.current] = traces[0].getTask().getProc(); this.steppingEngine = new SteppingEngine(); @@ -497,18 +484,15 @@ public class SourceWindow extends Window { * @param glade * The LibGlade object that contains the window for this * instance - * @param gladePath - * The path that the .glade file for the LibGlade was on * @param proc * The Proc to have this SourceWindow observe * @param ao * The AttachedObserver currently blocking the given Proc */ - public SourceWindow(LibGlade glade, String gladePath, Proc proc, - SourceWindowFactory.AttachedObserver ao) { + public SourceWindow(LibGlade glade, Proc proc, SourceWindowFactory.AttachedObserver ao) { - this(glade, gladePath, proc); + this(glade, proc); this.attachedObserver = ao; this.addListener(new LifeCycleListener() { @@ -1324,8 +1308,7 @@ public class SourceWindow extends Window { this.open_executable.addListener(new ActionListener() { public void actionEvent(ActionEvent action) { try { - glade_fc = new LibGlade(Config.getGladeDir() - + FILECHOOSER_GLADE, null); + glade_fc = new LibGlade(Prefix.gladeFile(FILECHOOSER_GLADE).getAbsolutePath(), null); fc = (FileChooserDialog) glade_fc .getWidget("frysk_filechooserdialog"); fc.addListener(new LifeCycleListener() { @@ -1408,8 +1391,7 @@ public class SourceWindow extends Window { this.open_executable.addListener(new ActionListener() { public void actionEvent(ActionEvent action) { try { - glade_fc = new LibGlade(Config.getGladeDir() - + FILECHOOSER_GLADE, null); + glade_fc = new LibGlade(Prefix.gladeFile(FILECHOOSER_GLADE).getAbsolutePath(), null); fc = (FileChooserDialog) glade_fc .getWidget("frysk_filechooserdialog"); fc.addListener(new LifeCycleListener() { @@ -1990,8 +1972,7 @@ public class SourceWindow extends Window { private void launchPreferencesWindow() { PreferenceWindow prefWin = null; try { - prefWin = new PreferenceWindow(new LibGlade(this.gladePath - + "/frysk_source_prefs.glade", prefWin)); + prefWin = new PreferenceWindow(new LibGlade(Prefix.gladeFile("frysk_source_prefs.glade").getAbsolutePath(), prefWin)); } catch (GladeXMLException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/frysk-gui/frysk/gui/srcwin/SourceWindowFactory.java b/frysk-gui/frysk/gui/srcwin/SourceWindowFactory.java index 2f6bef5..e662bb7 100644 --- a/frysk-gui/frysk/gui/srcwin/SourceWindowFactory.java +++ b/frysk-gui/frysk/gui/srcwin/SourceWindowFactory.java @@ -51,7 +51,7 @@ import org.gnu.gtk.event.LifeCycleListener; import org.jdom.output.Format; import org.jdom.output.XMLOutputter; import frysk.proc.dead.LinuxCoreFactory; -import frysk.config.Config; +import frysk.config.Prefix; import frysk.proc.TaskAttachedObserverXXX; import frysk.debuginfo.DebugInfoFrame; import frysk.debuginfo.DebugInfoStackFactory; @@ -79,92 +79,63 @@ public class SourceWindowFactory // private static TaskAttachedObserverXXX attachedObserver = null; - /** - * Creates a new source window using the given task. The SourceWindows - * correspond to tasks in a 1-1 relationship, so if you try to launch a - * SourceWindow for a Task and an existing window has already been created, - * that one will be brought to the forefront rather than creating a new - * window. - * - * @param proc The Proc to open a SourceWindow for. - */ - public static void createSourceWindow (Proc proc) - { - - LibGlade glade; - try - { - glade = new LibGlade (Config.getGladeDir () + SourceWindow.GLADE_FILE, null); - } - catch (Exception e) - { - throw new RuntimeException (e); - } - - srcWin = new SourceWindow(glade, Config.getGladeDir (), proc); - - srcWin.addListener(new SourceWinListener()); + /** + * Creates a new source window using the given task. The + * SourceWindows correspond to tasks in a 1-1 relationship, so if + * you try to launch a SourceWindow for a Task and an existing + * window has already been created, that one will be brought to + * the forefront rather than creating a new window. + * + * @param proc The Proc to open a SourceWindow for. + */ + public static void createSourceWindow(Proc proc) { + LibGlade glade; + try { + glade = new LibGlade(Prefix.gladeFile(SourceWindow.GLADE_FILE).getAbsolutePath(), null); + } catch (Exception e) { + throw new RuntimeException(e); + } + srcWin = new SourceWindow(glade, proc); + srcWin.addListener(new SourceWinListener()); // runState = srcWin.getRunState(); - - srcWin.grabFocus(); - } - - public static void createSourceWindow (Proc[] procs) - { - - LibGlade glade; - try - { - glade = new LibGlade (Config.getGladeDir () + SourceWindow.GLADE_FILE, null); + srcWin.grabFocus(); } - catch (Exception e) - { - throw new RuntimeException (e); + + public static void createSourceWindow(Proc[] procs) { + LibGlade glade; + try { + glade = new LibGlade(Prefix.gladeFile(SourceWindow.GLADE_FILE).getAbsolutePath(), null); + } catch (Exception e) { + throw new RuntimeException(e); + } + srcWin = new SourceWindow(glade, procs); + srcWin.addListener(new SourceWinListener()); + srcWin.grabFocus(); } - - srcWin = new SourceWindow(glade, Config.getGladeDir (), procs); - srcWin.addListener(new SourceWinListener()); - - srcWin.grabFocus(); - } - public static void createSourceWindow (DebugInfoFrame frame) - { - LibGlade glade; - try - { - glade = new LibGlade(Config.getGladeDir() + SourceWindow.GLADE_FILE, - null); - } - catch (Exception e) - { - throw new RuntimeException(e); - } - - SourceWindow srcWin = new SourceWindow(glade, Config.getGladeDir(), frame); - srcWin.addListener(new SourceWinListener()); hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-04-17 16:54 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080417165417.4244.qmail@sourceware.org \ --to=cagney@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).