diff --git a/src/controller/buffers.py b/src/controller/buffers.py index 4dd7706..cfc6ea5 100644 --- a/src/controller/buffers.py +++ b/src/controller/buffers.py @@ -57,7 +57,7 @@ class baseBuffer(object): if num > 0: [self.insert(i, False) for i in self.session.db[self.name]["items"][:num]] - def update(self): + def get_more_items(self): self.get_items(show_nextpage=True) def post(self, *args, **kwargs): @@ -135,9 +135,6 @@ class feedBuffer(baseBuffer): else: [self.insert(i) for i in self.session.db[self.name]["items"][:num]] - def update(self): - output.speak(_(u"Wall buffers can't get up to 100 items.")) - class audioBuffer(feedBuffer): def create_tab(self, parent): self.tab = home.audioTab(parent) @@ -178,6 +175,9 @@ class audioBuffer(feedBuffer): return False + def get_more_items(self, *args, **kwargs): + output.speak(_(u"This buffer doesn't support getting more items.")) + class empty(object): def __init__(self, name=None, parent=None, *args, **kwargs): @@ -187,7 +187,7 @@ class empty(object): def get_items(self, *args, **kwargs): pass - def update(self, *args, **kwargs): - pass + def get_more_items(self, *args, **kwargs): + output.speak(_(u"This buffer doesn't support getting more items.")) def remove_buffer(self): return False diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 817ab45..1ed334f 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -79,6 +79,7 @@ class Controller(object): widgetUtils.connect_event(self.window, widgetUtils.MENU, self.window.about_dialog, menuitem=self.window.about) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.search_audios, menuitem=self.window.search_audios) widgetUtils.connect_event(self.window, widgetUtils.MENU,self.remove_buffer, menuitem=self.window.remove_buffer_) + widgetUtils.connect_event(self.window, widgetUtils.MENU, self.get_more_items, menuitem=self.window.load_previous_items) def disconnect_events(self): pub.unsubscribe(self.in_post, "posted") @@ -134,6 +135,10 @@ class Controller(object): b = self.get_current_buffer() b.get_items() + def get_more_items(self, *args, **kwargs): + b = self.get_current_buffer() + b.get_more_items() + def check_for_updates(self, *args, **kwargs): update = updater.do_update() if update == False: diff --git a/src/wxUI/mainWindow.py b/src/wxUI/mainWindow.py index 3d51ed0..8ac7a95 100644 --- a/src/wxUI/mainWindow.py +++ b/src/wxUI/mainWindow.py @@ -11,7 +11,7 @@ class mainWindow(wx.Frame): buffer.AppendMenu(wx.NewId(), _(u"New buffer"), self.new_buffer) self.update_buffer = buffer.Append(wx.NewId(), _(u"Update current buffer")) self.load_previous_items = buffer.Append(wx.NewId(), _(u"Load previous items")) - self.load_previous_items.Enable(False) + self.remove_buffer_ = buffer.Append(wx.NewId(), _(u"&Remove buffer")) mb.Append(buffer, _(u"Buffer")) help_ = wx.Menu()