Hi Benoît,

Attached are three diffs that add a small benefit to those whose package
up a lot of projects.  Basically it adds "default" settings for the
items on the first page of the FMakeInstall wizard.  These are help in
the gambas3.config file.

The changes are:
1) add another tab to the Preferences form to allow the user to
set/change the defaults for packaging info.
2) changes the name of the "Packages" tab to "Source Archives" (ditto
the label on that tab.
3) adds logic to FOptions.class to manage the default values in and out
of Settings
4) adds logic to the FMakeInstall form to look for these defaults in
Settings[FMakeInstall/...]

The benefits are only to those who do package a lot of projects.

Hope you see your way to adopting these.  I wrote them after having to
type in the same info 20 times and retype them after mispelling the
email address every time. (And I hate managing conflicts in trunk.)

regards
Bruce

Index: FMakeInstall.class
===================================================================
--- FMakeInstall.class    (revision 4795) 
+++ FMakeInstall.class    (working copy) 
@@ -44,7 +44,7 @@
   If Project.Maintainer Then
     txtName.Text = Project.Maintainer
   Else 
-    txtName.Text = System.User.Name 
+    txtName.Text = Settings["FMakeInstall/Maintainer", System.User.Name] 
   Endif
   
   txtName.SelectAll
@@ -53,21 +53,25 @@
   If Project.Address Then
     txtMail.Text = Project.Address
   Else 
-    txtMail.Text = System.User.Name & "@" & System.Host 
+    txtMail.Text = Settings["FMakeInstall/Address", System.User.Name & "@" & System.Host] 
   Endif
   
-  txtVendor.Text = Project.Vendor 
-   
+  If Project.Vendor Then 
+    txtVendor.Text = Project.Vendor 
+  Else 
+    txtVendor.Text = Settings["FMakeInstall/Vendor"] 
+  Endif 
+     
   If Project.License Then
     txtLicense.Text = Project.License
   Else 
-    txtLicense.Text = "General Public License" 
+    txtLicense.Text = Settings["FMakeInstall/License", "General Public License"] 
   Endif
   
   If Project.Url Then
     txtUrl.Text = Project.Url
   Else 
-    txtUrl.Text = Project.DEFAULT_URL 
+    txtUrl.Text = Settings["FMakeInstall/URL", Project.DEFAULT_URL] 
   Endif
 
   txtDescribe.Text = Project.Description
@@ -76,7 +80,11 @@
   txtChangeLog.Pos = 0
   txtTests.Text = Project.ExtraAutoconfTest
 
-  chkPrefix.Value = Project.Prefix 
+  If Project.Prefix 
+    chkPrefix.Value = True 
+  Else 
+    chkPrefix.Value = Settings["FMakeInstall/Prefix", False] 
+  Endif 
 
   'InitSystemControls
   InitSystems
Index: FOption.class
===================================================================
--- FOption.class    (revision 4795) 
+++ FOption.class    (working copy) 
@@ -138,6 +138,13 @@
   tvwIgnore.Columns.Count = 1
   LoadIgnoreFiles
   
+  txtMaintainer.Text = Settings["FMakeInstall/Maintainer", User.Name] 
+  txtVendor.Text = Settings["FMakeInstall/Vendor"] 
+  txtAddress.Text = Settings["FMakeInstall/Address", User.Name & "@" & System.Host] 
+  txtLicense.Text = Settings["FMakeInstall/License", "GPL"] 
+  txtURL.Text = Settings["FMakeInstall/URL", "www.endoftheinternet.com"] 
+  cboPrefix.Index = If(Settings["FMakeInstall/Prefix", False], 1, 0) 
+   
   Me.Utility = Settings["/UseUtilityWindows", 1]
   
 End
@@ -945,3 +952,39 @@
   MHelp.LoadProxyConfig
 
 End
+ 
+Public Sub txtMaintainer_LostFocus() 
+ 
+  Settings["FMakeInstall/Maintainer"] = txtMaintainer.Text 
+ 
+End 
+ 
+Public Sub txtVendor_LostFocus() 
+ 
+  Settings["FMakeInstall/Vendor"] = txtVendor.Text 
+ 
+End 
+ 
+Public Sub txtAddress_LostFocus() 
+ 
+  Settings["FMakeInstall/Address"] = txtAddress.Text 
+ 
+End 
+ 
+Public Sub txtLicense_LostFocus() 
+ 
+  Settings["FMakeInstall/License"] = txtLicense.Text 
+ 
+End 
+ 
+Public Sub txtURL_LostFocus() 
+ 
+  Settings["FMakeInstall/URL"] = txtURL.Text 
+ 
+End 
+ 
+Public Sub cboPrefix_Click() 
+ 
+  Settings["FMakeInstall/Prefix"] = cboPrefix.Index = 1 
+ 
+End 
Index: FOption.form
===================================================================
--- FOption.form    (revision 4795) 
+++ FOption.form    (working copy) 
@@ -1,7 +1,7 @@
 # Gambas Form File 3.0
 
 { Form Form
-  MoveScaled(0,0,92,56) 
+  MoveScaled(0,0,92,62) 
   Visible = False
   Action = "option"
   Text = ("Preferences")
@@ -32,10 +32,10 @@
     }
   }
   { ipnOption IconPanel
-    MoveScaled(1,1,90,54) 
+    MoveScaled(1,1,90,60) 
     Arrangement = Arrange.Vertical
     Spacing = True
-    Count = 8 
+    Count = 9 
     Index = 0
     Text = ("Interface")
     Picture = Picture["icon:/large/menu"]
@@ -661,22 +661,22 @@
       }
     }
     Index = 7
-    Text = ("Packages") 
+    Text = ("Source Archives") 
     Picture = Picture["icon:/32/archive"]
-    { Label33 Label 
-      MoveScaled(0,1,66,3) 
-      Text = ("Ignore these files in source packages") 
+    { Label39 Label 
+      MoveScaled(0,0,66,3) 
+      Text = ("Ignore these files in source archives") 
     }
-    { HBox34 HBox 
-      MoveScaled(1,6,65,46) 
+    { HBox41 HBox 
+      MoveScaled(0,4,65,55) 
       Expand = True
       Spacing = True
       { tvwIgnore TableView
-        MoveScaled(2,2,39,41) 
+        MoveScaled(3,1,39,52) 
         Expand = True
       }
-      { VBox1 VBox 
-        MoveScaled(46,1,17,41) 
+      { VBox3 VBox 
+        MoveScaled(46,1,17,20) 
         Spacing = True
         { btnInsertIgnore Button
           MoveScaled(0,0,17,4)
@@ -698,6 +698,114 @@
         }
       }
     }
+    Index = 8 
+    Text = ("Packaging") 
+    Picture = Picture["icon:/32/package"] 
+    { Label33 Label 
+      MoveScaled(0,0,61,4) 
+      Font = Font["Bold"] 
+      Text = ("Packager Defaults") 
+    } 
+    { HBox36 HBox 
+      MoveScaled(0,4,66,4) 
+      Spacing = True 
+      Indent = True 
+      { Panel21 Panel 
+        MoveScaled(0,1,2,2.1429) 
+      } 
+      { Label35 Label 
+        MoveScaled(10,0,17,4) 
+        Expand = True 
+        Text = ("Maintainer") 
+      } 
+      { txtMaintainer TextBox 
+        MoveScaled(29,0,35,4) 
+      } 
+    } 
+    { HBox37 HBox 
+      MoveScaled(0,9,66,4) 
+      Spacing = True 
+      Indent = True 
+      { Panel22 Panel 
+        MoveScaled(0,0,2,2.1429) 
+      } 
+      { Label34 Label 
+        MoveScaled(10,0,17,4) 
+        Expand = True 
+        Text = ("Vendor") 
+      } 
+      { txtVendor TextBox 
+        MoveScaled(29,0,35,4) 
+      } 
+    } 
+    { HBox38 HBox 
+      MoveScaled(0,14,66,4) 
+      Spacing = True 
+      Indent = True 
+      { Panel23 Panel 
+        MoveScaled(0,0,2,2.1429) 
+      } 
+      { Label36 Label 
+        MoveScaled(10,0,17,4) 
+        Expand = True 
+        Text = ("Address") 
+      } 
+      { txtAddress TextBox 
+        MoveScaled(29,0,35,4) 
+      } 
+    } 
+    { HBox39 HBox 
+      MoveScaled(0,19,66,4) 
+      Spacing = True 
+      Indent = True 
+      { Panel24 Panel 
+        MoveScaled(0,0,2,2.1429) 
+      } 
+      { Label37 Label 
+        MoveScaled(10,0,17,4) 
+        Expand = True 
+        Text = ("License") 
+      } 
+      { txtLicense ComboBox 
+        MoveScaled(29,0,35,4) 
+        ReadOnly = True 
+        List = [("Freeware"), ("General Public License"), ("Lesser General Public License"), ("Non-free License"), ("Other License(s)"), ("Public Domain")] 
+      } 
+    } 
+    { HBox40 HBox 
+      MoveScaled(0,24,66,4) 
+      Spacing = True 
+      Indent = True 
+      { Panel25 Panel 
+        MoveScaled(0,0,2,2.1429) 
+      } 
+      { Label38 Label 
+        MoveScaled(10,0,17,4) 
+        Expand = True 
+        Text = ("URL") 
+      } 
+      { txtURL TextBox 
+        MoveScaled(29,0,35,4) 
+      } 
+    } 
+    { HBox34 HBox 
+      MoveScaled(0,30,66,4) 
+      Spacing = True 
+      Indent = True 
+      { Panel26 Panel 
+        MoveScaled(0,0,2,2.1429) 
+      } 
+      { Label41 Label 
+        MoveScaled(10,0,31,4) 
+        Expand = True 
+        Text = ("Prefix package with vendor name") 
+      } 
+      { cboPrefix ComboBox 
+        MoveScaled(49,0,14,4) 
+        ReadOnly = True 
+        List = [("No"), ("Yes")] 
+      } 
+    } 
     Index = 0
   }
 }
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to