fixed a bug in get_account_balance() and started the layout for the character page
authorRyan Campbell <campbellr@gmail.com>
Tue, 20 Apr 2010 05:47:04 +0000 (23:47 -0600)
committerRyan Campbell <campbellr@gmail.com>
Tue, 20 Apr 2010 05:47:04 +0000 (23:47 -0600)
mevemon.py
ui/fremantle/ui.py

index 05b726c..422a8e1 100644 (file)
@@ -93,9 +93,10 @@ class mEveMon():
 
     def get_account_balance(self, charID):
         try:
-            wallet = auth.char.AccountBalance(charID)
+            wallet = self.auth.char.AccountBalance(CharacterID=charID)
             isk = wallet.accounts[0].balance  # do we always want the first one??
         except eveapi.Error, e:
+            print e
             return None
 
         return isk
index 7e8db4d..6017fb8 100644 (file)
@@ -60,29 +60,63 @@ class mEveMonUI():
         # Attach menu to the window
         win.set_app_menu(menu)
 
+        #pannable_area = hildon.PannableArea()
+
         model = treeview.get_model()
         miter = model.get_iter(path)
         
         # column 0 is the portrait, column 1 is name
 
         char_name = model.get_value(miter, 1)
+        char_id = self.controller.char_name2id(char_name)
 
         win.set_title(char_name)
         
-        label = gtk.Label("This is a subview with information about %s" % char_name)
+        skillLabel = gtk.Label("Skills")
+
+        # TODO: replace these with api calls
+        corp_name = ""
+        skill_points = 0
+
+        name = gtk.Label("Name: %s" % char_name)
+        name.set_alignment(0, 0.5)
+
+        corp = gtk.Label("Corp: %s" % corp_name)
+        corp.set_alignment(0, 0.5)
+
+        balance = gtk.Label("Balance: %s ISK" % 
+                self.controller.get_account_balance(char_id))
+        balance.set_alignment(0, 0.5)
+
+        sp = gtk.Label("Skill points: %s" % skill_points)
+        sp.set_alignment(0, 0.5)
+
         portrait = gtk.Image()
         portrait.set_from_file(self.controller.get_portrait(char_name, 256))
         portrait.show()
+        
+        hbox = gtk.HBox(False, 0)
 
+        info_vbox = gtk.VBox(False, 0)
+        info_vbox.pack_start(name, False, False, 1)
+        info_vbox.pack_start(corp, False, False, 1)
+        info_vbox.pack_start(balance, False, False, 1)
+        info_vbox.pack_start(sp, False, False, 1)
 
+        hbox.pack_start(portrait, False, False, 10)
+        hbox.pack_start(info_vbox, False, False, 5)
+        #hbox.pack_start(stats_vbox, False, False, 5)
+        
         vbox = gtk.VBox(False, 0)
-        vbox.pack_start(portrait, True, True, 0)
-        vbox.pack_start(label, True, True, 0)
+        #pannable_area.add(vbox)
+
+        vbox.pack_start(hbox, False, False, 0)
+        vbox.pack_start(skillLabel, False, False, 5)
 
         win.add(vbox)
         win.show_all()
 
-    
+
     def create_char_model(self):
         lstore = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING)