Mercurial > pyarq-presupuestos
diff Gtk/gui.py @ 16:60bc5117926c
no durus
author | Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es> |
---|---|
date | Fri, 19 Apr 2013 00:04:20 +0200 |
parents | fe9c55f86698 |
children | f7e0cc58737f |
line wrap: on
line diff
--- a/Gtk/gui.py Sun Jan 02 10:27:16 2011 +0100 +++ b/Gtk/gui.py Fri Apr 19 00:04:20 2013 +0200 @@ -55,7 +55,7 @@ from Gtk import importFiebdc from Generic import base from Generic import fiebdc -from Generic import durusdatabase +#from Generic import durusdatabase from Generic import utils from Generic import globalVars from Generic import openwith @@ -118,10 +118,6 @@ <menuitem action="GoUp"/> <menuitem action="GoToRoot"/> </menu> - <menu action="Test"> - <menuitem action="ImportFiebdcPriceDatabase"/> - <menuitem action="OpenPriceDatabase"/> - </menu> </menubar> <toolbar name="ToolBar"> <toolitem action="ImportFiebdc"/> @@ -134,6 +130,11 @@ </toolbar> </ui>''' + #<menu action="Test"> + # <menuitem action="ImportFiebdcPriceDatabase"/> + # <menuitem action="OpenPriceDatabase"/> + #</menu> + def __init__(self): """__init__() @@ -173,11 +174,11 @@ ("View", None, _("_View")), ("Go", None, _("_Go")), ("Test", None, _("_Test")), - ('ImportFiebdcPriceDatabase', gtk.STOCK_OPEN, - _("Import Fiebdc _price database"), "", _("Import database"), - self._menuitemImportPriceDatabase ), - ("OpenPriceDatabase", gtk.STOCK_OPEN, _('_Open price database'), - "", _('Open Database'), self._menuitemOpenPriceDatabase), + #('ImportFiebdcPriceDatabase', gtk.STOCK_OPEN, + # _("Import Fiebdc _price database"), "", _("Import database"), + # self._menuitemImportPriceDatabase ), + #("OpenPriceDatabase", gtk.STOCK_OPEN, _('_Open price database'), + # "", _('Open Database'), self._menuitemOpenPriceDatabase), ]) self.__navigation_action_group = gtk.ActionGroup("Navigation") self.__navigation_action_group.add_actions( @@ -373,40 +374,40 @@ _file_window = importFiebdc.FileSelectionWindow(self, _read_method, _budget, _filename, _exit_method, _filetype) - def _menuitemImportPriceDatabase(self, widget): - """_menuitemImportPriceDatabase(widget) - - widget: the widget where the event is emitted from - Callback to open a price database file. - - Creates and shows a file selection window to open a price database - file. - """ - _budget = base.Budget() - _budget_file = fiebdc.Read() - _read_method = _budget_file.readFile - _filename = "file" - _filetype = "database" - _exit_method = _budget_file.cancel - _file_window = importFiebdc.FileSelectionWindow(self, - _read_method, _budget, _filename, _exit_method, _filetype) - - def _menuitemOpenPriceDatabase(self, widget): - """_menuitemOpenPriceDatabase(widget) - - widget: the widget where the event is emitted from - Callback to open a price database from a durus file. - - Creates and shows a file selection window to open a durus database - """ - _budget = None - _budget_file = durusdatabase.Read() - _read_method = _budget_file.readFile - _filename = "file" - _filetype = "durus" - _exit_method = _budget_file.cancel - _file_window = importFiebdc.FileSelectionWindow(self, - _read_method, _budget, _filename, _exit_method, _filetype) + #def _menuitemImportPriceDatabase(self, widget): + # """_menuitemImportPriceDatabase(widget) + # + # widget: the widget where the event is emitted from + # Callback to open a price database file. + # + # Creates and shows a file selection window to open a price database + # file. + # """ + # _budget = base.Budget() + # _budget_file = fiebdc.Read() + # _read_method = _budget_file.readFile + # _filename = "file" + # _filetype = "database" + # _exit_method = _budget_file.cancel + # _file_window = importFiebdc.FileSelectionWindow(self, + # _read_method, _budget, _filename, _exit_method, _filetype) + + #def _menuitemOpenPriceDatabase(self, widget): + # """_menuitemOpenPriceDatabase(widget) + # + # widget: the widget where the event is emitted from + # Callback to open a price database from a durus file. + # + # Creates and shows a file selection window to open a durus database + # """ + # _budget = None + # _budget_file = durusdatabase.Read() + # _read_method = _budget_file.readFile + # _filename = "file" + # _filetype = "durus" + # _exit_method = _budget_file.cancel + # _file_window = importFiebdc.FileSelectionWindow(self, + # _read_method, _budget, _filename, _exit_method, _filetype) def _menuitemClose(self, widget): """_menuitemClose(widget) @@ -418,11 +419,11 @@ _page_num = self.__notebook.get_current_page() if _page_num != -1: _page = self.__page_list[_page_num] - if isinstance(_page, EmptyPage) and _page.filetype == "durus": - print _("Cancel reading Durus database has not been " - "implemented.") - else: - _page.close() + #if isinstance(_page, EmptyPage) and _page.filetype == "durus": + # print _("Cancel reading Durus database has not been " + # "implemented.") + #else: + _page.close() def closePage(self, page): """closePage(page) @@ -657,8 +658,8 @@ _progressframe.set_shadow_type(gtk.SHADOW_IN) _progressframe.show() self.__progress_bar = gtk.ProgressBar() - if self.__filetype != "durus": - self.__progress_bar.show() + #if self.__filetype != "durus": + # self.__progress_bar.show() _progressframe.add(self.__progress_bar) self.__statusbar.pack_start(_progressframe, False, False, 0) self.__widget.pack_end(self.__statusbar, False, True, 0) @@ -713,11 +714,11 @@ 3- If the other timetouts are stoped the window is closed """ gobject.timeout_add(1000, self._updateLabel, time.time()) - if self.__filetype != "durus": - gobject.timeout_add(500, self._updateProgressBar) - self.__cancel = [False, False] - else: - self.__cancel = [True, False] + #if self.__filetype != "durus": + # gobject.timeout_add(500, self._updateProgressBar) + # self.__cancel = [False, False] + #else: + self.__cancel = [True, False] gobject.timeout_add(1000, self._autoClose) def _updateProgressBar(self):