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,
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 }
102
"on_treeview_left_row_activated": handler.on_treeview_left_row_activated }
130
104
# Connect the signals to the handlers
131
105
self.toplevel.signal_autoconnect(dic)
151
125
# Show drive selector if under Win32
152
126
if sys.platform == 'win32':
127
self.comm.vbox_main_right.pack_start(self.comm.combobox_drive, False, True, 0)
128
self.comm.vbox_main_right.reorder_child(self.comm.combobox_drive, 0)
129
self.comm.combobox_drive.show()
153
130
self.comm.gen_hard_selector()
154
self.comm.optionmenu_drive.show()
156
132
# Load default data into the panels
157
133
self.treeview_left = self.toplevel.get_widget('treeview_left')
365
341
self.toolbutton_pull = self.toplevel.get_widget('toolbutton_pull')
366
342
self.toolbutton_push = self.toplevel.get_widget('toolbutton_push')
367
343
# Get the drive selector
368
self.optionmenu_drive = self.toplevel.get_widget('optionmenu_drive')
344
self.combobox_drive = gtk.combo_box_new_text()
345
self.combobox_drive.connect("changed", self._refresh_drives)
347
self.vbox_main_right = self.toplevel.get_widget('vbox_main_right')
370
349
def set_path(self, path):
371
350
""" Set the current path while browsing the directories. """
566
545
driveletters = []
567
546
for drive in string.ascii_uppercase:
568
if win32file.GetDriveType(drive) == win32file.DRIVE_FIXED:
569
driveletters.append(drive)
547
if win32file.GetDriveType(drive+':') == win32file.DRIVE_FIXED:
548
driveletters.append(drive+':')
570
549
return driveletters
572
551
def gen_hard_selector(self):
573
552
""" 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()
553
drives = self._harddisks()
555
self.combobox_drive.append_text(drive)
557
def _refresh_drives(self, combobox):
558
model = combobox.get_model()
559
active = combobox.get_active()
561
drive = model[active][0]
562
self.refresh_right(drive + '\\')
580
564
class OlivePreferences:
581
565
""" A class which handles Olive's preferences. """