本文整理汇总了Python中utils.containerRemoveAll函数的典型用法代码示例。如果您正苦于以下问题:Python containerRemoveAll函数的具体用法?Python containerRemoveAll怎么用?Python containerRemoveAll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了containerRemoveAll函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: selectPage
def selectPage(self, pageId):
'''Select recommend page.'''
utils.containerRemoveAll(self.contentBox)
self.navigatebar.pageId = pageId
self.navigatebar.box.queue_draw()
if self.detailViewDict.has_key(pageId):
child = self.detailViewDict[pageId].scrolledWindow
elif self.searchViewDict.has_key(pageId):
child = self.searchViewDict[pageId].box
else:
if pageId == PAGE_RECOMMEND:
child = self.recommendPage.scrolledwindow
elif pageId == PAGE_REPO:
child = self.repoPage.box
elif pageId == PAGE_UPGRADE:
child = self.updatePage.box
elif pageId == PAGE_UNINSTALL:
child = self.uninstallPage.box
elif pageId == PAGE_COMMUNITY:
child = self.communityPage.box
else:
child = self.morePage.box
self.contentBox.pack_start(child)
self.contentBox.show_all()
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:27,代码来源:deepin-software-center.py
示例2: show
def show(self, scrollToTop=True):
'''Show application view.'''
# Remove child widgets first.
utils.containerRemoveAll(self.box)
self.itemDict.clear()
if self.appNum != 0:
# Get application list.
appList = self.getListFunc((self.pageIndex - 1) * self.defaultRows,
min(self.pageIndex * self.defaultRows, self.appNum)
)
# Create application view.
self.box.pack_start(self.createAppList(appList))
# Create index view.
indexbar = self.createIndexbar()
if not indexbar == None:
self.box.pack_start(indexbar)
self.box.show_all()
# Request vote data.
self.fetchVoteCallback(
self.pageId,
map (lambda appInfo: utils.getPkgName(appInfo.pkg), appList),
self.isSearchPage)
# Scroll ScrolledWindow to top after render.
if scrollToTop:
utils.scrollToTop(self.scrolledwindow)
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:31,代码来源:appView.py
示例3: initNormalStatus
def initNormalStatus(self):
'''Init normal status.'''
pkg = self.appInfo.pkg
# Clean right box first.
utils.containerRemoveAll(self.appAdditionBox)
# Add application vote information.
self.appVoteView = VoteView(
self.appInfo, PAGE_UPGRADE,
self.sendVoteCallback)
self.appAdditionBox.pack_start(self.appVoteView.eventbox, False, False)
# Add application size.
size = utils.getPkgSize(pkg)
appSize = gtk.Label()
appSize.set_size_request(self.SIZE_LABEL_WIDTH, -1)
appSize.set_markup("<span size='%s'>%s</span>" % (LABEL_FONT_SIZE, utils.formatFileSize(size)))
appSize.set_alignment(1.0, 0.5)
self.appAdditionBox.pack_start(appSize, False, False, self.APP_RIGHT_PADDING_X)
# Add ignore button.
(ignoreLabel, ignoreEventBox) = setDefaultClickableDynamicLabel(
__("Notify again"),
"appIgnore",
)
ignoreEventBox.connect("button-press-event",
lambda w, e: self.removeIgnorePkgCallback([utils.getPkgName(pkg)]))
ignoreLabelPaddingX = 30
ignoreAlign = gtk.Alignment()
ignoreAlign.set(0.0, 0.5, 0.0, 0.0)
ignoreAlign.set_padding(0, 0, ignoreLabelPaddingX, ignoreLabelPaddingX)
ignoreAlign.add(ignoreEventBox)
self.appAdditionBox.pack_start(ignoreAlign, False, False)
开发者ID:StephenPCG,项目名称:deepin-software-center,代码行数:35,代码来源:ignoreView.py
示例4: initActionStatus
def initActionStatus(appAdditionBox, progress, feedback):
'''Init action status.'''
APP_RIGHT_PADDING_X = 20
PROGRESS_WIDTH = 170
# Clean right box first.
utils.containerRemoveAll(appAdditionBox)
# Add progress.
progressbar = drawProgressbar(PROGRESS_WIDTH)
progressbar.setProgress(progress)
appAdditionBox.pack_start(progressbar.box)
# Alignment box.
alignBox = gtk.HBox()
alignBox.set_size_request(ACTION_BUTTON_WIDTH, -1)
appAdditionBox.pack_start(alignBox, False, False, ACTION_BUTTON_PADDING_X)
# Add feedback label.
feedbackLabel = gtk.Label()
feedbackLabel.set_markup("<span size='%s'>%s</span>" % (LABEL_FONT_SIZE, feedback))
feedbackLabel.set_ellipsize(pango.ELLIPSIZE_END)
feedbackLabel.set_alignment(0.5, 0.5)
alignBox.pack_start(feedbackLabel)
return (progressbar, feedbackLabel)
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:26,代码来源:appItem.py
示例5: initNormalStatus
def initNormalStatus(self):
'''Init normal status.'''
pkg = self.appInfo.pkg
# Clean right box first.
utils.containerRemoveAll(self.appAdditionBox)
# Add application installed size.
size = utils.getPkgInstalledSize(pkg)
appSize = gtk.Label()
appSize.set_size_request(self.SIZE_LABEL_WIDTH, -1)
appSize.set_markup("<span size='%s'>%s</span>" % (LABEL_FONT_SIZE, utils.formatFileSize(size)))
appSize.set_alignment(1.0, 0.5)
self.appAdditionBox.pack_start(appSize, False, False, self.APP_RIGHT_PADDING_X)
# Add application vote information.
self.appVoteView = VoteView(
self.appInfo, PAGE_UNINSTALL,
self.entryDetailCallback,
self.sendVoteCallback)
self.appAdditionBox.pack_start(self.appVoteView.eventbox, False, False)
# Add action button.
(actionButtonBox, actionButtonAlign) = createActionButton()
self.appAdditionBox.pack_start(actionButtonAlign, False, False)
if self.confirmUninstall:
appUninstallLabel = gtk.Label()
appUninstallLabel.set_markup("<span size='%s'>%s</span>" % (LABEL_FONT_SIZE, "你确定要卸载吗?"))
actionButtonBox.pack_start(appUninstallLabel, False, False)
appUninstallBox = gtk.HBox()
appUninstallAlign = gtk.Alignment()
appUninstallAlign.set(0.5, 0.5, 1.0, 1.0)
appUninstallAlign.set_padding(ACTION_BUTTON_PADDING_Y, ACTION_BUTTON_PADDING_Y, 0, 0)
appUninstallAlign.add(appUninstallBox)
actionButtonBox.pack_start(appUninstallAlign, False, False)
(appConfirmButton, appConfirmAlign) = newActionButton(
"uninstall_confirm", 0.0, 0.5,
"cell", False, "卸载", BUTTON_FONT_SIZE_SMALL
)
appConfirmButton.connect("button-release-event", lambda widget, event: self.switchToUninstalling())
(appCancelButton, appCancelAlign) = newActionButton(
"uninstall_confirm", 1.0, 0.5,
"cell", False, "取消", BUTTON_FONT_SIZE_SMALL
)
appCancelButton.connect("button-release-event", lambda widget, event: self.switchToNormal(False))
appUninstallBox.pack_start(appConfirmAlign)
appUninstallBox.pack_start(appCancelAlign)
else:
(appUninstallBox, appUninstallAlign) = newActionButton(
"uninstall", 0.5, 0.5,
"cell", False, "卸载", BUTTON_FONT_SIZE_SMALL
)
appUninstallBox.connect("button-release-event", lambda widget, event: self.switchToNormal(True))
actionButtonBox.pack_start(appUninstallAlign)
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:59,代码来源:appItem.py
示例6: show
def show(self):
'''Show application view.'''
# Remove child widgets first.
utils.containerRemoveAll(self.box)
self.itemDict.clear()
if self.appNum == 0:
if (getDefaultLanguage() == "default"):
paddingX = 10
else:
paddingX = 45
notifyBox = gtk.VBox()
notifyAlign = gtk.Alignment()
notifyAlign.set(0.5, 0.5, 0.0, 0.0)
notifyAlign.add(notifyBox)
self.box.pack_start(notifyAlign)
tipImage = gtk.image_new_from_pixbuf(
gtk.gdk.pixbuf_new_from_file("../icon/tips/%s/downloadTip.png" % (getDefaultLanguage())))
tipAlign = gtk.Alignment()
tipAlign.set_padding(0, 0, paddingX, 0)
tipAlign.add(tipImage)
notifyBox.pack_start(tipAlign)
penguinImage = gtk.image_new_from_pixbuf(
gtk.gdk.pixbuf_new_from_file("../icon/tips/penguin.png"))
penguinAlign = gtk.Alignment()
penguinAlign.set_padding(0, 0, 0, paddingX)
penguinAlign.add(penguinImage)
notifyBox.pack_start(penguinAlign)
self.box.show_all()
else:
# Get application list.
appList = self.getListFunc(
(self.pageIndex - 1) * self.defaultRows,
min(self.pageIndex * self.defaultRows, self.appNum)
)
# Create application view.
self.box.pack_start(self.createAppList(appList))
# Create index view.
indexbar = self.createIndexbar()
if not indexbar == None:
self.box.pack_start(indexbar)
# Show all.
self.box.show_all()
# Request vote data.
self.fetchVoteCallback(
PAGE_DOWNLOAD_MANAGE,
map (lambda appInfo: utils.getPkgName(appInfo.pkg), appList))
# Scroll ScrolledWindow to top after render.
utils.scrollToTop(self.scrolledwindow)
开发者ID:StephenPCG,项目名称:deepin-software-center,代码行数:58,代码来源:downloadManageView.py
示例7: show
def show(self, scrollToTop=True):
'''Show application view.'''
# Remove child widgets first.
utils.containerRemoveAll(self.box)
self.itemDict.clear()
# If i don't re-connect self.eventbox and self.box,
# update view will show nothing.
# I still can't understand why?
# Maybe this is bug of GtkEventBox?
utils.containerRemoveAll(self.eventbox)
self.eventbox.add(self.box)
if self.appNum == 0:
notifyBox = gtk.HBox()
notifyAlign = gtk.Alignment()
notifyAlign.set(0.5, 0.5, 0.0, 0.0)
notifyAlign.add(notifyBox)
self.box.pack_start(notifyAlign)
notifyIconAlignX = 5
notifyIcon = gtk.image_new_from_file("./icons/update/smile.gif")
notifyIconAlign = gtk.Alignment()
notifyIconAlign.set(0.5, 1.0, 0.0, 0.0)
notifyIconAlign.set_padding(0, 0, notifyIconAlignX, notifyIconAlignX)
notifyIconAlign.add(notifyIcon)
notifyBox.pack_start(notifyIconAlign)
notifyLabel = gtk.Label()
notifyLabel.set_markup("<span foreground='#1A38EE' size='%s'>%s</span>" % (LABEL_FONT_XX_LARGE_SIZE, "你的系统已经是最新的. :)"))
notifyBox.pack_start(notifyLabel, False, False)
self.box.show_all()
else:
# Get application list.
appList = self.getListFunc(
(self.pageIndex - 1) * self.defaultRows,
min(self.pageIndex * self.defaultRows, self.appNum)
)
# Create application view.
self.box.pack_start(self.createAppList(appList))
# Create index view.
indexbar = self.createIndexbar()
if not indexbar == None:
self.box.pack_start(indexbar)
self.box.show_all()
# Request vote data.
self.fetchVoteCallback(
PAGE_UPGRADE,
map (lambda appInfo: utils.getPkgName(appInfo.pkg), appList))
# Scroll ScrolledWindow to top after render.
if scrollToTop:
utils.scrollToTop(self.scrolledwindow)
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:58,代码来源:updateView.py
示例8: drawFocusInit
def drawFocusInit(self):
'''Draw focus out.'''
# Remove child first.
utils.containerRemoveAll(self.starBox)
# Add waiting label.
waitingVoteLabel = gtk.Label()
waitingVoteLabel.set_markup("")
self.starBox.pack_start(waitingVoteLabel)
开发者ID:Zulfikarlatief,项目名称:tealinux-software-center,代码行数:9,代码来源:appItem.py
示例9: drawFocusInit
def drawFocusInit(self):
'''Draw focus out.'''
# Remove child first.
utils.containerRemoveAll(self.starBox)
utils.containerRemoveAll(self.voteBox)
# Add waiting label.
waitingVoteLabel = gtk.Label()
waitingVoteLabel.set_markup("<span foreground='#1A3E88' size='%s'>读取评论数据...</span>" % (LABEL_FONT_SIZE))
self.starBox.pack_start(waitingVoteLabel)
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:10,代码来源:appItem.py
示例10: drawFocusStar
def drawFocusStar(self):
'''Draw focus star status.'''
# Remove child first.
utils.containerRemoveAll(self.starBox)
utils.containerRemoveAll(self.voteBox)
# Add application vote star.
self.starView = StarView()
self.starBox.pack_start(self.starView.eventbox)
self.starView.eventbox.connect("button-press-event", lambda w, e: self.sendVote())
self.starView.eventbox.connect("button-press-event", lambda w, e: self.switchFocusStatus(self.FOCUS_NORMAL))
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:11,代码来源:appItem.py
示例11: updateSubCategorybar
def updateSubCategorybar(self, category, categoryList):
'''Update sub category bar.'''
# Update value.
self.category = category
self.categoryList = categoryList
# Remove child widgets first.
utils.containerRemoveAll(self.box)
# Show sub-category bar.
rect = self.box.get_allocation()
self.showSubCategorybar(rect.width)
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:12,代码来源:subCategorybar.py
示例12: updateIgnoreNum
def updateIgnoreNum(self, ignoreNum):
'''Update ignore number label.'''
utils.containerRemoveAll(self.ignoreNumBox)
if ignoreNum > 0:
(ignoreLabel, ignoreEventBox) = setDefaultClickableDynamicLabel(
__("No Notify UpdatePage") % (ignoreNum),
"topbarButton",
)
ignoreEventBox.connect("button-press-event", lambda w, e: self.showIgnorePageCallback())
self.ignoreNumBox.add(ignoreEventBox)
self.ignoreNumBox.show_all()
开发者ID:Zulfikarlatief,项目名称:tealinux-software-center,代码行数:12,代码来源:updatePage.py
示例13: drawFocusNormal
def drawFocusNormal(self):
'''Draw focus normal status.'''
# Remove child first.
utils.containerRemoveAll(self.starBox)
utils.containerRemoveAll(self.voteBox)
# Add application vote star.
starBox = createStarBox(self.starLevel, self.starSize)
self.starBox.pack_start(starBox)
self.voteLabel = gtk.Label()
self.voteLabel.set_markup("<span foreground='#1A3E88' size='%s'>评分</span>" % (LABEL_FONT_SIZE))
self.voteEventBox = gtk.EventBox()
self.voteEventBox.set_visible_window(False)
self.voteEventBox.add(self.voteLabel)
self.voteEventBox.connect("button-press-event", lambda w, e: self.switchFocusStatus(self.FOCUS_STAR))
self.voteBox.pack_start(self.voteEventBox)
utils.setClickableLabel(
self.voteEventBox,
self.voteLabel,
"<span foreground='#1A3E88' size='%s'>评分</span>" % (LABEL_FONT_SIZE),
"<span foreground='#0084FF' size='%s'>评分</span>" % (LABEL_FONT_SIZE))
self.rate = gtk.Label()
self.rateEventBox = gtk.EventBox()
self.rateEventBox.set_visible_window(False)
self.rateEventBox.add(self.rate)
self.rateEventBox.connect("button-press-event",
lambda w, e: self.entryDetailCallback(self.pageId, self.appInfo))
rateAlign = gtk.Alignment()
rateAlign.set(1.0, 0.5, 0.0, 0.0)
rateAlign.add(self.rateEventBox)
self.voteBox.pack_start(rateAlign)
if self.voteNum == 0:
self.rate.set_markup("<span foreground='#1A3E88' size='%s'>抢沙发!</span>" % (LABEL_FONT_SIZE))
utils.setClickableLabel(
self.rateEventBox,
self.rate,
"<span foreground='#1A3E88' size='%s'>抢沙发!</span>" % (LABEL_FONT_SIZE),
"<span foreground='#0084FF' size='%s'>抢沙发!</span>" % (LABEL_FONT_SIZE))
else:
self.rate.set_markup("<span foreground='#1A3E88' size='%s'>%s 评论</span>" % (LABEL_FONT_SIZE, self.voteNum))
utils.setClickableLabel(
self.rateEventBox,
self.rate,
"<span foreground='#1A3E88' size='%s'>%s 评论</span>" % (LABEL_FONT_SIZE, self.voteNum),
"<span foreground='#0084FF' size='%s'>%s 评论</span>" % (LABEL_FONT_SIZE, self.voteNum))
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:51,代码来源:appItem.py
示例14: onSizeAllocate
def onSizeAllocate(self, width):
'''Call when signal 'size-allocate' emit.'''
# When first time redraw, remove child and reset width.
if self.redrawCount == 0:
self.redrawCount = self.redrawCount + 1
utils.containerRemoveAll(self.box)
self.box.set_size_request(1, -1)
# When second time redraw, redraw with new width allocated.
elif self.redrawCount == 1:
self.redrawCount = self.redrawCount + 1
self.showSubCategorybar(width)
# When third time, reset redraw count, stop redraw.
else:
self.redrawCount = 0
开发者ID:hiweed,项目名称:deepin-software-center,代码行数:14,代码来源:subCategorybar.py
示例15: drawFocusNormal
def drawFocusNormal(self):
'''Draw focus normal status.'''
# Remove child first.
utils.containerRemoveAll(self.starBox)
# utils.containerRemoveAll(self.voteBox)
# Add application vote star.
starBox = createStarBox(self.starLevel, self.starSize)
self.starBox.pack_start(starBox)
starBox.connect("button-press-event", lambda w, e: self.switchFocusStatus(self.FOCUS_STAR))
utils.setHelpTooltip(starBox, __("Click Start Vote"))
setClickableCursor(starBox)
开发者ID:Zulfikarlatief,项目名称:tealinux-software-center,代码行数:14,代码来源:appItem.py
示例16: drawFocusStar
def drawFocusStar(self):
'''Draw focus star status.'''
# Remove child first.
utils.containerRemoveAll(self.starBox)
# Add application vote star.
self.starView = StarView()
self.starBox.pack_start(self.starView.eventbox)
self.starView.eventbox.connect("button-press-event", lambda w, e: self.sendVote())
self.starView.eventbox.connect("button-press-event", lambda w, e: self.switchFocusStatus(self.FOCUS_NORMAL))
# Show help.
utils.setHelpTooltip(self.starView.eventbox, __("Click Finish Vote"))
setClickableCursor(self.starView.eventbox)
开发者ID:Zulfikarlatief,项目名称:tealinux-software-center,代码行数:14,代码来源:appItem.py
示例17: initDownloadPauseStatus
def initDownloadPauseStatus(self, appAdditionBox, withoutBorder=False, color=None):
if color == None:
color = appTheme.getDynamicColor("statusUpdate").getColor()
"""Init download pause status."""
# Clean right box first.
utils.containerRemoveAll(appAdditionBox)
# Add progress.
progress = self.appInfo.downloadingProgress
if withoutBorder:
progressbar = drawProgressbarWithoutBorder(self.PROGRESS_WIDTH)
else:
progressbar = drawProgressbar(self.PROGRESS_WIDTH)
progressbar.setProgress(progress)
appAdditionBox.pack_start(progressbar.box)
# Alignment box.
(actionBox, actionAlign) = createActionButton()
appAdditionBox.pack_start(actionAlign)
# Add play icon.
buttonBox = gtk.HBox()
buttonAlign = gtk.Alignment()
buttonAlign.set(0.5, 0.5, 0.0, 0.0)
buttonAlign.set_padding(ACTION_BUTTON_PADDING_Y, ACTION_BUTTON_PADDING_Y, 0, 0)
buttonAlign.add(buttonBox)
actionBox.pack_start(buttonAlign)
continueIcon = gtk.Button()
drawSimpleButton(continueIcon, "continue")
continueIcon.connect("button-release-event", lambda widget, event: self.switchToDownloading())
buttonBox.pack_start(continueIcon, False, False, self.BUTTON_PADDING_X)
# Add stop icon.
stopIcon = gtk.Button()
drawSimpleButton(stopIcon, "stop")
stopIcon.connect("button-release-event", lambda widget, event: self.switchToNormal())
buttonBox.pack_start(stopIcon, False, False, self.BUTTON_PADDING_X)
# Add pause label.
pauseLabel = gtk.Label()
pauseLabel.set_markup(
"<span foreground='%s' size='%s'>%s</span>" % (color, LABEL_FONT_SIZE, __("Action Pause"))
)
pauseLabel.set_width_chars(self.PROGRESS_LABEL_WIDTH_CHARS)
pauseLabel.set_ellipsize(pango.ELLIPSIZE_END)
pauseLabel.set_alignment(0.5, 0.5)
actionBox.pack_start(pauseLabel)
开发者ID:forostm,项目名称:deepin-software-center,代码行数:49,代码来源:appItem.py
示例18: initNormalStatus
def initNormalStatus(self):
'''Init normal status.'''
pkg = self.appInfo.pkg
# Clean right box first.
utils.containerRemoveAll(self.appAdditionBox)
# Add application vote information.
self.appVoteView = VoteView(
self.appInfo, PAGE_DOWNLOAD_MANAGE,
self.sendVoteCallback)
self.appAdditionBox.pack_start(self.appVoteView.eventbox, False, False)
# Add application size.
size = utils.getPkgSize(pkg)
appSize = gtk.Label()
appSize.set_markup("<span size='%s'>%s</span>" % (LABEL_FONT_SIZE, utils.formatFileSize(size)))
appSize.set_alignment(1.0, 0.5)
self.appAdditionBox.pack_start(appSize, False, False, self.LIKE_PADDING_X)
# Add action button.
(actionButtonBox, actionButtonAlign) = createActionButton()
self.appAdditionBox.pack_start(actionButtonAlign, False, False)
if self.appInfo.status == APP_STATE_NORMAL:
(appButton, appButtonAlign) = newActionButton(
"install", 0.5, 0.5,
"cell", False, __("Action Install"), BUTTON_FONT_SIZE_SMALL, "buttonFont"
)
appButton.connect("button-release-event", lambda widget, event: self.switchToDownloading())
actionButtonBox.pack_start(appButtonAlign)
elif self.appInfo.status == APP_STATE_UPGRADE:
(appButton, appButtonAlign) = newActionButton(
"update", 0.5, 0.5,
"cell", False, __("Action Update"), BUTTON_FONT_SIZE_SMALL, "buttonFont"
)
appButton.connect("button-release-event", lambda widget, event: self.switchToDownloading())
actionButtonBox.pack_start(appButtonAlign)
else:
appInstalledDynamicLabel = DynamicSimpleLabel(
actionButtonBox,
__("Action Installed"),
appTheme.getDynamicColor("installed"),
LABEL_FONT_SIZE,
)
appInstalledLabel = appInstalledDynamicLabel.getLabel()
buttonImage = appTheme.getDynamicPixbuf("cell/update_hover.png").getPixbuf()
appInstalledLabel.set_size_request(buttonImage.get_width(), buttonImage.get_height())
actionButtonBox.pack_start(appInstalledLabel)
开发者ID:StephenPCG,项目名称:deepin-software-center,代码行数:48,代码来源:downloadManageView.py
示例19: updateCommentNum
def updateCommentNum(self, commentNum):
'''Update comment num.'''
if commentNum > 0:
utils.containerRemoveAll(self.appCommentNumBox)
appCommentLabel = DynamicSimpleLabel(
self.appCommentNumBox,
__("Comment") % commentNum,
appTheme.getDynamicColor("appComment"),
LABEL_FONT_SIZE,
).getLabel()
appCommentLabel.set_single_line_mode(True)
appCommentLabel.set_alignment(0.0, 1.0)
self.appCommentNumBox.pack_start(appCommentLabel, True, True)
self.align.show_all()
开发者ID:Zulfikarlatief,项目名称:tealinux-software-center,代码行数:16,代码来源:appItem.py
示例20: initDownloadingStatus
def initDownloadingStatus(self, appAdditionBox, withoutBorder=False):
'''Init downloading status.'''
# Clean right box first.
utils.containerRemoveAll(appAdditionBox)
# Add progress.
progress = self.appInfo.downloadingProgress
if withoutBorder:
progressbar = drawProgressbarWithoutBorder(self.PROGRESS_WIDTH)
else:
progressbar = drawProgressbar(self.PROGRESS_WIDTH)
progressbar.setProgress(progress)
self.downloadingProgressbar = progressbar
appAdditionBox.pack_start(progressbar.box)
# Alignment box.
(actionBox, actionAlign) = createActionButton()
appAdditionBox.pack_start(actionAlign)
# Add pause icon.
buttonBox = gtk.HBox()
buttonAlign = gtk.Alignment()
buttonAlign.set(0.5, 0.5, 0.0, 0.0)
buttonAlign.set_padding(ACTION_BUTTON_PADDING_Y, ACTION_BUTTON_PADDING_Y, 0, 0)
buttonAlign.add(buttonBox)
actionBox.pack_start(buttonAlign)
pauseIcon = gtk.Button()
drawSimpleButton(pauseIcon, "pause")
pauseIcon.connect("button-release-event", lambda widget, event: self.switchToDownloadPause())
buttonBox.pack_start(pauseIcon, False, False, self.BUTTON_PADDING_X)
# Add stop icon.
stopIcon = gtk.Button()
drawSimpleButton(stopIcon, "stop")
stopIcon.connect("button-release-event", lambda widget, event: self.switchToNormal())
buttonBox.pack_start(stopIcon, False, False, self.BUTTON_PADDING_X)
# Add feedback label.
feedbackLabel = gtk.Label()
feedbackLabel.set_markup("<span size='%s'>%s</span>" % (LABEL_FONT_SIZE, self.appInfo.downloadingFeedback))
feedbackLabel.set_width_chars(self.PROGRESS_LABEL_WIDTH_CHARS)
feedbackLabel.set_ellipsize(pango.ELLIPSIZE_END)
feedbackLabel.set_alignment(0.5, 0.5)
self.downloadingFeedbackLabel = feedbackLabel
actionBox.pack_start(feedbackLabel)
开发者ID:Zulfikarlatief,项目名称:tealinux-software-center,代码行数:46,代码来源:appItem.py
注:本文中的utils.containerRemoveAll函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论