rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
return
if self.fullscreen_mode == True: self.change_cursor(None) dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, "You are viewing the last image in the list. Wrap around to the first image?") dialog.set_default_response(gtk.RESPONSE_YES) self.user_prompt_visible = True respo...
def next_img_in_list(self, action): if len(self.image_list) > 1: self.randomlist = [] if self.curr_img_in_list < len(self.image_list) - 1: self.curr_img_in_list += 1 else: if self.listwrap == True: self.curr_img_in_list = 0 else: return if self.fullscreen_mode == False: self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))...
if self.curr_img_in_list == 0: if self.listwrap == False:
if self.image_loaded == False or len(self.image_list) == 1: self.set_previous_image_sensitivities(False) self.set_first_image_sensitivities(False) self.set_next_image_sensitivities(False) self.set_last_image_sensitivities(False) elif self.curr_img_in_list == 0: if self.listwrap_mode == 0:
def set_go_navigation_sensitivities(self): if self.curr_img_in_list == 0: if self.listwrap == False: self.set_previous_image_sensitivities(False) else: self.set_previous_image_sensitivities(True) self.set_first_image_sensitivities(False) self.set_next_image_sensitivities(True) self.set_last_image_sensitivities(True) el...
if self.listwrap == False:
if self.listwrap_mode == 0:
def set_go_navigation_sensitivities(self): if self.curr_img_in_list == 0: if self.listwrap == False: self.set_previous_image_sensitivities(False) else: self.set_previous_image_sensitivities(True) self.set_first_image_sensitivities(False) self.set_next_image_sensitivities(True) self.set_last_image_sensitivities(True) el...
if i.get_window_type() != gtk.gdk.WINDOW_TEMP:
if i.get_window_type() != gtk.gdk.WINDOW_TEMP and i.get_window_type() != gtk.gdk.WINDOW_CHILD:
def change_cursor(self, type): for i in gtk.gdk.window_get_toplevels(): if i.get_window_type() != gtk.gdk.WINDOW_TEMP: i.set_cursor(type) self.layout.window.set_cursor(type)
('ToolsMenu', None, '_Tools'),
('SettingsMenu', None, '_Settings'),
def __init__(self): # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit
('Options', gtk.STOCK_PREFERENCES, '_Options', None, 'Options', self.show_prefs),
('Preferences', gtk.STOCK_PREFERENCES, '_Preferences', None, 'Preferences', self.show_prefs),
def __init__(self): # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit
<menu action="ToolsMenu"> <menuitem action="Options"/>
<menu action="SettingsMenu"> <menuitem action="Preferences"/>
def __init__(self): # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit
self.prefs_dialog = gtk.Dialog(title="Mirage Options", parent=self.window)
self.prefs_dialog = gtk.Dialog(title="Mirage Preferences", parent=self.window)
def show_prefs(self, action): self.prefs_dialog = gtk.Dialog(title="Mirage Options", parent=self.window) self.prefs_dialog.set_has_separator(False) self.prefs_dialog.set_resizable(False) # Add "general" prefs: table_settings = gtk.Table(13, 3, False) table_settings.attach(gtk.Label(), 1, 3, 1, 2, gtk.FILL|gtk.EXPAND, g...
self.last_image_action_was_fit = True
def zoom_to_fit_or_1_to_1(self, action): if self.userimage != "": if self.zoomratio < self.min_zoomratio * self.zoomratio_for_zoom_to_fit: self.set_zoom_out_sensitivities(True) if self.zoomratio > self.max_zoomratio * self.zoomratio_for_zoom_to_fit: self.set_zoom_in_sensitivities(True) self.last_image_action_was_fit = ...
if self.fullscreen_mode == True: self.toggle_fullscreen(None)
def next_img_in_list(self, action): if len(self.image_list) > 1: self.randomlist = [] if self.curr_img_in_list < len(self.image_list) - 1: self.curr_img_in_list += 1 else: if self.listwrap == True: self.curr_img_in_list = 0 else: if self.fullscreen_mode == True: self.toggle_fullscreen(None) return if self.fullscreen_mo...
item_fullpath = os.path.abspath(inputlist[itemnum])
item_fullpath = os.path.abspath(inputlist[0])
def expand_filelist_and_load_image(self, inputlist): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) while gtk.events_pending(): gtk.main_iteration() # Takes the current list (i.e. ["pic.jpg", "pic2.gif", "../images"]) and # expands it into a list of all pictures found; returns new list first_image_found = False self...
self.slideshow_window.move(2, int(winheight-y-2)) self.slideshow_window2.move(winwidth-ss_win2width-2, int(winheight-y-2))
self.slideshow_window.move(2+xpos, int(winheight-y-2)) self.slideshow_window2.move(winwidth-ss_win2width-2+xpos, int(winheight-y-2))
def slideshow_controls_show(self): if self.slideshow_controls_visible == False and self.controls_moving == False: self.slideshow_controls_visible = True
self.slideshow_window.move(2, int(winheight-y-2)) self.slideshow_window2.move(winwidth-ss_win2width-2, int(winheight-y-2))
self.slideshow_window.move(2+xpos, int(winheight-y-2)) self.slideshow_window2.move(winwidth-ss_win2width-2+xpos, int(winheight-y-2))
def slideshow_controls_hide(self): if self.slideshow_controls_visible == True and self.controls_moving == False: self.slideshow_controls_visible = False
temp = self.recursive self.recursive = False self.stop_now = False inputlist = self.expand_directory(itempath, False) self.recursive = temp inputlist = list(set(inputlist))
temp = self.recursive self.recursive = False self.stop_now = False self.expand_directory(itempath, False) self.recursive = temp for item in self.image_list: duplicate_image = False for item2 in inputlist: if item == item2: duplicate_image = True if duplicate_image == False: inputlist.append(item) self.image_list = []
def expand_filelist_and_load_image(self, inputlist):
self.curr_img_in_list = itemnum
temp = self.image_list[0] self.image_list[0] = self.image_list[itemnum] self.image_list[itemnum] = temp
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]: self.curr_img_in_list = itemnum
self.slideshow_abort = False
def __init__(self): # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit
self.window.set_title("Mirage")
self.set_window_title()
def __init__(self): # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit
self.statusbar.set_has_resize_grip(True)
def __init__(self): # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit
if self.slideshow_mode == False: self.zoom_to_fit_window(None)
self.zoom_to_fit_window(None)
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 if self.slideshow_mode == False: self.prev_img_in_list(Non...
if self.slideshow_mode == False: self.zoom_1_to_1(None)
self.zoom_1_to_1(None)
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 if self.slideshow_mode == False: self.prev_img_in_list(Non...
if self.fullscreen_mode == False or len(self.image_list) <= 1: self.UIManager.get_widget('/Popup/Start Slideshow').hide() self.UIManager.get_widget('/Popup/Stop Slideshow').hide() elif self.slideshow_mode == True: self.UIManager.get_widget('/Popup/Start Slideshow').hide() self.UIManager.get_widget('/Popup/Stop Slidesho...
def set_slideshow_sensitivities(self): if len(self.image_list) <=1: self.UIManager.get_widget('/MainMenu/GoMenu/Start Slideshow').show() self.UIManager.get_widget('/MainMenu/GoMenu/Start Slideshow').set_sensitive(False) self.UIManager.get_widget('/MainMenu/GoMenu/Stop Slideshow').hide() self.UIManager.get_widget('/Main...
context_id = self.statusbar.get_context_id("i don't get this") self.statusbar.push(context_id, status_text)
self.statusbar.push(self.statusbar.get_context_id(""), status_text)
def update_statusbar(self): # Update status bar: try: st = os.stat(self.userimage) filesize = st[6]/1000 ratio = int(100 * self.zoomratio) status_text=str(self.originalimg.get_width()) + "x" + str(self.originalimg.get_height()) + " " + str(filesize) + "KB " + str(ratio) + "% " except: status_text="Cannot load ima...
if event.type == gtk.gdk.SCROLL and self.slideshow_mode == False:
if event.type == gtk.gdk.SCROLL:
def mousewheel_scrolled(self, widget, event): if event.type == gtk.gdk.SCROLL and self.slideshow_mode == False: # Zooming of the image by Ctrl-mousewheel if event.state == gtk.gdk.CONTROL_MASK: if event.direction == gtk.gdk.SCROLL_UP: self.zoom_out(None) elif event.direction == gtk.gdk.SCROLL_DOWN: self.zoom_in(None) r...
elif self.mousewheel_nav == True:
elif self.mousewheel_nav == True and self.slideshow_mode == False:
def mousewheel_scrolled(self, widget, event): if event.type == gtk.gdk.SCROLL and self.slideshow_mode == False: # Zooming of the image by Ctrl-mousewheel if event.state == gtk.gdk.CONTROL_MASK: if event.direction == gtk.gdk.SCROLL_UP: self.zoom_out(None) elif event.direction == gtk.gdk.SCROLL_DOWN: self.zoom_in(None) r...
if action != None and self.slideshow_mode == True: return
def zoom_to_fit_window(self, action): if action != None and self.slideshow_mode == True: return if self.userimage != "" and (self.slideshow_mode == True or self.UIManager.get_widget('/MainMenu/ViewMenu/Fit').get_property('sensitive') == True): self.last_mode = self.open_mode_fit self.last_image_action_was_fit = True # ...
if self.slideshow_mode == False: self.set_zoom_sensitivities()
self.set_zoom_sensitivities()
def zoom_to_fit_window(self, action): if action != None and self.slideshow_mode == True: return if self.userimage != "" and (self.slideshow_mode == True or self.UIManager.get_widget('/MainMenu/ViewMenu/Fit').get_property('sensitive') == True): self.last_mode = self.open_mode_fit self.last_image_action_was_fit = True # ...
if action != None and self.slideshow_mode == True: return
def zoom_to_fit_or_1_to_1(self, action): if action != None and self.slideshow_mode == True: return if self.userimage != "": self.last_image_action_was_fit = True # Calculate zoomratio needed to fit to window: win_width = self.available_image_width() win_height = self.available_image_height() img_width = self.originalim...
if self.slideshow_mode == False: self.set_zoom_sensitivities()
self.set_zoom_sensitivities()
def zoom_to_fit_or_1_to_1(self, action): if action != None and self.slideshow_mode == True: return if self.userimage != "": self.last_image_action_was_fit = True # Calculate zoomratio needed to fit to window: win_width = self.available_image_width() win_height = self.available_image_height() img_width = self.originalim...
if action != None and self.slideshow_mode == True: return
def zoom_1_to_1(self, action): if action != None and self.slideshow_mode == True: return if self.userimage != "" and (self.slideshow_mode == True or self.image_is_animation == True or (self.image_is_animation == False and self.UIManager.get_widget('/MainMenu/ViewMenu/1:1').get_property('sensitive') == True)): self.last...
if self.slideshow_abort == True: self.slideshow_abort = False return
def next_img_in_list(self, action): if self.slideshow_abort == True: self.slideshow_abort = False return if len(self.image_list) > 1: self.randomlist = [] if self.curr_img_in_list < len(self.image_list) - 1: self.curr_img_in_list += 1 else: if self.listwrap_mode == 0: if self.slideshow_mode == True: self.toggle_slidesh...
self.slideshow_abort = False
def next_img_in_list(self, action): if self.slideshow_abort == True: self.slideshow_abort = False return if len(self.image_list) > 1: self.randomlist = [] if self.curr_img_in_list < len(self.image_list) - 1: self.curr_img_in_list += 1 else: if self.listwrap_mode == 0: if self.slideshow_mode == True: self.toggle_slidesh...
timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action)
self.timer_delay = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action)
def next_img_in_list(self, action): if self.slideshow_abort == True: self.slideshow_abort = False return if len(self.image_list) > 1: self.randomlist = [] if self.curr_img_in_list < len(self.image_list) - 1: self.curr_img_in_list += 1 else: if self.listwrap_mode == 0: if self.slideshow_mode == True: self.toggle_slidesh...
return if self.slideshow_abort == True: self.slideshow_abort = False
def random_img_in_list(self, action): if action != None and self.slideshow_mode == True: return if self.slideshow_abort == True: self.slideshow_abort = False return if len(self.image_list) > 1: if self.randomlist == []: self.reinitialize_randomlist() else: # check if we have seen every image; if so, reinitialize array ...
self.slideshow_abort = False
def random_img_in_list(self, action): if action != None and self.slideshow_mode == True: return if self.slideshow_abort == True: self.slideshow_abort = False return if len(self.image_list) > 1: if self.randomlist == []: self.reinitialize_randomlist() else: # check if we have seen every image; if so, reinitialize array ...
timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.random_img_in_list, action)
self.timer_delay = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.random_img_in_list, action)
def random_img_in_list(self, action): if action != None and self.slideshow_mode == True: return if self.slideshow_abort == True: self.slideshow_abort = False return if len(self.image_list) > 1: if self.randomlist == []: self.reinitialize_randomlist() else: # check if we have seen every image; if so, reinitialize array ...
self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + " of " + str(len(self.image_list)) + "] " + os.path.basename(self.userimage))
self.set_window_title()
def image_load_failed(self): self.userimage = str(self.image_list[self.curr_img_in_list]) if self.verbose == True and self.userimage != "": print "Loading:", self.userimage self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + " of " + str(len(self.image_list)) + "] " + os.path.basename(self.userimage)) s...
if self.slideshow_mode == False: self.set_image_sensitivities(True)
self.set_image_sensitivities(True)
def load_new_image(self): self.currimg = None self.first_image_load = True self.location = 0 self.orientation = 0 self.zoomratio = 1 self.userimage = str(self.image_list[self.curr_img_in_list]) if self.verbose == True and self.userimage != "": print "Loading:", self.userimage animtest = gtk.gdk.PixbufAnimation(self.use...
self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + " of " + str(len(self.image_list)) + "] " + os.path.basename(self.userimage))
self.set_window_title()
def load_new_image(self): self.currimg = None self.first_image_load = True self.location = 0 self.orientation = 0 self.zoomratio = 1 self.userimage = str(self.image_list[self.curr_img_in_list]) if self.verbose == True and self.userimage != "": print "Loading:", self.userimage animtest = gtk.gdk.PixbufAnimation(self.use...
timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action)
self.timer_delay = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action)
def toggle_slideshow(self, action): if self.slideshow_mode == False: self.slideshow_mode = True self.set_slideshow_sensitivities() if self.slideshow_random == False: timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action) else: self.reinitialize_randomlist() timer_id ...
timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.random_img_in_list, action) self.set_image_sensitivities(False)
self.timer_delay = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.random_img_in_list, action)
def toggle_slideshow(self, action): if self.slideshow_mode == False: self.slideshow_mode = True self.set_slideshow_sensitivities() if self.slideshow_random == False: timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action) else: self.reinitialize_randomlist() timer_id ...
self.slideshow_abort = True
def toggle_slideshow(self, action): if self.slideshow_mode == False: self.slideshow_mode = True self.set_slideshow_sensitivities() if self.slideshow_random == False: timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action) else: self.reinitialize_randomlist() timer_id ...
if gtk.gdk.PixbufAnimation(self.userimage).is_static_image() == True: self.set_image_sensitivities(True)
def toggle_slideshow(self, action): if self.slideshow_mode == False: self.slideshow_mode = True self.set_slideshow_sensitivities() if self.slideshow_random == False: timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action) else: self.reinitialize_randomlist() timer_id ...
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.userimage) + " - Slideshow Mode") else: self.window.set_ti...
def toggle_slideshow(self, action): if self.slideshow_mode == False: self.slideshow_mode = True self.set_slideshow_sensitivities() if self.slideshow_random == False: timer_id = gobject.timeout_add(self.delayoptions[self.slideshow_delay]*1000, self.next_img_in_list, action) else: self.reinitialize_randomlist() timer_id ...
self.about_dialog = gtk.AboutDialog() self.about_dialog.set_name('Mirage') self.about_dialog.set_version(__version__) self.about_dialog.set_comments(_('A fast GTK+ Image Viewer.')) self.about_dialog.set_license(__license__) self.about_dialog.set_authors(['Scott Horowitz <stonecrest@gmail.com>']) self.about_dialog.set_a...
def show_about(self, action): # Help > About iconname = 'mirage_large.png' if os.path.exists(iconname): icon_path = iconname elif os.path.exists('../share/pixmaps/' + iconname): icon_path = '../share/pixmaps/' + iconname elif os.path.exists('/usr/local/share/pixmaps/' + iconname): icon_path = '/usr/local/share/pixmaps/...
self.expand_directory(itempath, False, go_buttons_enabled)
self.expand_directory(itempath, False, go_buttons_enabled, False)
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...
self.expand_directory(item, True, go_buttons_enabled)
self.expand_directory(item, True, go_buttons_enabled, False)
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...
self.expand_directory(item, False, go_buttons_enabled)
self.expand_directory(item, False, go_buttons_enabled, True)
def add_folderlist_images(self, folderlist, go_buttons_enabled): if len(folderlist) > 0: folderlist.sort(locale.strcoll) folderlist = list(set(folderlist)) for item in folderlist: if item[0] != '.' and not self.closing_app: self.stop_now = False self.expand_directory(item, False, go_buttons_enabled)
def expand_directory(self, item, stop_when_image_found, go_buttons_enabled):
def expand_directory(self, item, stop_when_image_found, go_buttons_enabled, update_title):
def expand_directory(self, item, stop_when_image_found, go_buttons_enabled): 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 == False: item2 = item + "/" + ite...
self.expand_directory(item2, stop_when_image_found, go_buttons_enabled) self.set_window_title() if not self.closing_app: while gtk.events_pending(): gtk.main_iteration(True)
self.expand_directory(item2, stop_when_image_found, go_buttons_enabled, update_title) if update_title == True: self.set_window_title() if not self.closing_app: while gtk.events_pending(): gtk.main_iteration(True)
def expand_directory(self, item, stop_when_image_found, go_buttons_enabled): 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 == False: item2 = item + "/" + ite...
transparency2 = gtk.Label(str(pixbuf.get_has_alpha())) animation2 = gtk.Label(str(not animtest.is_static_image()))
if pixbuf.get_has_alpha() == True: transparency2 = gtk.Label(_("Yes")) else: transparency2 = gtk.Label(_("No")) if animtest.is_static_image() == True: animation2 = gtk.Label(_("No")) else: animation2 = gtk.Label(_("Yes"))
def show_properties(self, action): show_props = gtk.Dialog(_("Properties"), self.window) show_props.set_has_separator(False) show_props.set_resizable(False) table = gtk.Table(3, 3, False) image = gtk.Image() animtest = gtk.gdk.PixbufAnimation(self.currimg_name) if animtest.is_static_image() == True: pixbuf, image_width...
temp_pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, self.currimg_pixbuf_original.get_has_alpha(), 8, coords[2], coords[3])
temp_pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, self.currimg_pixbuf_original.get_has_alpha(), 8, self.coords[2], self.coords[3])
def crop_image(self, action): dialog = gtk.Dialog(_("Crop Image"), self.window, gtk.DIALOG_MODAL, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) cropbutton = dialog.add_button(_("Crop"), gtk.RESPONSE_ACCEPT) cropimage = gtk.Image() cropimage.set_from_stock(gtk.STOCK_OK, gtk.ICON_SIZE_BUTTON) cropbutton.set_image(cropimage) i...
('Ctrl-KP_Add', None, '', '<Ctrl>KP_Add', _('Zoom In'), self.zoom_in)
('Ctrl-KP_Add', None, '', '<Ctrl>KP_Add', _('Zoom In'), self.zoom_in), ('Ctrl-KP_0', None, '', '<Ctrl>KP_0', _('Fit'), self.zoom_to_fit_window_action), ('Ctrl-KP_1', None, '', '<Ctrl>KP_1', _('1:1'), self.zoom_1_to_1_action)
def __init__(self):
print event.keyval, event.state
def topwindow_keypress(self, widget, event):
elif event.keyval == 61:
elif event.keyval == 61 or event.keyval == 43:
def topwindow_keypress(self, widget, event):
if event.keyval == 43:
if event.keyval == 43 or event.keyval == 61:
def topwindow_keypress(self, widget, event):
if set_prev_to_none == True: self.preloadimg_prev_pixbuf_original = None elif set_next_to_none == True: self.preloadimg_next_pixbuf_original = None
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...
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.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 and event.state != gtk.gdk.LOCK_MASK | gtk.gdk.CONTROL_MASK:
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
gtk.Tooltips().set_tip(combobox, _("Smart mode uses 1:1 for images smaller than the window and Fit To Window for images larger."))
def prefs_show(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) # Add "Interface" prefs: table_settings = gtk.Table(13, 3, False) table_settings.attach(gtk.Label(), 1, 3, 1, 2, gtk.FILL|gtk....
else:
elif self.listwrap_mode > 0:
def preload_next_image(self, use_existing_image): if self.preloading_images == True and len(self.image_list) > 1: if use_existing_image == False: if self.curr_img_in_list + 1 <= len(self.image_list)-1: temp_name = str(self.image_list[self.curr_img_in_list+1]) else: temp_name = str(self.image_list[0]) if temp_name == se...
else:
elif self.listwrap_mode > 0:
def preload_prev_image(self, use_existing_image): if self.preloading_images == True and len(self.image_list) > 1: if use_existing_image == False: if self.curr_img_in_list - 1 >= 0: temp_name = str(self.image_list[self.curr_img_in_list-1]) else: temp_name = str(self.image_list[len(self.image_list)-1]) if temp_name == se...
init_image = os.path.abspath(inputlist[0])
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...
('Previous Image', gtk.STOCK_GO_BACK, _('_Previous Image'), 'Left', _('Previous Image'), self.img_in_list_prev), ('Next Image', gtk.STOCK_GO_FORWARD, _('_Next Image'), 'Right', _('Next Image'), self.img_in_list_next), ('Previous2', gtk.STOCK_GO_BACK, _('_Previous'), 'Left', _('Previous'), self.img_in_list_prev), ('Next...
('Previous Image', gtk.STOCK_GO_BACK, _('_Previous Image'), 'Left', _('Previous Image'), self.goto_prev_image), ('Next Image', gtk.STOCK_GO_FORWARD, _('_Next Image'), 'Right', _('Next Image'), self.goto_next_image), ('Previous2', gtk.STOCK_GO_BACK, _('_Previous'), 'Left', _('Previous'), self.goto_prev_image), ('Next2',...
def __init__(self):
('Space', None, '', 'space', _('Next'), self.img_in_list_next),
('Space', None, '', 'space', _('Next'), self.goto_next_image),
def __init__(self):
ss_back.connect('clicked', self.img_in_list_prev)
ss_back.connect('clicked', self.goto_prev_image)
def __init__(self):
ss_forward.connect('clicked', self.img_in_list_next)
ss_forward.connect('clicked', self.goto_next_image)
def __init__(self):
self.img_in_list_prev(None)
self.goto_prev_image(None)
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 ...
self.img_in_list_next(None)
self.goto_next_image(None)
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 ...
self.img_in_list_next(None)
self.goto_next_image(None)
def parse_action_command2(self, command, imagename): # First, replace any property keywords with their flags: if "%F" in command: command = command.replace("%F", imagename) if "%N" in command: command = command.replace("%N", os.path.splitext(os.path.basename(imagename))[0]) if "%P" in command: command = command.replace...
self.img_in_list_prev(None)
self.goto_prev_image(None)
def parse_action_command2(self, command, imagename): # First, replace any property keywords with their flags: if "%F" in command: command = command.replace("%F", imagename) if "%N" in command: command = command.replace("%N", os.path.splitext(os.path.basename(imagename))[0]) if "%P" in command: command = command.replace...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss")
def delay_changed(self, action): self.curr_slideshow_delay = self.ss_delaycombo.get_active() if self.slideshow_mode == True: gobject.source_remove(self.timer_delay) if self.curr_slideshow_random == True: self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss")
def delay_changed(self, action): self.curr_slideshow_delay = self.ss_delaycombo.get_active() if self.slideshow_mode == True: gobject.source_remove(self.timer_delay) if self.curr_slideshow_random == True: self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "...
self.img_in_list_prev(None)
self.goto_prev_image(None)
def mousewheel_scrolled(self, widget, event): if event.type == gtk.gdk.SCROLL: # Zooming of the image by Ctrl-mousewheel if event.state == gtk.gdk.CONTROL_MASK: if event.direction == gtk.gdk.SCROLL_UP: self.zoom_out(None) elif event.direction == gtk.gdk.SCROLL_DOWN: self.zoom_in(None) return True # Navigation of images...
self.img_in_list_next(None)
self.goto_next_image(None)
def mousewheel_scrolled(self, widget, event): if event.type == gtk.gdk.SCROLL: # Zooming of the image by Ctrl-mousewheel if event.state == gtk.gdk.CONTROL_MASK: if event.direction == gtk.gdk.SCROLL_UP: self.zoom_out(None) elif event.direction == gtk.gdk.SCROLL_DOWN: self.zoom_in(None) return True # Navigation of images...
def img_in_list_prev(self, action):
def goto_prev_image(self, action):
def img_in_list_prev(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
currimg_location = self.location currimg_orientation = self.orientation
if self.location != 0 or self.orientation != 0 or self.zoomlevel_changed == True: regenerate_next_preload_img = True else: regenerate_next_preload_img = False
def img_in_list_prev(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss")
def img_in_list_prev(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss")
def img_in_list_prev(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
if currimg_location != 0 or currimg_orientation != 0:
if regenerate_next_preload_img == True:
def img_in_list_prev(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
def img_in_list_next(self, action):
def goto_next_image(self, action):
def img_in_list_next(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
currimg_location = self.location
if self.location != 0 or self.orientation != 0 or self.zoomlevel_changed == True: regenerate_prev_preload_img = True else: regenerate_prev_preload_img = False
def img_in_list_next(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss")
def img_in_list_next(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss")
def img_in_list_next(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
if currimg_location != 0 or currimg_orientation != 0:
if regenerate_prev_preload_img == True:
def img_in_list_next(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) currimg_location = self.location currimg_orientation = self.orientation if len(self.image_list) > 1: try: gobject.source_remove(self.preload_when_idle) gobject.source_remove(self.preload_when_i...
def img_in_list_random(self, action):
def goto_random_image(self, action):
def img_in_list_random(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 if self.randomlist == []: self.reinitialize_randoml...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss")
def img_in_list_random(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 if self.randomlist == []: self.reinitialize_randoml...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss")
def img_in_list_random(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 if self.randomlist == []: self.reinitialize_randoml...
def img_in_list_first(self, action):
def goto_first_image(self, action):
def img_in_list_first(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 self.randomlist = [] ...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss")
def img_in_list_first(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 self.randomlist = [] ...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss")
def img_in_list_first(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 self.randomlist = [] ...
def img_in_list_last(self, action):
def goto_last_image(self, action):
def img_in_list_last(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 s...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss")
def img_in_list_last(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 s...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss")
def img_in_list_last(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 s...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_next, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_next_image, "ss")
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...
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.img_in_list_random, "ss")
self.timer_delay = gobject.timeout_add(self.delayoptions[self.curr_slideshow_delay]*1000, self.goto_random_image, "ss")
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...
self.toolbar.set_property('visible', self.toolbar_show)
def __init__(self):
self.statusbar.set_property('visible', self.statusbar_show) self.statusbar2.set_property('visible', self.statusbar_show)
def __init__(self):
self.layout.set_flags(gtk.CAN_FOCUS) self.window.set_focus(self.layout)
def __init__(self):
self.zoom_to_fit_window(None, False, False)
if self.last_image_action_was_smart_fit == True: self.zoom_to_fit_or_1_to_1(None, False, False) else: self.zoom_to_fit_window(None, False, False)
def gconf_key_changed(self, client, cnxn_id, entry, label): if entry.value.type == gconf.VALUE_STRING: style = entry.value.to_string() if style == "both": self.toolbar.set_style(gtk.TOOLBAR_BOTH) elif style == "both-horiz": self.toolbar.set_style(gtk.TOOLBAR_BOTH_HORIZ) elif style == "icons": self.toolbar.set_style(gtk...
self.zoom_to_fit_window(None, False, False)
if self.last_image_action_was_smart_fit == True: self.zoom_to_fit_or_1_to_1(None, False, False) else: self.zoom_to_fit_window(None, False, False)
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: self.zoom_to_fit_window(None, False, Fal...
return
return True
def delete_event(self, widget, event, data=None): cancel = self.autosave_image() if cancel == True: return self.stop_now = True self.closing_app = True self.save_settings() sys.exit(0) return False