Changeset 9005

Show
Ignore:
Timestamp:
11/17/07 16:03:02 (13 months ago)
Author:
baron
Message:

Fixed a bug with forcing autodetection of browser/mail during startup when the
config file already existed and had a different option choosen. Added in an
'Always use OS/X default applications' option for when running on OS/X. Changed
the custom defaults to use OS/X native applications.

Location:
trunk/src
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/config.py

    r8972 r9005  
    5454        if sys.platform == 'darwin': 
    5555                DEFAULT_OPENWITH = 'open' 
    56                 DEFAULT_BROWSER = 'open -a firefox' 
    57                 DEFAULT_MAILAPP = 'open -a thunderbird' 
    58                 DEFAULT_FILE_MANAGER = 'open' 
     56                DEFAULT_BROWSER = 'open -a Safari' 
     57                DEFAULT_MAILAPP = 'open -a Mail' 
     58                DEFAULT_FILE_MANAGER = 'open -a Finder' 
    5959        else: 
    6060                DEFAULT_OPENWITH = 'gnome-open' 
  • trunk/src/common/helpers.py

    r8972 r9005  
    430430                elif gajim.config.get('openwith') == 'exo-open': 
    431431                        command = 'exo-open' 
     432                elif ((sys.platform == 'darwin') and 
     433                          (gajim.config.get('openwith') == 'open')): 
     434                        command = 'open' 
    432435                elif gajim.config.get('openwith') == 'custom': 
    433436                        if kind == 'url': 
     
    457460                elif gajim.config.get('openwith') == 'exo-open': 
    458461                        command = 'exo-open' 
     462                elif ((sys.platform == 'darwin') and 
     463                          (gajim.config.get('openwith') == 'open')): 
     464                        command = 'open' 
    459465                elif gajim.config.get('openwith') == 'custom': 
    460466                        command = gajim.config.get('custom_file_manager') 
  • trunk/src/common/optparser.py

    r8931 r9005  
    6464                                #we talk about a file 
    6565                                print _('error: cannot open %s for reading') % self.__filename 
    66                         return 
     66                        return False 
    6767 
    6868                new_version = gajim.config.get('version') 
     
    8181 
    8282                fd.close() 
     83                return True 
    8384 
    8485        def write_line(self, fd, opt, parents, value): 
  • trunk/src/config.py

    r8972 r9005  
    400400 
    401401                        if sys.platform == 'darwin': 
     402                                self.applications_combobox.remove_text(4) 
    402403                                self.applications_combobox.remove_text(3) 
    403404                                self.applications_combobox.remove_text(2) 
    404405                                self.applications_combobox.remove_text(1) 
     406                                self.applications_combobox.append_text("Always use OS/X default applications") 
     407                                self.applications_combobox.append_text("Custom") 
    405408 
    406409                        if gajim.config.get('autodetect_browser_mailer'): 
     
    413416                                self.applications_combobox.set_active(2) 
    414417                        elif gajim.config.get('openwith') == 'exo-open': 
    415                                 self.applications_combobox.set_active(3)                                 
     418                                self.applications_combobox.set_active(3) 
     419                        elif ((sys.platform == 'darwin') and 
     420                                  (gajim.config.get('openwith') == 'open')): 
     421                                self.applications_combobox.set_active(1) 
    416422                        elif gajim.config.get('openwith') == 'custom': 
    417423                                if sys.platform == 'darwin': 
    418                                         self.applications_combobox.set_active(1) 
     424                                        self.applications_combobox.set_active(2) 
    419425                                else: 
    420426                                        self.applications_combobox.set_active(4) 
     
    913919                                self.xml.get_widget('custom_apps_frame').hide() 
    914920                        elif widget.get_active() == 1: 
     921                                self.xml.get_widget('custom_apps_frame').hide() 
     922                                gajim.config.set('openwith', 'open') 
     923                        elif widget.get_active() == 2: 
    915924                                self.xml.get_widget('custom_apps_frame').show() 
    916925                                gajim.config.set('openwith', 'custom') 
  • trunk/src/gajim.py

    r8993 r9005  
    25862586                } 
    25872587 
    2588                 parser.read() 
     2588                cfg_was_read = parser.read() 
    25892589                # Do not set gajim.verbose to False if -v option was given 
    25902590                if gajim.config.get('verbose'): 
     
    26302630                                                theme[d.index(o)]) 
    26312631                         
    2632                 if gajim.config.get('autodetect_browser_mailer') or \ 
    2633                 len(gajim.connections) == 0: 
     2632                if gajim.config.get('autodetect_browser_mailer') or not cfg_was_read: 
    26342633                        gtkgui_helpers.autodetect_browser_mailer() 
    26352634 
  • trunk/src/gtkgui_helpers.py

    r8927 r9005  
    187187        elif user_runs_xfce(): 
    188188                gajim.config.set('openwith', 'exo-open') 
     189        elif user_runs_osx(): 
     190                gajim.config.set('openwith', 'open') 
    189191        else: 
    190192                gajim.config.set('openwith', 'custom') 
     
    201203                return True 
    202204        return False 
     205 
     206def user_runs_osx(): 
     207        return sys.platform == 'darwin' 
    203208 
    204209def get_running_processes():