diff --git a/src/controller/settings.py b/src/controller/settings.py index e58be9f6..f58b6ecf 100644 --- a/src/controller/settings.py +++ b/src/controller/settings.py @@ -130,7 +130,8 @@ class accountSettingsController(globalSettingsController): widgetUtils.connect_event(self.dialog.general.au, widgetUtils.BUTTON_PRESSED, self.manage_autocomplete) self.dialog.set_value("general", "relative_time", self.config["general"]["relative_times"]) self.dialog.set_value("general", "show_screen_names", self.config["general"]["show_screen_names"]) - self.dialog.set_value("general", "apiCalls", self.config["general"]["max_api_calls"]) + if application.streaming_lives(): + self.dialog.set_value("general", "apiCalls", self.config["general"]["max_api_calls"]) self.dialog.set_value("general", "itemsPerApiCall", self.config["general"]["max_tweets_per_call"]) self.dialog.set_value("general", "reverse_timelines", self.config["general"]["reverse_timelines"]) rt = self.config["general"]["retweet_mode"] @@ -182,7 +183,8 @@ class accountSettingsController(globalSettingsController): self.needs_restart = True self.config["general"]["relative_times"] = self.dialog.get_value("general", "relative_time") self.config["general"]["show_screen_names"] = self.dialog.get_value("general", "show_screen_names") - self.config["general"]["max_api_calls"] = self.dialog.get_value("general", "apiCalls") + if application.streaming_lives(): + self.config["general"]["max_api_calls"] = self.dialog.get_value("general", "apiCalls") self.config["general"]["max_tweets_per_call"] = self.dialog.get_value("general", "itemsPerApiCall") if self.config["general"]["persist_size"] != self.dialog.get_value("general", "persist_size"): if self.dialog.get_value("general", "persist_size") == '': diff --git a/src/sessionmanager/session.py b/src/sessionmanager/session.py index f6a072ee..6f0a9f1a 100644 --- a/src/sessionmanager/session.py +++ b/src/sessionmanager/session.py @@ -251,7 +251,10 @@ class Session(object): update_function str: The function to call. This function must be child of self.twitter.twitter returns a list with all items retrieved.""" - max = int(self.settings["general"]["max_api_calls"])-1 + if application.streaming_lives(): + max = int(self.settings["general"]["max_api_calls"])-1 + else: + max = 0 results = [] data = getattr(self.twitter.twitter, update_function)(count=self.settings["general"]["max_tweets_per_call"], *args, **kwargs) results.extend(data) diff --git a/src/wxUI/dialogs/configuration.py b/src/wxUI/dialogs/configuration.py index 5a6786f8..1afd1929 100644 --- a/src/wxUI/dialogs/configuration.py +++ b/src/wxUI/dialogs/configuration.py @@ -93,13 +93,14 @@ class generalAccount(wx.Panel, baseDialog.BaseWXDialog): sizer.Add(self.au, 0, wx.ALL, 5) self.relative_time = wx.CheckBox(self, wx.NewId(), _(U"Relative timestamps")) sizer.Add(self.relative_time, 0, wx.ALL, 5) - apiCallsBox = wx.BoxSizer(wx.HORIZONTAL) - apiCallsBox.Add(wx.StaticText(self, -1, _(u"API calls (One API call = 200 tweets, two API calls = 400 tweets, etc):")), 0, wx.ALL, 5) - self.apiCalls = wx.SpinCtrl(self, wx.NewId()) - self.apiCalls.SetRange(1, 10) - self.apiCalls.SetSize(self.apiCalls.GetBestSize()) - apiCallsBox.Add(self.apiCalls, 0, wx.ALL, 5) - sizer.Add(apiCallsBox, 0, wx.ALL, 5) + if application.streaming_lives(): + apiCallsBox = wx.BoxSizer(wx.HORIZONTAL) + apiCallsBox.Add(wx.StaticText(self, -1, _(u"API calls (One API call = 200 tweets, two API calls = 400 tweets, etc):")), 0, wx.ALL, 5) + self.apiCalls = wx.SpinCtrl(self, wx.NewId()) + self.apiCalls.SetRange(1, 10) + self.apiCalls.SetSize(self.apiCalls.GetBestSize()) + apiCallsBox.Add(self.apiCalls, 0, wx.ALL, 5) + sizer.Add(apiCallsBox, 0, wx.ALL, 5) tweetsPerCallBox = wx.BoxSizer(wx.HORIZONTAL) tweetsPerCallBox.Add(wx.StaticText(self, -1, _(u"Items on each API call")), 0, wx.ALL, 5) self.itemsPerApiCall = wx.SpinCtrl(self, wx.NewId())