diff --git a/files/ZAZFavorites_v0.6.0.oxt b/files/ZAZFavorites_v0.6.0.oxt index 02d86f8..cbad9e7 100644 Binary files a/files/ZAZFavorites_v0.6.0.oxt and b/files/ZAZFavorites_v0.6.0.oxt differ diff --git a/source/ZAZFavorites.py b/source/ZAZFavorites.py index 6908aac..7b3c34d 100644 --- a/source/ZAZFavorites.py +++ b/source/ZAZFavorites.py @@ -18,48 +18,6 @@ class ZAZFavorites(unohelper.Base, XJobExecutor): main.run(args, __file__) return - def _create_dialog(self): - columns = ( - {'Title': _('File Name'), 'MaxWidth': 120}, - {'Title': 'X', 'HorizontalAlign': 1, 'Resizeable': False, 'ColumnWidth': 10}, - {'Title': '', 'Resizeable': False, 'ColumnWidth': 0}, - ) - args = { - 'Type': 'Grid', - 'Name': 'grid', - 'Width': 140, - 'Height': 110, - 'ShowRowHeader': True, - 'Columns': columns - } - dlg.add_control(args) - dlg.grid.set_column_image(1, app.join(self.IMAGES, 'delete.png')) - paths = app.get_config('paths', []) - for path in paths: - p, filename, n, e = app.get_info_path(path) - dlg.grid.add_row((filename, '', path)) - dlg.grid.set_cell_tooltip(0, dlg.grid.rows-1, p) - dlg.events.paths = paths - - args = { - 'Type': 'Button', - 'Name': 'button_save', - 'Label': _('~Save'), - 'ImageURL': app.join(self.IMAGES, 'save.png'), - 'ImagePosition': 1, - 'Width': 60, - 'Height': 15, - } - dlg.add_control(args) - - dlg.button_add.center() - dlg.grid.move(dlg.button_add) - dlg.grid.center() - dlg.button_save.move(dlg.grid) - dlg.button_save.center() - - return dlg - g_ImplementationHelper = unohelper.ImplementationHelper() g_ImplementationHelper.addImplementation(ZAZFavorites, ID_EXTENSION, SERVICE) diff --git a/source/pythonpath/main.py b/source/pythonpath/main.py index 7bc9c73..d32b56e 100644 --- a/source/pythonpath/main.py +++ b/source/pythonpath/main.py @@ -94,6 +94,15 @@ class Controllers(object): def _config(): dlg = _create_dialog() + + # ~ dlg.grid.set_column_image(1, app.join(self.IMAGES, 'delete.png')) + # ~ paths = app.get_config('paths', []) + # ~ for path in paths: + # ~ p, filename, n, e = app.get_info_path(path) + # ~ dlg.grid.add_row((filename, '', path)) + # ~ dlg.grid.set_cell_tooltip(0, dlg.grid.rows-1, p) + # ~ dlg.events.paths = paths + dlg.open() return @@ -105,7 +114,7 @@ def _create_dialog(): 'Name': 'dialog', 'Title': TITLE, 'Width': 160, - 'Height': 160, + 'Height': 170, } dlg = app.create_dialog(args) dlg.id = ID_EXTENSION @@ -123,6 +132,21 @@ def _create_dialog(): } dlg.add_control(args) + columns = ( + {'Title': _('File Name'), 'MaxWidth': 120}, + {'Title': 'X', 'HorizontalAlign': 1, 'Resizeable': False, 'ColumnWidth': 10}, + {'Title': '', 'Resizeable': False, 'ColumnWidth': 0}, + ) + args = { + 'Type': 'Grid', + 'Name': 'grid', + 'Width': 140, + 'Height': 110, + 'ShowRowHeader': True, + } + grid = dlg.add_control(args) + grid.columns = columns + args = { 'Type': 'Button', 'Name': 'button_save', @@ -135,7 +159,9 @@ def _create_dialog(): dlg.add_control(args) dlg.button_add.center() - dlg.button_save.move(dlg.button_add) + dlg.grid.move(dlg.button_add) + dlg.button_save.move(dlg.grid) + dlg.grid.center() dlg.button_save.center() return dlg