diff options
author | Aneesh Dogra <lionaneesh@gmail.com> | 2012-11-27 17:01:43 (GMT) |
---|---|---|
committer | Aneesh Dogra <lionaneesh@gmail.com> | 2012-11-27 17:01:43 (GMT) |
commit | 0f2d7123f8f76fcb6d57bc764e61c728813a0e6e (patch) | |
tree | 3bb62b5cdf7a3cacf7c66d11012b20278f7ebdab | |
parent | e681d00ed1e3b3bda36b286fb19503f4ef0725b6 (diff) |
-rw-r--r-- | AbiWordActivity.py | 13 | ||||
-rw-r--r-- | fontcombobox.py | 2 | ||||
-rw-r--r-- | widgets.py | 4 |
3 files changed, 19 insertions, 0 deletions
diff --git a/AbiWordActivity.py b/AbiWordActivity.py index ccfec0e..892d3b5 100644 --- a/AbiWordActivity.py +++ b/AbiWordActivity.py @@ -57,6 +57,8 @@ logger = logging.getLogger('write-activity') class AbiWordActivity(activity.Activity): + # TODO: We need to add a function for setting/getting data to/from + # the configuration file def __init__(self, handle): activity.Activity.__init__(self, handle) @@ -64,6 +66,10 @@ class AbiWordActivity(activity.Activity): # abiword uses the current directory for all its file dialogs os.chdir(os.path.expanduser('~')) + # create a class variable for font here! + + # check if the /etc/font.conf extists, if yes + # create our main abiword canvas self.abiword_canvas = Abi.Widget() self._shared_activity = None @@ -162,6 +168,11 @@ class AbiWordActivity(activity.Activity): self.abiword_canvas.connect('size-allocate', self.size_allocate_cb) + # def read_write_configuration(self, file='font.conf') + # This function would look into 'file' for defined key, value pairs of + # font and font-size + # if the key-value pairs are not found it will add the default font, font-size + def size_allocate_cb(self, abi, alloc): logging.error('size allocate %s', alloc) GObject.idle_add(abi.queue_draw) @@ -203,6 +214,8 @@ class AbiWordActivity(activity.Activity): self.abiword_canvas.invoke_ex( 'com.abisource.abiword.loadbindings.fromURI', keybindings_file, 0, 0) + # Don't use the hardcoded font_name here, instead use the self.font_name + # which is synced with the configuration file. # set default font if self._new_instance: self.abiword_canvas.select_all() diff --git a/fontcombobox.py b/fontcombobox.py index 9de5e34..82efe25 100644 --- a/fontcombobox.py +++ b/fontcombobox.py @@ -52,6 +52,8 @@ class FontComboBox(Gtk.ComboBox): self.show() def set_font_name(self, font_name): + # Edit this function to update the coonfiguration file everytime + # we change the font. count = 0 tree_iter = self.get_model().get_iter_first() while tree_iter is not None: @@ -94,11 +94,15 @@ class FontCombo(ComboBox): """ +# The class where font size is changed. class FontSizeCombo(ComboBox): def __init__(self, abi): ComboBox.__init__(self) + # again follow the same configuration stuff here too. + # Question: Where are we setting the default font-size? + self._abi_handler = abi.connect('font-size', self._font_size_cb) self._font_sizes = ['8', '9', '10', '11', '12', '14', '16', '20', \ |