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


Python Icon.standard_set方法代码示例

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


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

示例1: __init__

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def __init__(self, app):
        # create the main window
        StandardWindow.__init__(self, "eepdater", "eepDater - System Updater",
                                autodel=True, size=(320, 320))
        self.callback_delete_request_add(lambda o: elementary.exit())
        self.app = app

        icon = Icon(self)
        icon.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
        icon.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL)
        icon.standard_set('software-center')
        icon.show()
        self.icon_object_set(icon.object_get())

        # build the two main boxes
        self.mainBox = self.buildMainBox()
        self.loadBox = self.buildLoadBox()
        
        # build the information details inwin object
        self.buildDetailsWin()

        # the flip object has the load screen on one side and the GUI on the other
        self.flip = Flip(self, size_hint_weight=EXPAND_BOTH,
                         size_hint_align=FILL_BOTH)
        self.flip.part_content_set("front", self.mainBox)
        self.flip.part_content_set("back", self.loadBox)
        self.resize_object_add(self.flip)
        self.flip.show()

        # show the window
        self.show()
开发者ID:jbenito,项目名称:bodhi3packages,代码行数:33,代码来源:eepDater.py

示例2: addTab

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def addTab(self, widget, tabName, canClose=True, disabled=False):
        self.tabs.append(widget)

        btn = Button(self.buttonBox, style="anchor", size_hint_align=ALIGN_LEFT)
        btn.text = tabName
        btn.data["widget"] = widget
        btn.disabled = disabled
        btn.callback_clicked_add(self.showTab, widget)
        btn.show()

        icn = Icon(self.buttonBox)
        icn.standard_set("gtk-close")
        icn.show()

        cls = Button(self.buttonBox, content=icn, style="anchor", size_hint_align=ALIGN_LEFT)
        cls.data["widget"] = widget
        cls.callback_clicked_add(self.closeTab)
        cls.disabled = disabled
        if canClose:
            cls.show()

        sep = Separator(self.buttonBox, size_hint_align=ALIGN_LEFT)
        sep.show()

        self.buttonBox.pack_end(btn)
        self.buttonBox.pack_end(cls)
        self.buttonBox.pack_end(sep)

        #Arguments go: btn, cls, sep
        widget.data["close"] = cls
        widget.data["button"] = btn
        widget.data["sep"] = sep
        
        self.showTab(widget=widget)
开发者ID:Deepspeed,项目名称:bodhi3packages,代码行数:36,代码来源:tabbedbox.py

示例3: fileExists

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def fileExists(self, filePath):

        self.confirmPopup = Popup(self.mainWindow,
                                  size_hint_weight=EXPAND_BOTH)

        # Add a table to hold dialog image and text to Popup
        tb = Table(self.confirmPopup, size_hint_weight=EXPAND_BOTH)
        self.confirmPopup.part_content_set("default", tb)
        tb.show()

        # Add dialog-error Image to table
        need_ethumb()
        icon = Icon(self.confirmPopup, thumb='True')
        icon.standard_set('dialog-question')
        # Using gksudo or sudo fails to load Image here
        #   unless options specify using preserving their existing environment.
        #   may also fail to load other icons but does not raise an exception
        #   in that situation.
        # Works fine using eSudo as a gksudo alternative,
        #   other alternatives not tested
        try:
            dialogImage = Image(self.confirmPopup,
                                size_hint_weight=EXPAND_HORIZ,
                                size_hint_align=FILL_BOTH,
                                file=icon.file_get())
            tb.pack(dialogImage, 0, 0, 1, 1)
            dialogImage.show()
        except RuntimeError:
            # An error message is displayed for this same error
            #   when aboutWin is initialized so no need to redisplay.
            pass
        # Add dialog text to table
        dialogLabel = Label(self.confirmPopup, line_wrap=ELM_WRAP_WORD,
                            size_hint_weight=EXPAND_HORIZ,
                            size_hint_align=FILL_BOTH)
        current_file = os.path.basename(filePath)
        dialogLabel.text = "'%s' already exists. Overwrite?<br><br>" \
                           % (current_file)
        tb.pack(dialogLabel, 1, 0, 1, 1)
        dialogLabel.show()

        # Close without saving button
        no_btt = Button(self.mainWindow)
        no_btt.text = "No"
        no_btt.callback_clicked_add(self.closePopup, self.confirmPopup)
        no_btt.show()
        # Save the file and then close button
        sav_btt = Button(self.mainWindow)
        sav_btt.text = "Yes"
        sav_btt.callback_clicked_add(self.doSelected)
        sav_btt.callback_clicked_add(self.closePopup, self.confirmPopup)
        sav_btt.show()

        # add buttons to popup
        self.confirmPopup.part_content_set("button1", no_btt)
        self.confirmPopup.part_content_set("button3", sav_btt)
        self.confirmPopup.show()
开发者ID:emctoo,项目名称:ePad,代码行数:59,代码来源:ePad.py

示例4: __init__

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
 def __init__(self, ourParent, ourText, ourIcon=None, ourCB=None, *args, **kwargs):
     Button.__init__(self, ourParent, *args, **kwargs)
     icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
     icon.standard_set(ourIcon)
     icon.show()
     
     self.text = ourText
     self.content_set(icon)
     self.callback_clicked_add(ourCB)
开发者ID:Feneric,项目名称:bodhi3packages,代码行数:11,代码来源:StandardButton.py

示例5: errorPopup

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
def errorPopup(window, errorMsg):
    errorPopup = Popup(window, size_hint_weight=EXPAND_BOTH)
    errorPopup.callback_block_clicked_add(lambda obj: errorPopup.delete())

    # Add a table to hold dialog image and text to Popup
    tb = Table(errorPopup, size_hint_weight=EXPAND_BOTH)
    errorPopup.part_content_set("default", tb)
    tb.show()

    # Add dialog-error Image to table
    need_ethumb()
    icon = Icon(errorPopup, thumb='True')
    icon.standard_set('dialog-warning')
    # Using gksudo or sudo fails to load Image here
    #   unless options specify using preserving their existing environment.
    #   may also fail to load other icons but does not raise an exception
    #   in that situation.
    # Works fine using eSudo as a gksudo alternative,
    #   other alternatives not tested
    try:
        dialogImage = Image(errorPopup,
                            size_hint_weight=EXPAND_HORIZ,
                            size_hint_align=FILL_BOTH,
                            file=icon.file_get())
        tb.pack(dialogImage, 0, 0, 1, 1)
        dialogImage.show()
    except RuntimeError:
        # An error message is displayed for this same error
        #   when aboutWin is initialized so no need to redisplay.
        pass
    # Add dialog text to table
    dialogLabel = Label(errorPopup, line_wrap=ELM_WRAP_WORD,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=FILL_BOTH)
    dialogLabel.text = errorMsg
    tb.pack(dialogLabel, 1, 0, 1, 1)
    dialogLabel.show()

    # Ok Button
    ok_btt = Button(errorPopup)
    ok_btt.text = "Ok"
    ok_btt.callback_clicked_add(lambda obj: errorPopup.delete())
    ok_btt.show()

    # add button to popup
    errorPopup.part_content_set("button3", ok_btt)
    errorPopup.show()
开发者ID:emctoo,项目名称:ePad,代码行数:49,代码来源:ePad.py

示例6: addButtonPressed

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def addButtonPressed(self, btn):
        toAppend = "file://%s%s"%(self.filepathEntry.text, self.selectedFolder.text.replace(" ", "%20"))

        con = Icon(self, size_hint_weight=EXPAND_BOTH,
                    size_hint_align=FILL_BOTH)
        con.standard_set("gtk-directory")
        con.show()
        it = self.bookmarksList.item_append(self.selectedFolder.text, icon=con)
        it.data["path"] = "%s%s"%(self.filepathEntry.text, self.selectedFolder.text)

        self.bookmarksList.go()

        self.addButton.disabled = True
        self.removeButton.disabled = False

        with open(os.path.expanduser('~/.config/gtk-3.0/bookmarks'),'a') as f:
                f.write( toAppend + " " + self.selectedFolder.text + "\n" )
开发者ID:JeffHoogland,项目名称:bodhi4packages,代码行数:19,代码来源:fileselector.py

示例7: populateBookmarks

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def populateBookmarks(self):
        con = Icon(self, size_hint_weight=EXPAND_BOTH,
                size_hint_align=FILL_BOTH)
        con.standard_set("folder_home")
        con.show()

        it = self.bookmarksList.item_append("Home", icon=con)
        it.data["path"] = self.home

        con = Icon(self, size_hint_weight=EXPAND_BOTH,
                size_hint_align=FILL_BOTH)
        con.standard_set("drive-harddisk")
        con.show()

        it = self.bookmarksList.item_append("Root", icon=con)
        it.data["path"] = self.root

        it = self.bookmarksList.item_append("")
        it.separator_set(True)

        for bk in self.getGTKBookmarks():
            con = Icon(self, size_hint_weight=EXPAND_BOTH,
                    size_hint_align=FILL_BOTH)
            con.standard_set("gtk-directory")
            con.show()
            it = self.bookmarksList.item_append(bk.split("/")[-1], icon=con)
            it.data["path"] = bk[7:]
开发者ID:JeffHoogland,项目名称:bodhi4packages,代码行数:29,代码来源:fileselector.py

示例8: SwamiModule

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
class SwamiModule(Box):
    def __init__(self, rent):
        Box.__init__(self, rent)
        self.parent = rent
        
        #This appears on the button in the main swmai window
        self.name = "Startup Applications"
        #The section in the main window the button is added to
        self.section = "Applications"
        #Search terms that this module should appear for
        self.searchData = ["startup", "command", "applications", "apps"]
        #Command line argument to open this module directly
        self.launchArg = "--startupapps"
        #Should be none by default. This value is used internally by swami
        self.button = None
        
        self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        #Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
        self.icon.standard_set('system-run')
        self.icon.show()
        
        self.mainBox = Box(self, size_hint_weight = EXPAND_BOTH)
        self.mainBox.show()
        
        buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
        buttonBox.horizontal = True
        
        buttonReturn = StandardButton(self, "Back", "go-previous", self.returnPressed)
        buttonReturn.show()
        
        buttonBox.pack_end(buttonReturn)
        buttonBox.show()
        
        self.pack_end(self.mainBox)
        self.pack_end(buttonBox)
        
    def returnPressed(self, btn):
        self.parent.returnMain()
开发者ID:JeffHoogland,项目名称:swami,代码行数:40,代码来源:swami_startupapps.py

示例9: FileSelector

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]

#.........这里部分代码省略.........
        #self.filepathEntry.input_hint_set(ELM_INPUT_HINT_AUTO_COMPLETE)

        if defaultPath and os.path.isdir(defaultPath):
            startPath = defaultPath
        else:
            startPath = self.home
        self.filepathEntry.show()

        self.filepathBox.pack_end(fileLabel)
        self.filepathBox.pack_end(self.filepathEntry)

        self.autocompleteHover = Hoversel(self, hover_parent=self)
        self.autocompleteHover.callback_selected_add(self.autocompleteSelected)
        #self.autocompleteHover.show()

        self.fileSelectorBox = Panes(self, content_left_size=0.3,
                      size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.fileSelectorBox.show()

        """Bookmarks Box contains:

            - Button - Up Arrow
            - List - Home/Root/GTK bookmarks
            - Box
            -- Button - Add Bookmark
            -- Button - Remove Bookmark"""
        self.bookmarkBox = Box(self, size_hint_weight=(0.3, EVAS_HINT_EXPAND),
                size_hint_align=FILL_BOTH)
        self.bookmarkBox.show()


        upIcon = Icon(self, size_hint_weight=EXPAND_BOTH,
                size_hint_align=FILL_BOTH)
        upIcon.standard_set("go-up")
        upIcon.show()

        self.upButton = Button(self, size_hint_weight=EXPAND_HORIZ,
                size_hint_align=FILL_HORIZ, content=upIcon)
        self.upButton.text = "Up"
        self.upButton.callback_pressed_add(self.upButtonPressed)
        self.upButton.show()

        self.bookmarksList = List(self, size_hint_weight=EXPAND_BOTH,
                size_hint_align=FILL_BOTH)
        self.bookmarksList.callback_activated_add(self.bookmarkDoubleClicked)
        self.bookmarksList.show()

        self.bookmarkModBox = Box(self, size_hint_weight=EXPAND_HORIZ,
                size_hint_align=FILL_HORIZ)
        self.bookmarkModBox.horizontal = True
        self.bookmarkModBox.show()

        con = Icon(self, size_hint_weight=EXPAND_BOTH,
                size_hint_align=FILL_BOTH)
        con.standard_set("add")
        con.show()

        self.addButton = Button(self, size_hint_weight=EXPAND_HORIZ,
                size_hint_align=FILL_HORIZ, content=con)
        self.addButton.callback_pressed_add(self.addButtonPressed)
        self.addButton.disabled = True
        self.addButton.show()

        con = Icon(self, size_hint_weight=EXPAND_BOTH,
                size_hint_align=FILL_BOTH)
        con.standard_set("remove")
开发者ID:JeffHoogland,项目名称:bodhi4packages,代码行数:70,代码来源:fileselector.py

示例10: __init__

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def __init__(self):
        self.mainWindow = StandardWindow("epad", "Untitled - ePad",
                                         size=(600, 400))
        self.mainWindow.callback_delete_request_add(self.closeChecks)
        self.mainWindow.elm_event_callback_add(self.eventsCb)

        icon = Icon(self.mainWindow,
                    size_hint_weight=EXPAND_BOTH,
                    size_hint_align=FILL_BOTH)
        icon.standard_set('accessories-text-editor')
        icon.show()
        self.mainWindow.icon_object_set(icon.object_get())

        self.mainBox = Box(self.mainWindow,
                           size_hint_weight=EXPAND_BOTH,
                           size_hint_align=FILL_BOTH)
        self.mainBox.show()

        self.mainTb = ePadToolbar(self, self.mainWindow)
        self.mainTb.show()
        self.mainBox.pack_end(self.mainTb)

        # Initialize Text entry box
        print("Word wrap Initialized: {0}".format(self.wordwrap))
        self.entryInit()

        # Add label to show current cursor position
        if SHOW_POS:
            self.line_label = Label(self.mainWindow,
                                    size_hint_weight=EXPAND_HORIZ,
                                    size_hint_align=ALIGN_RIGHT)
            self.curChanged(self.mainEn, self.line_label)
            self.line_label.show()
            self.mainBox.pack_end(self.line_label)
            self.mainEn.callback_cursor_changed_add(self.curChanged,
                                                    self.line_label)

        # Build our file selector for saving/loading files
        self.fileBox = Box(self.mainWindow,
                           size_hint_weight=EXPAND_BOTH,
                           size_hint_align=FILL_BOTH)
        self.fileBox.show()

        self.fileLabel = Label(self.mainWindow,
                               size_hint_weight=EXPAND_HORIZ,
                               size_hint_align=FILL_BOTH, text="")
        self.fileLabel.show()

        self.fileSelector = Fileselector(self.mainWindow, is_save=False,
                                         expandable=False, folder_only=False,
                                         path=os.getenv("HOME"),
                                         size_hint_weight=EXPAND_BOTH,
                                         size_hint_align=FILL_BOTH)
        self.fileSelector.callback_done_add(self.fileSelected)
        self.fileSelector.show()

        self.fileBox.pack_end(self.fileLabel)
        self.fileBox.pack_end(self.fileSelector)

        # Flip object has the file selector on one side
        #   and the GUI on the other
        self.flip = Flip(self.mainWindow, size_hint_weight=EXPAND_BOTH,
                         size_hint_align=FILL_BOTH)
        self.flip.part_content_set("front", self.mainBox)
        self.flip.part_content_set("back", self.fileBox)
        self.mainWindow.resize_object_add(self.flip)
        self.flip.show()

        self.isSaved = True
        self.isNewFile = False
        self.confirmPopup = None
开发者ID:nijek,项目名称:ePad,代码行数:73,代码来源:ePad.py

示例11: SwamiModule

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
class SwamiModule(Box):
    def __init__(self, rent):
        Box.__init__(self, rent)
        self.parent = rent
        
        self.name = "Keyboard Layout"
        self.section = "System Settings"
        self.searchData = ["keyboard", "layout", "system", "input"]
        self.launchArg = "--keyboard"
        self.button = None
        
        self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        #Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
        self.icon.standard_set('input-keyboard')
        self.icon.show()
        
        #print(list(KeyboardLayouts))
        
        self.keyboardList = keyboardList = SearchableList(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        keyboardList.callback_item_focused_add(self.enableKBSelect)
        self.keys = list(KeyboardLayouts)
        self.keys.sort()
        for kbl in self.keys:
            keyboardList.item_append(kbl)
        keyboardList.show()
        
        self.mainBox = Box(self, size_hint_weight = EXPAND_BOTH, size_hint_align = FILL_BOTH)
        self.mainBox.pack_end(keyboardList)
        self.mainBox.show()
        
        buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
        buttonBox.horizontal = True
        
        self.buttonKBSelect = buttonKBSelect = StandardButton(self, "Apply Selected", "ok", self.applyPressed)
        buttonKBSelect.disabled = True
        buttonKBSelect.show()
        
        buttonReturn = StandardButton(self, "Back", "go-previous", self.returnPressed)
        buttonReturn.show()
        
        buttonBox.pack_end(buttonKBSelect)
        buttonBox.pack_end(buttonReturn)
        buttonBox.show()
        
        self.pack_end(self.mainBox)
        self.pack_end(buttonBox)
    
    def enableKBSelect(self, lst, item):
        self.buttonKBSelect.disabled = False
    
    def applyPressed(self, btn):
        selectKB = self.keyboardList.selected_item_get().text
        print selectKB
        print KeyboardLayouts[selectKB]
        cmd = ecore.Exe("setxkbmap %s"%(KeyboardLayouts[selectKB]))
        
        compPop = StandardPopup(self, "%s keymap applied for current session."%selectKB, 'ok', size_hint_weight=EXPAND_BOTH)
        compPop.show()
    
    def returnPressed(self, btn):
        self.parent.returnMain()
开发者ID:Feneric,项目名称:bodhi3packages,代码行数:63,代码来源:swami_keyboard.py

示例12: SwamiModule

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
class SwamiModule(Box):
    def __init__(self, rent):
        Box.__init__(self, rent)
        self.parent = rent
        
        #This appears on the button in the main swmai window
        self.name = "Light DM"
        #The section in the main window the button is added to
        self.section = "System Settings"
        #Search terms that this module should appear for
        self.searchData = ["lightdm", "autologin", "login", "display"]
        #Command line argument to open this module directly
        self.launchArg = "--lightdm"
        #Should be none by default. This value is used internally by swami
        self.button = None
        
        self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        #Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
        self.icon.standard_set('video-display')
        self.icon.show()
        
        self.mainBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.mainBox.show()
        
        self.config = {}
        
        with open(LightDMConf) as f:
            for line in f:
                #Sections start with [ - such as [SeatDefaults]
                if line[0] != "[":
                    setting, value = line.replace("\n", "").split("=")
                    
                    e = Entry(self)
                    e.single_line_set(True)
                    e.text = value
                    e.show()
                    
                    f = Frame(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
                    f.text = setting
                    f.content = e
                    f.show()
                    
                    self.mainBox.pack_end(f)
                    
                    self.config[setting] = f
        
        buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
        buttonBox.horizontal = True
        
        buttonSave = StandardButton(self, "Save Changes", "ok", self.savePressed)
        buttonSave.show()
        
        buttonReturn = StandardButton(self, "Back", "go-previous", self.returnPressed)
        buttonReturn.show()
        
        buttonBox.pack_end(buttonSave)
        buttonBox.pack_end(buttonReturn)
        buttonBox.show()
        
        self.pack_end(self.mainBox)
        self.pack_end(buttonBox)
    
    def savePressed(self, btn):
        dataList = ["[SeatDefaults]\n"]
        for s in self.config:
            f = self.config[s]
            dataList.append("%s=%s\n"%(f.text, f.content_get().text))
        
        with open("/tmp/lightdm.conf", 'w') as f:
            for item in dataList:
                f.write(item)
        
        self.runCommand('mv -f /tmp/lightdm.conf %s'%LightDMConf)
    
    def returnPressed(self, btn):
        self.parent.returnMain()
    
    def runCommand(self, ourCommand):
        cmd = esudo.eSudo(ourCommand, self.parent)
开发者ID:Feneric,项目名称:bodhi3packages,代码行数:81,代码来源:swami_lightdm.py

示例13: SwamiModule

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
class SwamiModule(Box):
    def __init__(self, rent):
        Box.__init__(self, rent)
        self.parent = rent
        
        self.name = "Date and Time"
        self.section = "System Settings"
        self.searchData = ["clock", "timezone", "date", "system"]
        self.launchArg = "--time"
        self.button = None
        
        self.timezones = getTimeZones()
        
        self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        #Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
        self.icon.standard_set('clock')
        self.icon.show()
        
        cframe = Frame(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        cframe.text = "Current Time"
        cframe.show()

        self.clock = clock = Clock(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        clock.show_seconds_set(True)
        clock.show_am_pm_set(True)
        clock.show()
        
        cframe.content = clock
        
        dframe = Frame(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        dframe.text = "Current Day"
        dframe.show()

        self.cal = cal = Calendar(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        cal.select_mode = ELM_CALENDAR_SELECT_MODE_NONE
        cal.show()
        
        dframe.content = cal
        
        tzframe = Frame(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        tzframe.text = "Current Timezone"
        tzframe.show()

        self.tz = tz = Label(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        tz.text = "<b>%s</b>"%time.tzname[0]
        tz.show()
        
        tzframe.content = tz
        
        self.mainBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.mainBox.pack_end(cframe)
        self.mainBox.pack_end(dframe)
        self.mainBox.pack_end(tzframe)
        self.mainBox.show()
        
        self.zoneList = zoneList = SearchableList(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        zoneList.callback_item_focused_add(self.enableTZSelect)
        self.zones = []
        for tz in self.timezones:
            for each in self.timezones[tz]:
                if each not in self.zones:
                    self.zones.append(each)
        self.zones.sort(reverse=True)
        for zone in self.zones:
            zoneList.item_append(zone)
        zoneList.show()
        
        self.buttonTZSelect = buttonTZSelect = StandardButton(self, "Select", "ok", self.tzselectPressed)
        buttonTZSelect.disabled = True
        buttonTZSelect.show()
        
        buttonTZCancel = StandardButton(self, "Cancel", "close", self.tzcancelPressed)
        buttonTZCancel.show()
        
        tzBBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
        tzBBox.horizontal = True
        tzBBox.pack_end(buttonTZSelect)
        tzBBox.pack_end(buttonTZCancel)
        tzBBox.show()

        tzChangeBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        tzChangeBox.pack_end(zoneList)
        tzChangeBox.pack_end(tzBBox)
        tzChangeBox.show()
        
        self.flip = Flip(self, size_hint_weight=EXPAND_BOTH,
                         size_hint_align=FILL_BOTH)
        self.flip.part_content_set("front", self.mainBox)
        self.flip.part_content_set("back", tzChangeBox)
        self.flip.show()
        
        buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
        buttonBox.horizontal = True
        
        self.buttonApply = buttonApply = StandardButton(self, "Apply Changes", "ok", self.applyPressed)
        buttonApply.disabled = True
        buttonApply.show()
        
        self.buttonSync = buttonSync = StandardButton(self, "Sync from Internet", "refresh", self.syncPressed)
        buttonSync.show()
#.........这里部分代码省略.........
开发者ID:Feneric,项目名称:bodhi3packages,代码行数:103,代码来源:swami_timezone.py

示例14: __init__

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def __init__(self, parent, canvas):

        self._parent = parent
        self._canvas = canvas
        # Dialog Window Basics
        self.aboutDialog = Window("epad", ELM_WIN_DIALOG_BASIC)
        #
        self.aboutDialog.callback_delete_request_add(self.closeabout)
        #    Set Dialog background
        background = Background(self.aboutDialog, size_hint_weight=EXPAND_BOTH)
        self.aboutDialog.resize_object_add(background)
        background.show()
        #
        mainBox = Box(self.aboutDialog, size_hint_weight=EXPAND_BOTH,
                      size_hint_align=FILL_BOTH)
        self.aboutDialog.resize_object_add(mainBox)
        mainBox.show()
        #
        need_ethumb()
        icon = Icon(self.aboutDialog, thumb='True')
        icon.standard_set('accessories-text-editor')

        # Using gksudo or sudo fails to load Image here
        #   unless options specify using preserving their existing environment.
        #   may also fail to load other icons but does not raise an exception
        #   in that situation.
        # Works fine using eSudo as a gksudo alternative,
        #   other alternatives not tested
        try:
            aboutImage = Image(self.aboutDialog, no_scale=True,
                               size_hint_weight=EXPAND_BOTH,
                               size_hint_align=FILL_BOTH,
                               file=icon.file_get())
            aboutImage.aspect_fixed_set(False)

            mainBox.pack_end(aboutImage)
            aboutImage.show()
        except RuntimeError as msg:
            print("Warning: to run as root please use:\n"
                  "\t gksudo -k or sudo -E \n"
                  "Continuing with minor errors ...")

        labelBox = Box(self.aboutDialog, size_hint_weight=EXPAND_NONE)
        mainBox.pack_end(labelBox)
        labelBox.show()
        #    Entry to hold text
        titleStr = '<br>ePad version <em>{0}</em><br>'.format(__version__)
        aboutStr = ('<br>A simple text editor written in <br>'
                    'python and elementary<br>')
        aboutLbTitle = Label(self.aboutDialog, style='marker')
        aboutLbTitle.text = titleStr
        aboutLbTitle.show()

        labelBox.pack_end(aboutLbTitle)

        sep = Separator(self.aboutDialog, horizontal=True)
        labelBox.pack_end(sep)
        sep.show()

        aboutText = Label(self.aboutDialog)
        aboutText.text = aboutStr

        aboutText.show()
        labelBox.pack_end(aboutText)

        aboutCopyright = Label(self.aboutDialog)
        aboutCopyright.text = '<b>Copyright</b> © <i>2014 Bodhi Linux</i><br>'

        aboutCopyright.show()
        labelBox.pack_end(aboutCopyright)

        # Dialog Buttons
        #    Horizontal Box for Dialog Buttons
        buttonBox = Box(self.aboutDialog, horizontal=True,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=FILL_BOTH, padding=PADDING)
        buttonBox.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0)
        buttonBox.show()
        labelBox.pack_end(buttonBox)
        #    Credits Button
        creditsBtn = Button(self.aboutDialog, text="Credits ",
                            size_hint_weight=EXPAND_NONE)
        creditsBtn.callback_clicked_add(self.creditsPress)
        creditsBtn.show()
        buttonBox.pack_end(creditsBtn)
        #    Close Button
        okBtn = Button(self.aboutDialog, text=" Close ",
                       size_hint_weight=EXPAND_NONE)
        okBtn.callback_clicked_add(self.closeabout)
        okBtn.show()
        buttonBox.pack_end(okBtn)

        # Ensure the min height
        self.aboutDialog.resize(300, 100)
开发者ID:emctoo,项目名称:ePad,代码行数:96,代码来源:ePad.py

示例15: __init__

# 需要导入模块: from efl.elementary.icon import Icon [as 别名]
# 或者: from efl.elementary.icon.Icon import standard_set [as 别名]
    def __init__(self):

        # Dialog Window Basics
        self.findDialog = Window("find", ELM_WIN_DIALOG_BASIC)
        self.findDialog.callback_delete_request_add(self.closeFind)
        #    Set Window Icon
        #       Icons work  in ubuntu min everything compiled
        #       but not bodhi rc3
        icon = Icon(self.findDialog,
                    size_hint_weight=EXPAND_BOTH,
                    size_hint_align=FILL_BOTH)
        icon.standard_set('edit-find-replace')
        icon.show()
        self.findDialog.icon_object_set(icon.object_get())
        #    Set Dialog background
        background = Background(self.findDialog, size_hint_weight=EXPAND_BOTH)
        self.findDialog.resize_object_add(background)
        background.show()
        #    Main box to hold shit
        mainBox = Box(self.findDialog, size_hint_weight=EXPAND_BOTH)
        self.findDialog.resize_object_add(mainBox)
        mainBox.show()

        # Search Section
        #    Horizontal Box to hold search stuff
        seachBox = Box(self.findDialog, horizontal=True,
                       size_hint_weight=EXPAND_HORIZ,
                       size_hint_align=FILL_BOTH, padding=PADDING)
        seachBox.show()
        mainBox.pack_end(seachBox)
        #    Label for search entry
        seachLabel = Label(self.findDialog, text="Search for:",
                           size_hint_weight=EXPAND_NONE,
                           size_hint_align=FILL_HORIZ)
        seachBox.pack_end(seachLabel)
        seachLabel.show()
        #    Search Entry
        self.sent = Entry(self.findDialog, scrollable=True, single_line=True,
                          size_hint_weight=EXPAND_HORIZ,
                          size_hint_align=FILL_HORIZ)
        self.sent.callback_activated_add(self.find)  # Enter activates find fn
        self.sent.show()
        seachBox.pack_end(self.sent)

        #    Check boxs for Search Options
        #   FIXME: add callbacks  These states should be in config file
        caseCk = Check(self.findDialog, text="Case sensitive",
                       size_hint_weight=EXPAND_BOTH,
                       size_hint_align=FILL_HORIZ, state=CASE_SENSITIVE)
        caseCk.callback_changed_add(self.ckCase)
        caseCk.show()
        mainBox.pack_end(caseCk)
        wordCk = Check(self.findDialog, text="Match only a whole word",
                       size_hint_weight=EXPAND_BOTH,
                       size_hint_align=FILL_HORIZ, state=WHOLE_WORD)
        wordCk.callback_changed_add(self.ckWord)
        wordCk.show()
        mainBox.pack_end(wordCk)

        # Dialog Buttons
        #    Horizontal Box for Dialog Buttons
        buttonBox = Box(self.findDialog, horizontal=True,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=FILL_BOTH, padding=PADDING)
        buttonBox.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0)
        buttonBox.show()
        mainBox.pack_end(buttonBox)
        #    Cancel Button
        cancelBtn = Button(self.findDialog, text="Cancel",
                           size_hint_weight=EXPAND_NONE)
        cancelBtn.callback_clicked_add(self.closeFind)
        cancelBtn.show()
        buttonBox.pack_end(cancelBtn)
        #    Ok Button
        okBtn = Button(self.findDialog, text=" Find ",
                       size_hint_weight=EXPAND_NONE)
        okBtn.callback_clicked_add(self.find)
        okBtn.show()
        buttonBox.pack_end(okBtn)

        # Ensure the min height
        self.findDialog.resize(300, 1)
        self.findDialog.show()
开发者ID:emctoo,项目名称:ePad,代码行数:85,代码来源:find.py


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