コード例 #1
0
ファイル: place.py プロジェクト: over2sd/minette
def buildLocRow(data,fileid):
  row = gtk.HBox()
  row.show()
  label = gtk.Label("Location:")
  label.show()
  row.pack_start(label,False,False,2)
  label.set_width_chars(20)
  label.set_alignment(1,0.5)
  choices = getCityList()
  loc = gtk.Label()
  loc.show()
  row.pack_start(loc,True,True,2)
  g = getInf(data,["info","loc"])
  h = getInf(data,["info","state"])
  loc.set_text("%s, %s" % (g,h))
  addLocButton(row,1,entry=loc,cat='l',city="loc",cityfile="locfile",state="state",statefile="statefile",data=data)
  return row
コード例 #2
0
ファイル: person.py プロジェクト: over2sd/minette
def initPinfo(self, fileid,ar,psalts):
  global people
  global config
  info = {}
  scroll = self.get_parent()
  try:
    info = people[fileid]['info']
  except KeyError as e:
    print "initPinfo: An error occurred accessing %s: %s" % (fileid,e)
    return
  scroll = self.get_parent()
  self.namelabelbox = gtk.HBox()
  self.namelabelbox.show()
  self.l1 = gtk.Label("Name:")
  self.l1.set_alignment(0,0)
  self.namelabelbox.pack_start(self.l1,1,1,2)
  self.nord = gtk.CheckButton("Order reversed")
  self.nord.show()
  self.nord.set_active(isOrderRev(fileid))
  self.nord.unset_flags(gtk.CAN_FOCUS)
  self.nord.connect("clicked",toggleOrder,fileid)
  self.namelabelbox.pack_start(self.nord,0,0,2)
  self.add(self.namelabelbox)
  self.namebox = gtk.HBox()
  self.namebox.set_border_width(2)
  self.add(self.namebox)
  self.namebox.show()
  self.l5 = gtk.Label("Title:")
  self.ctitle = gtk.Entry(5)
  self.l2 = gtk.Label("Family:")
  self.fname = gtk.Entry(25)
  activateInfoEntry(self.fname,ar,psalts,scroll,people.get(fileid),fileid,"fname")
  self.l3 = gtk.Label("Given:")
  self.gname = gtk.Entry(25)
  activateInfoEntry(self.gname,ar,psalts,scroll,people.get(fileid),fileid,"gname")
  self.l4 = gtk.Label("Middle/Maiden:")
  self.mname = gtk.Entry(25)
  activateInfoEntry(self.mname,ar,psalts,scroll,people.get(fileid),fileid,"mname")
  self.namebox.add(self.l5)
  self.namebox.add(self.ctitle)
  self.ctitle.set_width_chars(4)
  self.fname.set_width_chars(10)
  self.gname.set_width_chars(10)
  self.mname.set_width_chars(10)
  self.namebox.set_child_packing(self.ctitle,0,0,2,gtk.PACK_START)
  data = people.get(fileid)
  self.ctitle.set_text(getInf(data,["info","ctitle"]))
  self.ctitle.show()
  activateInfoEntry(self.ctitle,ar,psalts,scroll,people.get(fileid),fileid,"ctitle")
  if config['familyfirst'] == True:
    self.namebox.add(self.l2)
    self.namebox.add(self.fname)
  self.namebox.add(self.l3)
  self.namebox.add(self.gname)
  self.gname.set_text(getInf(data,["info","gname"]))
  self.gname.show()
  self.namebox.add(self.l4)
  self.namebox.add(self.mname)
  self.mname.set_text(getInf(data,["info","mname"]))
  if config['usemiddle'] == True:
    self.mname.show()
  if config['familyfirst'] == False:
    self.namebox.add(self.l2)
    self.namebox.add(self.fname)
  self.fname.set_text(getInf(data,["info","fname"]))
  self.fname.show()
  self.l1.show()
  self.l2.show()
  self.l3.show()
  self.l4.show()
  self.l5.show()
  self.cname = buildarow(scroll,"Common Name:",people.get(fileid),fileid,'commonname',ar,psalts,tooltip="Name commonly used to refer to this character\nShows at the top of the XSL template") # TODO: Some day, maybe move all these labels into a dict and generate these things algorithmically? What about sections?
  self.add(self.cname)
  self.nname = buildarow(scroll,"Nickname:",people.get(fileid),fileid,'nname',ar,psalts,tooltip="Something other characters call this one")
  self.add(self.nname)
  self.gender = buildGenderRow(scroll,people.get(fileid),fileid,ar,psalts)
  self.add(self.gender)
  self.bday = buildarow(scroll,"Birth Date:",people.get(fileid),fileid,'bday',ar,psalts,style=3,tooltip="Date of person's birth")
  self.add(self.bday)
  self.dday = buildarow(scroll,"Death Date:",people.get(fileid),fileid,'dday',ar,psalts,style=3,tooltip="Date of person's death")
  self.add(self.dday)
  self.l6 = gtk.Label("Stories")
  self.l6.set_alignment(0,0)
  self.l6.show()
  self.add(self.l6)
  self.s1 = gtk.HSeparator()
  self.add(self.s1)
  self.s1.show()
  self.stories = buildarow(scroll,"Stories:",people.get(fileid),fileid,'stories',ar,psalts,style=2,tooltip="Stories where this character appears")
  self.add(self.stories)
  storyDefault(self.stories.e,config['realmdir'])
  self.mention = buildarow(scroll,"First Mention:",people.get(fileid),fileid,'mention',ar,psalts,tooltip="In which (story:)scene does someone first mention this person?")
  self.add(self.mention)
  self.appearch = buildarow(scroll,"First appeared (chron):",people.get(fileid),fileid,'appear1ch',ar,psalts,tooltip="First scene where the person appeared, based on the scene's position in the story")
  self.add(self.appearch)
  self.appearwr = buildarow(scroll,"First appeared (writ):",people.get(fileid),fileid,'appear1wr',ar,psalts,tooltip="First scene where the person appeared, based on when the scene was written")
  self.add(self.appearwr)
  self.conflict = buildarow(scroll,"Conflict:",people.get(fileid),fileid,'conflict',ar,psalts,tooltip="What disputes does this person have with the protagonist, or on what issues do they disagree?")
  self.add(self.conflict)
  self.leadrel = buildarow(scroll,"Relation to lead:",people.get(fileid),fileid,'leadrel',ar,psalts,tooltip="What is this person's relationship to the protagonist/lead character?")
  self.add(self.leadrel)
  self.l7 = gtk.Label("Physical Appearance")
  self.l7.set_alignment(0,1)
  self.l7.show()
  self.add(self.l7)
  self.s2 = gtk.HSeparator()
  self.add(self.s2)
  self.s2.show()
  self.bodytyp = buildarow(scroll,"Body Type:",people.get(fileid),fileid,'bodytyp',ar,psalts,tooltip="Description of the person's body or general appearance")
  self.add(self.bodytyp)
  self.age = buildarow(scroll,"Age:",people.get(fileid),fileid,'age',ar,psalts,tooltip="How old is this person?")
  ageText(self.bday.e,self.dday.e,self.age)
  if config['hideage']: self.age.e.hide()
  self.add(self.age)
  self.skin = buildarow(scroll,"Skin:",people.get(fileid),fileid,'skin',ar,psalts,tooltip="Skin tone or type (e.g., light, dark, hairy, scaly)")
  self.add(self.skin)
  self.eyes = buildarow(scroll,"Eyes:",people.get(fileid),fileid,'eyes',ar,psalts,tooltip="Color, type, or attributes of the person's eyes")
  self.add(self.eyes)
  self.hair = buildarow(scroll,"Hair:",people.get(fileid),fileid,'hair',ar,psalts,tooltip="Color, amount, descriptions of the person's hair or fur")
  self.add(self.hair)
  self.dmarks = buildarow(scroll,"Distinguishing Marks:",people.get(fileid),fileid,'dmarks',ar,psalts,tooltip="Any markings that distinguish this person from others (birthmarks, scars, etc.)")
  self.add(self.dmarks)
  self.dress = buildarow(scroll,"Dress:",people.get(fileid),fileid,'dress',ar,psalts,tooltip="How does this person normally dress?")
  self.add(self.dress)
  self.attpos = buildarow(scroll,"Attached Possessions:",people.get(fileid),fileid,'attposs',ar,psalts,tooltip="What does this person usually have at hand?")
  self.add(self.attpos)
  self.asmell = buildarow(scroll,"Associated Smell:",people.get(fileid),fileid,'asmell',ar,psalts,tooltip="What smell(s) would others associate with this person?")
  self.add(self.asmell)
  self.l8 = gtk.Label("Personality Traits")
  self.l8.set_alignment(0,1)
  self.l8.show()
  self.add(self.l8)
  self.s3 = gtk.HSeparator()
  self.add(self.s3)
  self.s3.show()
  self.pers = buildarow(scroll,"Personality:",people.get(fileid),fileid,'personality',ar,psalts,tooltip="General description of personality")
  self.add(self.pers)
  self.speech = buildarow(scroll,"Distinct Speech:",people.get(fileid),fileid,'speech',ar,psalts,tooltip="Speech patterns that set this person apart")
  self.add(self.speech)
  self.formocc = buildarow(scroll,"Former Occupation:",people.get(fileid),fileid,'formocc',ar,psalts,style=1,tooltip="The person's previous job")
  self.add(self.formocc)
  self.curocc = buildarow(scroll,"Current Occupation:",people.get(fileid),fileid,'currocc',ar,psalts,style=1,tooltip="The person's current job or preoccupation")
  self.add(self.curocc)
  self.strength = buildarow(scroll,"Strengths:",people.get(fileid),fileid,'strength',ar,psalts,tooltip="What does this character do well or have as benefits?")
  self.add(self.strength)
  self.weak = buildarow(scroll,"Weakness:",people.get(fileid),fileid,'weak',ar,psalts,tooltip="What does this character do poorly, or what things keep this character from achieving goals easily?")
  self.add(self.weak)
  self.mole = buildarow(scroll,"Mole:",people.get(fileid),fileid,'mole',ar,psalts,)
  self.add(self.mole)
  self.hobby = buildarow(scroll,"Hobby:",people.get(fileid),fileid,'hobby',ar,psalts,tooltip="What does this character like to do with free time?")
  self.add(self.hobby)
  self.aspects = buildaspectrow(scroll,people.get(fileid),fileid,ar,psalts) # ,display = 0)
  self.add(self.aspects)
  self.l9 = gtk.Label("Miscellany")
  self.l9.set_alignment(0,1)
  self.l9.show()
  self.add(self.l9)
  self.s4 = gtk.HSeparator()
  self.add(self.s4)
  self.s4.show()
  self.misc = buildarow(scroll,"Misc:",people.get(fileid),fileid,'misc',ar,psalts,tooltip="Miscellaneous info") # make a textbox
  self.add(self.misc)
  self.ethnic = buildarow(scroll,"Ethnic background:",people.get(fileid),fileid,'ethnic',ar,psalts,tooltip="What kind of people are in this character's ancestry")
  self.add(self.ethnic)
  self.origin = buildarow(scroll,"Origin:",people.get(fileid),fileid,'origin',ar,psalts,tooltip="Where was this character born (or descended from)?")
  addLocButton(self.origin,0,entry=self.origin.e)
  self.add(self.origin)
  self.backs = buildarow(scroll,"Background:",people.get(fileid),fileid,'backstory',ar,psalts,tooltip="Major life events, experiences, training") # make a textbox someday?
  self.add(self.backs)
  self.residence = buildarow(scroll,"Place of residence:",people.get(fileid),fileid,'residence',ar,psalts,tooltip="Where the person lives")
  self.add(self.residence)
  self.minchar = buildarow(scroll,"Minor related characters:",people.get(fileid),fileid,'minchar',ar,psalts,tooltip="Related characters that are too minor to get a record")
  self.add(self.minchar)
  self.talent = buildarow(scroll,"Talents:",people.get(fileid),fileid,'talent',ar,psalts,tooltip="Inate gifts")
  self.add(self.talent)
  self.abil = buildarow(scroll,"Abilities:",people.get(fileid),fileid,'abil',ar,psalts,tooltip="Trained abilities") # textbox someday?
  self.add(self.abil)
  self.sgoal = buildarow(scroll,"Story goal:",people.get(fileid),fileid,'sgoal',ar,psalts,tooltip="What the person is trying to do in the current story")
  self.add(self.sgoal)
  self.other = buildarow(scroll,"Other notes:",people.get(fileid),fileid,'other',ar,psalts) # textbox someday
  self.add(self.other)
  el = gtk.Label("End of record")
  el.show()
  el.set_alignment(1,1)
  self.pack_start(el,0,0,3)