Changeset 5535

Show
Ignore:
Timestamp:
02/16/10 19:52:18 (6 months ago)
Author:
nopper
Message:

Fixes for #374

Location:
trunk/umit
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/umit/core/UmitConf.py

    r5229 r5535  
    199199            self.add_section(profile_name) 
    200200        except DuplicateSectionError: 
     201            return None 
     202        except ValueError: 
    201203            return None 
    202204 
  • trunk/umit/gui/ProfileEditor.py

    r5147 r5535  
    243243    def save_profile(self, widget): 
    244244        profile_name = self.profile_name_entry.get_text() 
     245 
    245246        if profile_name == '': 
    246247            alert = HIGAlertDialog(message_format=_('Unnamed profile'),\ 
    247248                                   secondary_text=_('You must provide a name \ 
    248249for this profile.')) 
     250 
     251        elif profile_name.lower() == 'default': 
     252            alert = HIGAlertDialog(message_format=_('Reserved profile name'),\ 
     253                                   secondary_text=_('Cannot assign "default" \ 
     254name to this profile. Please rename it and retry.')) 
     255        else: 
     256            alert = None 
     257 
     258        if alert: 
    249259            alert.run() 
    250260            alert.destroy() 
  • trunk/umit/gui/Wizard.py

    r4789 r5535  
    263263     
    264264    def profile_forward(self, widget): 
    265         if self.directions['Profile'].profile_entry.get_text() == '': 
     265        profile_name = self.directions['Profile'].profile_entry.get_text() 
     266 
     267        if not profile_name: 
    266268            alert = HIGAlertDialog(message_format=_('Unnamed profile'),\ 
    267269                                   secondary_text=_('You must provide a name \ 
    268270for this profile.')) 
     271        elif profile_name.lower() == 'default': 
     272            alert = HIGAlertDialog(message_format=_('Reserved profile name'),\ 
     273                                   secondary_text=_('Cannot assign "default" \ 
     274name to this profile. Please rename it and retry.')) 
     275        else: 
     276            alert = None 
     277 
     278        if alert: 
     279 
    269280            alert.run() 
    270281            alert.destroy() 
    271              
     282 
    272283            self.directions['Profile'].profile_entry.grab_focus() 
    273              
     284 
    274285            return None 
    275          
     286 
    276287        self.main_vbox.remove(self.directions['Profile']) 
    277288        self.main_vbox._pack_expand_fill(self.directions['Command']) 
     
    349360            annotation = buffer.get_text(buffer.get_start_iter(),\ 
    350361                                          buffer.get_end_iter()) 
     362 
    351363            self.profile.add_profile(profile_name,\ 
    352364                                     command=command,\