# -*- coding: utf-8 -*-
# python:2.x
__author__ = ‘Administrator‘
#自定义模块导入
from down import Ui_Form as Ui
#导入内置/第三方模块
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.Qt import *
import datetime,time,sys,os
import urllib,urllib2
import threading
from os import *
import json
QTextCodec.setCodecForTr(QTextCodec.codecForName("utf8"))
#说明
"""
本工具由PyQt4+python2.7.8制作而成
"""
#DownResources是一个类名,为下载资源的名称
class DownResources(QWidget,Ui):
def __init__(self,parnt=None):
super(DownResources,self).__init__(parnt)
self.setupUi(self)
#信号槽
self.ToolSet.clicked.connect(self._tabWindows)
self.UpdateButton.clicked.connect(self._update)
self.Setbutton.clicked.connect(self._action)
self._ontenables()
self.downs.clicked.connect(self._onenables)
self.tool2.clicked.connect(self._onclose)
self.OKlist.itemPressed.connect(self.__actionclicked)
self.tool1.clicked.connect(self._Editaction)
self.tool1.toggle()
self.SetButton.clicked.connect(self.__setAttrs)
#self.tool1.setAutoExclusive(True)#状态
def __actionclicked(self,txt):
lurl=[‘http://www.pc6.com‘,‘http://www.baidu.com‘,‘http://tieba.baidu.com/‘,‘http://www.dytt8.net‘,
‘http://www.qvod.com‘,‘http://www.qq.com‘,‘http://www.xiazaiba.com‘,
‘http://www.zxxk.com‘,‘http://kuai.xunlei.com‘,‘http://www.kugou.com‘]
item=self.OKlist.currentRow()
for item1,item2 in enumerate(lurl):
if item==item1:
QDesktopServices.openUrl(QUrl(item2))
def _Editaction(self,ok):
source = self.sender()
if source.text()==u‘编辑‘:
self.OKlist.setEditTriggers(QListWidget.NoEditTriggers)
self.tool1.setText(u‘取消‘)
if self.OKlist.isSelectionRectVisible():
self.disconnect(self.OKlist,SIGNAL(‘itemPressed(QListWidgetItem *)‘),self.__actionclicked)
self.removeOK()
else:
self.tool1.setText(u‘编辑‘)
self.OKlist.itemPressed.connect(self.__actionclicked)
def _actioncha(self):
row=self.OKlist.currentRow()
item=self.OKlist.item(row)
if unicode(item.text()):
if row in range(0,10):
print ‘ok‘,row,unicode(item.text())
else:pass
#删除功能
def removeOK(self):
row=self.OKlist.currentRow()
item=self.OKlist.item(row)
print dir(item)
if unicode(item.text()):
self._rok()
#出现窗口
def _rok(self):
row=self.OKlist.currentRow()
item=self.OKlist.item(row)
reply = QMessageBox.warning(self, u‘删除提醒‘,
u‘是否需要删除?‘,
QMessageBox.Yes,
QMessageBox.No)
if reply == QMessageBox.Yes:
item = self.OKlist.takeItem(row)
del item
def _ontenables(self):
visible=[self.OKlist.setVisible(False),
self.tool1.setVisible(False),
self.tool2.setVisible(False),
self.line.setVisible(False),
self.line_2.setVisible(False),
self.enble1.setVisible(False)]
return visible
def _onenables(self):
view=[self.OKlist.setResizeMode(QListView.Adjust),
self.OKlist.setViewMode(QListView.IconMode),
self.OKlist.setMovement(QListView.Static),
self.OKlist.setSelectionMode(QAbstractItemView.SingleSelection),
self.OKlist.setSpacing(20)]
visible=[self.OKlist.setVisible(True),
self.tool1.setVisible(True),
self.tool2.setVisible(True),
self.line.setVisible(True),
self.line_2.setVisible(True),
self.enble1.setVisible(True),self.downs.setEnabled(False)]
return visible,view
def __setAttrs(self):
menu=QMenu(self)
menu1=menu.addMenu(u‘文件‘)
m1=menu1.addAction(u‘网址导航‘)
m2=menu1.addAction(u‘查看网速‘)
m3=menu1.addAction(u‘博客论坛‘)
menu.exec_(self.SetButton.mapToGlobal(QPoint(10,30)))
menu.show()
def _onclose(self):
self.downs.setEnabled(True)
view=[self.tool1.close(),self.tool2.close(),self.line_2.close(),self.line.close(),self.OKlist.close()]
return view
#下拉菜单及显示
def _action(self):
menu=QMenu(self)
menu1=menu.addMenu(u‘文件‘)
menu11=menu1.addAction(u‘新建任务‘)
menu1.addSeparator()
menu12=menu1.addAction(u‘删除全部任务‘)
menu13=menu1.addAction(u‘删除‘)
menu1.addSeparator()
menu14=menu1.addAction(u‘清空列表‘)
menu.addSeparator()
menu4=menu.addMenu(u‘编辑‘)
menu41=menu4.addAction(u‘重名名‘)
menu4.addSeparator()
menu42=menu4.addAction(u‘全选(A)‘)
menu43=menu4.addAction(u‘反选(I)‘)
menu.addSeparator()
menu2=menu.addAction(u‘帮助‘)#做了
menu21=menu.addMenu(u‘其他帮助‘)
menu22=menu21.addAction(u‘在线论坛‘)
menu23=menu21.addAction(u‘检查更新‘)
menu.addSeparator()
menu4=menu.addAction(u‘关于本工具?‘)
menu.addSeparator()
menu5=menu.addMenu(u‘其他功能‘)
menu51=menu5.addAction(u‘打开页面‘)
menu52=menu5.addAction(u‘本地库‘)#暂时不做
menu.addSeparator()
menu3=menu.addAction(u‘退出‘)#做了
#状态是否可用,是否选中,是否显示等
menu41.setEnabled(False)
menu52.setVisible(False)
#快捷键设置
menu22.setShortcut(‘F1‘)
menu3.setShortcut(‘Ctrl+X‘)
menu2.setShortcut(‘Ctrl+H‘)
menu11.setShortcut(‘Ctrl+N‘)
menu12.setShortcut(‘Ctrl+F10‘)
menu13.setShortcut(‘F10‘)
menu42.setShortcut(‘Ctrl+A‘)
menu41.setShortcut(‘Ctrl+R‘)
menu.show()
#信号
menu11.triggered.connect(self._action1)
menu2.triggered.connect(self._action0)
menu3.triggered.connect(self.close_action)
menu4.triggered.connect(self.about_action)
menu.exec_(self.mapToGlobal(QPoint(820,20)))
#下拉菜单对应方法
def about_action(self):
customMsgBox=QMessageBox(self)
customMsgBox.setWindowIcon(QIcon(r‘imges/icon/dq.png‘))
#customMsgBox.setWindowFlags(Qt.FramelessWindowHint)#去掉标题栏
customMsgBox.setIconPixmap(QPixmap(r‘imges/xl3.png‘))
customMsgBox.setWindowTitle(u‘关于本工具?‘)
customMsgBox.setTextFormat(Qt.RichText)
customMsgBox.move(240,150)
customMsgBox.setStyleSheet(QString("color:palette(highlight)"))
customMsgBox.setText(u‘本工具由pyqt4.10+python2.7.8 64位制作\n\n\n\n\n‘
u‘制作时间为2014年下半年,‘
u‘最新更新的博客<a href="http://home.cnblogs.com/u/mhxy13867806343/">博客园地址</a>‘)
#ok按钮的qss色彩
ok=customMsgBox.addButton(u‘确定‘,customMsgBox.ActionRole)
# ok.setStyleSheet(" margin-top:0pt; "> # "stop:0 rgba(0, 82, 112, 255), stop:0.5 rgba(0, 211, 197, 255), "
# "stop:1 rgba(0, 82, 112, 255));")
customMsgBox.exec_()
def close_action(self):
self.close()
def _action0(self):
os.popen(r‘help\\i.txt‘).read()
def _action1(self):
print ‘assa‘
def _update(self):#更新工具
url=‘http://113.5.80.27/ws.cdn.baidupcs.com/file/7‘ \
‘a0dca7e5c7720cbba17ab4c57eedd34?xcode=27811fd6a109659949923b58f77b3119c6a297e532b0a722837047dfb5e85c39&fid=453223706-250528‘ \
‘-296039013363193&time=1412756138&sign=FDTAXER-DCb740ccc5511e5e8fedcff06b081203-‘ \
‘3DcFwidk0dTpkkhzemqwdfwwyFo%3D&to=cb&fm=Nan,B,U,nc&sta_dx=178&sta_cs=12&sta_ft=pdf&sta‘ \
‘_ct=0&newver=1&newfm=1&flow_ver=3&expires=8h&rt=sh&r=773044636&mlogid=830128945&vuk=‘ \
‘453223706&vbdid=3641626726&fn=%5BPython%E6%A0%87%E5%87%86%E5%BA%93%5D‘ \
‘.%E8%8D%B7%E5%B0%94%E6%9B%BC.%E6%89%AB%E6%8F%8F%E7%89%88%5B%E7%94%B5%E5%AD%90%E4%B9%A6www.minxue.net%5D.‘ \
‘pdf&wshc_tag=0&wsts_tag=5434f2ab&wsid_tag=7056cdfd&wsiphost=ipdbm‘
url1=‘http://pan.baidu.com/s/1kT1diwJ‘
QDesktopServices.openUrl(QUrl(QLatin1String(url1)))
path=r‘exe\a.pdf‘
#下拉子菜单显示
#0点到24点实实显示的动态时间
def _donwTimer(self):
t=datetime.datetime.now().strftime(‘%Y-%m-%d %H:%M:%S‘)
if ‘00‘<=t[11:]<‘06‘:
self.TimeOk.setToolTip(u‘凌晨‘)
self.TimeOk.setText("<font color=green>%s</font>"%(t))
self.setStyleSheet("<font color=green>White</font>")
if ‘06‘<=t[11:]<‘12‘:
self.TimeOk.setToolTip(u‘上午‘)
self.TimeOk.setText("<font color=blue>%s</font>"%(t))
self.setStyleSheet("<font color=White></font>")
if ‘12‘<=t[11:]<‘18‘:
self.TimeOk.setToolTip(u‘下午‘)
self.TimeOk.setText("<font color=red>%s</font>"%(t))
self.setStyleSheet("<font color=White></font>")
if ‘18‘<=t[11:]<‘24‘:
self.TimeOk.setToolTip(u‘晚上‘)
self.TimeOk.setText("<font color=black>%s</font>"%(t))
self.setStyleSheet("<font color=Black></font>")
#判断路径是否出现问题
def _tabWindows(self):
p1=self.SetLine.text()
path=QFileDialog.getExistingDirectory(self,u‘设置目录‘,‘/‘)
while True:
if path.isEmpty():#判断是否为空
QMessageBox.information(self,u‘提示‘,u‘下载目录无法为空,如果为空资源无法存储‘)
path=QFileDialog.getExistingDirectory(self,u‘设置目录‘,‘/‘)
elif self.SetLine.text()==path:
QMessageBox.information(self,u‘提示‘,u‘与上次设置目录相同,请更换其他目录‘)
path=QFileDialog.getExistingDirectory(self,u‘设置目录‘,‘/‘)
else:
self.SetLine.setText(unicode(path))
break
def main(s):
app=QApplication(s.argv)
downs=DownResources()
downs.setFixedSize(851,500)
downs.setWindowTitle(u‘下载工具‘)
downs.setWindowIcon(QIcon(r‘imges/icon/jumplist_bttask.ico‘))
downs.SetLine.setReadOnly(True)
downs.treeOk.setToolTip(u‘子根‘)
downs.SetLine.setText(u‘/down‘)
t=QTimer()
t.timeout.connect(downs._donwTimer)
t.start(1000)
downs.show()
s.exit(app.exec_())
main(sys)
"""
f=QFile(‘://qss//BB.qss‘)
f.open(QIODevice.ReadOnly)
f=QTextStream(f)
customMsgBox.setStyleSheet(f.readAll())
#居中customMsgBox.move((QApplication.desktop().width() - customMsgBox.width())/2,(QApplication.desktop().height() - customMsgBox.height())/2);
#customMsgBox.setStandardButtons(QMessageBox.NoButton)#按钮不可用
"""
如图:
--------------------------------
源文件:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ‘F:\project\project\py2014-10\down.ui‘
#
# Created: Thu Oct 16 22:13:51 2014
# by: PyQt4 UI code generator 4.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(846, 495)
Form.setStyleSheet(_fromUtf8(""))
self.tabwindows = QtGui.QTabWidget(Form)
self.tabwindows.setGeometry(QtCore.QRect(140, 20, 711, 491))
self.tabwindows.setObjectName(_fromUtf8("tabwindows"))
self.DownTab = QtGui.QWidget()
self.DownTab.setObjectName(_fromUtf8("DownTab"))
self.tabOk = QtGui.QTableWidget(self.DownTab)
self.tabOk.setGeometry(QtCore.QRect(0, 50, 711, 281))
self.tabOk.setFrameShape(QtGui.QFrame.HLine)
self.tabOk.setFrameShadow(QtGui.QFrame.Sunken)
self.tabOk.setObjectName(_fromUtf8("tabOk"))
self.tabOk.setColumnCount(7)
self.tabOk.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.tabOk.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.tabOk.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem()
self.tabOk.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem()
self.tabOk.setHorizontalHeaderItem(3, item)
item = QtGui.QTableWidgetItem()
self.tabOk.setHorizontalHeaderItem(4, item)
item = QtGui.QTableWidgetItem()
self.tabOk.setHorizontalHeaderItem(5, item)
item = QtGui.QTableWidgetItem()
self.tabOk.setHorizontalHeaderItem(6, item)
self.plainOk = QtGui.QPlainTextEdit(self.DownTab)
self.plainOk.setGeometry(QtCore.QRect(0, 320, 711, 151))
self.plainOk.setObjectName(_fromUtf8("plainOk"))
self.label_21 = QtGui.QLabel(self.DownTab)
self.label_21.setGeometry(QtCore.QRect(-10, -10, 721, 51))
self.label_21.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_21.setFrameShape(QtGui.QFrame.NoFrame)
self.label_21.setFrameShadow(QtGui.QFrame.Plain)
self.label_21.setText(_fromUtf8(""))
self.label_21.setObjectName(_fromUtf8("label_21"))
self.label_3 = QtGui.QLabel(self.DownTab)
self.label_3.setGeometry(QtCore.QRect(325, 10, 71, 16))
self.label_3.setObjectName(_fromUtf8("label_3"))
self.upload2 = QtGui.QLabel(self.DownTab)
self.upload2.setGeometry(QtCore.QRect(120, 10, 31, 16))
self.upload2.setObjectName(_fromUtf8("upload2"))
self.Find = QtGui.QLineEdit(self.DownTab)
self.Find.setGeometry(QtCore.QRect(410, 10, 241, 20))
self.Find.setObjectName(_fromUtf8("Find"))
self.label_12 = QtGui.QLabel(self.DownTab)
self.label_12.setGeometry(QtCore.QRect(20, 10, 81, 16))
self.label_12.setObjectName(_fromUtf8("label_12"))
self.tooldow = QtGui.QToolButton(self.DownTab)
self.tooldow.setGeometry(QtCore.QRect(630, 10, 21, 21))
self.tooldow.setMouseTracking(False)
self.tooldow.setStyleSheet(_fromUtf8("QToolButton:hover{\n"
" border-image: url(:/imges/icon/find.png); \n"
"}"))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8("imges/icon/find.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tooldow.setIcon(icon)
self.tooldow.setIconSize(QtCore.QSize(70, 80))
self.tooldow.setObjectName(_fromUtf8("tooldow"))
self.tabwindows.addTab(self.DownTab, _fromUtf8(""))
self.SetTab = QtGui.QWidget()
self.SetTab.setObjectName(_fromUtf8("SetTab"))
self.label_9 = QtGui.QLabel(self.SetTab)
self.label_9.setGeometry(QtCore.QRect(-10, 390, 721, 91))
self.label_9.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_9.setText(_fromUtf8(""))
self.label_9.setObjectName(_fromUtf8("label_9"))
self.dowcount = QtGui.QLabel(self.SetTab)
self.dowcount.setGeometry(QtCore.QRect(588, 407, 111, 16))
self.dowcount.setObjectName(_fromUtf8("dowcount"))
self.label_8 = QtGui.QLabel(self.SetTab)
self.label_8.setGeometry(QtCore.QRect(352, 433, 51, 16))
self.label_8.setObjectName(_fromUtf8("label_8"))
self.SetButton = QtGui.QPushButton(self.SetTab)
self.SetButton.setGeometry(QtCore.QRect(11, 435, 31, 23))
self.SetButton.setStyleSheet(_fromUtf8("QPushButton:hover {\n"
" \n"
"}\n"
"QPushButton{\n"
" color : solid gray;\n"
" border: 2px solid gray;\n"
" border-radius: 5px;\n"
" background: transparent;\n"
" padding: 0px;\n"
" text-align : center ;\n"
"}"))
self.SetButton.setText(_fromUtf8(""))
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(_fromUtf8("imges/icon/jumplist_taskgroup.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SetButton.setIcon(icon1)
self.SetButton.setIconSize(QtCore.QSize(60, 60))
self.SetButton.setObjectName(_fromUtf8("SetButton"))
self.label_6 = QtGui.QLabel(self.SetTab)
self.label_6.setGeometry(QtCore.QRect(11, 405, 51, 16))
self.label_6.setObjectName(_fromUtf8("label_6"))
self.TimeOk1 = QtGui.QLabel(self.SetTab)
self.TimeOk1.setGeometry(QtCore.QRect(71, 407, 71, 16))
self.TimeOk1.setObjectName(_fromUtf8("TimeOk1"))
self.label_15 = QtGui.QLabel(self.SetTab)
self.label_15.setGeometry(QtCore.QRect(-10, 56, 721, 41))
self.label_15.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_15.setFrameShape(QtGui.QFrame.NoFrame)
self.label_15.setFrameShadow(QtGui.QFrame.Plain)
self.label_15.setText(_fromUtf8(""))
self.label_15.setObjectName(_fromUtf8("label_15"))
self.label_16 = QtGui.QLabel(self.SetTab)
self.label_16.setGeometry(QtCore.QRect(299, 40, 81, 16))
self.label_16.setObjectName(_fromUtf8("label_16"))
self.visiblename = QtGui.QLabel(self.SetTab)
self.visiblename.setGeometry(QtCore.QRect(90, 66, 81, 16))
self.visiblename.setObjectName(_fromUtf8("visiblename"))
self.visiblename_2 = QtGui.QLabel(self.SetTab)
self.visiblename_2.setGeometry(QtCore.QRect(450, 66, 81, 16))
self.visiblename_2.setObjectName(_fromUtf8("visiblename_2"))
self.visiblecapacity = QtGui.QLabel(self.SetTab)
self.visiblecapacity.setGeometry(QtCore.QRect(540, 66, 31, 16))
self.visiblecapacity.setObjectName(_fromUtf8("visiblecapacity"))
self.label_17 = QtGui.QLabel(self.SetTab)
self.label_17.setGeometry(QtCore.QRect(-10, 106, 721, 41))
self.label_17.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_17.setFrameShape(QtGui.QFrame.NoFrame)
self.label_17.setFrameShadow(QtGui.QFrame.Plain)
self.label_17.setText(_fromUtf8(""))
self.label_17.setObjectName(_fromUtf8("label_17"))
self.label_18 = QtGui.QLabel(self.SetTab)
self.label_18.setGeometry(QtCore.QRect(300, 93, 81, 21))
self.label_18.setObjectName(_fromUtf8("label_18"))
self.label_19 = QtGui.QLabel(self.SetTab)
self.label_19.setGeometry(QtCore.QRect(30, 120, 111, 16))
self.label_19.setObjectName(_fromUtf8("label_19"))
self.checkselect = QtGui.QCheckBox(self.SetTab)
self.checkselect.setGeometry(QtCore.QRect(150, 116, 71, 21))
self.checkselect.setChecked(True)
self.checkselect.setObjectName(_fromUtf8("checkselect"))
self.selectEdit = QtGui.QLineEdit(self.SetTab)
self.selectEdit.setGeometry(QtCore.QRect(240, 116, 361, 20))
self.selectEdit.setObjectName(_fromUtf8("selectEdit"))
self.selectButton = QtGui.QPushButton(self.SetTab)
self.selectButton.setGeometry(QtCore.QRect(610, 116, 75, 23))
self.selectButton.setStyleSheet(_fromUtf8("QPushButton:hover {\n"
" \n"
"}\n"
"QPushButton{\n"
" color : solid gray;\n"
" border: 2px solid gray;\n"
" border-radius: 5px;\n"
" background: transparent;\n"
" padding: 0px;\n"
" text-align : center ;\n"
"}"))
self.selectButton.setObjectName(_fromUtf8("selectButton"))
self.label_20 = QtGui.QLabel(self.SetTab)
self.label_20.setGeometry(QtCore.QRect(-10, -10, 721, 51))
self.label_20.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_20.setFrameShape(QtGui.QFrame.NoFrame)
self.label_20.setFrameShadow(QtGui.QFrame.Plain)
self.label_20.setText(_fromUtf8(""))
self.label_20.setObjectName(_fromUtf8("label_20"))
self.label_2 = QtGui.QLabel(self.SetTab)
self.label_2.setGeometry(QtCore.QRect(352, 10, 81, 16))
self.label_2.setObjectName(_fromUtf8("label_2"))
self.SetLine = QtGui.QLineEdit(self.SetTab)
self.SetLine.setGeometry(QtCore.QRect(432, 10, 221, 20))
self.SetLine.setObjectName(_fromUtf8("SetLine"))
self.ToolSet = QtGui.QToolButton(self.SetTab)
self.ToolSet.setGeometry(QtCore.QRect(660, 10, 21, 21))
self.ToolSet.setStyleSheet(_fromUtf8("QToolButton:hover {\n"
" \n"
"}\n"
"QToolButton{\n"
" color : solid gray;\n"
" border: 2px solid gray;\n"
" border-radius: 5px;\n"
" background: transparent;\n"
" padding: 0px;\n"
" text-align : center ;\n"
"}"))
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(_fromUtf8("imges/icon/thumbbtn_newtask.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ToolSet.setIcon(icon2)
self.ToolSet.setIconSize(QtCore.QSize(60, 60))
self.ToolSet.setObjectName(_fromUtf8("ToolSet"))
self.label_23 = QtGui.QLabel(self.SetTab)
self.label_23.setGeometry(QtCore.QRect(300, 146, 111, 16))
self.label_23.setObjectName(_fromUtf8("label_23"))
self.WidgetLink = QtGui.QListWidget(self.SetTab)
self.WidgetLink.setGeometry(QtCore.QRect(0, 170, 711, 151))
self.WidgetLink.setObjectName(_fromUtf8("WidgetLink"))
self.label_26 = QtGui.QLabel(self.SetTab)
self.label_26.setGeometry(QtCore.QRect(-10, 320, 731, 41))
self.label_26.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_26.setFrameShape(QtGui.QFrame.NoFrame)
self.label_26.setFrameShadow(QtGui.QFrame.Plain)
self.label_26.setText(_fromUtf8(""))
self.label_26.setObjectName(_fromUtf8("label_26"))
self.TimeOk = QtGui.QLabel(self.SetTab)
self.TimeOk.setGeometry(QtCore.QRect(550, 330, 131, 16))
self.TimeOk.setObjectName(_fromUtf8("TimeOk"))
self.label_22 = QtGui.QLabel(self.SetTab)
self.label_22.setGeometry(QtCore.QRect(0, -70, 721, 51))
self.label_22.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_22.setFrameShape(QtGui.QFrame.NoFrame)
self.label_22.setFrameShadow(QtGui.QFrame.Plain)
self.label_22.setText(_fromUtf8(""))
self.label_22.setObjectName(_fromUtf8("label_22"))
self.down1 = QtGui.QLabel(self.SetTab)
self.down1.setGeometry(QtCore.QRect(422, 433, 51, 16))
self.down1.setObjectName(_fromUtf8("down1"))
self.upload1 = QtGui.QLabel(self.SetTab)
self.upload1.setGeometry(QtCore.QRect(610, 426, 51, 30))
self.upload1.setObjectName(_fromUtf8("upload1"))
self.upload1_2 = QtGui.QLabel(self.SetTab)
self.upload1_2.setGeometry(QtCore.QRect(538, 426, 51, 30))
self.upload1_2.setObjectName(_fromUtf8("upload1_2"))
self.visiblename_3 = QtGui.QLabel(self.SetTab)
self.visiblename_3.setGeometry(QtCore.QRect(0, 67, 81, 16))
self.visiblename_3.setObjectName(_fromUtf8("visiblename_3"))
self.TimeOk_2 = QtGui.QLabel(self.SetTab)
self.TimeOk_2.setGeometry(QtCore.QRect(460, 330, 91, 16))
self.TimeOk_2.setObjectName(_fromUtf8("TimeOk_2"))
self.label_27 = QtGui.QLabel(self.SetTab)
self.label_27.setGeometry(QtCore.QRect(-10, 352, 731, 41))
self.label_27.setStyleSheet(_fromUtf8("QLabel {\n"
" margin: 8px;\n"
" border: 0px solid green;\n"
" padding: 10px;\n"
"\n"
" \n"
" background-image: url(qt.png);\n"
" background-position: top right;\n"
" background-origin: content;\n"
" background-repeat: none;\n"
"}"))
self.label_27.setFrameShape(QtGui.QFrame.NoFrame)
self.label_27.setFrameShadow(QtGui.QFrame.Plain)
self.label_27.setText(_fromUtf8(""))
self.label_27.setObjectName(_fromUtf8("label_27"))
self.UpdateButton = QtGui.QPushButton(self.SetTab)
self.UpdateButton.setGeometry(QtCore.QRect(620, 360, 75, 23))
self.UpdateButton.setStyleSheet(_fromUtf8("QPushButton:hover {\n"
" \n"
"}\n"
"QPushButton{\n"
" color : solid gray;\n"
" border: 2px solid gray;\n"
" border-radius: 5px;\n"
" background: transparent;\n"
" padding: 0px;\n"
" text-align : center ;\n"
"}"))
self.UpdateButton.setObjectName(_fromUtf8("UpdateButton"))
self.tabwindows.addTab(self.SetTab, _fromUtf8(""))
self.label = QtGui.QLabel(Form)
self.label.setGeometry(QtCore.QRect(360, 10, 81, 16))
self.label.setObjectName(_fromUtf8("label"))
self.treeOk = QtGui.QTreeView(Form)
self.treeOk.setGeometry(QtCore.QRect(0, 0, 141, 511))
self.treeOk.setObjectName(_fromUtf8("treeOk"))
self.Setbutton = QtGui.QToolButton(Form)
self.Setbutton.setGeometry(QtCore.QRect(820, 0, 21, 21))
self.Setbutton.setStyleSheet(_fromUtf8("QToolButton:hover {\n"
" \n"
"}\n"
"QToolButton{\n"
" color : solid gray;\n"
" border: 2px solid gray;\n"
" border-radius: 5px;\n"
" background: transparent;\n"
" padding: 0px;\n"
" text-align : center ;\n"
"}"))
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(_fromUtf8("imges/icon/win7_thumbview_down.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.Setbutton.setIcon(icon3)
self.Setbutton.setIconSize(QtCore.QSize(60, 60))
self.Setbutton.setObjectName(_fromUtf8("Setbutton"))
self.downs = QtGui.QPushButton(Form)
self.downs.setGeometry(QtCore.QRect(790, 0, 21, 20))
self.downs.setStyleSheet(_fromUtf8("QToolButton{\n"
" color : solid gray;\n"
" border: 2px solid gray;\n"
" border-radius: 5px;\n"
" background: transparent;\n"
" padding: 0px;\n"
" text-align : center ;\n"
"}"))
self.downs.setText(_fromUtf8(""))
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(_fromUtf8("imges/icon/dq.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.downs.setIcon(icon4)
self.downs.setIconSize(QtCore.QSize(60, 60))
self.downs.setObjectName(_fromUtf8("downs"))
self.OKlist = QtGui.QListWidget(Form)
self.OKlist.setGeometry(QtCore.QRect(570, 27, 271, 211))
self.OKlist.setObjectName(_fromUtf8("OKlist"))
item = QtGui.QListWidgetItem()
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/pc6下载.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon5)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/百度.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon6)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon7 = QtGui.QIcon()
icon7.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/百度贴吧.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon7)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon8 = QtGui.QIcon()
icon8.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/电影天堂.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon8)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon9 = QtGui.QIcon()
icon9.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/快播.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon9)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon10 = QtGui.QIcon()
icon10.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/腾讯.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon10)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon11 = QtGui.QIcon()
icon11.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/下载吧.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon11)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon12 = QtGui.QIcon()
icon12.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/学科网.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon12)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon13 = QtGui.QIcon()
icon13.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/迅雷快传.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon13)
self.OKlist.addItem(item)
item = QtGui.QListWidgetItem()
icon14 = QtGui.QIcon()
icon14.addPixmap(QtGui.QPixmap(_fromUtf8("imges/png/音乐网.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item.setIcon(icon14)
self.OKlist.addItem(item)
self.enble1 = QtGui.QLabel(Form)
self.enble1.setGeometry(QtCore.QRect(580, 30, 71, 16))
self.enble1.setObjectName(_fromUtf8("enble1"))
self.tool1 = QtGui.QToolButton(Form)
self.tool1.setGeometry(QtCore.QRect(733, 30, 37, 18))
self.tool1.setAutoRaise(True)
self.tool1.setObjectName(_fromUtf8("tool1"))
self.tool2 = QtGui.QToolButton(Form)
self.tool2.setGeometry(QtCore.QRect(785, 30, 37, 18))
self.tool2.setAcceptDrops(False)
self.tool2.setAutoRaise(True)
self.tool2.setObjectName(_fromUtf8("tool2"))
self.line = QtGui.QFrame(Form)
self.line.setGeometry(QtCore.QRect(570, 39, 271, 21))
self.line.setFrameShape(QtGui.QFrame.HLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
self.line.setObjectName(_fromUtf8("line"))
self.line_2 = QtGui.QFrame(Form)
self.line_2.setGeometry(QtCore.QRect(683, 30, 20, 21))
self.line_2.setFrameShape(QtGui.QFrame.VLine)
self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
self.line_2.setObjectName(_fromUtf8("line_2"))
self.retranslateUi(Form)
self.tabwindows.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(_translate("Form", "Form", None))
item = self.tabOk.horizontalHeaderItem(0)
item.setText(_translate("Form", "资源名称", None))
item = self.tabOk.horizontalHeaderItem(1)
item.setText(_translate("Form", "下载时间", None))
item = self.tabOk.horizontalHeaderItem(2)
item.setText(_translate("Form", "文件大小", None))
item = self.tabOk.horizontalHeaderItem(3)
item.setText(_translate("Form", "下载速度", None))
item = self.tabOk.horizontalHeaderItem(4)
item.setText(_translate("Form", "资源所在网站", None))
item = self.tabOk.horizontalHeaderItem(5)
item.setText(_translate("Form", "文件目录", None))
item = self.tabOk.horizontalHeaderItem(6)
item.setText(_translate("Form", "文件类型", None))
self.plainOk.setPlainText(_translate("Form", "显示消息\n"
"", None))
self.label_3.setToolTip(_translate("Form", "小型下载工具", None))
self.label_3.setText(_translate("Form", "搜 索", None))
self.upload2.setText(_translate("Form", "0个", None))
self.label_12.setText(_translate("Form", "当前下载个数", None))
self.tooldow.setText(_translate("Form", "...", None))
self.tabwindows.setTabText(self.tabwindows.indexOf(self.DownTab), _translate("Form", "下载界面", None))
self.dowcount.setText(_translate("Form", "完成了0个下载任务", None))
self.label_8.setText(_translate("Form", "下载速度", None))
self.label_6.setText(_translate("Form", "下载时间", None))
self.TimeOk1.setText(_translate("Form", "下载时间", None))
self.label_16.setText(_translate("Form", "系 统 设 置", None))
self.visiblename.setText(_translate("Form", "None", None))
self.visiblename_2.setText(_translate("Form", "剩余容量", None))
self.visiblecapacity.setText(_translate("Form", "0KB", None))
self.label_18.setText(_translate("Form", "系 统 声 音", None))
self.label_19.setText(_translate("Form", "下载完之后播放声音", None))
self.checkselect.setText(_translate("Form", "是否选择", None))
self.selectEdit.setText(_translate("Form", "voice/download-complete.wav", None))
self.selectButton.setText(_translate("Form", "浏览", None))
self.label_2.setText(_translate("Form", "设 置 路 径", None))
self.SetLine.setText(_translate("Form", "UpdateButton", None))
self.ToolSet.setText(_translate("Form", "...", None))
self.label_23.setText(_translate("Form", "各 种 链 接", None))
self.TimeOk.setText(_translate("Form", "0000-00-00 00:00:00", None))
self.down1.setText(_translate("Form", "0KB/S", None))
self.upload1.setText(_translate("Form", "0KB/S", None))
self.upload1_2.setText(_translate("Form", "上传速度", None))
self.visiblename_3.setText(_translate("Form", "所在硬盘名称", None))
self.TimeOk_2.setText(_translate("Form", "当前本地时间", None))
self.UpdateButton.setText(_translate("Form", "检查更新", None))
self.tabwindows.setTabText(self.tabwindows.indexOf(self.SetTab), _translate("Form", "下载设置", None))
self.label.setText(_translate("Form", "小型下载工具", None))
self.Setbutton.setText(_translate("Form", "...", None))
__sortingEnabled = self.OKlist.isSortingEnabled()
self.OKlist.setSortingEnabled(False)
item = self.OKlist.item(0)
item.setText(_translate("Form", "pc6下载", None))
item = self.OKlist.item(1)
item.setText(_translate("Form", "百度", None))
item = self.OKlist.item(2)
item.setText(_translate("Form", "百度贴吧", None))
item = self.OKlist.item(3)
item.setText(_translate("Form", "电影天堂", None))
item = self.OKlist.item(4)
item.setText(_translate("Form", "快播", None))
item = self.OKlist.item(5)
item.setText(_translate("Form", "腾讯", None))
item = self.OKlist.item(6)
item.setText(_translate("Form", "下载吧", None))
item = self.OKlist.item(7)
item.setText(_translate("Form", "学科网", None))
item = self.OKlist.item(8)
item.setText(_translate("Form", "迅雷快传", None))
item = self.OKlist.item(9)
item.setText(_translate("Form", "音乐网", None))
self.OKlist.setSortingEnabled(__sortingEnabled)
self.enble1.setText(_translate("Form", "常用下载站点", None))
self.tool1.setText(_translate("Form", "编辑", None))
self.tool2.setText(_translate("Form", "关闭", None))
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
Form = QtGui.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())