changeset 61:f3d8101211c4 ornery-dev

Traipse Dev 'OpenRPG' {090813-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: This update completes the front end of the Updater tab. Material is now ready to start adding to the Controls tab, however GUI planning needs to take place first. Player List and Game Server Menu Columns now have a minimum width and the software will refresh to that width on an update, if the column is too small.
author sirebral
date Thu, 13 Aug 2009 04:25:10 -0500
parents 3b2cfa13b610
children e8029caed892
files orpg/main.py orpg/networking/gsclient.py orpg/player_list.py upmana/updatemana.py
diffstat 4 files changed, 32 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/main.py	Wed Aug 12 20:54:46 2009 -0500
+++ b/orpg/main.py	Thu Aug 13 04:25:10 2009 -0500
@@ -639,7 +639,7 @@
         #Update Manager
         self.manifest = manifest.ManifestChanges()
         self.updateMana = upmana.updatemana.updaterFrame(self, 
-            "OpenRPG Update Manager Beta 0.7.1", open_rpg, self.manifest, True)
+            "OpenRPG Update Manager Beta 0.7.2", open_rpg, self.manifest, True)
         self.log.log("Menu Created", ORPG_DEBUG)
         h = int(xml_dom.getAttribute("height"))
         w = int(xml_dom.getAttribute("width"))
--- a/orpg/networking/gsclient.py	Wed Aug 12 20:54:46 2009 -0500
+++ b/orpg/networking/gsclient.py	Thu Aug 13 04:25:10 2009 -0500
@@ -159,9 +159,9 @@
 
         #Build Rooms Sizer
         self.room_list = wx.ListCtrl(self, LIST_ROOM, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
-        self.room_list.InsertColumn(0,"Game", wx.LIST_FORMAT_LEFT,0)
-        self.room_list.InsertColumn(1,"Players", wx.LIST_FORMAT_LEFT,0)
-        self.room_list.InsertColumn(2,"PW", wx.LIST_FORMAT_LEFT,0)
+        self.room_list.InsertColumn(0,"Game", wx.LIST_FORMAT_LEFT,-1)
+        self.room_list.InsertColumn(1,"Players", wx.LIST_FORMAT_LEFT,-1)
+        self.room_list.InsertColumn(2,"PW", wx.LIST_FORMAT_LEFT,-1)
         self.buttons[GS_JOIN] = wx.Button(self, GS_JOIN, "Join Room")
         self.buttons[GS_JOINLOBBY] = wx.Button(self, GS_JOINLOBBY, "Lobby")
         self.sizers["roombtns"] = wx.BoxSizer(wx.HORIZONTAL)
@@ -243,7 +243,6 @@
 # [END] Snowdog: Updated Game Server Window 12/02
 #---------------------------------------------------------
 
-
     #-----------------------------------------------------
     # on_server_dbclick()
     # support for double click selection of server.
@@ -464,8 +463,11 @@
     def autosizeRooms(self):
         self.log.log("Enter game_server_panel->autosizeRooms(self)", ORPG_DEBUG)
         self.room_list.SetColumnWidth(0, wx.LIST_AUTOSIZE)
-        self.room_list.SetColumnWidth(1, wx.LIST_AUTOSIZE)
-        self.room_list.SetColumnWidth(2, wx.LIST_AUTOSIZE)
+        #self.room_list.SetColumnWidth(1, wx.LIST_AUTOSIZE)
+        #self.room_list.SetColumnWidth(2, wx.LIST_AUTOSIZE)
+        if self.room_list.GetColumnWidth(0) < 70: self.room_list.SetColumnWidth(0, 70)
+        if self.room_list.GetColumnWidth(1) < 70: self.room_list.SetColumnWidth(1, 70)
+        if self.room_list.GetColumnWidth(2) < 50: self.room_list.SetColumnWidth(2, 50)
         self.log.log("Exit game_server_panel->autosizeRooms(self)", ORPG_DEBUG)
 
     def refresh_server_list(self):
@@ -527,6 +529,7 @@
             # No server is currently selected!!!  Versus the broken and random 0!
             self.cur_server_index = -1
             self.server_list.SetColumnWidth(0, wx.LIST_AUTOSIZE)
+            if self.server_list.GetColumnWidth(0) < 70: self.server_list.SetColumnWidth(0, 70)
             self.server_list.SetColumnWidth(1, wx.LIST_AUTOSIZE)
 
             if self.serverNameSet == 0:
--- a/orpg/player_list.py	Wed Aug 12 20:54:46 2009 -0500
+++ b/orpg/player_list.py	Thu Aug 13 04:25:10 2009 -0500
@@ -95,7 +95,7 @@
         self.SetImageList( self._imageList, wx.IMAGE_LIST_SMALL )
         # Create our column headers
         self.InsertColumn( 0, "ID" )
-        self.InsertColumn( 1, "Player" )
+        self.InsertColumn( 1, "Player")
         self.InsertColumn( 2, "Status" )
 #---------------------------------------------------------
 # [START] Digitalxero Multi Whisper Group 1/1/05
@@ -192,6 +192,13 @@
 #
 #       Revised 8/03 to add support for password manager
 #---------------------------------------------------------
+
+    def AutoAdjust(self):
+        self.SetColumnWidth(0, -1)
+        if self.GetColumnWidth(1) < 75: self.SetColumnWidth(1, 75)
+        if self.GetColumnWidth(2) < 75: self.SetColumnWidth(2, 75)
+        self.Refresh()
+
     def on_menu_password( self, evt ):
         id = evt.GetId()
         self.session = open_rpg.get_component("session")
@@ -328,6 +335,7 @@
         roleString = None
         roleBase = "/role %d=%s"
         infoBase = "Attempting to assign the role of %s to (%d) %s..."
+
         # Do type specific processing
 	recycle_bin = {PLAYER_ROLE_LURKER: ROLE_LURKER, PLAYER_ROLE_PLAYER: ROLE_PLAYER, PLAYER_ROLE_GM: ROLE_GM}
 	if recycle_bin.has_key(id):
@@ -449,6 +457,7 @@
         if sound_file != '':
             sound_player = open_rpg.get_component('sound')
             sound_player.play(sound_file)
+        self.AutoAdjust()
 
     def del_player(self,player):
         i = self.FindItemData(-1,int(player[2]))
@@ -492,7 +501,7 @@
         self.SetStringItem(i,2,player[3])
         item = self.GetItem(i)
         self.colorize_player_list()
-        self.Refresh()
+        self.AutoAdjust()
 
     def colorize_player_list(self):
         session = open_rpg.get_component("session")
--- a/upmana/updatemana.py	Wed Aug 12 20:54:46 2009 -0500
+++ b/upmana/updatemana.py	Thu Aug 13 04:25:10 2009 -0500
@@ -9,7 +9,7 @@
 import upmana.validate
 import tempfile
 import shutil
-from mercurial import ui, hg, commands, repo, revlog, cmdutil
+from mercurial import ui, hg, commands, repo, revlog, cmdutil, util
 
 
 class Updater(wx.Panel):
@@ -28,8 +28,8 @@
         self.log.log("Enter updaterFrame", ORPG_DEBUG)
         self.SetBackgroundColour(wx.WHITE)
         self.sizer = wx.GridBagSizer(hgap=1, vgap=1)
-        self.changelog = wx.TextCtrl(self, wx.ID_ANY, size=(400, -1), style=wx.TE_MULTILINE | wx.TE_READONLY)
-        self.filelist = wx.TextCtrl(self, wx.ID_ANY, size=(250, 300), style=wx.TE_MULTILINE | wx.TE_READONLY)
+        self.changelog = wx.TextCtrl(self, wx.ID_ANY, size=(325, -1), style=wx.TE_MULTILINE | wx.TE_READONLY)
+        self.filelist = wx.TextCtrl(self, wx.ID_ANY, size=(275, 300), style=wx.TE_MULTILINE | wx.TE_READONLY)
         self.buttons = {}
         self.buttons['progress_bar'] = wx.Gauge(self, wx.ID_ANY, 100)
         self.buttons['auto_text'] = wx.StaticText(self, wx.ID_ANY, "Auto Update")
@@ -169,40 +169,20 @@
         heads = dict.fromkeys(self.repo.heads(), 1)
         l = [((n in heads), self.repo.changelog.rev(n), n, t) for t, n in branches.items()]
 
-        #l.sort()
-        #l.reverse()
-        #for ishead, r, n, t in l: self.package_list.append(t)
-
         if self.current != type:
-            #r = hg.islocal()
-            files = self.c.files()
-            #print commands.log(u, r, c)
-            #print r.changelog
-
-            ### Cleaning up for dev build 0.1
-            ### The below material is for the Rev Log.  You can run hg log to see what data it will pull.
-            #cs = r.changectx(c.rev()).changeset()
-            #get = util.cachefunc(lambda r: repo.changectx(r).changeset())
-            #changeiter, matchfn = cmdutil.walkchangerevs(u, r, 1, cs, 1)
-            #for st, rev, fns in changeiter:
-            #    revbranch = get(rev)[5]['branch']; print revbranch
-
             heads = dict.fromkeys(self.repo.heads(), self.repo.branchtags())
             branches = dict.copy(self.repo.branchtags())
             self.BranchInfo(self.current)
 
     def BranchInfo(self, branch):
-        self.filelist.SetValue('')
-        self.filelist.AppendText("Files that will change\n\n")
+        cs = self.repo.changectx( self.current ).changeset()
         self.changelog.SetValue('')
-        changelog = "Traipse 'OpenRPG' Update Manager.\n\nThis is Dev Build 0.7.1 (open beta) of the Update Manager. This version is nearly 100% functional. Users can now add repositories of OpenRPG, choose from different branches available from those repositories, and add files to an ignore list.\n\nThe Update Manager is divided into tabs, Updater, Repos, Manifest, and Control. \n\nUpdater: Set your update type on startup; Auto, None. Select a package of changes from a branch and update.\n\nRepos: Collect repositories of different projects. Set a name then assign it a URL. Refresh repositories in your list or delete them from your list.\n\nManifest: A complete list of all the files in your current change set. Check files off that you want to be safe from future updates.\n\nControl: Incomplete. Future revisions will allow users to update to specific revision branchs and delete branches from their computer.\n\nThis is a good start. Enjoy the freedom!!"
+        changelog = cs[4]
         self.changelog.AppendText(changelog + '\n')
-        self.filelist.AppendText("Traipse 'OpenRPG'\n\n Currently selected branch: " + branch + "\n\nFile List: When Control is completed this field will display a list of files that will be affected by your selection of branch.  The window to the left will display the description of the branch.\n\nDescription: Stable releases will have a formated Description that displays the Build Number, a summary of the branch, and a summary of the changes in the selected changeset.")
-
-        #### Files works but not fully without the change log information, pulled for Dev 0.1
-        #for f in files:
-        #    fc = c[f]
-        #    self.filelist.AppendText(str(f + '\n'))
+        self.filelist.SetValue('')
+        self.filelist.AppendText("Currently selected branch: " + branch + "\n\nAuthor: "+cs[1]+"\n\nFiles Modified (in branch): \n")
+        for f in cs[3]:
+            self.filelist.AppendText(f+"\n")
 
     def get_packages(self, type=None):
         #Fixed and ready for Test. Can be cleaner
@@ -435,7 +415,7 @@
     def __init__(self, parent, title, openrpg, manifest, main):
         self.dir_struct = open_rpg.get_component("dir_struct")
 
-        wx.Frame.__init__(self, None, wx.ID_ANY, title, size=(700,480), style=wx.DEFAULT_FRAME_STYLE)
+        wx.Frame.__init__(self, None, wx.ID_ANY, title, size=(600,480), style=wx.DEFAULT_FRAME_STYLE)
         if wx.Platform == '__WXMSW__': icon = wx.Icon(self.dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
         else: icon = wx.Icon(self.dir_struct["icon"]+"d20.xpm", wx.BITMAP_TYPE_XPM )
         self.SetIcon(icon)
@@ -483,7 +463,7 @@
         self.open_rpg.add_component("dir_struct", orpg.dirpath.dir_struct)
         self.validate = upmana.validate.Validate()
         self.open_rpg.add_component("validate", self.validate)
-        self.updater = updaterFrame(self, "OpenRPG Update Manager 0.7.1 (open beta)", self.open_rpg, self.manifest, self.main)
+        self.updater = updaterFrame(self, "OpenRPG Update Manager 0.7.2 (open beta)", self.open_rpg, self.manifest, self.main)
         if self.manifest.GetString("updatemana", "auto_update", "") == 'on' and self.main == False:
             self.AutoUpdate(); self.OnExit()
         else: pass
@@ -492,7 +472,6 @@
         else: pass
         try:
             self.updater.Show()
-            #self.SetTopWindow(self.updater)
             self.updater.Fit()
         except: pass
         return True