diff --git a/files/ZAZFavorites_v0.6.0.oxt b/files/ZAZFavorites_v0.6.0.oxt index eec29af..02d86f8 100644 Binary files a/files/ZAZFavorites_v0.6.0.oxt and b/files/ZAZFavorites_v0.6.0.oxt differ diff --git a/images/add.png b/images/add.png deleted file mode 100644 index 6cacfc5..0000000 Binary files a/images/add.png and /dev/null differ diff --git a/images/add.svg b/images/add.svg new file mode 100644 index 0000000..5b15d6d --- /dev/null +++ b/images/add.svg @@ -0,0 +1,93 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/ZAZFavorites.py b/source/ZAZFavorites.py index f1ce7ae..6908aac 100644 --- a/source/ZAZFavorites.py +++ b/source/ZAZFavorites.py @@ -19,29 +19,6 @@ class ZAZFavorites(unohelper.Base, XJobExecutor): return def _create_dialog(self): - args = { - 'Name': 'dialog', - 'Title': self.TITLE, - 'Width': 160, - 'Height': 160, - } - dlg = app.create_dialog(args) - dlg.events = Controllers(dlg) - dlg.events.TITLE = self.TITLE - - args = { - 'Type': 'Button', - 'Name': 'button_add', - 'Label': _('~Add'), - 'ImageURL': app.join(self.IMAGES, 'add.png'), - 'ImagePosition': 1, - 'Width': 60, - 'Height': 15, - 'Y': 5, - 'FocusOnClick': False, - } - dlg.add_control(args) - columns = ( {'Title': _('File Name'), 'MaxWidth': 120}, {'Title': 'X', 'HorizontalAlign': 1, 'Resizeable': False, 'ColumnWidth': 10}, diff --git a/source/images/add.png b/source/images/add.png deleted file mode 100644 index 6cacfc5..0000000 Binary files a/source/images/add.png and /dev/null differ diff --git a/source/images/add.svg b/source/images/add.svg new file mode 100644 index 0000000..5b15d6d --- /dev/null +++ b/source/images/add.svg @@ -0,0 +1,93 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/images/save.png b/source/images/save.png deleted file mode 100644 index 06d84fe..0000000 Binary files a/source/images/save.png and /dev/null differ diff --git a/source/images/save.svg b/source/images/save.svg new file mode 100644 index 0000000..b53fde9 --- /dev/null +++ b/source/images/save.svg @@ -0,0 +1,99 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/pythonpath/main.py b/source/pythonpath/main.py index bc7e906..7bc9c73 100644 --- a/source/pythonpath/main.py +++ b/source/pythonpath/main.py @@ -15,19 +15,20 @@ class Controllers(object): self.paths = [] def button_add_action(self, event): - path = app.get_file() - if not path: - return - if path in self.paths: - msg = _('Path previously added') - app.msgbox(msg, self.TITLE) - return + path = app.paths.get_file() + # ~ if not path: + # ~ return + # ~ if path in self.paths: + # ~ msg = _('Path previously added') + # ~ app.msgbox(msg, self.TITLE) + # ~ return - self.paths.append(path) - p, filename, n, e = app.get_info_path(path) - self.d.grid.add_row((filename, '', path)) - self.d.grid.set_cell_tooltip(0, self.d.grid.rows-1, p) - self.d.grid.sort(0) + # ~ self.paths.append(path) + # ~ p, filename, n, e = app.get_info_path(path) + # ~ self.d.grid.add_row((filename, '', path)) + # ~ self.d.grid.set_cell_tooltip(0, self.d.grid.rows-1, p) + # ~ self.d.grid.sort(0) + app.debug(path) return def button_save_action(self, event): @@ -107,8 +108,36 @@ def _create_dialog(): 'Height': 160, } dlg = app.create_dialog(args) + dlg.id = ID_EXTENSION dlg.events = Controllers + args = { + 'Type': 'Button', + 'Name': 'button_add', + 'Label': _('~Add'), + 'ImageURL': 'add.svg', + 'ImagePosition': 1, + 'Width': 60, + 'Height': 20, + 'Y': 5, + } + dlg.add_control(args) + + args = { + 'Type': 'Button', + 'Name': 'button_save', + 'Label': _('~Save'), + 'ImageURL': 'save.svg', + 'ImagePosition': 1, + 'Width': 60, + 'Height': 20, + } + dlg.add_control(args) + + dlg.button_add.center() + dlg.button_save.move(dlg.button_add) + dlg.button_save.center() + return dlg @app.catch_exception @@ -117,7 +146,6 @@ def run(args, path_locales): _ = app.install_locales(path_locales) - app.debug(args) if args == 'config': _config() return