← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 159: Small misc changes.

 

------------------------------------------------------------
revno: 159
committer: Eduardo César <xcesar@xxxxxxxxx>
branch nick: cdd
timestamp: Fri 2012-07-06 23:48:23 -0300
message:
  Small misc changes.
modified:
  Generator/cdg/MainFrame.py
  Generator/cdg/cdg_extra.py


--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk

Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== modified file 'Generator/cdg/MainFrame.py'
--- Generator/cdg/MainFrame.py	2012-07-07 02:34:40 +0000
+++ Generator/cdg/MainFrame.py	2012-07-07 02:48:23 +0000
@@ -172,7 +172,6 @@
 
     def generate(self, event):  # wxGlade: MainFrame.<event_handler>
 
-
         title = self.text_ctrl_title.GetValue().encode('utf8')
         description = self.text_ctrl_description.GetValue().encode('utf8')
         creator = self.text_ctrl_creator.GetValue().encode('utf8')
@@ -194,7 +193,7 @@
 
         # Test if the mandatary fields are with something
         if not (title and date and description and creator and subject and rights):
-            cdg_extra.popup_message(self, 'The options marker with a "*" are mandatory. Please fill them before generating a CCD file.', wx.ICON_EXCLAMATION)
+            cdg_extra.popup_message(self, 'The options marker with a "*" are mandatory. Please fill them before generating a CCD file.', 'Error', wx.OK|wx.ICON_EXCLAMATION)
             return
 
         # Get the path
@@ -208,7 +207,7 @@
 
 
         # Show dialog
-        cdg_extra.wrote_diag(self, ccd_id)
+        cdg_extra.popup_message(self, '%s.xsd' % ccd_id, 'Generated the file', wx.OK | wx.ICON_INFORMATION)
 
     def about(self, event):  # wxGlade: MainFrame.<event_handler>
         cdg_extra.about_box(self)

=== modified file 'Generator/cdg/cdg_extra.py'
--- Generator/cdg/cdg_extra.py	2012-07-07 02:11:53 +0000
+++ Generator/cdg/cdg_extra.py	2012-07-07 02:48:23 +0000
@@ -27,7 +27,7 @@
 
 def about_box(self):
     info = wx.AboutDialogInfo()
-    info.Name = "CDG Version 1.0 - [RM version (2.3.0)]"
+    info.Name = "CDG Version 1.0\n[RM version (2.3.0)]"
     #info.Version = "1.2.3"
 
     info.Description = wordwrap(
@@ -43,20 +43,6 @@
     # Then we call wx.AboutBox giving it that info object
     return wx.AboutBox(info)
 
-
-def wrote_diag(self, ccd_id):
-    schema = ccd_id + ".xsd"
-    dlg = wx.MessageDialog(self, "%s" % schema,
-
-                           'Generated the file',
-                           wx.OK | wx.ICON_INFORMATION
-                           #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION
-                           )
-    dlg.ShowModal()
-    dlg.Destroy()
-
-
-
 def get_path(self):
     path = os.getcwd()
 
@@ -91,13 +77,14 @@
     icon = wx.IconFromBitmap(bitmap)
     self.SetIcon(icon)
 
-def popup_message(self, msg, icon):
-    dlg = wx.MessageDialog(self, msg,
-                           "", wx.OK|icon)
+def popup_message(self, msg, tag, icons):
+    dlg = wx.MessageDialog(self, msg, tag, icons)
     result = dlg.ShowModal()
     dlg.Destroy()
-    # if result == wx.ID_OK:
-    #     self.Destroy()
+    if result == wx.ID_OK:
+        return True
+    else:
+        return False
 
 def quit_program(self):
     msg = "Are you sure you want to exit?"