/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/frontend/gtk/__init__.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-11 02:04:11 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060911020411-8195205657edb791
Implemented drive selector for Win32 platforms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
                "on_treeview_right_button_press_event": handler.on_treeview_right_button_press_event,
100
100
                "on_treeview_right_row_activated": handler.on_treeview_right_row_activated,
101
101
                "on_treeview_left_button_press_event": handler.on_treeview_left_button_press_event,
102
 
                "on_treeview_left_row_activated": handler.on_treeview_left_row_activated }
 
102
                "on_treeview_left_row_activated": handler.on_treeview_left_row_activated,
 
103
                "on_drive_a_activate": handler.on_drive_activate,
 
104
                "on_drive_b_activate": handler.on_drive_activate,
 
105
                "on_drive_c_activate": handler.on_drive_activate,
 
106
                "on_drive_d_activate": handler.on_drive_activate,
 
107
                "on_drive_e_activate": handler.on_drive_activate,
 
108
                "on_drive_f_activate": handler.on_drive_activate,
 
109
                "on_drive_g_activate": handler.on_drive_activate,
 
110
                "on_drive_h_activate": handler.on_drive_activate,
 
111
                "on_drive_i_activate": handler.on_drive_activate,
 
112
                "on_drive_j_activate": handler.on_drive_activate,
 
113
                "on_drive_k_activate": handler.on_drive_activate,
 
114
                "on_drive_l_activate": handler.on_drive_activate,
 
115
                "on_drive_m_activate": handler.on_drive_activate,
 
116
                "on_drive_n_activate": handler.on_drive_activate,
 
117
                "on_drive_o_activate": handler.on_drive_activate,
 
118
                "on_drive_p_activate": handler.on_drive_activate,
 
119
                "on_drive_q_activate": handler.on_drive_activate,
 
120
                "on_drive_r_activate": handler.on_drive_activate,
 
121
                "on_drive_s_activate": handler.on_drive_activate,
 
122
                "on_drive_t_activate": handler.on_drive_activate,
 
123
                "on_drive_u_activate": handler.on_drive_activate,
 
124
                "on_drive_v_activate": handler.on_drive_activate,
 
125
                "on_drive_w_activate": handler.on_drive_activate,
 
126
                "on_drive_x_activate": handler.on_drive_activate,
 
127
                "on_drive_y_activate": handler.on_drive_activate,
 
128
                "on_drive_z_activate": handler.on_drive_activate }
103
129
        
104
130
        # Connect the signals to the handlers
105
131
        self.toplevel.signal_autoconnect(dic)
120
146
        #menubutton.set_menu(handler.menu.toolbar_diff)
121
147
        
122
148
        # Now we can show the window
123
 
        self.window.show_all()
 
149
        self.window.show()
 
150
        
 
151
        # Show drive selector if under Win32
 
152
        if sys.platform == 'win32':
 
153
            self.comm.gen_hard_selector()
 
154
            self.comm.optionmenu_drive.show()
124
155
        
125
156
        # Load default data into the panels
126
157
        self.treeview_left = self.toplevel.get_widget('treeview_left')
333
364
        self.toolbutton_commit = self.toplevel.get_widget('toolbutton_commit')
334
365
        self.toolbutton_pull = self.toplevel.get_widget('toolbutton_pull')
335
366
        self.toolbutton_push = self.toplevel.get_widget('toolbutton_push')
 
367
        # Get the drive selector
 
368
        self.optionmenu_drive = self.toplevel.get_widget('optionmenu_drive')
336
369
    
337
370
    def set_path(self, path):
338
371
        """ Set the current path while browsing the directories. """
518
551
 
519
552
        gtk.main_iteration(0)
520
553
 
521
 
    def harddisks():
 
554
    def harddisks(self):
522
555
        """ Returns hard drive letters under Win32. """
523
556
        try:
524
557
            import win32file
532
565
        
533
566
        driveletters = []
534
567
        for drive in string.ascii_uppercase:
535
 
            if win32file.GetDriveType(drive+":") == win32file.DRIVE_FIXED:
536
 
                driveletters.append(drive+":")
 
568
            if win32file.GetDriveType(drive) == win32file.DRIVE_FIXED:
 
569
                driveletters.append(drive)
537
570
        return driveletters
 
571
    
 
572
    def gen_hard_selector(self):
 
573
        """ Generate the hard drive selector under Win32. """
 
574
        import string
 
575
        drives = self.harddisks()
 
576
        for drive in string.ascii_uppercase:
 
577
            if drive not in drives:
 
578
                self.toplevel.get_widget(drive).destroy()
538
579
 
539
580
class OlivePreferences:
540
581
    """ A class which handles Olive's preferences. """