本文整理汇总了Python中foobnix.helpers.menu.Popup.show方法的典型用法代码示例。如果您正苦于以下问题:Python Popup.show方法的具体用法?Python Popup.show怎么用?Python Popup.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类foobnix.helpers.menu.Popup
的用法示例。
在下文中一共展示了Popup.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
if is_empty_click(w, e):
w.get_selection().unselect_all()
if is_double_left_click(e):
selected = self.get_selected_bean()
beans = self.get_all_child_beans_by_selected()
self.controls.notetabs._append_tab(selected.text, [selected] + beans, optimization=True)
"run radio channel"
self.controls.play_first_file_in_playlist()
if is_rigth_click(e):
right_click_optimization_for_trees(w, e)
menu = Popup()
menu.add_item(_("Add Station"), gtk.STOCK_ADD, self.on_add_station, None)
menu.add_item(_("Create Group"), gtk.STOCK_ADD, self.create_new_group, None)
bean = self.get_selected_bean()
if bean:
if self.get_selected_bean().is_file:
menu.add_item(_("Edit Station"), gtk.STOCK_EDIT, self.on_edit_radio, None)
menu.add_item(_("Delete Station"), gtk.STOCK_DELETE, self.delete_selected, None)
else:
menu.add_item(_("Rename Group"), gtk.STOCK_EDIT, self.on_rename_group, None)
menu.add_item(_("Delete Group"), gtk.STOCK_DELETE, self.delete_selected, None)
menu.show(e)
示例2: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
if is_empty_click(w, e):
w.get_selection().unselect_all()
if is_double_left_click(e):
selected = self.get_selected_bean()
beans = self.get_all_child_beans_by_selected()
self.controls.notetabs._append_tab(selected.text, [selected] + beans, optimization=True)
self.controls.play_first_file_in_playlist()
if is_rigth_click(e):
right_click_optimization_for_trees(w, e)
menu = Popup()
menu.add_item(_("Add playlist"), gtk.STOCK_ADD, self.create_playlist, None)
bean = self.get_selected_bean()
if bean:
if bean.is_file:
menu.add_item(_("Rename"), gtk.STOCK_EDIT, self.rename_selected, None)
menu.add_item(_("Delete"), gtk.STOCK_DELETE, self.delete_selected, None)
else:
menu.add_item(_("Rename playlist"), gtk.STOCK_EDIT, self.rename_selected, None)
menu.add_item(_("Delete playlist"), gtk.STOCK_DELETE, self.delete_selected, None)
#menu.add_item(_("Save as"), gtk.STOCK_SAVE_AS, None, None)
#menu.add_item(_("Open as"), gtk.STOCK_OPEN, None, None)
menu.show(e)
示例3: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
active = self.get_selected_bean()
if is_rigth_click(e):
menu = Popup()
menu.add_item(_('Play'), gtk.STOCK_MEDIA_PLAY, self.controls.play, active)
menu.add_item(_('Copy to Search Line'), gtk.STOCK_COPY, self.controls.searchPanel.set_search_text, active.text)
menu.show(e)
示例4: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
if is_empty_click(w, e):
w.get_selection().unselect_all()
active = self.get_selected_bean()
if active:
active.type = FTYPE_NOT_UPDATE_INFO_PANEL
else:
return None
if is_left_click(e):
if active.get_status():
if active.get_status() == DOWNLOAD_STATUS_ALL:
self.controls.dm.filter(None, FTreeModel().status[0])
else:
self.controls.dm.filter(active.get_status(), FTreeModel().status[0])
if is_double_left_click(e):
self.controls.play(active)
if is_rigth_click(e):
right_click_optimization_for_trees(w, e)
menu = Popup()
menu.add_item('Play', gtk.STOCK_MEDIA_PLAY, self.controls.play, active)
menu.add_item('Copy to Search Line', gtk.STOCK_COPY, self.controls.searchPanel.set_search_text, active.text)
menu.show(e)
示例5: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
if is_middle_click(e):
self.add_to_tab(True)
return
if is_left_click(e):
# on left click expand selected folders
return
if is_double_left_click(e):
# on middle click play selected beans
self.add_to_tab()
return
if is_rigth_click(e):
# on right click, show pop-up menu
menu = Popup()
menu.add_item(_("Add to current tab"), gtk.STOCK_ADD, lambda: self.add_to_tab(True), None)
menu.add_item(_("Add to new tab"), gtk.STOCK_MEDIA_PLAY, self.add_to_tab, None)
menu.add_separator()
menu.add_item(_("Add folder"), gtk.STOCK_OPEN, self.add_folder, None)
menu.add_separator()
if FC().tabs_mode == "Multi":
menu.add_item(_("Add folder in new tab"), gtk.STOCK_OPEN, lambda : self.add_folder(True), None)
menu.add_item(_("Clear Music Tree"), gtk.STOCK_CLEAR, lambda : self.controls.tabhelper.clear_tree(self.scroll), None)
menu.add_item(_("Update Music Tree"), gtk.STOCK_REFRESH, lambda: self.controls.tabhelper.on_update_music_tree(self.scroll), None)
menu.show(e)
示例6: on_button_release
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_release(self, w, e):
if is_rigth_click_release(e):
"""to select item under cursor"""
try:
path, col, cellx, celly = self.get_path_at_pos(int(e.x), int(e.y)) #@UnusedVariable
self.get_selection().select_path(path)
except TypeError:
pass
#menu.add_item('Save as', gtk.STOCK_SAVE_AS, self.controls.save_beans_to, self.get_all_selected_beans())
beans = self.get_selected_beans()
if beans:
menu = Popup()
menu.add_item(_('Play'), gtk.STOCK_MEDIA_PLAY, self.controls.play_selected_song, None)
menu.add_item(_('Download'), gtk.STOCK_ADD, self.controls.dm.append_tasks, self.get_all_selected_beans())
menu.add_item(_('Download To...'), gtk.STOCK_ADD, self.controls.dm.append_tasks_with_dialog, self.get_all_selected_beans())
menu.add_separator()
paths = [bean.path for bean in beans]
if paths[0]:
menu.add_item(_('Edit Tags'), gtk.STOCK_EDIT, edit_tags, (self.controls, paths))
menu.add_item(_('Format Converter'), gtk.STOCK_CONVERT, convert_files, paths)
text = self.get_selected_bean().text
menu.add_item(_('Copy To Search Line'), gtk.STOCK_COPY, self.controls.searchPanel.set_search_text, text)
menu.add_separator()
menu.add_item(_('Copy №-Title-Time'), gtk.STOCK_COPY, self.copy_info_to_clipboard)
menu.add_item(_('Copy Artist-Title-Album'), gtk.STOCK_COPY, self.copy_info_to_clipboard, True)
menu.add_separator()
menu.add_item(_('Love This Track(s)'), None, self.controls.love_this_tracks, self.get_all_selected_beans())
menu.add_separator()
if paths[0]:
menu.add_item(_("Open In File Manager"), None, open_in_filemanager, paths[0])
menu.show(e)
示例7: LastFmIntegrationControls
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
class LastFmIntegrationControls(CommonTreeControl):
def __init__(self, controls):
CommonTreeControl.__init__(self, controls)
"""column config"""
column = Gtk.TreeViewColumn(_("Lasm.fm Integration ") + FCBase().lfm_login,
self.ellipsize_render, text=self.text[0], font=self.font[0])
column.set_resizable(True)
self.set_headers_visible(True)
self.append_column(column)
self.tree_menu = Popup()
self.configure_send_drag()
self.configure_recive_drag()
self.set_type_tree()
self.services = {_("My recommendations"): self.controls.lastfm_service.get_recommended_artists,
_("My loved tracks"): self.controls.lastfm_service.get_loved_tracks,
_("My top tracks"): self.controls.lastfm_service.get_top_tracks,
_("My recent tracks"): self.controls.lastfm_service.get_recent_tracks,
_("My top artists"): self.controls.lastfm_service.get_top_artists,
_("My events"): self.controls.lastfm_service.get_events,
_("My friends"): self.controls.lastfm_service.get_friends,
_("My neighbours"): self.controls.lastfm_service.get_neighbours
}
for name in self.services:
parent = FModel(name)
bean = FDModel(_("loading...")).parent(parent).add_is_file(True)
self.append(parent)
self.append(bean)
def on_button_press(self, w, e):
if is_empty_click(w, e):
w.get_selection().unselect_all()
if is_rigth_click(e):
right_click_optimization_for_trees(w, e)
active = self.get_selected_bean()
self.tree_menu.clear()
self.tree_menu.add_item(_('Play'), "media-playback-start", self.controls.play, active)
self.tree_menu.add_item(_('Copy to Search Line'), "edit-copy",
self.controls.searchPanel.set_search_text, active.text)
self.tree_menu.show(e)
def on_bean_expanded(self, parent):
logging.debug("expanded %s" % parent)
def task():
old_iters = self.get_child_iters_by_parent(self.model, self.get_iter_from_bean(parent))
childs = self.services[parent.text](FCBase().lfm_login, str(int(FC().search_limit)))
update_parent_for_beans(childs, parent)
self.append_all(childs)
GLib.idle_add(self.remove_iters, old_iters)
self.controls.in_thread.run_with_spinner(task)
示例8: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
if is_empty_click(w, e):
w.get_selection().unselect_all()
if is_rigth_click(e):
right_click_optimization_for_trees(w, e)
active = self.get_selected_bean()
menu = Popup()
menu.add_item(_('Play'), gtk.STOCK_MEDIA_PLAY, self.controls.play, active)
menu.add_item(_('Copy to Search Line'), gtk.STOCK_COPY, self.controls.searchPanel.set_search_text, active.text)
menu.show(e)
示例9: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
logging.debug("on dm button release")
if is_rigth_click(e):
menu = Popup()
try:
if self.get_selected_bean():
menu.add_item(_("Open in file manager"), None, open_in_filemanager, self.get_selected_bean().path)
else:
menu.add_item(_("Open in file manager"), None, open_in_filemanager, FC().online_save_to_folder)
except Exception, e:
logging.error(e)
menu.show(e)
示例10: on_mouse_click
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_mouse_click(self, w, event):
menu = Popup()
menu.add_item(_("Play"), gtk.STOCK_MEDIA_PLAY, self.set_action_text, "--play")
menu.add_item(_("Pause"), gtk.STOCK_MEDIA_PAUSE, self.set_action_text, "--pause")
menu.add_item(_("Stop"), gtk.STOCK_MEDIA_STOP, self.set_action_text, "--stop")
menu.add_item(_("Next song"), gtk.STOCK_MEDIA_NEXT, self.set_action_text, "--next")
menu.add_item(_("Previous song"), gtk.STOCK_MEDIA_PREVIOUS, self.set_action_text, "--prev")
menu.add_item(_("Volume up"), gtk.STOCK_GO_UP, self.set_action_text, "--volume-up")
menu.add_item(_("Volume down"), gtk.STOCK_GO_DOWN, self.set_action_text, "--volume-down")
menu.add_item(_("Show-Hide"), gtk.STOCK_FULLSCREEN, self.set_action_text, "--show-hide")
menu.add_item(_("Play-Pause"), gtk.STOCK_MEDIA_RECORD, self.set_action_text, "--play-pause")
menu.show(event)
示例11: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
if is_empty_click(w, e):
w.get_selection().unselect_all()
if is_double_left_click(e):
self.controls.play_selected_song()
if is_rigth_click(e):
right_click_optimization_for_trees(w, e)
beans = self.get_selected_beans()
if beans:
menu = Popup()
menu.add_item(_('Play'), gtk.STOCK_MEDIA_PLAY, self.controls.play_selected_song, None)
menu.add_item(_('Delete from playlist'), gtk.STOCK_DELETE, self.delete_selected, None)
paths = []
inet_paths = []
local_paths = []
for bean in beans:
if bean.path in paths:
continue
paths.append(bean.path)
if not bean.path or bean.path.startswith("http://"):
inet_paths.append(bean.path)
else:
local_paths.append(bean.path)
if local_paths:
menu.add_item(_('Copy To...'), gtk.STOCK_ADD, copy_to, local_paths)
menu.add_item(_("Open in file manager"), None, open_in_filemanager, local_paths[0])
if inet_paths:
menu.add_item(_('Download'), gtk.STOCK_ADD, self.controls.dm.append_tasks, self.get_all_selected_beans())
menu.add_item(_('Download To...'), gtk.STOCK_ADD, self.controls.dm.append_tasks_with_dialog, self.get_all_selected_beans())
menu.add_separator()
if paths[0]:
menu.add_item(_('Edit Tags'), gtk.STOCK_EDIT, edit_tags, (self.controls, paths))
menu.add_item(_('Format Converter'), gtk.STOCK_CONVERT, convert_files, paths)
text = self.get_selected_bean().text
menu.add_item(_('Copy To Search Line'), gtk.STOCK_COPY, self.controls.searchPanel.set_search_text, text)
menu.add_separator()
menu.add_item(_('Copy №-Title-Time'), gtk.STOCK_COPY, self.copy_info_to_clipboard)
menu.add_item(_('Copy Artist-Title-Album'), gtk.STOCK_COPY, self.copy_info_to_clipboard, True)
menu.add_separator()
menu.add_item(_('Love This Track(s) by Last.fm'), None, self.controls.love_this_tracks, self.get_all_selected_beans())
menu.add_separator()
if paths[0]:
menu.add_item(_("Open In File Manager"), None, open_in_filemanager, paths[0])
menu.show(e)
示例12: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
logging.debug("on dm button press")
if is_empty_click(w, e):
w.get_selection().unselect_all()
if is_rigth_click(e):
right_click_optimization_for_trees(w, e)
try:
menu = Popup()
if self.get_selected_bean():
menu.add_item(_("Open in file manager"), None, open_in_filemanager, self.get_selected_bean().path)
else:
menu.add_item(_("Open in file manager"), None, open_in_filemanager, FC().online_save_to_folder)
menu.show(e)
except Exception, e:
logging.error(e)
示例13: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
self.controls.notetabs.set_active_tree(self)
if is_double_left_click(e):
self.controls.play_selected_song()
if is_rigth_click(e):
menu = Popup()
menu.add_item(_("Play"), gtk.STOCK_MEDIA_PLAY, self.controls.play_selected_song, None)
menu.add_item(_("Download"), gtk.STOCK_ADD, self.controls.dm.append_tasks, self.get_all_selected_beans())
# menu.add_item('Save as', gtk.STOCK_SAVE_AS, self.controls.save_beans_to, self.get_all_selected_beans())
menu.add_separator()
path = self.get_selected_bean().path
menu.add_item(_("Edit tags"), gtk.STOCK_EDIT, edit_tags, path)
text = self.get_selected_bean().text
menu.add_item(_("Copy to Search Line"), gtk.STOCK_COPY, self.controls.searchPanel.set_search_text, text)
menu.show(e)
示例14: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
if is_double_left_click(e):
selected = self.get_selected_bean()
beans = self.get_all_child_beans_by_selected()
self.controls.append_to_new_notebook(selected.text, [selected] + beans)
if is_rigth_click(e):
menu = Popup()
menu.add_item(_("Add playlist"), gtk.STOCK_ADD, self.create_playlist, None)
menu.add_item(_("Rename playlist"), gtk.STOCK_EDIT, self.rename_playlist, None)
menu.add_item(_("Delete playlist"), gtk.STOCK_DELETE, self.delete_playlist, None)
#menu.add_item(_("Save as"), gtk.STOCK_SAVE_AS, None, None)
#menu.add_item(_("Open as"), gtk.STOCK_OPEN, None, None)
menu.show(e)
示例15: on_button_press
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import show [as 别名]
def on_button_press(self, w, e):
active = self.get_selected_bean()
if active and is_rigth_click(e):
menu = Popup()
menu.add_item(_('Play'), gtk.STOCK_MEDIA_PLAY, self.controls.play, active)
menu.add_item(_('Copy to Search Line'), gtk.STOCK_COPY, self.controls.searchPanel.set_search_text, active.text)
menu.show(e)
if is_double_left_click(e):
selected = self.get_selected_bean()
beans = self.get_all_child_beans_by_selected()
self.controls.notetabs._append_tab(selected.text, [selected] + beans, optimization=True)
"run radio channel"
self.controls.play_first_file_in_playlist()