/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/__init__.py

merged integration (Szilveszter)

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        self.window = self.toplevel.get_widget('window_main')
80
80
        
81
81
        self.pref = OlivePreferences()
 
82
        
 
83
        self.path = None
82
84
 
83
85
        # Initialize the statusbar
84
86
        self.statusbar = self.toplevel.get_widget('statusbar')
200
202
    def set_path(self, path):
201
203
        self.path = path
202
204
        self.notbranch = False
 
205
        
203
206
        try:
204
207
            self.wt, self.wtpath = WorkingTree.open_containing(self.path)
205
208
        except (errors.NotBranchError, errors.NoWorkingTree):
206
209
            self.notbranch = True
 
210
        
 
211
        self.statusbar.push(self.context_id, path)
207
212
 
208
213
    def get_path(self):
209
214
        return self.path
329
334
                    existing_bzrdir.create_workingtree()
330
335
        except errors.AlreadyBranchError, errmsg:
331
336
            error_dialog(_('Directory is already a branch'),
332
 
                                     _('The current directory (%s) is already a branch.\nYou can start using it, or initialize another directory.') % errmsg)
 
337
                         _('The current directory (%s) is already a branch.\nYou can start using it, or initialize another directory.') % errmsg)
333
338
        except errors.BranchExistsWithoutWorkingTree, errmsg:
334
339
            error_dialog(_('Branch without a working tree'),
335
 
                                     _('The current directory (%s)\nis a branch without a working tree.') % errmsg)
 
340
                         _('The current directory (%s)\nis a branch without a working tree.') % errmsg)
336
341
        else:
337
342
            info_dialog(_('Initialize successful'),
338
 
                                    _('Directory successfully initialized.'))
 
343
                        _('Directory successfully initialized.'))
339
344
            self.refresh_right()
340
345
        
341
346
    def on_menuitem_file_make_directory_activate(self, widget):
391
396
    def on_menuitem_view_show_hidden_files_activate(self, widget):
392
397
        """ View/Show hidden files menu handler. """
393
398
        self.pref.set_preference('dotted_files', widget.get_active())
 
399
        if self.path is not None:
 
400
            self.refresh_right()
394
401
 
395
402
    def on_treeview_left_button_press_event(self, widget, event):
396
403
        """ Occurs when somebody right-clicks in the bookmark list. """
441
448
                m_remove.set_sensitive(False)
442
449
                m_commit.set_sensitive(False)
443
450
                m_diff.set_sensitive(False)
 
451
 
444
452
            menu.right_context_menu().popup(None, None, None, 0,
445
453
                                            event.time)
446
454
        
472
480
        self.pref.set_preference('window_x', x)
473
481
        self.pref.set_preference('window_y', y)
474
482
        self.pref.set_preference('paned_position',
475
 
                                      self.hpaned_main.get_position())
 
483
                                 self.hpaned_main.get_position())
476
484
        
477
485
        self.pref.write()
478
486
        self.window_main.destroy()
919
927
 
920
928
    def set_preference(self, option, value):
921
929
        """ Set the value of the given option. """
 
930
        if value == True:
 
931
            value = 'yes'
 
932
        elif value == False:
 
933
            value = 'no'
 
934
        
922
935
        if self.config.has_section('preferences'):
923
936
            self.config.set('preferences', option, value)
924
937
        else:
932
945
        """
933
946
        if self.config.has_option('preferences', option):
934
947
            if kind == 'bool':
935
 
                #return self.config.getboolean('preferences', option)
936
 
                return True
 
948
                return self.config.getboolean('preferences', option)
937
949
            elif kind == 'int':
938
950
                return self.config.getint('preferences', option)
939
951
            elif kind == 'float':