bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
#ifdef _WIN32 | #ifdef _WIN32 | 36,700 |
def optimal_graphs(target_type, source_groups, generators): """A 'simple generator' that produces the sequence of least-cost solutions for producing the target type from a subset of the source_groups, using the given generators. """ # An index from target type to lists of groups with that type. all_groups = {} # Prime... | def optimal_graphs(target_type, source_groups, generators): """A 'simple generator' that produces the sequence of least-cost solutions for producing the target type from a subset of the source_groups, using the given generators. """ # An index from target type to lists of groups with that type. all_groups = {} # Prime... | 36,701 |
def expand_filelist_and_load_image(self, inputlist): | def expand_filelist_and_load_image(self, inputlist): | 36,702 |
def expand_filelist_and_load_image(self, inputlist): | def expand_filelist_and_load_image(self, inputlist): | 36,703 |
def expand_filelist_and_load_image(self, inputlist): | def expand_filelist_and_load_image(self, inputlist): | 36,704 |
def do_image_list_stuff(self, first_image): if len(self.image_list) > 0: self.set_go_navigation_sensitivities() self.image_list = list(set(self.image_list)) self.image_list.sort(locale.strcoll) for itemnum in range(len(self.image_list)): if first_image == self.image_list[itemnum]: temp = self.image_list[0] self.image_l... | def do_image_list_stuff(self, first_image, second_image): if len(self.image_list) > 0: self.set_go_navigation_sensitivities() self.image_list = list(set(self.image_list)) self.image_list.sort(locale.strcoll) for itemnum in range(len(self.image_list)): if first_image == self.image_list[itemnum]: temp = self.image_list[0... | 36,705 |
def x_adjustment_changed(self, xadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = xadjust.get_value() * zoomratio + (self.available_image_width()) * (zoomratio - 1) / 2 if newvalue >= xadjust.lower and newvalue <= (xadjust.upper - xadjust.page_size): xadjust.set_value(newvalue) exc... | def x_adjustment_changed(self, xadjust): try: zoomratio = float(self.currimg_width)/self.previmg_width newvalue = abs(xadjust.get_value() * zoomratio + (self.available_image_width()) * (zoomratio - 1) / 2) if newvalue >= xadjust.lower and newvalue <= (xadjust.upper - xadjust.page_size): xadjust.set_value(newvalue) exce... | 36,706 |
def y_adjustment_changed(self, yadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = yadjust.get_value() * zoomratio + (self.available_image_height()) * (zoomratio - 1) / 2 if newvalue >= yadjust.lower and newvalue <= (yadjust.upper - yadjust.page_size): yadjust.set_value(newvalue) # ... | def y_adjustment_changed(self, yadjust): try: zoomratio = float(self.currimg_width)/self.previmg_width newvalue = abs(yadjust.get_value() * zoomratio + (self.available_image_height()) * (zoomratio - 1) / 2) if newvalue >= yadjust.lower and newvalue <= (yadjust.upper - yadjust.page_size): yadjust.set_value(newvalue) # S... | 36,707 |
def y_adjustment_changed(self, yadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = yadjust.get_value() * zoomratio + (self.available_image_height()) * (zoomratio - 1) / 2 if newvalue >= yadjust.lower and newvalue <= (yadjust.upper - yadjust.page_size): yadjust.set_value(newvalue) # ... | def y_adjustment_changed(self, yadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = yadjust.get_value() * zoomratio + (self.available_image_height()) * (zoomratio - 1) / 2 if newvalue >= yadjust.lower and newvalue <= (yadjust.upper - yadjust.page_size): yadjust.set_value(newvalue) # ... | 36,708 |
def window_resized(self, widget, allocation): # Update the image size on window resize if the current image was last fit: if self.image_loaded == True: if allocation.width != self.prevwinwidth or allocation.height != self.prevwinheight: if self.last_image_action_was_fit == True: if self.zoomratio != 1: self.zoom_to_fit... | def window_resized(self, widget, allocation): # Update the image size on window resize if the current image was last fit: if self.image_loaded == True: if allocation.width != self.prevwinwidth or allocation.height != self.prevwinheight: if self.last_image_action_was_fit == True and self.zoomratio != 1: self.zoom_to_fit... | 36,709 |
def __init__(self): | def __init__(self): | 36,710 |
def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: for i in range(len(self.image_list)): imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.parse_action_command... | def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: self.num_custom_actions = len(self.image_list) for i in range(self.num_custom_actions): self.curr_custom_action += 1 self.update_statusbar() while ... | 36,711 |
def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: for i in range(len(self.image_list)): imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.parse_action_command... | def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: for i in range(len(self.image_list)): imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.parse_action_command... | 36,712 |
def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: for i in range(len(self.image_list)): imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.parse_action_command... | def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: for i in range(len(self.image_list)): imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.parse_action_command... | 36,713 |
def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: for i in range(len(self.image_list)): imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.parse_action_command... | def parse_action_command(self, command, batchmode): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() if batchmode == True: for i in range(len(self.image_list)): imagename = self.image_list[i] self.parse_action_command2(command, imagename) else: self.parse_action_command... | 36,714 |
def update_statusbar(self): # Update status bar: try: st = os.stat(self.currimg_name) filesize = st[stat.ST_SIZE]/1000 ratio = int(100 * self.currimg_zoomratio) status_text = str(self.currimg_pixbuf_original.get_width()) + "x" + str(self.currimg_pixbuf_original.get_height()) + " " + str(filesize) + "KB " + str(rati... | def update_statusbar(self): # Update status bar: try: st = os.stat(self.currimg_name) filesize = st[stat.ST_SIZE]/1000 ratio = int(100 * self.currimg_zoomratio) status_text = str(self.currimg_pixbuf_original.get_width()) + "x" + str(self.currimg_pixbuf_original.get_height()) + " " + str(filesize) + "KB " + str(rati... | 36,715 |
def goto_prev_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave_image() if cancel == True: retu... | def goto_prev_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave_image() if cancel == True: retu... | 36,716 |
def goto_next_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave_image() if cancel == True: retu... | def goto_next_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave_image() if cancel == True: retu... | 36,717 |
def goto_random_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave_image() if cancel == True: re... | def goto_random_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave_image() if cancel == True: re... | 36,718 |
def goto_first_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1 and self.curr_img_in_list != 0: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave... | def goto_first_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1 and self.curr_img_in_list != 0: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass cancel = self.autosave... | 36,719 |
def goto_last_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1 and self.curr_img_in_list != len(self.image_list)-1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass ca... | def goto_last_image(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1 and self.curr_img_in_list != len(self.image_list)-1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_idle2) except: pass ca... | 36,720 |
def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, use_current_pixbuf_original, reset_cursor, perform_onload_action): # If use_current_pixbuf_original == True, do not reload the # self.currimg_pixbuf_original from the file; instead, use the existing # one. This is only currently useful for resizing imag... | def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, use_current_pixbuf_original, reset_cursor, perform_onload_action): # If use_current_pixbuf_original == True, do not reload the # self.currimg_pixbuf_original from the file; instead, use the existing # one. This is only currently useful for resizing imag... | 36,721 |
def __init__(self): | def __init__(self): | 36,722 |
def topwindow_keypress(self, widget, event): # For whatever reason, 'Left' and 'Right' cannot be used as menu # accelerators so we will manually check for them here: if event.state != gtk.gdk.SHIFT_MASK and event.state != gtk.gdk.CONTROL_MASK and event.state != gtk.gdk.MOD1_MASK and event.state != gtk.gdk.CONTROL_MASK ... | def topwindow_keypress(self, widget, event): # For whatever reason, 'Left' and 'Right' cannot be used as menu # accelerators so we will manually check for them here: if event.state != gtk.gdk.SHIFT_MASK and event.state != gtk.gdk.CONTROL_MASK and event.state != gtk.gdk.MOD1_MASK and event.state != gtk.gdk.CONTROL_MASK ... | 36,723 |
def open_folder(self, action): self.open_file_or_folder(action, False) | def open_folder(self, action): self.open_file_or_folder(action, False) | 36,724 |
def open_file_or_folder(self, action, isfile): # If isfile = True, file; If isfile = False, folder dialog = gtk.FileChooserDialog(title=_("Open"),action=gtk.FILE_CHOOSER_ACTION_OPEN,buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) if isfile == True: filter = gtk.FileFilter() filter.set_nam... | def open_file_or_folder(self, action, isfile): # If isfile = True, file; If isfile = False, folder dialog = gtk.FileChooserDialog(title=_("Open"),action=gtk.FILE_CHOOSER_ACTION_OPEN,buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) if isfile == True: filter = gtk.FileFilter() filter.set_nam... | 36,725 |
def delete_image(self, action): if len(self.image_list) > 0: temp_slideshow_mode = self.slideshow_mode if self.slideshow_mode == True: self.toggle_slideshow(None) delete_dialog = gtk.Dialog(_('Delete Image'), self.window, gtk.DIALOG_MODAL) if self.delete_without_prompt == False: permlabel = gtk.Label(_('Are you sure yo... | def delete_image(self, action): if len(self.image_list) > 0: temp_slideshow_mode = self.slideshow_mode if self.slideshow_mode == True: self.toggle_slideshow(None) delete_dialog = gtk.Dialog(_('Delete Image'), self.window, gtk.DIALOG_MODAL) if self.delete_without_prompt == False: permlabel = gtk.Label(_('Are you sure yo... | 36,726 |
def image_load_failed(self, reset_cursor): self.currimg_name = str(self.image_list[self.curr_img_in_list]) if self.verbose == True and self.currimg_name != "": print _("Loading:"), self.currimg_name self.set_window_title() self.put_error_image_to_window() self.image_loaded = False self.currimg_pixbuf_original = None if... | def image_load_failed(self, reset_cursor): self.currimg_name = str(self.image_list[self.curr_img_in_list]) if self.verbose == True and self.currimg_name != "": print _("Loading:"), self.currimg_name self.update_title() self.put_error_image_to_window() self.image_loaded = False self.currimg_pixbuf_original = None if res... | 36,727 |
def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, reset_cursor): # If there is a preloaded image available, use that instead of generating # a new one: if use_preloadimg_next == True and self.preloading_images == True: # Set current image as preload_prev_image self.preloadimg_prev_name = self.currimg_n... | def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, reset_cursor): # If there is a preloaded image available, use that instead of generating # a new one: if use_preloadimg_next == True and self.preloading_images == True: # Set current image as preload_prev_image self.preloadimg_prev_name = self.currimg_n... | 36,728 |
def expand_filelist_and_load_image(self, inputlist): self.images_found = 0 self.stop_now = True # Make sure that any previous search process is stopped # Takes the current list (i.e. ["pic.jpg", "pic2.gif", "../images"]) and # expands it into a list of all pictures found; returns new list self.change_cursor(gtk.gdk.Cur... | def expand_filelist_and_load_image(self, inputlist): self.images_found = 0 self.stop_now = True # Make sure that any previous search process is stopped # Takes the current list (i.e. ["pic.jpg", "pic2.gif", "../images"]) and # expands it into a list of all pictures found; returns new list self.change_cursor(gtk.gdk.Cur... | 36,729 |
def expand_directory(self, item, stop_when_image_found, go_buttons_enabled, update_title, print_found_msg): if self.stop_now == False and self.closing_app == False: folderlist = [] filelist = [] if os.access(item, os.R_OK) == False: return False for item2 in os.listdir(item): if item2[0] != '.' and self.closing_app == ... | def expand_directory(self, item, stop_when_image_found, go_buttons_enabled, update_window_title, print_found_msg): if self.stop_now == False and self.closing_app == False: folderlist = [] filelist = [] if os.access(item, os.R_OK) == False: return False for item2 in os.listdir(item): if item2[0] != '.' and self.closing_... | 36,730 |
def expand_directory(self, item, stop_when_image_found, go_buttons_enabled, update_title, print_found_msg): if self.stop_now == False and self.closing_app == False: folderlist = [] filelist = [] if os.access(item, os.R_OK) == False: return False for item2 in os.listdir(item): if item2[0] != '.' and self.closing_app == ... | def expand_directory(self, item, stop_when_image_found, go_buttons_enabled, update_title, print_found_msg): if self.stop_now == False and self.closing_app == False: folderlist = [] filelist = [] if os.access(item, os.R_OK) == False: return False for item2 in os.listdir(item): if item2[0] != '.' and self.closing_app == ... | 36,731 |
def expand_directory(self, item, stop_when_image_found, go_buttons_enabled, update_title, print_found_msg): if self.stop_now == False and self.closing_app == False: folderlist = [] filelist = [] if os.access(item, os.R_OK) == False: return False for item2 in os.listdir(item): if item2[0] != '.' and self.closing_app == ... | def expand_directory(self, item, stop_when_image_found, go_buttons_enabled, update_title, print_found_msg): if self.stop_now == False and self.closing_app == False: folderlist = [] filelist = [] if os.access(item, os.R_OK) == False: return False for item2 in os.listdir(item): if item2[0] != '.' and self.closing_app == ... | 36,732 |
def toggle_slideshow(self, action): if len(self.image_list) > 1: if self.slideshow_mode == False: if self.slideshow_in_fullscreen == True and self.fullscreen_mode == False: self.enter_fullscreen(None) self.slideshow_mode = True self.set_window_title() self.set_slideshow_sensitivities() if self.curr_slideshow_random == ... | def toggle_slideshow(self, action): if len(self.image_list) > 1: if self.slideshow_mode == False: if self.slideshow_in_fullscreen == True and self.fullscreen_mode == False: self.enter_fullscreen(None) self.slideshow_mode = True self.update_title() self.set_slideshow_sensitivities() if self.curr_slideshow_random == Fals... | 36,733 |
def toggle_slideshow(self, action): if len(self.image_list) > 1: if self.slideshow_mode == False: if self.slideshow_in_fullscreen == True and self.fullscreen_mode == False: self.enter_fullscreen(None) self.slideshow_mode = True self.set_window_title() self.set_slideshow_sensitivities() if self.curr_slideshow_random == ... | def toggle_slideshow(self, action): if len(self.image_list) > 1: if self.slideshow_mode == False: if self.slideshow_in_fullscreen == True and self.fullscreen_mode == False: self.enter_fullscreen(None) self.slideshow_mode = True self.update_title() self.set_slideshow_sensitivities() if self.curr_slideshow_random == Fals... | 36,734 |
def set_window_title(self): if len(self.image_list) == 0: self.window.set_title("Mirage") else: if self.slideshow_mode == True: self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name) + ' - ' + _('Slideshow Mode')) ... | def update_title(self): if len(self.image_list) == 0: self.window.set_title("Mirage") else: if self.slideshow_mode == True: self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name) + ' - ' + _('Slideshow Mode')) else... | 36,735 |
def set_window_title(self): if len(self.image_list) == 0: self.window.set_title("Mirage") else: if self.slideshow_mode == True: self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name) + ' - ' + _('Slideshow Mode')) ... | def set_window_title(self): if len(self.image_list) == 0: title = "Mirage" else: title = "Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name) if self.slideshow_mode == True: self.window.set_title("Mirage - [" + str(self.curr_img_in_li... | 36,736 |
def set_window_title(self): if len(self.image_list) == 0: self.window.set_title("Mirage") else: if self.slideshow_mode == True: self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name) + ' - ' + _('Slideshow Mode')) ... | def set_window_title(self): if len(self.image_list) == 0: self.window.set_title("Mirage") else: if self.slideshow_mode == True: self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name) + ' - ' + _('Slideshow Mode')) ... | 36,737 |
def __init__(self): | def __init__(self): | 36,738 |
def __init__(self): | def __init__(self): | 36,739 |
def __init__(self): | def __init__(self): | 36,740 |
def save_image_as(self, action): dialog = gtk.FileChooserDialog(title=_("Save As"),action=gtk.FILE_CHOOSER_ACTION_SAVE,buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_SAVE,gtk.RESPONSE_OK)) dialog.set_default_response(gtk.RESPONSE_OK) filename = os.path.basename(self.currimg_name) filetype = None dialog.set_cur... | def save_image_as(self, action): dialog = gtk.FileChooserDialog(title=_("Save As"),action=gtk.FILE_CHOOSER_ACTION_SAVE,buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_SAVE,gtk.RESPONSE_OK)) dialog.set_default_response(gtk.RESPONSE_OK) filename = os.path.basename(self.currimg_name) filetype = None dialog.set_cur... | 36,741 |
def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(_("Mirage Preferences"), self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') + '</b>') bgl... | def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(_("Mirage Preferences"), self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') + '</b>') bgl... | 36,742 |
def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(_("Mirage Preferences"), self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') + '</b>') bgl... | def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(_("Mirage Preferences"), self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') + '</b>') bgl... | 36,743 |
def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(_("Mirage Preferences"), self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') + '</b>') bgl... | def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(_("Mirage Preferences"), self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') + '</b>') bgl... | 36,744 |
def expand_filelist_and_load_image(self, inputlist): | def expand_filelist_and_load_image(self, inputlist): | 36,745 |
def __init__(self): | def __init__(self): | 36,746 |
def __init__(self): | def __init__(self): | 36,747 |
def set_zoom_sensitivities(self): if self.currimg_is_animation == False: if self.currimg_zoomratio < self.min_zoomratio * self.zoomratio_for_zoom_to_fit: self.set_zoom_out_sensitivities(False) else: self.set_zoom_out_sensitivities(True) if self.currimg_zoomratio > self.max_zoomratio * self.zoomratio_for_zoom_to_fit: se... | def set_zoom_sensitivities(self): if self.currimg_is_animation == False: self.set_zoom_out_sensitivities(True) self.set_zoom_in_sensitivities(True) else: self.set_zoom_out_sensitivities(False) self.set_zoom_in_sensitivities(False) | 36,748 |
def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(title=_("Mirage Preferences"), parent=self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') ... | def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(title=_("Mirage Preferences"), parent=self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') ... | 36,749 |
def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(title=_("Mirage Preferences"), parent=self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') ... | def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(title=_("Mirage Preferences"), parent=self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # "Interface" prefs: table_settings = gtk.Table(13, 3, False) bglabel = gtk.Label() bglabel.set_markup('<b>' + _('Interface') ... | 36,750 |
def zoom_to_fit_or_1_to_1(self, action, is_preloadimg_next, is_preloadimg_prev): if is_preloadimg_next == True: if self.preloading_images == True and self.preloadimg_next_pixbuf_original != None: win_width = self.available_image_width() win_height = self.available_image_height() preimg_width = self.preloadimg_next_pixb... | def zoom_to_fit_or_1_to_1(self, action, is_preloadimg_next, is_preloadimg_prev): if is_preloadimg_next == True: if self.preloading_images == True and self.preloadimg_next_pixbuf_original != None: win_width = self.available_image_width() win_height = self.available_image_height() preimg_width = self.preloadimg_next_pixb... | 36,751 |
def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, use_current_pixbuf_original, reset_cursor, perform_onload_action): # If use_current_pixbuf_original == True, do not reload the # self.currimg_pixbuf_original from the file; instead, use the existing # one. This is only currently useful for resizing imag... | def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, use_current_pixbuf_original, reset_cursor, perform_onload_action): # If use_current_pixbuf_original == True, do not reload the # self.currimg_pixbuf_original from the file; instead, use the existing # one. This is only currently useful for resizing imag... | 36,752 |
def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, use_current_pixbuf_original, reset_cursor, perform_onload_action): # If use_current_pixbuf_original == True, do not reload the # self.currimg_pixbuf_original from the file; instead, use the existing # one. This is only currently useful for resizing imag... | def load_new_image(self, use_preloadimg_next, use_preloadimg_prev, use_current_pixbuf_original, reset_cursor, perform_onload_action): # If use_current_pixbuf_original == True, do not reload the # self.currimg_pixbuf_original from the file; instead, use the existing # one. This is only currently useful for resizing imag... | 36,753 |
def expand_filelist_and_load_image(self, inputlist): # Takes the current list (i.e. ["pic.jpg", "pic2.gif", "../images"]) and # expands it into a list of all pictures found self.images_found = 0 self.stop_now = True # Make sure that any previous search process is stopped self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)... | def expand_filelist_and_load_image(self, inputlist): # Takes the current list (i.e. ["pic.jpg", "pic2.gif", "../images"]) and # expands it into a list of all pictures found self.images_found = 0 self.stop_now = True # Make sure that any previous search process is stopped self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)... | 36,754 |
def __init__(self): | def __init__(self): | 36,755 |
def window_resized(self, widget, allocation): # Update the image size on window resize if the current image was last fit: if self.image_loaded == True and self.last_image_action_was_fit == True: if allocation.width != self.prevwinwidth or allocation.height != self.prevwinheight: if self.zoomratio != 1: print "window re... | def window_resized(self, widget, allocation): # Update the image size on window resize if the current image was last fit: if self.image_loaded == True: if allocation.width != self.prevwinwidth or allocation.height != self.prevwinheight: if self.zoomratio != 1: print "window resized" self.zoom_to_fit_window(None) self.p... | 36,756 |
def window_resized(self, widget, allocation): # Update the image size on window resize if the current image was last fit: if self.image_loaded == True and self.last_image_action_was_fit == True: if allocation.width != self.prevwinwidth or allocation.height != self.prevwinheight: if self.zoomratio != 1: print "window re... | def window_resized(self, widget, allocation): # Update the image size on window resize if the current image was last fit: if self.image_loaded == True and self.last_image_action_was_fit == True: if allocation.width != self.prevwinwidth or allocation.height != self.prevwinheight: if self.last_image_action_was_fit == Tru... | 36,757 |
def toggle_fullscreen(self, action): if self.fullscreen_mode == True: self.fullscreen_mode = False self.UIManager.get_widget('/Popup/FM4').hide() self.UIManager.get_widget('/Popup/Exit Full Screen').hide() self.window.unfullscreen() if self.toolbar_show == True: self.toolbar.show() self.menubar.show() if self.statusbar... | def toggle_fullscreen(self, action): if self.fullscreen_mode == True: self.fullscreen_mode = False self.UIManager.get_widget('/Popup/FM4').hide() self.UIManager.get_widget('/Popup/Exit Full Screen').hide() self.window.unfullscreen() if self.toolbar_show == True: self.toolbar.show() self.menubar.show() if self.statusbar... | 36,758 |
def __init__(self): | def __init__(self): | 36,759 |
def topwindow_keypress(self, widget, event): if event.state != gtk.gdk.SHIFT_MASK and event.state != gtk.gdk.CONTROL_MASK and event.state != gtk.gdk.MOD1_MASK and event.state != gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK: if event.keyval == 65361: # Left arrow self.prev_img_in_list(None) elif event.keyval == 65363: #... | def topwindow_keypress(self, widget, event): if event.state != gtk.gdk.SHIFT_MASK and event.state != gtk.gdk.CONTROL_MASK and event.state != gtk.gdk.MOD1_MASK and event.state != gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK: if event.keyval == 65361: # Left arrow self.prev_img_in_list(None) elif event.keyval == 65363 or ... | 36,760 |
def x_adjustment_changed(self, xadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = xadjust.get_value() * zoomratio + (self.available_image_width() - 20) * (zoomratio - 1) / 2 if newvalue >= xadjust.lower and newvalue <= (xadjust.upper - xadjust.page_size): xadjust.set_value(newvalue... | def x_adjustment_changed(self, xadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = xadjust.get_value() * zoomratio + (self.available_image_width()) * (zoomratio - 1) / 2 if newvalue >= xadjust.lower and newvalue <= (xadjust.upper - xadjust.page_size): xadjust.set_value(newvalue) exc... | 36,761 |
def y_adjustment_changed(self, yadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = yadjust.get_value() * zoomratio + (self.available_image_height() - 20) * (zoomratio - 1) / 2 if newvalue >= yadjust.lower and newvalue <= (yadjust.upper - yadjust.page_size): yadjust.set_value(newvalu... | def y_adjustment_changed(self, yadjust): try: zoomratio = float(self.currimg.get_width())/self.previmg_width newvalue = yadjust.get_value() * zoomratio + (self.available_image_height()) * (zoomratio - 1) / 2 if newvalue >= yadjust.lower and newvalue <= (yadjust.upper - yadjust.page_size): yadjust.set_value(newvalue) # ... | 36,762 |
def put_zoom_image_to_window(self): previmg = self.currimg # Always start with the original image to preserve quality! # Calculate image size: finalimg_width = int(self.originalimg.get_width() * self.zoomratio) finalimg_height = int(self.originalimg.get_height() * self.zoomratio) # If self.zoomratio < 1, scale first so... | def put_zoom_image_to_window(self): previmg = self.currimg # Always start with the original image to preserve quality! # Calculate image size: finalimg_width = int(self.originalimg.get_width() * self.zoomratio) finalimg_height = int(self.originalimg.get_height() * self.zoomratio) # If self.zoomratio < 1, scale first so... | 36,763 |
def put_zoom_image_to_window(self): previmg = self.currimg # Always start with the original image to preserve quality! # Calculate image size: finalimg_width = int(self.originalimg.get_width() * self.zoomratio) finalimg_height = int(self.originalimg.get_height() * self.zoomratio) # If self.zoomratio < 1, scale first so... | def put_zoom_image_to_window(self): previmg = self.currimg # Always start with the original image to preserve quality! # Calculate image size: finalimg_width = int(self.originalimg.get_width() * self.zoomratio) finalimg_height = int(self.originalimg.get_height() * self.zoomratio) # If self.zoomratio < 1, scale first so... | 36,764 |
def center_image(self, width, height): if width == 0: width = self.imageview.size_request()[0] if height == 0: height = self.imageview.size_request()[1] while gtk.events_pending(): gtk.main_iteration() x_shift = int((self.available_image_width() - width)/2) if x_shift < 0: x_shift = 0 y_shift = int((self.available_imag... | def center_image(self, width, height): if width == 0: width = self.imageview.size_request()[0] if height == 0: height = self.imageview.size_request()[1] while gtk.events_pending(): gtk.main_iteration() x_shift = int((self.available_image_width() - width)/2) if x_shift < 0: x_shift = 0 y_shift = int((self.available_imag... | 36,765 |
def center_image(self, width, height): if width == 0: width = self.imageview.size_request()[0] if height == 0: height = self.imageview.size_request()[1] while gtk.events_pending(): gtk.main_iteration() x_shift = int((self.available_image_width() - width)/2) if x_shift < 0: x_shift = 0 y_shift = int((self.available_imag... | def center_image(self, width, height): if width == 0: width = self.imageview.size_request()[0] if height == 0: height = self.imageview.size_request()[1] while gtk.events_pending(): gtk.main_iteration() x_shift = int((self.available_image_width() - width)/2) if x_shift < 0: x_shift = 0 y_shift = int((self.available_imag... | 36,766 |
def toggle_fullscreen(self, action): if self.fullscreen_mode == True: self.fullscreen_mode = False self.UIManager.get_widget('/Popup/FM4').hide() self.UIManager.get_widget('/Popup/Exit Full Screen').hide() self.window.unfullscreen() if self.toolbar_show == True: self.toolbar.show() self.menubar.show() if self.statusbar... | def toggle_fullscreen(self, action): if self.fullscreen_mode == True: self.fullscreen_mode = False self.UIManager.get_widget('/Popup/FM4').hide() self.UIManager.get_widget('/Popup/Exit Full Screen').hide() self.window.unfullscreen() if self.toolbar_show == True: self.toolbar.show() self.menubar.show() if self.statusbar... | 36,767 |
def mouse_moved(self, widget, event): | def mouse_moved(self, widget, event): | 36,768 |
def mouse_moved(self, widget, event): | def mouse_moved(self, widget, event): | 36,769 |
def mouse_moved(self, widget, event): | defmouse_moved(self,widget,event): | 36,770 |
def mouse_moved(self, widget, event): | def mouse_moved(self, widget, event): | 36,771 |
def button_pressed(self, widget, event): # Changes the cursor to the 'resize' cursor, like GIMP, on a middle click: if event.button == 2 or event.button == 1: self.layout.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR)) self.prevmousex = event.x self.prevmousey = event.y # Right-click popup: elif self.image_loaded == T... | def button_pressed(self, widget, event): # Changes the cursor to the 'resize' cursor, like GIMP, on a middle click: if event.button == 2 or event.button == 1: self.layout.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR)) self.prevmousex = event.x_root self.prevmousey = event.y_root # Right-click popup: elif self.image_l... | 36,772 |
def rotate_left(self, action): if self.userimage != "": self.last_image_action_was_fit = False if self.orientation == 0: self.orientation = 1 else: self.orientation = 0 self.location -= 1 if self.location == -1: self.location = 3 self.currimg = self.image_rotate(self.currimg, 90) self.imageview.set_from_pixbuf(self.cur... | def rotate_left(self, action): if self.userimage != "": self.last_image_action_was_fit = False if self.orientation == 0: self.orientation = 1 else: self.orientation = 0 self.location -= 1 if self.location == -1: self.location = 3 self.currimg = self.image_rotate(self.currimg, 90) self.imageview.set_from_pixbuf(self.cur... | 36,773 |
def rotate_right(self, action): if self.userimage != "": self.last_image_action_was_fit = False if self.orientation == 0: self.orientation = 1 else: self.orientation = 0 self.location += 1 if self.location == 4: self.location = 0 self.currimg = self.image_rotate(self.currimg, 270) self.imageview.set_from_pixbuf(self.cu... | def rotate_right(self, action): if self.userimage != "": self.last_image_action_was_fit = False if self.orientation == 0: self.orientation = 1 else: self.orientation = 0 self.location += 1 if self.location == 4: self.location = 0 self.currimg = self.image_rotate(self.currimg, 270) self.imageview.set_from_pixbuf(self.cu... | 36,774 |
def __init__(self): | def __init__(self): | 36,775 |
def __init__(self): | def __init__(self): | 36,776 |
def __init__(self): | def __init__(self): | 36,777 |
def __init__(self): | def __init__(self): | 36,778 |
def __init__(self): | def __init__(self): | 36,779 |
def __init__(self): | def __init__(self): | 36,780 |
def __init__(self): | def __init__(self): | 36,781 |
def __init__(self): | def __init__(self): | 36,782 |
def __init__(self): | def __init__(self): | 36,783 |
def __init__(self): | def __init__(self): | 36,784 |
def __init__(self): | def __init__(self): | 36,785 |
def __init__(self): | def __init__(self): | 36,786 |
def __init__(self): | def __init__(self): | 36,787 |
def __init__(self): | def __init__(self): | 36,788 |
def __init__(self): | def __init__(self): | 36,789 |
def __init__(self): | def __init__(self): | 36,790 |
def __init__(self): | def __init__(self): | 36,791 |
def __init__(self): | def __init__(self): | 36,792 |
def __init__(self): | def __init__(self): | 36,793 |
def __init__(self): | def __init__(self): | 36,794 |
def __init__(self): | def __init__(self): | 36,795 |
def __init__(self): | def __init__(self): | 36,796 |
def __init__(self): | def __init__(self): | 36,797 |
def __init__(self): | def __init__(self): | 36,798 |
def __init__(self): | def __init__(self): | 36,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.