Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2321)
+++ ChangeLog	(working copy)
@@ -1,3 +1,36 @@
+2007-04-26  Rich Burridge <rich.burridge@sun.com>
+
+        * src/orca/scripts/gaim.py:
+          src/orca/scripts/StarOffice.py:
+          src/orca/orca_prefs.py:
+          src/orca/app_gui_prefs.py:
+          src/orca/script.py:
+          Work on bug #433146 – Add ability to configure app-unique 
+          settings via GUI.
+
+          Added two new methods to the Script class:
+              def getAppPreferencesGUI(self):
+              Returns a GtkVBox contain the application unique configuration
+              GUI items for the current application.
+
+              def writeAppPreferences(self, prefs):
+              Write out the application specific preferences lines.
+
+          Any application that has application unique settings need to
+          overridge those methods any implement them. 
+
+          If <script>.getAppPreferencesGUI() does return something other
+          than None (the default), then that is assumed to be a Gtk widget
+          that can be given to a new tab in the application configuration
+          dialog.
+
+          Adjusted the gaim script to do exactly that. What this does seem
+          to mean is that those settings values need to be global variables
+          within the application script file rather than script variables
+          (self.<whatever>).
+
+          Similar adjustments for the StarOffice script.
+
 2007-04-24  Lynn MonSanto <lynn.monsanto@sun.com>
 
         * test/harness/runall.sh
@@ -41,7 +74,6 @@
 	in keystroke files, when Orca is not speaking
 	during the test runs.
 
-
 2007-04-24  Rich Burridge <rich.burridge@sun.com>
 
         * src/orca/app_gui_prefs.py:   (new)
Index: src/orca/scripts/gaim.py
===================================================================
--- src/orca/scripts/gaim.py	(revision 2321)
+++ src/orca/scripts/gaim.py	(working copy)
@@ -33,6 +33,8 @@
 __copyright__ = "Copyright (c) 2005-2007 Sun Microsystems Inc."
 __license__   = "LGPL"
 
+import gtk
+
 import orca.atspi as atspi
 import orca.braille as braille
 import orca.debug as debug
@@ -45,6 +47,10 @@
 
 from orca.orca_i18n import _
 
+# Whether we prefix chat room messages with the name of the chat room.
+#
+prefixChatMessage = False
+
 ########################################################################
 #                                                                      #
 # Ring List. A fixed size circular list by Flavio Catalani             #
@@ -106,10 +112,6 @@
         #
         self.debugLevel = debug.LEVEL_FINEST
 
-        # Whether we prefix chat room messages with the name of the chat room.
-        #
-        self.prefixChatMessage = False
-
         # Create two cyclic lists; one that will contain the previous
         # chat room messages and the other that will contain the names
         # of the associated chat rooms.
@@ -182,6 +184,37 @@
 
         return keyBindings
 
+    def getAppPreferencesGUI(self):
+        """Return a GtkVBox contain the application unique configuration
+        GUI items for the current application.
+        """
+
+        global prefixChatMessage
+
+        vbox = gtk.VBox(False, 0)
+        vbox.set_border_width(12)
+        gtk.Widget.show(vbox)
+        label = _("Speak Chat Room name")
+        self.speakNameCheckButton = gtk.CheckButton(label)
+        gtk.Widget.show(self.speakNameCheckButton)
+        gtk.Box.pack_start(vbox, self.speakNameCheckButton, False, False, 0)
+        gtk.ToggleButton.set_active(self.speakNameCheckButton, 
+                                    prefixChatMessage)
+
+        return vbox
+
+    def writeAppPreferences(self, prefs):
+        """Write out the application specific preferences lines.
+
+        Arguments:
+        - prefs: file handle for application preferences.
+        """
+
+        prefs.writelines("\n")
+        prefs.writelines( \
+            "orca.scripts.gaim.prefixChatMessage = %s\n" % \
+                     self.speakNameCheckButton.get_active())
+
     def togglePrefix(self, inputEvent):
         """ Toggle whether we prefix chat room messages with the name of
         the chat room.
@@ -190,11 +223,13 @@
         - inputEvent: if not None, the input event that caused this action.
         """
 
+        global prefixChatMessage
+
         debug.println(self.debugLevel, "gaim.togglePrefix.")
 
         line = _("speak chat room name.")
-        self.prefixChatMessage = not self.prefixChatMessage
-        if not self.prefixChatMessage:
+        prefixChatMessage = not prefixChatMessage
+        if not prefixChatMessage:
             line = _("Do not speak chat room name.")
 
         speech.speak(line)
@@ -210,8 +245,10 @@
         - message: the chat room message.
         """
 
+        global prefixChatMessage
+
         text = ""
-        if self.prefixChatMessage:
+        if prefixChatMessage:
             if chatRoomName and chatRoomName != "":
                 text += _("Message from chat room %s") % chatRoomName + " "
         if message and message != "":
Index: src/orca/scripts/StarOffice.py
===================================================================
--- src/orca/scripts/StarOffice.py	(revision 2321)
+++ src/orca/scripts/StarOffice.py	(working copy)
@@ -25,6 +25,8 @@
 __copyright__ = "Copyright (c) 2005-2007 Sun Microsystems Inc."
 __license__   = "LGPL"
 
+import gtk
+
 import orca.debug as debug
 import orca.atspi as atspi
 import orca.chnames as chnames
@@ -802,6 +804,43 @@
 
         return keyBindings
 
+    def getAppPreferencesGUI(self):
+        """Return a GtkVBox contain the application unique configuration
+        GUI items for the current application.
+        """
+
+        vbox = gtk.VBox(False, 0)
+        vbox.set_border_width(12)
+        gtk.Widget.show(vbox)
+
+        hbox = gtk.HBox(False, 0)
+        gtk.Widget.show(hbox)
+
+        self.textAttributesLabel = gtk.Label(_("Enabled Text Attributes:"))
+        gtk.Widget.show(self.textAttributesLabel)
+        gtk.Box.pack_start(hbox, self.textAttributesLabel, False, False, 5)
+
+        self.enabledTextAttributes = gtk.Entry()
+        gtk.Widget.show(self.enabledTextAttributes)
+        self.enabledTextAttributes.set_text(orca.settings.enabledTextAttributes)
+        gtk.Box.pack_end(hbox, self.enabledTextAttributes, True, True, 5)
+
+        gtk.Box.pack_start(vbox, hbox, False, False, 0)
+
+        return vbox
+
+    def writeAppPreferences(self, prefs):
+        """Write out the application specific preferences lines.
+
+        Arguments:
+        - prefs: file handle for application preferences.
+        """
+
+        prefs.writelines("\n")
+        prefs.writelines( \
+            "orca.settings.enabledTextAttributes = '%s'\n" % \
+                     self.enabledTextAttributes.get_text())
+
     def adjustForWriterTable(self, obj):
         """Check to see if we are in Writer, where the object with focus
         is a paragraph, and the parent is the table cell. If it is, then,
Index: src/orca/app_gui_prefs.py
===================================================================
--- src/orca/app_gui_prefs.py	(revision 2321)
+++ src/orca/app_gui_prefs.py	(working copy)
@@ -44,18 +44,31 @@
 
 class orcaSetupGUI(orca_gui_prefs.orcaSetupGUI):
 
-    def _initAppGUIState(self):
+    def _initAppGUIState(self, appScript):
         """Before we show the GUI to the user we want to remove the
         General tab and gray out the Speech systems and servers 
         controls on the speech tab.
+
+        Arguments:
+        - appScript: the application script.
         """
 
+        # Save away the application script so that it can be used later
+        # by writeUserPreferences().
+        #
+        self.appScript = appScript
+
         self.notebook.remove_page(0)
         self.speechSystemsLabel.set_sensitive(False)
         self.speechSystems.set_sensitive(False)
         self.speechServersLabel.set_sensitive(False)
         self.speechServers.set_sensitive(False)
 
+        vbox = appScript.getAppPreferencesGUI()
+        if vbox:
+            label = gtk.Label(orca_state.locusOfFocus.app.name)
+            self.notebook.append_page(vbox, label)
+
     def _showGUI(self):
         """Show the app-specific Orca configuration GUI window. This 
         assumes that the GUI has already been created.
@@ -77,7 +90,7 @@
 
         moduleName = settings.getScriptModuleName(self.app)
         orca_prefs.writeAppPreferences(self.prefsDict, moduleName,
-                                       self.keyBindingsModel)
+                                       self.appScript, self.keyBindingsModel)
 
     def okButtonClicked(self, widget):
         """Signal handler for the "clicked" signal for the okButton
@@ -120,6 +133,8 @@
         speech.speak(message)
         return
 
+    appScript = orca_state.activeScript
+
     # The name of the application that currently has focus.
     #
     applicationName = orca_state.locusOfFocus.app.name
@@ -145,7 +160,7 @@
 
     OS._init()
     if removeGeneralPane:
-        OS._initAppGUIState()
+        OS._initAppGUIState(appScript)
     OS._showGUI()
 
 def main():
Index: src/orca/orca_prefs.py
===================================================================
--- src/orca/orca_prefs.py	(revision 2321)
+++ src/orca/orca_prefs.py	(working copy)
@@ -27,6 +27,8 @@
 
 import os
 import pprint
+
+import orca_state
 import settings
 
 from orca_i18n import _  # for gettext support
@@ -508,7 +510,7 @@
     prefs.writelines("except ImportError:\n")
     prefs.writelines("    pass\n")
 
-def writeAppPreferences(prefsDict, appName, treeModel=None):
+def writeAppPreferences(prefsDict, appName, appScript, treeModel=None):
     """Creates the directory and files to hold application specific
     user preferences.  Write out any preferences that are different
     from the generic Orca preferences for this user. Note that callers 
@@ -519,6 +521,7 @@
     - prefsDict: a dictionary where the keys are orca preferences
     names and the values are the values for the preferences.
     - appName: the application these preferences are for.
+    - appScript: the application script.
     - treeModel: key bindings treemodel.
     """
 
@@ -543,5 +546,9 @@
     if treeModel:
         _writeKeyBindingsMap(prefs, treeModel)
 
+    # Write out the application unique preferences (if any).
+    #
+    appScript.writeAppPreferences(prefs)
+
     _writeAppPreferencesPostamble(prefs, appName)
     prefs.close()
Index: src/orca/script.py
===================================================================
--- src/orca/script.py	(revision 2321)
+++ src/orca/script.py	(working copy)
@@ -181,6 +181,20 @@
         """
         return where_am_I.WhereAmI(self)
 
+    def getAppPreferencesGUI(self):
+        """Return a GtkVBox contain the application unique configuration
+        GUI items for the current application.
+        """
+        return None
+
+    def writeAppPreferences(self, prefs):
+        """Write out the application specific preferences lines.
+
+        Arguments:
+        - prefs: file handle for application preferences.
+        """
+        pass
+
     # [[[WDW - There is a circular reference going on somewhere (see
     # bug 333168).  In the presence of this reference, the existence
     # of a __del__ method prevents the garbage collector from
