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 }
104
130
# Connect the signals to the handlers
105
131
self.toplevel.signal_autoconnect(dic)
120
146
#menubutton.set_menu(handler.menu.toolbar_diff)
122
148
# Now we can show the window
123
self.window.show_all()
151
# Show drive selector if under Win32
152
if sys.platform == 'win32':
153
self.comm.gen_hard_selector()
154
self.comm.optionmenu_drive.show()
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')
337
370
def set_path(self, path):
338
371
""" Set the current path while browsing the directories. """
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
572
def gen_hard_selector(self):
573
""" Generate the hard drive selector under Win32. """
575
drives = self.harddisks()
576
for drive in string.ascii_uppercase:
577
if drive not in drives:
578
self.toplevel.get_widget(drive).destroy()
539
580
class OlivePreferences:
540
581
""" A class which handles Olive's preferences. """