当前位置: 首页>>代码示例>>Python>>正文


Python Window.get_open_windows方法代码示例

本文整理汇总了Python中Window.get_open_windows方法的典型用法代码示例。如果您正苦于以下问题:Python Window.get_open_windows方法的具体用法?Python Window.get_open_windows怎么用?Python Window.get_open_windows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Window的用法示例。


在下文中一共展示了Window.get_open_windows方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import Window [as 别名]
# 或者: from Window import get_open_windows [as 别名]
	def __init__(self):
		QtGui.QMainWindow.__init__(self,None,QtCore.Qt.WindowStaysOnTopHint|QtCore.Qt.FramelessWindowHint)
		self.setAttribute(QtCore.Qt.WA_TranslucentBackground,True)
		self.setAttribute(QtCore.Qt.WA_X11NetWmWindowTypeDock,True)
		self.setWindowTitle("ducklauncher!!")#recognisable by wnck
		self.activateWindow()
		#screen size
		d = QtGui.QDesktopWidget()
		self.top_pos=0
		self.s_width = d.availableGeometry().width()
		self.s_height =d.availableGeometry().height()
		self.top_pos= d.availableGeometry().y()
		#Config values
		conf=Config.get()
		self.conf=conf
		self.HALF_OPEN_POS=int(conf['size'])
		self.ICO_TOP=self.HALF_OPEN_POS-5
		self.OPEN_STATE_TOP=self.ICO_TOP*4+5
		self.SIZE = 14
		#Geometry
		self.setGeometry(0,self.top_pos,self.HALF_OPEN_POS+9,self.s_height)
		#Values
		self.ICON_SIZE=int(conf['icon-size'])
		self.apps_per_row = math.trunc(((self.s_width/3)-50)/ int(self.conf["icon-size"]))
		self.apps_per_col = math.trunc(((self.s_height)-90)/ int(self.conf["icon-size"]))
		self.apps_per_page=self.apps_per_col*self.apps_per_row
		self.app_page_state=0
		self.appRect=None		
		self.drawAppRect=False
		self.pos_x=self.HALF_OPEN_POS-2
		self.move=False
		self.current_state="half_open"
		self.activity="apps"
		self.dock_apps = Apps.find_info(self.conf['dock-apps'])	
		self.current_text=''
		self.allApps=Apps.info(self.current_text)
		self.plugin=False
		self.pl_rect_pos=0
		self.pl_logo=None
		self.fg_color=(int(self.conf['r']),int(self.conf['g']),int(self.conf['b']))
		self.font_color=(int(self.conf['font-r']),int(self.conf['font-g']),int(self.conf['font-b']))
		##Windows
		#Enables the server which gets open windows
		self.op_thread=Window.openWindowsThread()
		self.op_thread.start()
		self.connect(self.op_thread,QtCore.SIGNAL("new-window"),self.addOpenWindow)
		self.connect(self.op_thread,QtCore.SIGNAL("remove-window"),self.updateOpenWindows)
		self.open_windows=Window.get_open_windows()
		self.ow_in_dock=[]
		#Dock Apps Options Window
		self.dock_options_win=DockAppsOptions.Window(parent=self)
		#Webview (for plugins, files, and settings view)
		self.webview=Widgets.pluginView(self)
		self.webview.setGeometry(2,60,self.s_width/3-20,self.s_height-60)
		#System window
		self.sys_win=System.Window()
		#Fake window, required to capture keyboard events
		self.fakewin = Fakewin(10,10, self)
		self.fakewin.show()
		XlibStuff.fix_window(self.winId(),self.HALF_OPEN_POS+3,0,0,0)
开发者ID:descentos,项目名称:launcher,代码行数:62,代码来源:Main.py

示例2: updateOpenWindows

# 需要导入模块: import Window [as 别名]
# 或者: from Window import get_open_windows [as 别名]
	def updateOpenWindows(self):
		self.open_windows=Window.get_open_windows()
		try:
			if self.conf["size"]!=self.HALF_OPEN_POS:
				XlibStuff.fix_window(self.winId(),self.HALF_OPEN_POS+5,0,0,0)
		except:
			pass
		self.update()
		QtGui.QApplication.processEvents()
		Config.check_dict(self.conf)
开发者ID:harj0,项目名称:launcher,代码行数:12,代码来源:Main.py

示例3: __init__

# 需要导入模块: import Window [as 别名]
# 或者: from Window import get_open_windows [as 别名]
	def __init__(self):
		QtGui.QMainWindow.__init__(self, None,QtCore.Qt.WindowStaysOnTopHint|QtCore.Qt.FramelessWindowHint)#| QtCore.Qt.X11BypassWindowManagerHint)
		self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
		self.setWindowTitle("ducklauncher")#recognisable by wnck
		#screen size
		d = QtGui.QDesktopWidget()
		self.top_pos=0
		self.s_width = d.availableGeometry().width()
		self.s_height =d.availableGeometry().height()
		d.resized.connect(self.updateSize)
		#Config
		conf=Config.get()
		self.conf=conf
		self.HALF_OPEN_POS=int(conf['size'])
		self.ICO_TOP=self.HALF_OPEN_POS-5
		self.OPEN_STATE_TOP=self.ICO_TOP*4+5
		self.SIZE = 15
		self.R=int(conf['r'])
		self.G=int(conf['g'])
		self.B=int(conf['b'])
		self.ICON_SIZE=int(conf['icon-size'])
		#Geometry
		self.setGeometry(0,0,self.HALF_OPEN_POS+4,self.s_height)
		#reserve wndow space
		#self.activateWindow()
		xwin = XlibStuff.fix_window(self.winId(),self.HALF_OPEN_POS+5,0,0,0)
		#
		#Values
		self.apps_per_row = math.trunc(((self.s_width/3)-30)/self.ICON_SIZE)
		self.apps_per_col = math.trunc(((self.s_height)-30)/self.ICON_SIZE)
		self.apps_per_page=self.apps_per_col*self.apps_per_row
		self.app_page_state=0
		self.files_page_state=0
		self.Files = Files.getFiles()
		self.pos_x=self.HALF_OPEN_POS
		self.move=False
		self.current_state="half_open"
		self.activity="apps"
		self.dock_apps = Apps.find_info(self.conf['dock-apps'])
		self.current_text=''
		#Update open windows
		self.timer=QtCore.QTimer()
		self.timer.setInterval(2000)
		self.timer.start()
		self.timer.timeout.connect(self.updateOpenWindows)
		#
		self.open_windows=window.get_open_windows()
		self.open_win = window.open_windows()
		self.open_state=False
		#
		self.settings_win = Settings.Window(self)
开发者ID:xcool,项目名称:launcher,代码行数:53,代码来源:Main.py

示例4: updateOpenWindows

# 需要导入模块: import Window [as 别名]
# 或者: from Window import get_open_windows [as 别名]
	def updateOpenWindows(self):
		self.open_windows=window.get_open_windows()
		self.update()
开发者ID:xcool,项目名称:launcher,代码行数:5,代码来源:Main.py

示例5: mousePressEvent

# 需要导入模块: import Window [as 别名]
# 或者: from Window import get_open_windows [as 别名]
	def mousePressEvent(self,e):
		x_m,y_m = e.x(),e.y()
		self.open_windows=window.get_open_windows()
		self.update()
		QtGui.QApplication.processEvents()
		if self.current_state=="open":
			if self.pos_x-self.SIZE<x_m<self.pos_x and self.move==False:
				self.close_it()
			###app events
			if self.activity == "apps":
				max_apps=  math.trunc(len(Apps.info(self.current_text))/self.apps_per_page)+1
				##Change Page
				for i in range(0,max_apps):
						btn_size = 20
						x_pos = self.s_width/6-btn_size+(btn_size*i)
						if x_pos<x_m<x_pos+btn_size and 2<y_m<2+btn_size:
							self.app_page_state=i
							self.update()
							QtGui.QApplication.processEvents()	
				## launch apps
				for i, app in enumerate(Apps.info(self.current_text)):
					app_page = math.trunc(i/self.apps_per_page)
					if app_page==self.app_page_state:
						row_pos = math.trunc(i/self.apps_per_row)
						x_pos = self.ICON_SIZE*(i-(row_pos*self.apps_per_row))+30
						y_pos = row_pos*self.ICON_SIZE+30-(app_page*(self.ICON_SIZE*self.apps_per_col))
						if x_pos<x_m<(x_pos+self.ICON_SIZE) and y_pos<y_m<(y_pos+self.ICON_SIZE):
							print "It should launch:  " + app["name"] + "  with  " + app["exec"]
							thread = Launch(parent=self)
							thread.app=app["exec"]
							thread.start()
							self.close_it()
			if self.activity == "files":
				if 10<x_m<40 and 10<y_m<40:
					l= self.Files.directory.split("/")[:-1][1:]
					new_dir=''
					for a in l:
						new_dir+='/'
						new_dir+=a
					if new_dir=='':new_dir='/'
					self.Files.directory=new_dir
					self.update()
				max_files=  math.trunc(len(self.Files.all())/self.apps_per_page)+1
				##Change Page
				for i in range(0,max_files):
						btn_size = 20
						x_pos = self.s_width/6-btn_size+(btn_size*i)
						if x_pos<x_m<x_pos+btn_size and 2<y_m<2+btn_size:
							self.files_page_state=i
							self.update()
							QtGui.QApplication.processEvents()	
				## launch apps
				for i, f in enumerate(self.Files.all()):
					app_page = math.trunc(i/self.apps_per_page)
					if app_page==self.files_page_state:
						row_pos = math.trunc(i/self.apps_per_row)
						x_pos = self.ICON_SIZE*(i-(row_pos*self.apps_per_row))+30
						y_pos = row_pos*self.ICON_SIZE+30-(app_page*(self.ICON_SIZE*self.apps_per_col))
						if x_pos<x_m<(x_pos+self.ICON_SIZE) and y_pos<y_m<(y_pos+self.ICON_SIZE):
							if f["type"]=="file":
								import webbrowser
								webbrowser.open(f["whole_path"])
							elif  f["type"]=="directory":
								self.Files.directory=f["whole_path"]
								self.update()
								QtGui.QApplication.processEvents()	
			if self.activity=="star":
				blocks=self.conf['blocks']
				all_rows=0
				for i,b in enumerate(blocks):
					all_stuff = Config.get_from_block(b)
					row_num = math.trunc(len(all_stuff)/self.apps_per_row)+1
					h=self.ICON_SIZE*all_rows+20
					all_rows+=row_num
					for j, thing in enumerate(all_stuff):
						row_pos = math.trunc(j/self.apps_per_row)
						x_pos = self.ICON_SIZE*(j-(row_pos*self.apps_per_row))+40
						y_pos = (row_pos*self.ICON_SIZE+20)+h
						if x_pos+15<x_m<x_pos+15+self.ICON_SIZE and y_pos+15<y_m<y_pos+15+self.ICON_SIZE:
							if thing['type']=='app':
								the_exec=""
								for a in Apps.info(''):
									if thing['value'] in a['name']:
										print "a"
										the_exec=a['exec']
								thread = Launch(parent=self)
								thread.app=the_exec
								thread.start()
								print "Launching " , thing['value'], "with :",the_exec
							else:
								import webbrowser
								webbrowser.open(thing['value'])
		if self.current_state=="half_open":
			##buttons
			if 0<x_m<self.HALF_OPEN_POS:
				if 0<y_m<self.ICO_TOP:
					self.activity="apps"
					self.current_text=''
					self.open_it()
				if self.ICO_TOP<y_m<self.ICO_TOP*2:
#.........这里部分代码省略.........
开发者ID:xcool,项目名称:launcher,代码行数:103,代码来源:Main.py

示例6: __init__

# 需要导入模块: import Window [as 别名]
# 或者: from Window import get_open_windows [as 别名]
	def __init__(self):
		QtGui.QMainWindow.__init__(self,None,QtCore.Qt.WindowStaysOnTopHint|QtCore.Qt.FramelessWindowHint)
		self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
		self.setAttribute(QtCore.Qt.WA_X11NetWmWindowTypeDock)
		self.setWindowTitle("ducklauncher!!")#recognisable by wnck
		self.activateWindow()
		#screen size
		d = QtGui.QDesktopWidget()
		self.top_pos=0
		self.s_width = d.availableGeometry().width()
		self.s_height =d.availableGeometry().height()
		self.top_pos= d.availableGeometry().y()
		#bg_width
		#Config
		conf=Config.get()
		self.conf=conf
		self.HALF_OPEN_POS=int(conf['size'])
		self.ICO_TOP=self.HALF_OPEN_POS-5
		self.OPEN_STATE_TOP=self.ICO_TOP*4+5
		self.SIZE = 14
		#self.R=int(conf['r'])
		#self.G=int(conf['g'])
		#self.B=int(conf['b'])
		#self.ICON_SIZE=int(conf['icon-size'])
		#Geometry
		self.setGeometry(0,self.top_pos,self.HALF_OPEN_POS+6,self.s_height)
		#Values
		self.appRect=None		
		self.drawAppRect=False
		self.pos_x=self.HALF_OPEN_POS-2
		self.move=False
		self.current_state="half_open"
		self.activity="apps"
		self.dock_apps = Apps.find_info(self.conf['dock-apps'])	
		self.current_text=''
		self.allApps=Apps.info(self.current_text)
		self.appHtmlSource="/usr/share/duck-launcher/default-theme/apps.html"
		self.appHtmlString=Template(open(self.appHtmlSource,"r").read()).render(color=(int(self.conf["r"]),int(self.conf["g"]),int(self.conf["b"])),font=str(self.conf["font"]), icon_size=int(self.conf["icon-size"])) 
		self.plugin=False
		#Open windows window
		self.open_windows=Window.get_open_windows()
		self.open_win = Window.open_windows()
		#Dock Apps Options Window
		self.dock_options_win=DockAppsOptions.Window(parent=self)
		#Webview for plugins
		self.webview=QtWebKit.QWebView(self)
		palette = self.webview.palette()
		palette.setBrush(QtGui.QPalette.Base, QtCore.Qt.transparent)
		self.webview.page().setPalette(palette)
		self.webview.setAttribute(QtCore.Qt.WA_OpaquePaintEvent, False)
		self.webview.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
		self.webview.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
		self.webview.connect(self.webview, QtCore.SIGNAL("linkClicked(const QUrl&)"), self.web_linkClicked)
		self.webview.page().mainFrame().javaScriptWindowObjectCleared.connect(self.web_populateJavaScriptWindowObject)
		self.webview.setHtml("<body style='background:rgb(230,100,80);'><input type='text' placehodler='aaa'></input></body>")
		self.webview.setGeometry(2,50,self.s_width/3-20,self.s_height-50)
		self.webview.activateWindow()
		self.webview.hide()
		#System window
		self.sys_win=System.Window()
		#Fake window
		self.fakewin = Fakewin(10,10, self)
		self.fakewin.show()
		XlibStuff.fix_window(self.winId(),self.HALF_OPEN_POS+5,0,0,0)
开发者ID:harj0,项目名称:launcher,代码行数:66,代码来源:Main.py

示例7: __init__

# 需要导入模块: import Window [as 别名]
# 或者: from Window import get_open_windows [as 别名]
	def __init__(self):
		QtGui.QMainWindow.__init__(self, None,QtCore.Qt.WindowStaysOnTopHint|QtCore.Qt.FramelessWindowHint)
		self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
		self.setAttribute(QtCore.Qt.WA_X11NetWmWindowTypeDock)
		self.setWindowTitle("ducklauncher!!")#recognisable by wnck
		self.activateWindow()
		#screen size
		d = QtGui.QDesktopWidget()
		self.top_pos=0
		self.s_width = d.availableGeometry().width()
		self.s_height =d.availableGeometry().height()
		import Xlib
		screen = Xlib.display.Display().screen().root.get_geometry()
		self.top_pos= screen.height-self.s_height
		#bg_width
		#Config
		conf=Config.get()
		self.conf=conf
		self.HALF_OPEN_POS=int(conf['size'])
		self.ICO_TOP=self.HALF_OPEN_POS-5
		self.OPEN_STATE_TOP=self.ICO_TOP*4+5
		self.SIZE = 14
		self.R=int(conf['r'])
		self.G=int(conf['g'])
		self.B=int(conf['b'])
		self.ICON_SIZE=int(conf['icon-size'])
		#Geometry
		self.setGeometry(0,self.top_pos,self.HALF_OPEN_POS+4,self.s_height)
		#Values
		self.apps_per_row = math.trunc(((self.s_width/3)-30)/self.ICON_SIZE)
		self.apps_per_col = math.trunc(((self.s_height)-30)/self.ICON_SIZE)
		self.apps_per_page=self.apps_per_col*self.apps_per_row
		self.app_page_state=0
		self.appRect=None		
		self.drawAppRect=False
		self.files_page_state=0
		self.Files = Files.getFiles()
		self.pos_x=self.HALF_OPEN_POS
		self.move=False
		self.current_state="half_open"
		self.activity="apps"
		self.dock_apps = Apps.find_info(self.conf['dock-apps'])	
		self.current_text=''
		self.allApps=Apps.info(self.current_text)
		#Update open windows
		'''
		self.timer=QtCore.QTimer()
		self.timer.setInterval(1000)
		self.timer.start()
		self.timer.timeout.connect(self.updateOpenWindows)
		'''
		#Open windows window
		self.open_windows=Window.get_open_windows()
		self.open_win = Window.open_windows()
		#Settings window
		#self.settings_win = Settings.Window(self)
		#System window
		self.sys_win=System.Window()
		#Fake window
		self.fakewin = Fakewin(self.HALF_OPEN_POS,self.s_height, self)
		self.fakewin.show()
		XlibStuff.fix_window(self.fakewin.winId(),self.HALF_OPEN_POS+5,0,0,0)
开发者ID:archlinux2002,项目名称:launcher,代码行数:64,代码来源:Main.py


注:本文中的Window.get_open_windows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。