Changeset 4931

Show
Ignore:
Timestamp:
06/28/09 01:38:54 (4 years ago)
Author:
luis
Message:

Fixed #331 - Permission denied writing umit config file

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/umit/gui/MainWindow.py

    r4789 r4931  
    5757from umit.gui.Help import show_help 
    5858 
    59 from umit.core.Paths import Path 
     59from umit.core.Paths import Path, check_access 
    6060from umit.core.RecentScans import recent_scans 
    6161from umit.core.UmitLogging import log 
     
    119119        self._create_toolbar() 
    120120        self._create_scan_notebook() 
     121        self._verify_access_write() 
    121122        self._verify_root() 
    122123 
     
    144145        if not root: 
    145146            non_root = NonRootWarning() 
     147             
     148    def _verify_access_write(self): 
     149        if (not check_access(Path.config_file, os.R_OK and os.W_OK )): 
     150            error_text = _('''You do not have access to config files!\nPlease run Umit as root or change permissions %s  
     151            ''' % Path.config_dir) 
     152 
     153            d = HIGAlertDialog(message_format=_('Permission Denied'), 
     154                                secondary_text=error_text) 
     155            d.run() 
     156            sys.exit(0) 
    146157             
    147158    def _get_running_ni(self):