authURL = rtm.getAuthURL()
webbrowser.open(authURL)
- # mb = gtk_toolbox.MessageBox2("You need to authorize DoneIt with\nRemember The Milk.\nClick OK after you authorize.")
- # mb.run()
+ mb = gtk_toolbox.MessageBox2("You need to authorize DoneIt with\nRemember The Milk.\nClick OK after you authorize.")
+ mb.run()
token = rtm.getToken()
return token
def get_credentials(credentialsDialog):
- # @todo Figure out storage of credentials
username, password = credentialsDialog.request_credentials()
token = get_token(username, rtmilk.RtMilkManager.API_KEY, rtmilk.RtMilkManager.SECRET)
return username, password, token
self._projectsCombo = widgetTree.get_widget("projectsCombo")
self._onListActivateId = 0
+ # @todo Need to figure out how to make the list sortable, especially with weird priority sorting
self._itemList = gtk.ListStore(
gobject.TYPE_STRING, # id
gobject.TYPE_BOOLEAN, # is complete
"""
@note Thread Agnostic
"""
- username = config.get(self.name(), "username")
- password = None
- blobbedToken = config.get(self.name(), "bin_blob")
- token = base64.b64decode(blobbedToken)
- self._credentials = username, password, token
+ blobs = (
+ config.get(self.name(), "bin_blob_%i" % i)
+ for i in xrange(len(self._credentials))
+ )
+ creds = (
+ base64.b64decode(blob)
+ for blob in blobs
+ )
+ self._credentials = tuple(creds)
def save_settings(self, config):
"""
@note Thread Agnostic
"""
config.add_section(self.name())
- config.set(self.name(), "username", self._credentials[0])
- blobbedToken = base64.b64encode(self._credentials[2])
- config.set(self.name(), "bin_blob", blobbedToken)
+ for i, value in enumerate(self._credentials):
+ blob = base64.b64encode(value)
+ config.set(self.name(), "bin_blob_%i" % i, blob)
def login(self):
"""
return currentProjectName
def _populate_items(self):
- # @todo Look using a button for notes and links, and labels for all else
+ # @todo Look into using a button for notes and links, and labels for all else
currentProject = self._get_project()
projId = self._manager.lookup_project(currentProject)["id"]
for taskDetails in self._manager.get_tasks_with_details(projId):
def _on_item_select(self, treeView, path, viewColumn):
# @todo See if there is a way to get a right click / tap'n'hold for more task goodness
+ # https://garage.maemo.org/plugins/wiki/index.php?TapAndHold&id=40&type=g
taskId = self._itemList[path[0]][self.ID_IDX]
if viewColumn is self._priorityColumn: