Index: branch/k0p/umitGUI/ProfileManager.py
===================================================================
--- branch/k0p/umitGUI/ProfileManager.py (revision 894)
+++ branch/k0p/umitGUI/ProfileManager.py (revision 895)
@@ -30,5 +30,5 @@
 
 from umitGUI.Wizard import Wizard
-
+from umitCore.NmapCommand import CommandConstructor
 # Testing at devel 
 from os.path import split, join
@@ -101,4 +101,5 @@
 	self.cancel_button.connect("clicked", self.quit)
         self.ok_button = HIGButton(stock='gtk-ok')
+	self.ok_button.connect("clicked", self.apply_modifications)
 
     def __fill_widgets(self):
@@ -194,5 +195,32 @@
 	Copy selected Profile
 	"""
+
+
 	d = ProfileName(_("Insert a profile name"))
+	profile_name = d.run()
+	if profile_name == None:
+	    return None
+	#get commands of selected profile
+	profile_selected = self.get_selected_profile()
+	command = self.profiles.get_command(profile_selected)
+	hint = self.profiles.get_hint(profile_selected)
+	description = self.profiles.get_description(profile_selected)
+	annotation = self.profiles.get_annotation(profile_selected)
+	#Options???
+	prof = self.profiles.get_profile(profile_selected)
+	options_used = prof['options']
+	options = CommandConstructor(options_used)
+
+	self.profiles.add_profile(profile_name,\
+				  save = False,\
+				  command=command,\
+				  hint=hint,\
+				  description=description,\
+				  annotation=annotation,\
+				  options=options.get_options())
+	
+	myiter = self.model.insert_after(None, None)
+	self.model.set_value(myiter, 0, profile_name)
+	
 
     def delete_profile(self, widget=None):
@@ -206,24 +234,51 @@
 	model.remove(iter)	
 	
-	
-    
+    def _reload_profile_list(self):
+	"""
+	Reload a list of profiles
+	"""
+	
+	
+    
+    def apply_modifications(self, widget):
+	"""
+	Apply changes when clicked ok. Save based on treeview. 
+	"""
+	
+	self.profiles.save_changes()
+	
+	
+	
+	
     def quit(self, widget):
 	self.destroy()
-	
-class ProfileName:
+    
+	
+class ProfileName(HIGDialog):
     def __init__(self, text):
-	d = HIGDialog(title=_('Profile\'s Name'),
-		      buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
+	HIGDialog.__init__(self, _('Profile\'s Name'))
+
 	dialog_label = HIGDialogLabel(text)
 	dialog_label.show()
-	d.vbox.pack_start(dialog_label)
-
-	entry_text = HIGTextEntry()
-	entry_text.show()
-	d.vbox.pack_start(entry_text)
-	
-	d.run()
-	
-	d.destroy()
+	self.vbox.pack_start(dialog_label)
+	self.entry_text = HIGTextEntry()
+	self.entry_text.show()
+	self.vbox.pack_start(self.entry_text)
+	self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
+        self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
+    
+    def run(self):
+	"""
+	Returns text of entry
+	and None if someone clicked Cancel.
+	"""
+	text = None
+	response = HIGDialog.run(self)
+	text = self.entry_text.get_text()
+	if response==gtk.RESPONSE_CANCEL:
+	    text = None
+        self.destroy()
+	return text
+
         
 class ProfileChosse(HIGHBox):
