コード例 #1
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        hBox = KHBox(self)

        display = QTreeWidget(hBox)
        display.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels(["Volume", "File Path", "Accessible"])
        display.setColumnWidth(0, 200)
        display.setColumnWidth(1, 300)

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.StorageAccess object, but
        # receive one from the 'asDeviceInterface' call
        for device in deviceList:
            if device.isDeviceInterface(Solid.DeviceInterface.StorageAccess):
                access = device.asDeviceInterface(
                    Solid.DeviceInterface.StorageAccess)
                QTreeWidgetItem(display, [
                    device.product(),
                    access.filePath(),
                    str(access.isAccessible())
                ])
コード例 #2
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter | Qt.AlignTop)
        self.setSpacing(40)

        hBox = KHBox(self)
        vBox1 = KVBox(hBox)
        vBox2 = KVBox(hBox)

        hBox.layout().setAlignment(vBox1, Qt.AlignHCenter)
        hBox.layout().setAlignment(vBox2, Qt.AlignHCenter)
        vBox1.setMargin(20)
        vBox2.setSpacing(20)

        self.datePickerLabel = QLabel("KDatePicker", vBox1)

        self.datePicker = KDatePicker(vBox2)
        self.datePicker.setFixedSize(400, 200)

        self.other = QLabel("KDateWidget", vBox1)
        vBox1.layout().setAlignment(self.other, Qt.AlignBottom)

        self.dateDisplay = KDateWidget(vBox2)

        self.connect(self.datePicker, SIGNAL("dateChanged(QDate)"), self.dateDisplay.setDate)
コード例 #3
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        audioDriverStr = {
                            Solid.AudioInterface.Alsa: "Alsa",\
                            Solid.AudioInterface.OpenSoundSystem: "Open Sound",\
                            Solid.AudioInterface.UnknownAudioDriver: "Unknown"
                         }


        audioInterfaceTypeStr = {
                                  Solid.AudioInterface.UnknownAudioInterfaceType: "Unknown",\
                                  Solid.AudioInterface.AudioControl: "Control",\
                                  Solid.AudioInterface.AudioInput: "In",\
                                  Solid.AudioInterface.AudioOutput: "Out"
                                }

        soundcardTypeStr = {
                             Solid.AudioInterface.InternalSoundcard: "Internal",\
                             Solid.AudioInterface.UsbSoundcard: "USB",\
                             Solid.AudioInterface.FirewireSoundcard: "Firewire",\
                             Solid.AudioInterface.Headset: "Headset",\
                             Solid.AudioInterface.Modem: "Modem"
                           }

        hBox = KHBox(self)

        display = QTreeWidget(hBox)
        display.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels(
            ["Item", "Name", "Driver", "I/F Type", "Sound Card Type"])
        display.setColumnWidth(0, 300)
        display.setColumnWidth(1, 300)
        display.setColumnWidth(3, 75)

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.AudioInterface object, but
        # receive one from the 'asDeviceInterface' call
        for device in deviceList:
            if device.isDeviceInterface(Solid.DeviceInterface.AudioInterface):
                audio = device.asDeviceInterface(
                    Solid.DeviceInterface.AudioInterface)
                devtype = audio.deviceType()
                devstr = []
                for key in audioInterfaceTypeStr:
                    flag = key & devtype
                    if flag:
                        devstr.append(audioInterfaceTypeStr[key])

                QTreeWidgetItem(display, [
                    device.product(),
                    audio.name(), audioDriverStr[audio.driver()],
                    "/".join(devstr), soundcardTypeStr[audio.soundcardType()]
                ])
コード例 #4
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter | Qt.AlignTop)
        self.setSpacing(40)

        hBox = KHBox(self)
        vBox1 = KVBox(hBox)
        vBox2 = KVBox(hBox)

        hBox.layout().setAlignment(vBox1, Qt.AlignHCenter)
        hBox.layout().setAlignment(vBox2, Qt.AlignHCenter)
        vBox1.setMargin(20)
        vBox2.setSpacing(20)

        self.datePickerLabel = QLabel("KDatePicker", vBox1)

        self.datePicker = KDatePicker(vBox2)
        self.datePicker.setFixedSize(400, 200)

        self.other = QLabel('KDateWidget', vBox1)
        vBox1.layout().setAlignment(self.other, Qt.AlignBottom)

        self.dateDisplay = KDateWidget(vBox2)

        self.connect(self.datePicker, SIGNAL('dateChanged(QDate)'),
                     self.dateDisplay.setDate)
コード例 #5
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setSpacing (10)
        
        hBox          = KHBox (self)
        self.layout ().setAlignment (hBox, Qt.AlignHCenter)
        
        cBox          = KVBox (hBox)
        hBox.layout ().setAlignment (cBox, Qt.AlignTop)
        hBox.setSpacing (25)
        hBox.setMargin (10)

        self.stdDirs  = KStandardDirs ()
        types         = self.stdDirs.allTypes ()
        
        comboLbl      = QLabel ("Types", cBox)
        combo         = KComboBox (cBox)        
        combo.addItems (types)
        cBox.layout ().setAlignment (comboLbl, Qt.AlignTop)
        cBox.layout ().setAlignment (combo, Qt.AlignTop)
        
        self.connect (combo, SIGNAL ("currentIndexChanged (const QString&)"), self.slotIndexChanged)

        lBox          = KVBox (hBox)
        listLbl       = QLabel ("Directories", lBox)
        self.location = KListWidget (lBox)
        self.location.setMaximumSize (400, 200)
        lBox.layout ().setAlignment (listLbl, Qt.AlignTop)
        lBox.layout ().setAlignment (self.location, Qt.AlignTop)

        QLabel (self.stdDirs.installPath ("ui"), self)

        self.slotIndexChanged (combo.currentText ())
コード例 #6
0
ファイル: kcombobox.py プロジェクト: sigoa/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        hBox = KHBox(self)
        self.layout().setAlignment(hBox, Qt.AlignHCenter)

        cBox = KVBox(hBox)
        hBox.layout().setAlignment(cBox, Qt.AlignTop)
        hBox.setSpacing(25)
        hBox.setMargin(10)

        self.stdDirs = KStandardDirs()
        types = self.stdDirs.allTypes()

        comboLbl = QLabel("Types", cBox)
        combo = KComboBox(cBox)
        combo.addItems(types)
        cBox.layout().setAlignment(comboLbl, Qt.AlignTop)
        cBox.layout().setAlignment(combo, Qt.AlignTop)

        self.connect(combo, SIGNAL("currentIndexChanged (const QString&)"),
                     self.slotIndexChanged)

        lBox = KVBox(hBox)
        listLbl = QLabel("Directories", lBox)
        self.location = KListWidget(lBox)
        self.location.setMaximumSize(400, 200)
        lBox.layout().setAlignment(listLbl, Qt.AlignTop)
        lBox.layout().setAlignment(self.location, Qt.AlignTop)

        self.slotIndexChanged(combo.currentText())
コード例 #7
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setSpacing (10)

        hBox = KHBox (self)
                
        display = QTreeWidget (hBox)        
        display.setSizePolicy (QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels (["Volume", "File Path", "Accessible"])
        display.setColumnWidth (0, 200)
        display.setColumnWidth (1, 300)   

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices ()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.StorageAccess object, but
        # receive one from the 'asDeviceInterface' call
        for device in deviceList:
            if device.isDeviceInterface (Solid.DeviceInterface.StorageAccess):
                access = device.asDeviceInterface (Solid.DeviceInterface.StorageAccess)
                QTreeWidgetItem (display, [device.product (),
                                           access.filePath (),
                                           str (access.isAccessible ())])
コード例 #8
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setSpacing (10)

        audioDriverStr = {
                            Solid.AudioInterface.Alsa: "Alsa",\
                            Solid.AudioInterface.OpenSoundSystem: "Open Sound",\
                            Solid.AudioInterface.UnknownAudioDriver: "Unknown"
                         }


        audioInterfaceTypeStr = {
                                  Solid.AudioInterface.UnknownAudioInterfaceType: "Unknown",\
                                  Solid.AudioInterface.AudioControl: "Control",\
                                  Solid.AudioInterface.AudioInput: "In",\
                                  Solid.AudioInterface.AudioOutput: "Out"
                                }

        soundcardTypeStr = {
                             Solid.AudioInterface.InternalSoundcard: "Internal",\
                             Solid.AudioInterface.UsbSoundcard: "USB",\
                             Solid.AudioInterface.FirewireSoundcard: "Firewire",\
                             Solid.AudioInterface.Headset: "Headset",\
                             Solid.AudioInterface.Modem: "Modem"
                           }
        
        hBox = KHBox (self)
                
        display = QTreeWidget (hBox)
        display.setSizePolicy (QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels (["Item", "Name", "Driver", "I/F Type", "Sound Card Type"])
        display.setColumnWidth (0, 300)
        display.setColumnWidth (1, 300)
        display.setColumnWidth (3, 75)

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices ()

        
        # filter the list of all devices and display matching results
        # note that we never create a Solid.AudioInterface object, but
        # receive one from the 'asDeviceInterface' call
        for device in deviceList:
            if device.isDeviceInterface (Solid.DeviceInterface.AudioInterface):
                audio = device.asDeviceInterface (Solid.DeviceInterface.AudioInterface)
                devtype = audio.deviceType ()
                devstr  = []
                for key in audioInterfaceTypeStr:
                    flag = key & devtype
                    if flag:
                        devstr.append (audioInterfaceTypeStr [key])
                        
                QTreeWidgetItem (display, [device.product (),
                                           audio.name (),
                                           audioDriverStr [audio.driver ()],
                                           "/".join (devstr),
                                           soundcardTypeStr [audio.soundcardType ()]])
コード例 #9
0
    def __init__(self, parent):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        hBox = KHBox(self)
        self.button = KPushButton(i18n("Show %s" % dialogName), hBox)
        self.button.setMaximumSize(250, 30)

        self.connect(self.button, SIGNAL("clicked()"), self.showDialog)
コード例 #10
0
ファイル: solid_storagedrive.py プロジェクト: KDE/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        hBox = KHBox(self)

        display = QTreeWidget(hBox)
        display.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels(["Device", "Bus", "Type", "Hot Plug", "Removable"])
        display.setColumnWidth(0, 150)

        # convert enum values to strings for display
        bus2Str = {
            Solid.StorageDrive.Ide: "IDE",
            Solid.StorageDrive.Usb: "USB",
            Solid.StorageDrive.Ieee1394: "IEE1394",
            Solid.StorageDrive.Scsi: "SCSI",
            Solid.StorageDrive.Sata: "SATA",
            Solid.StorageDrive.Platform: "Platform",
        }

        driveType2Str = {
            Solid.StorageDrive.HardDisk: "Hard Disk",
            Solid.StorageDrive.CdromDrive: "CD ROM",
            Solid.StorageDrive.Floppy: "Floppy",
            Solid.StorageDrive.Tape: "Tape",
            Solid.StorageDrive.CompactFlash: "Compact Flash",
            Solid.StorageDrive.MemoryStick: "Memory Stick",
            Solid.StorageDrive.SmartMedia: "Smart Media",
            Solid.StorageDrive.SdMmc: "SD MMC",
            Solid.StorageDrive.Xd: "XD",
        }

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.StorageDrive object, but
        # receive one from the call to 'asDeviceInterface'
        for device in deviceList:
            if device.isDeviceInterface(Solid.DeviceInterface.StorageDrive):
                drive = device.asDeviceInterface(Solid.DeviceInterface.StorageDrive)
                QTreeWidgetItem(
                    display,
                    [
                        device.product(),
                        bus2Str[drive.bus()],
                        driveType2Str[drive.driveType()],
                        str(drive.isHotpluggable()),
                        str(drive.isRemovable()),
                    ],
                )
コード例 #11
0
ファイル: kaboutkdedialog.py プロジェクト: KDE/pykde4
    def __init__(self, parent):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        hBox = KHBox(self)
        self.button = KPushButton(i18n("Show %s" % dialogName), hBox)
        self.button.setMaximumSize(250, 30)

        self.helpmenu = KHelpMenu(parent, "", False)
        self.button.clicked.connect(self.helpmenu.aboutKDE)
コード例 #12
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        hBox1 = KHBox(self)
        hBox1.setSpacing(10)
        hBox1.setMargin(40)

        colorButtonLabel = QLabel("KColorButton", hBox1)
        colorButton = KColorButton(hBox1)

        colorCellsLabel = QLabel("KColorCells", hBox1)
        colorCells = KColorCells(hBox1, 1, 8)
        colorCells.setMaximumSize(160, 20)
        colorCells.setColor(0, Qt.black)
        colorCells.setColor(1, Qt.red)
        colorCells.setColor(2, Qt.yellow)
        colorCells.setColor(3, Qt.blue)
        colorCells.setColor(4, Qt.darkGreen)
        colorCells.setColor(5, Qt.magenta)
        colorCells.setColor(6, Qt.gray)
        colorCells.setColor(7, Qt.white)

        colorComboLabel = QLabel("KColorCombo", hBox1)
        colorCombo = KColorCombo(hBox1)

        colorList = [
            Qt.black, Qt.red, Qt.yellow, Qt.blue, Qt.darkGreen, Qt.magenta,
            Qt.gray, Qt.white
        ]
        colorCombo.setColors(colorList)
        colorCombo.setMaximumWidth(80)

        hBox2 = KHBox(self)
        hBox2.setSpacing(10)
        self.layout().setAlignment(hBox2, Qt.AlignHCenter | Qt.AlignTop)
        self.setStretchFactor(hBox2, 1)

        colorPatchLabel = QLabel("KColorPatch", hBox2)
        hBox2.layout().setAlignment(colorPatchLabel, Qt.AlignHCenter)
        self.colorPatch = KColorPatch(hBox2)
        self.colorPatch.setFixedSize(40, 40)
        hBox2.layout().setAlignment(self.colorPatch, Qt.AlignHCenter)

        self.colorPatch.setColor(Qt.red)
        self.colorPatch.show()

        self.connect(colorButton, SIGNAL("changed (const QColor&)"),
                     self.colorPatch.setColor)
        self.connect(colorCells, SIGNAL("colorSelected (int, const QColor&)"),
                     self.colorCellSelected)
        self.connect(colorCombo, SIGNAL("activated (const QColor&)"),
                     self.colorPatch.setColor)
コード例 #13
0
ファイル: kaboutkdedialog.py プロジェクト: sigoa/pykde4
    def __init__(self, parent):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        hBox = KHBox(self)
        self.button = KPushButton(i18n("Show %s" % dialogName), hBox)
        self.button.setMaximumSize(250, 30)

        self.helpmenu = KHelpMenu(parent, "", False)
        self.button.clicked.connect(self.helpmenu.aboutKDE)
コード例 #14
0
ファイル: kfontdialog.py プロジェクト: KDE/pykde4
    def __init__(self, parent):
        KVBox.__init__(self, parent)
        self.setSpacing (40)
        self.help = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)

        self.button = KPushButton(i18n("Show %s" % dialogName), self)
        self.button.setFixedSize (200, 30)
        self.layout ().setAlignment (self.button, Qt.AlignHCenter)
        self.fontLabel = QLabel (quote, self)
        self.layout ().setAlignment (self.fontLabel, Qt.AlignHCenter)
        
        self.connect(self.button, SIGNAL('clicked()'), self.showDialog)
コード例 #15
0
ファイル: kfontdialog.py プロジェクト: sigoa/pykde4
    def __init__(self, parent):
        KVBox.__init__(self, parent)
        self.setSpacing(40)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        self.button = KPushButton(i18n("Show %s" % dialogName), self)
        self.button.setFixedSize(200, 30)
        self.layout().setAlignment(self.button, Qt.AlignHCenter)
        self.fontLabel = QLabel(quote, self)
        self.layout().setAlignment(self.fontLabel, Qt.AlignHCenter)

        self.connect(self.button, SIGNAL('clicked()'), self.showDialog)
コード例 #16
0
ファイル: solid_storagedrive.py プロジェクト: sigoa/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        hBox = KHBox(self)

        display = QTreeWidget(hBox)
        display.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels(
            ["Device", "Bus", "Type", "Hot Plug", "Removable"])
        display.setColumnWidth(0, 150)

        # convert enum values to strings for display
        bus2Str = {Solid.StorageDrive.Ide : "IDE",\
                   Solid.StorageDrive.Usb : "USB",\
                   Solid.StorageDrive. Ieee1394 : "IEE1394",\
                   Solid.StorageDrive.Scsi : "SCSI",\
                   Solid.StorageDrive.Sata : "SATA",\
                   Solid.StorageDrive.Platform : "Platform"
                  }


        driveType2Str = {Solid.StorageDrive.HardDisk : "Hard Disk",\
                         Solid.StorageDrive.CdromDrive : "CD ROM",\
                         Solid.StorageDrive.Floppy : "Floppy",\
                         Solid.StorageDrive.Tape : "Tape",\
                         Solid.StorageDrive.CompactFlash : "Compact Flash",\
                         Solid.StorageDrive.MemoryStick : "Memory Stick",\
                         Solid.StorageDrive.SmartMedia : "Smart Media",\
                         Solid.StorageDrive.SdMmc : "SD MMC",\
                         Solid.StorageDrive.Xd : "XD"
                        }

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.StorageDrive object, but
        # receive one from the call to 'asDeviceInterface'
        for device in deviceList:
            if device.isDeviceInterface(Solid.DeviceInterface.StorageDrive):
                drive = device.asDeviceInterface(
                    Solid.DeviceInterface.StorageDrive)
                QTreeWidgetItem(display, [
                    device.product(), bus2Str[drive.bus()],
                    driveType2Str[drive.driveType()],
                    str(drive.isHotpluggable()),
                    str(drive.isRemovable())
                ])
コード例 #17
0
ファイル: kcolordialog.py プロジェクト: sigoa/pykde4
    def __init__(self, parent):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        hBox = KHBox(self)
        self.button = KPushButton(i18n("Show %s" % dialogName), hBox)
        self.button.setMaximumSize(250, 30)

        self.connect(self.button, SIGNAL('clicked()'), self.showDialog)

        self.colorPatch = KColorPatch(hBox)
        self.colorPatch.setColor(Qt.red)
        self.colorPatch.setMaximumSize(40, 40)
コード例 #18
0
ファイル: kcolorbutton.py プロジェクト: KDE/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (helpText, self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        
        hBox1 = KHBox (self)
        hBox1.setSpacing (10)
        hBox1.setMargin (40)

        
        colorButtonLabel = QLabel ("KColorButton", hBox1)
        colorButton = KColorButton (hBox1)

        colorCellsLabel = QLabel ("KColorCells", hBox1)
        colorCells = KColorCells (hBox1, 1, 8)
        colorCells.setMaximumSize (160, 20)
        colorCells.setColor (0, Qt.black)
        colorCells.setColor (1, Qt.red)
        colorCells.setColor (2, Qt.yellow)
        colorCells.setColor (3, Qt.blue)
        colorCells.setColor (4, Qt.darkGreen)
        colorCells.setColor (5, Qt.magenta)
        colorCells.setColor (6, Qt.gray)
        colorCells.setColor (7, Qt.white)
        
        
        colorComboLabel = QLabel ("KColorCombo", hBox1)
        colorCombo = KColorCombo (hBox1)

        colorList = [Qt.black, Qt.red, Qt.yellow, Qt.blue, Qt.darkGreen, Qt.magenta, Qt.gray, Qt.white]
        colorCombo.setColors (colorList)
        colorCombo.setMaximumWidth (80)
        
        hBox2 = KHBox (self)
        hBox2.setSpacing (10)
        self.layout ().setAlignment (hBox2, Qt.AlignHCenter | Qt.AlignTop)
        self.setStretchFactor (hBox2, 1)
        
        colorPatchLabel = QLabel ("KColorPatch", hBox2)
        hBox2.layout ().setAlignment (colorPatchLabel, Qt.AlignHCenter)
        self.colorPatch = KColorPatch (hBox2)
        self.colorPatch.setFixedSize (40, 40)
        hBox2.layout ().setAlignment (self.colorPatch, Qt.AlignHCenter)

        self.colorPatch.setColor (Qt.red)
        self.colorPatch.show ()

        self.connect (colorButton, SIGNAL ("changed (const QColor&)"), self.colorPatch.setColor)
        self.connect (colorCells, SIGNAL ("colorSelected (int, const QColor&)"), self.colorCellSelected)
        self.connect (colorCombo, SIGNAL ("activated (const QColor&)"), self.colorPatch.setColor)
コード例 #19
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setSpacing (10)
        
        display = QTreeWidget (self)        
        display.setHeaderLabels (["Product", "Vendor", "UDI"])
        display.setColumnWidth (0, 300)

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices ()
        
        for device in deviceList:
            item = QTreeWidgetItem (display, [device.product (), device.vendor (), device.udi ()])
コード例 #20
0
ファイル: default.py プロジェクト: KDE/pykde4
    def __init__(self, parent = None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (helpText, self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setMargin (40)
        
        # choose an image at random
        self.pix   = QPixmap (os.path.join (imagePath, "poster%i.png" % randint (0, 6)))

        hBox = KHBox (self)
        self.poster = QLabel (hBox)
        self.poster.setPixmap (self.pix)

        self.layout ().setAlignment (hBox, Qt.AlignHCenter)
        self.setStretchFactor (hBox, 1)
コード例 #21
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setMargin(40)

        # choose an image at random
        self.pix = QPixmap(
            os.path.join(imagePath, "poster%i.png" % randint(0, 6)))

        hBox = KHBox(self)
        self.poster = QLabel(hBox)
        self.poster.setPixmap(self.pix)

        self.layout().setAlignment(hBox, Qt.AlignHCenter)
        self.setStretchFactor(hBox, 1)
コード例 #22
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        statusString = {
                          Solid.Networking.Unknown: "Unknown",\
                          Solid.Networking.Unconnected: "Unconnected",\
                          Solid.Networking.Disconnecting: "Disconnecting",\
                          Solid.Networking.Connecting: "Connecting",\
                          Solid.Networking.Connected: "Connected"\
                       }

        status = Solid.Networking.status()
        self.label = QLabel("Status:   %s" % statusString[status], self)

        hBox = KHBox(self)

        display = QTreeWidget(hBox)
        display.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels(
            ["Interface", "Name", "Wireless", "HW Addr", "MAC Addr"])
        display.setColumnWidth(0, 200)
        display.setColumnWidth(1, 75)
        display.setColumnWidth(3, 150)

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.NetworkInterface object, but
        # receive one from the 'asDeviceInterface' call
        for device in deviceList:
            if device.isDeviceInterface(
                    Solid.DeviceInterface.NetworkInterface):
                iface = device.asDeviceInterface(
                    Solid.DeviceInterface.NetworkInterface)
                QTreeWidgetItem(display, [
                    device.product(),
                    iface.ifaceName(),
                    str(iface.isWireless()),
                    iface.hwAddress(),
                    str(iface.macAddress())
                ])
コード例 #23
0
ファイル: solid_networkinterface.py プロジェクト: KDE/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        statusString = {
            Solid.Networking.Unknown: "Unknown",
            Solid.Networking.Unconnected: "Unconnected",
            Solid.Networking.Disconnecting: "Disconnecting",
            Solid.Networking.Connecting: "Connecting",
            Solid.Networking.Connected: "Connected",
        }

        status = Solid.Networking.status()
        self.label = QLabel("Status:   %s" % statusString[status], self)

        hBox = KHBox(self)

        display = QTreeWidget(hBox)
        display.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels(["Interface", "Name", "Wireless", "HW Addr", "MAC Addr"])
        display.setColumnWidth(0, 200)
        display.setColumnWidth(1, 75)
        display.setColumnWidth(3, 150)

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.NetworkInterface object, but
        # receive one from the 'asDeviceInterface' call
        for device in deviceList:
            if device.isDeviceInterface(Solid.DeviceInterface.NetworkInterface):
                iface = device.asDeviceInterface(Solid.DeviceInterface.NetworkInterface)
                QTreeWidgetItem(
                    display,
                    [
                        device.product(),
                        iface.ifaceName(),
                        str(iface.isWireless()),
                        iface.hwAddress(),
                        str(iface.macAddress()),
                    ],
                )
コード例 #24
0
ファイル: solid_device.py プロジェクト: sigoa/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(i18n(helpText), self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)
        self.setSpacing(10)

        display = QTreeWidget(self)
        display.setHeaderLabels(["Product", "Vendor", "UDI"])
        display.setColumnWidth(0, 300)

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices()

        for device in deviceList:
            item = QTreeWidgetItem(
                display, [device.product(),
                          device.vendor(),
                          device.udi()])
コード例 #25
0
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setSpacing (10)
        
        display = QTreeWidget ()        
        display.setHeaderLabels (["Processor", "Max Speed", "Number", "Change Freq"])
        
        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices ()

        # filter the list of all devices and display matching results
        for device in deviceList:
            if device.isDeviceInterface (Solid.DeviceInterface.Processor):
                cpu = device.asDeviceInterface (Solid.DeviceInterface.Processor)
                QTreeWidgetItem (display, [device.product (),
                                           str (cpu.maxSpeed ()),
                                           str (cpu.number ()),
                                           str (cpu.canChangeFrequency ())])
コード例 #26
0
ファイル: solid_processor.py プロジェクト: sigoa/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setSpacing (10)
        
        display = QTreeWidget (self)        
        display.setHeaderLabels (["Processor", "Max Speed", "Number", "Change Freq"])
        
        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices ()

        # filter the list of all devices and display matching results
        for device in deviceList:
            if device.isDeviceInterface (Solid.DeviceInterface.Processor):
                cpu = device.asDeviceInterface (Solid.DeviceInterface.Processor)
                QTreeWidgetItem (display, [device.product (),
                                           str (cpu.maxSpeed ()),
                                           str (cpu.number ()),
                                           str (cpu.canChangeFrequency ())])
コード例 #27
0
ファイル: lqi.py プロジェクト: Alwnikrotikz/lilykde
 def __init__(self, tool):
     KVBox.__init__(self)
     self.tool = tool
     
     h = KHBox(self)
     h.layout().setContentsMargins(8, 2, 4, 0)
     l = QLabel(i18n("Direction:"), h)
     d = self.directionWidget = QComboBox(h)
     d.addItems([i18n("Up"), i18n("Neutral"), i18n("Down")])
     d.setItemIcon(0, KIcon("arrow-up"))
     d.setItemIcon(2, KIcon("arrow-down"))
     d.setCurrentIndex(1)
     l.setBuddy(d)
     h.setToolTip(i18n(
         "Where to add articulations et cetera: "
         "above or below the staff or in the default position."))
     
     t = self.toolboxWidget = ToolBox(self)
     # don't allow us to shrink below the minimum size of our children
     self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
     width = max(w.minimumSizeHint().width() for w in t.widgets) + 12
     self.setMinimumWidth(width)
コード例 #28
0
ファイル: solid_storagevolume.py プロジェクト: KDE/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help  = QLabel (i18n (helpText), self)
        self.layout ().setAlignment (self.help, Qt.AlignHCenter)
        self.setSpacing (10)

        hBox = KHBox (self)

        display = QTreeWidget (hBox)        
        display.setSizePolicy (QSizePolicy.Expanding, QSizePolicy.Expanding)
        display.setHeaderLabels (["Volume", "FS Type", "Label", "Ignored", "Size", "Usage"])
        display.setColumnWidth (0, 150)

        # convert enum values to strings for display
        usageType2Str = { Solid.StorageVolume.Other : "Other",\
                          Solid.StorageVolume.Unused : "Unused",\
                          Solid.StorageVolume.FileSystem : "File System",
                          Solid.StorageVolume.PartitionTable : "Partition Tbl",\
                          Solid.StorageVolume.Raid : "Raid",\
                          Solid.StorageVolume.Encrypted : "Encrypted"
                        }        

        # retrieve a list of Solid.Device for this machine
        deviceList = Solid.Device.allDevices ()

        # filter the list of all devices and display matching results
        # note that we never create a Solid.StorageVolume object,
        # but receive one from the 'asDeviceInterface" call
        for device in deviceList:
            if device.isDeviceInterface (Solid.DeviceInterface.StorageVolume):
                volume = device.asDeviceInterface (Solid.DeviceInterface.StorageVolume)
                QTreeWidgetItem (display, [device.product (),
                                           volume.fsType (),
                                           volume.label (),
                                           str (volume.isIgnored ()),
                                           "%i MB" % (volume.size ()/1024/1024),
                                           usageType2Str [volume.usage ()]])
コード例 #29
0
ファイル: example_template.py プロジェクト: KDE/pykde4
 def __init__(self, parent=None):
     KVBox.__init__(self, parent)
     self.help  = QLabel (helpText, self)
     self.layout ().setAlignment (self.help, Qt.AlignHCenter)
     
     hBox = KHBox (self)
コード例 #30
0
ファイル: example_template.py プロジェクト: sigoa/pykde4
    def __init__(self, parent=None):
        KVBox.__init__(self, parent)
        self.help = QLabel(helpText, self)
        self.layout().setAlignment(self.help, Qt.AlignHCenter)

        hBox = KHBox(self)