def __init__(self, parent=None):
        qt.QWidget.__init__(self, parent)

        self.show()
        self._expandpackage = False

        self._changeset = {}
        self._vbox = qt.QVBoxLayout(self)
        
        self._treeview = qt.QListView(self)
        qt.QObject.connect(self._treeview, qt.SIGNAL("clicked(QListViewItem *, const QPoint &, int)"), self._clicked)
        qt.QObject.connect(self._treeview, qt.SIGNAL("doubleClicked(QListViewItem *, const QPoint &, int)"), self._doubleClicked)
        qt.QObject.connect(self._treeview, qt.SIGNAL("rightButtonPressed(QListViewItem *, const QPoint &, int)"), self._rightButtonPressed)
        qt.QObject.connect(self._treeview, qt.SIGNAL("selectionChanged()"), self._selectionChanged)
        self._treeview.setAllColumnsShowFocus(True)
        self._treeview.setRootIsDecorated(True)
        self._treeview.show()
        self._vbox.addWidget(self._treeview)
        
        self._treeview.setSelectionMode(qt.QListView.Extended)
        
        self._treeview.addColumn("") # pixmap
        self._treeview.addColumn(_("Package"))
        self._treeview.addColumn(_("Version"))

        self._ipixbuf = getPixmap("package-installed")
        self._ilpixbuf = getPixmap("package-installed-locked")
        self._apixbuf = getPixmap("package-available")
        self._alpixbuf = getPixmap("package-available-locked")
        self._npixbuf = getPixmap("package-new")
        self._nlpixbuf = getPixmap("package-new-locked")
        self._fpixbuf = getPixmap("folder")
        self._Ipixbuf = getPixmap("package-install")
        self._Rpixbuf = getPixmap("package-remove")
        self._rpixbuf = getPixmap("package-reinstall")
Esempio n. 2
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(None)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Priorities"))
        #self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)

        self._treeview = qt.QListView(vbox)
        self._treeview.setAllColumnsShowFocus(True)
        self._treeview.show()

        qt.QObject.connect(self._treeview, qt.SIGNAL("itemRenamed(QListViewItem *, int, const QString &)"), self.itemRenamed)
        qt.QObject.connect(self._treeview, qt.SIGNAL("selectionChanged()"), self.selectionChanged)

        self._treeview.addColumn(_("Package Name"))
        self._treeview.addColumn(_("Channel Alias"))
        self._treeview.addColumn(_("Priority"))

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("New"), bbox)
        button.setEnabled(True)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-add")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newPriority)
        self._newpriority = button

        button = qt.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-delete")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delPriority)
        self._delpriority = button

        button = qt.QPushButton(_("Close"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))
        
        button.setDefault(True)
        vbox.adjustSize()
Esempio n. 3
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Package Priority"))
        self._window.setModal(True)
        
        #self._window.setMinimumSize(600, 400)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        self._vbox = vbox

        self._table = qt.QGrid(2, vbox)
        self._table.setSpacing(10)
        self._table.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Close"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("hide()"))

        self._vbox.adjustSize()
        self._window.adjustSize()
Esempio n. 4
0
    def __init__(self, parent=None):
        qt.QWidget.__init__(self, parent)

        self.show()
        self._expandpackage = False

        self._changeset = {}
        self._vbox = qt.QVBoxLayout(self)

        self._treeview = qt.QListView(self)
        qt.QObject.connect(
            self._treeview,
            qt.SIGNAL("clicked(QListViewItem *, const QPoint &, int)"),
            self._clicked)
        qt.QObject.connect(
            self._treeview,
            qt.SIGNAL("doubleClicked(QListViewItem *, const QPoint &, int)"),
            self._doubleClicked)
        qt.QObject.connect(
            self._treeview,
            qt.SIGNAL(
                "rightButtonPressed(QListViewItem *, const QPoint &, int)"),
            self._rightButtonPressed)
        qt.QObject.connect(self._treeview, qt.SIGNAL("selectionChanged()"),
                           self._selectionChanged)
        self._treeview.setAllColumnsShowFocus(True)
        self._treeview.setRootIsDecorated(True)
        self._treeview.show()
        self._vbox.addWidget(self._treeview)

        self._treeview.setSelectionMode(qt.QListView.Extended)

        self._treeview.addColumn("")  # pixmap
        self._treeview.addColumn(_("Package"))
        self._treeview.addColumn(_("Version"))

        self._ipixbuf = getPixmap("package-installed")
        self._ilpixbuf = getPixmap("package-installed-locked")
        self._apixbuf = getPixmap("package-available")
        self._alpixbuf = getPixmap("package-available-locked")
        self._npixbuf = getPixmap("package-new")
        self._nlpixbuf = getPixmap("package-new-locked")
        self._fpixbuf = getPixmap("folder")
        self._Ipixbuf = getPixmap("package-install")
        self._Rpixbuf = getPixmap("package-remove")
        self._rpixbuf = getPixmap("package-reinstall")
Esempio n. 5
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Package Priority"))
        self._window.setModal(True)

        #self._window.setMinimumSize(600, 400)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        table = qt.QGrid(2, vbox)
        table.setSpacing(10)
        table.show()

        label = qt.QLabel(_("Package Name:"), table)

        self._name = qt.QLineEdit(table)
        self._name.show()

        label = qt.QLabel(_("Channel Alias:"), table)

        self._alias = qt.QLineEdit(table)
        self._alias.setText("*")
        self._alias.show()

        label = qt.QLabel(_("Priority:"), table)

        self._priority = qt.QSpinBox(table)
        self._priority.setSteps(1, 10)
        self._priority.setRange(-100000,+100000)
        self._priority.show()

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        button.setDefault(True)
        vbox.adjustSize()
        self._window.adjustSize()
Esempio n. 6
0
 def inserttool(toolbar, tool):
     if tool:
         action = self._actions[tool]
         #b = qt.QToolButton(toolbar, TOOL)
         #b.setTextLabel(action.toolTip())
         pixmap = getPixmap(TOOLBARICONS[tool])
         #b.setIconSet(qt.QIconSet(pixmap))
         action.setIconSet(qt.QIconSet(pixmap))
         action.addTo(toolbar)
     else:
         toolbar.addSeparator()
Esempio n. 7
0
    def __init__(self):
        self._window = qt.QDialog()
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Status"))
        self._window.setModal(True)
        self._vbox = qt.QVBox(self._window)
        self._vbox.setMargin(20)

        self._label = qt.QLabel(self._vbox)
        self._label.show()

        self._lastshown = 0
Esempio n. 8
0
 def run(self, command=None, argv=None):
     self.setCatchExceptions(True)
     self.loadState()
     self._window.setIcon(getPixmap("smart"))
     self._window.show()
     self._ctrl.reloadChannels()
     self._changeset = ChangeSet(self._ctrl.getCache())
     self._pi.setChangeSet(self._changeset)
     self._progress.hide()
     self.refreshPackages()
     app.exec_loop()
     self.saveState()
     self.setCatchExceptions(False)
Esempio n. 9
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Target"))
        self._window.setModal(True)

        #self._window.setMinimumSize(600, 400)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        table = qt.QGrid(2, vbox)
        table.setSpacing(10)
        table.show()

        label = qt.QLabel(_("Target:"), table)

        self._target = qt.QLineEdit(table)
        self._target.setMaxLength(40)
        self._target.show()

        blank = qt.QWidget(table)

        label = qt.QLabel(
            _("Examples: \"pkgname\", \"pkgname = 1.0\" or "
              "\"pkgname <= 1.0\""), table)

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(bbox.tr("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("accept()"))

        button = qt.QPushButton(bbox.tr("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("reject()"))

        vbox.adjustSize()
        self._window.adjustSize()
Esempio n. 10
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Mirror"))
        self._window.setModal(True)

        #self._window.setMinimumSize(600, 400)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        table = qt.QGrid(2, vbox)
        table.setSpacing(10)
        table.show()
        
        label = qt.QLabel(_("Origin URL:"), table)
        label.show()

        self._origin = qt.QLineEdit(table)
        self._origin.setMaxLength(40)
        self._origin.show()

        label = qt.QLabel(_("Mirror URL:"), table)
        label.show()

        self._mirror = qt.QLineEdit(table)
        self._mirror.setMaxLength(40)
        self._mirror.show()

        sep = qt.QFrame(vbox)
        sep.setFrameStyle(qt.QFrame.HLine)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("reject()"))
        
        vbox.adjustSize()
        self._window.adjustSize()
Esempio n. 11
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Target"))
        self._window.setModal(True)

        # self._window.setMinimumSize(600, 400)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        table = qt.QGrid(2, vbox)
        table.setSpacing(10)
        table.show()

        label = qt.QLabel(_("Target:"), table)

        self._target = qt.QLineEdit(table)
        self._target.setMaxLength(40)
        self._target.show()

        blank = qt.QWidget(table)

        label = qt.QLabel(_('Examples: "pkgname", "pkgname = 1.0" or ' '"pkgname <= 1.0"'), table)

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(bbox.tr("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        button = qt.QPushButton(bbox.tr("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("reject()"))

        vbox.adjustSize()
        self._window.adjustSize()
Esempio n. 12
0
    def __init__(self, parent=None):
        qt.QDialog.__init__(self, parent)

        self.setIcon(getPixmap("smart"))
        self.setCaption(_("Change Summary"))
        self.setModal(True)
        self.setMinimumSize(600, 400)
        centerWindow(self)

        self._vbox = qt.QVBoxLayout(self)
        self._vbox.setMargin(10)
        self._vbox.setSpacing(10)

        self._label = qt.QLabel(self)
        self._vbox.addWidget(self._label)

        self._pv = QtPackageView(self)
        self._pv.getTreeView().header().hide()
        self._pv.setExpandPackage(True)
        self._pv.show()
        self._vbox.addWidget(self._pv)

        self._sizelabel = qt.QLabel("", self)
        self._vbox.addWidget(self._sizelabel)

        self._confirmbbox = qt.QHBox(self)
        self._confirmbbox.setSpacing(10)
        self._confirmbbox.layout().addStretch(1)
        self._vbox.addWidget(self._confirmbbox)

        self._cancelbutton = qt.QPushButton(_("Cancel"), self._confirmbbox)
        qt.QObject.connect(self._cancelbutton, qt.SIGNAL("clicked()"), self,
                           qt.SLOT("reject()"))
        self._okbutton = qt.QPushButton(_("OK"), self._confirmbbox)
        qt.QObject.connect(self._okbutton, qt.SIGNAL("clicked()"), self,
                           qt.SLOT("accept()"))

        self._closebbox = qt.QHBox(self)
        self._closebbox.setSpacing(10)
        self._closebbox.layout().addStretch(1)
        self._vbox.addWidget(self._closebbox)

        self._closebutton = qt.QPushButton(_("Close"), self._closebbox)
        qt.QObject.connect(self._closebutton, qt.SIGNAL("clicked()"), self,
                           qt.SLOT("close()"))
Esempio n. 13
0
    def __init__(self, parent=None):
        qt.QDialog.__init__(self, parent)

        self.setIcon(getPixmap("smart"))
        self.setCaption(_("Log"))
        self.setMinimumSize(400, 300)
        #self.setModal(True)

        layout = qt.QVBoxLayout(self)
        layout.setResizeMode(qt.QLayout.FreeResize)

        self._vbox = qt.QVBox(self)
        self._vbox.setMargin(10)
        self._vbox.setSpacing(10)
        self._vbox.show()

        layout.add(self._vbox)

        self._scrollview = BackgroundScrollView(self._vbox)
        self._scrollview.setVScrollBarMode(qt.QScrollView.AlwaysOn)
        self._scrollview.setFrameStyle(qt.QFrame.StyledPanel | qt.QFrame.Sunken)
        self._scrollview.show()

        self._textview = qt.QLabel(self._scrollview.viewport())
        self._textview.setAlignment(qt.Qt.AlignTop)
        self._textview.setTextFormat(qt.Qt.LogText)
        self._textview.show()
        self._textview.adjustSize()
        
        self._textview.setEraseColor(self._scrollview.eraseColor())

        self._buttonbox = qt.QHBox(self._vbox)
        self._buttonbox.setSpacing(10)
        self._buttonbox.layout().addStretch(1)
        self._buttonbox.show()

        self._clearbutton = qt.QPushButton(_("Clear"), self._buttonbox)
        self._clearbutton.show()
        qt.QObject.connect(self._clearbutton, qt.SIGNAL("clicked()"), self.clearText)

        self._closebutton = qt.QPushButton(_("Close"), self._buttonbox)
        self._closebutton.show()
        qt.QObject.connect(self._closebutton, qt.SIGNAL("clicked()"), self, qt.SLOT("hide()"))

        self._closebutton.setDefault(True)
Esempio n. 14
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Channel"))
        self._window.setModal(True)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()
        self._vbox = vbox

        table = qt.QGrid(2, vbox)
        table.setSpacing(10)
        table.show()
        self._table = table

        label = qt.QLabel(_("Type:"), table)

        self._typevbox = qt.QVButtonGroup(table)
        self._typevbox.setFrameStyle(qt.QFrame.NoFrame)
        self._typevbox.show()

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("accept()"))

        self._ok = button
        self._ok.setEnabled(False)
Esempio n. 15
0
    def __init__(self, parent=None):

        self._fields = {}
        self._fieldn = 0

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Edit Channel"))
        self._window.setModal(True)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)
        self._vbox = vbox

        self._table = qt.QGrid(2, vbox)
        self._table.setSpacing(10)
        self._table.show()

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("accept()"))

        button.setDefault(True)
Esempio n. 16
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Select Channels"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)

        self._treeview = qt.QListView(vbox)
        self._treeview.setSizePolicy(qt.QSizePolicy.Expanding,
                                     qt.QSizePolicy.Expanding)
        self._treeview.setAllColumnsShowFocus(True)
        self._treeview.show()

        self._treeview.addColumn("")
        self._treeview.addColumn(_("Alias"))
        self._treeview.addColumn(_("Type"))
        self._treeview.addColumn(_("Name"))

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("accept()"))

        button.setDefault(True)
Esempio n. 17
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Channel"))
        self._window.setModal(True)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()
        self._vbox = vbox

        table = qt.QGrid(2, vbox)
        table.setSpacing(10)
        table.show()
        self._table = table
        
        label = qt.QLabel(_("Type:"), table)

        self._typevbox = qt.QVButtonGroup(table)
        self._typevbox.setFrameStyle(qt.QFrame.NoFrame)
        self._typevbox.show()

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        self._ok = button
        self._ok.setEnabled(False)
Esempio n. 18
0
    def __init__(self, parent=None):
        qt.QDialog.__init__(self, parent)

        self.setIcon(getPixmap("smart"))
        self.setCaption(_("Change Summary"))
        self.setModal(True)
        self.setMinimumSize(600, 400)
        centerWindow(self)
        
        self._vbox = qt.QVBoxLayout(self)
        self._vbox.setMargin(10)
        self._vbox.setSpacing(10)

        self._label = qt.QLabel(self)
        self._vbox.addWidget(self._label)

        self._pv = QtPackageView(self)
        self._pv.getTreeView().header().hide()
        self._pv.setExpandPackage(True)
        self._pv.show()
        self._vbox.addWidget(self._pv)

        self._sizelabel = qt.QLabel("", self)
        self._vbox.addWidget(self._sizelabel)

        self._confirmbbox = qt.QHBox(self)
        self._confirmbbox.setSpacing(10)
        self._confirmbbox.layout().addStretch(1)
        self._vbox.addWidget(self._confirmbbox)

        self._cancelbutton = qt.QPushButton(_("Cancel"), self._confirmbbox)
        qt.QObject.connect( self._cancelbutton, qt.SIGNAL("clicked()"), self, qt.SLOT("reject()"))
        self._okbutton = qt.QPushButton(_("OK"), self._confirmbbox)
        qt.QObject.connect( self._okbutton, qt.SIGNAL("clicked()"), self, qt.SLOT("accept()"))

        self._closebbox = qt.QHBox(self)
        self._closebbox.setSpacing(10)
        self._closebbox.layout().addStretch(1)
        self._vbox.addWidget(self._closebbox)

        self._closebutton = qt.QPushButton(_("Close"), self._closebbox)
        qt.QObject.connect( self._closebutton, qt.SIGNAL("clicked()"), self, qt.SLOT("close()"))
Esempio n. 19
0
    def __init__(self, parent=None):

        self._fields = {}
        self._fieldn = 0

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Edit Channel"))
        self._window.setModal(True)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)
        self._vbox = vbox

        self._table = qt.QGrid(2, vbox)
        self._table.setSpacing(10)
        self._table.show()

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        button.setDefault(True)
Esempio n. 20
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Select Channels"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)

        self._treeview = qt.QListView(vbox)
        self._treeview.setSizePolicy(qt.QSizePolicy.Expanding,qt.QSizePolicy.Expanding)
        self._treeview.setAllColumnsShowFocus(True)
        self._treeview.show()

        self._treeview.addColumn("")
        self._treeview.addColumn(_("Alias"))
        self._treeview.addColumn(_("Type"))
        self._treeview.addColumn(_("Name"))

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        button.setDefault(True)
Esempio n. 21
0
    def __init__(self, parent=None):

        self._changed = False

        self._window = qt.QDialog(None)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Channels"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)

        self._treeview = qt.QListView(vbox)
        self._treeview.setSizePolicy(qt.QSizePolicy.Expanding,
                                     qt.QSizePolicy.Expanding)
        self._treeview.setAllColumnsShowFocus(True)
        self._treeview.setSelectionMode(qt.QListView.Single)
        self._treeview.show()

        qt.QObject.connect(self._treeview, qt.SIGNAL("selectionChanged()"),
                           self.selectionChanged)
        qt.QObject.connect(
            self._treeview,
            qt.SIGNAL("doubleClicked(QListViewItem *, const QPoint &, int)"),
            self.doubleClicked)

        self._treeview.addColumn("")
        self._treeview.addColumn(_("Pri"))
        self._treeview.addColumn(_("Alias"))
        self._treeview.addColumn(_("Type"))
        self._treeview.addColumn(_("Name"))

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("New"), bbox)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-add")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newChannel)
        self._newchannel = button

        button = qt.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-delete")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delChannel)
        self._delchannel = button

        button = qt.QPushButton(_("Edit"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-edit")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.editChannel)
        self._editchannel = button

        button = qt.QPushButton(_("Close"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("accept()"))

        button.setDefault(True)
        vbox.adjustSize()
Esempio n. 22
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Channel"))
        self._window.setModal(True)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        table = qt.QGrid(1, vbox)
        table.setSpacing(10)
        table.show()

        label = qt.QLabel(_("Method:"), table)

        methodvbox = qt.QVButtonGroup(table)
        methodvbox.show()

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("accept()"))

        self._ok = button
        self._ok.setEnabled(False)

        self._method = None
        for method, descr in [
            ("manual", _("Provide channel information")),
            ("descriptionpath", _("Read channel description from local path")),
            ("descriptionurl", _("Read channel description from URL")),
            ("detectmedia", _("Detect channel in media (CDROM, DVD, etc)")),
            ("detectpath", _("Detect channel in local path"))
        ]:
            if not self._method:
                self._method = method
            radio = qt.QRadioButton(descr, methodvbox, method)
            qt.QObject.connect(radio, qt.SIGNAL("clicked()"), self.ok)
            act = RadioAction(radio, method, descr)
            act.connect(self, "_method", method)
            radio.show()

        methodvbox.adjustSize()
        vbox.adjustSize()
        self._window.adjustSize()
Esempio n. 23
0
    def __init__(self, parent=None):
        qt.QDialog.__init__(self, parent)

        self.setIcon(getPixmap("smart"))
        self.setCaption(_("Icon Legend"))

        layout = qt.QVBoxLayout(self)

        self._vbox = qt.QVBox(self)
        self._vbox.setMargin(10)
        self._vbox.setSpacing(10)

        layout.add(self._vbox)

        label = qt.QLabel("<b>" + _("The following icons are used to indicate\nthe current status of a package:") + "</b>", self._vbox)
        label.show()

        grid = qt.QGrid(2, self._vbox)
        grid.setSpacing(5)
        grid.setMargin(5)
        grid.show()
  
        for icon, legend in [
        (getPixmap("package-install"),            _("Marked for installation")),
        (getPixmap("package-reinstall"),          _("Marked for re-installation")),
        (getPixmap("package-upgrade"),            _("Marked for upgrade")),
        (getPixmap("package-downgrade"),          _("Marked for downgrade")),
        (getPixmap("package-remove"),             _("Marked for removal")),
        (getPixmap("package-available"),          _("Not installed")),
        (getPixmap("package-new"),                _("Not installed (new)")),
        (getPixmap("package-available-locked"),   _("Not installed (locked)")),
        (getPixmap("package-installed"),          _("Installed")),
        (getPixmap("package-installed-outdated"), _("Installed (upgradable)")),
        (getPixmap("package-installed-locked"),   _("Installed (locked)")),
        (getPixmap("package-broken"),             _("Broken")),
        ]:
            image = qt.QLabel("", grid)
            image.setPixmap(icon)
            image.show()
            label = qt.QLabel(legend, grid)
            label.show()
        
        self._buttonbox = qt.QHBox(self._vbox)
        self._buttonbox.setSpacing(10)
        self._buttonbox.layout().addStretch(1)
        self._buttonbox.show()

        self._closebutton = qt.QPushButton(_("Close"), self._buttonbox)
        self._closebutton.show()
        qt.QObject.connect(self._closebutton, qt.SIGNAL("clicked()"), self, qt.SLOT("hide()"))
Esempio n. 24
0
    def packagePopup(self, packageview, pkgs, pnt):
        
        menu = qt.QPopupMenu(packageview)
        menu.move(pnt)
        
        hasinstalled = bool([pkg for pkg in pkgs if pkg.installed
                             and self._changeset.get(pkg) is not REMOVE])
        hasnoninstalled = bool([pkg for pkg in pkgs if not pkg.installed
                                and self._changeset.get(pkg) is not INSTALL])

        class PackagesAction(object):
        
            def __init__(self, pkgs):
                self._pkgs = pkgs
                self._callback = {}
                self._userdata = {}
            
            def connect(self, item, callback, userdata=None):
                self._callback[item] = callback
                self._userdata[item] = userdata
            
            def slot(self, index):
                self._callback[index](self._pkgs, self._userdata[index])

        action = PackagesAction(pkgs)

        iconset = qt.QIconSet(getPixmap("package-install"))
        item = menu.insertItem(iconset, _("Install"), action.slot)
        action.connect(item, self.actOnPackages, INSTALL)
        if not hasnoninstalled:
            menu.setItemEnabled(item, False)

        iconset = qt.QIconSet(getPixmap("package-reinstall"))
        item = menu.insertItem(iconset, _("Reinstall"), action.slot)
        action.connect(item, self.actOnPackages, REINSTALL)
        if not hasinstalled:
            menu.setItemEnabled(item, False)

        iconset = qt.QIconSet(getPixmap("package-remove"))
        item = menu.insertItem(iconset, _("Remove"), action.slot)
        action.connect(item, self.actOnPackages, REMOVE)
        if not hasinstalled:
            menu.setItemEnabled(item, False)

        if not hasinstalled:
            iconset = qt.QIconSet(getPixmap("package-available"))
        else:
            iconset = qt.QIconSet(getPixmap("package-installed"))
        item = menu.insertItem(iconset, _("Keep"), action.slot)
        action.connect(item, self.actOnPackages, KEEP)
        if not [pkg for pkg in pkgs if pkg in self._changeset]:
            menu.setItemEnabled(item, False)

        iconset = qt.QIconSet(getPixmap("package-broken"))
        item = menu.insertItem(iconset, _("Fix problems"), action.slot)
        action.connect(item, self.actOnPackages, FIX)
        if not hasinstalled:
            menu.setItemEnabled(item, False)

        inconsistent = False
        thislocked = None
        alllocked = None
        names = pkgconf.getFlagTargets("lock")
        if [pkg for pkg in pkgs if pkg in self._changeset]:
            inconsistent = True
        else:
            for pkg in pkgs:
                if (names and pkg.name in names and 
                    ("=", pkg.version) in names[pkg.name]):
                    newthislocked = True
                    newalllocked = len(names[pkg.name]) > 1
                else:
                    newthislocked = False
                    newalllocked = pkgconf.testFlag("lock", pkg)
                if (thislocked is not None and thislocked != newthislocked or
                    alllocked is not None and alllocked != newalllocked):
                    inconsistent = True
                    break
                thislocked = newthislocked
                alllocked = newalllocked

        lockaction = PackagesAction(pkgs)

        if thislocked:
            if not hasnoninstalled:
                iconset = qt.QIconSet(getPixmap("package-installed"))
            else:
                iconset = qt.QIconSet(getPixmap("package-available"))
            item = menu.insertItem(iconset, _("Unlock this version"), lockaction.slot)
            lockaction.connect(item, self.lockPackages, False)
        else:
            if not hasnoninstalled:
                iconset = qt.QIconSet(getPixmap("package-installed-locked"))
            else:
                iconset = qt.QIconSet(getPixmap("package-available-locked"))
            item = menu.insertItem(iconset, _("Lock this version"), lockaction.slot)
            lockaction.connect(item, self.lockPackages, True)
        if inconsistent:
            menu.setItemEnabled(item, False)

        lockallaction = PackagesAction(pkgs)

        if alllocked:
            if not hasnoninstalled:
                iconset = qt.QIconSet(getPixmap("package-installed"))
            else:
                iconset = qt.QIconSet(getPixmap("package-available"))
            item = menu.insertItem(iconset, _("Unlock all versions"), lockallaction.slot)
            lockallaction.connect(item, self.lockAllPackages, False)
        else:
            if not hasnoninstalled:
                iconset = qt.QIconSet(getPixmap("package-installed-locked"))
            else:
                iconset = qt.QIconSet(getPixmap("package-available-locked"))
            item = menu.insertItem(iconset, _("Lock all versions"), lockallaction.slot)
            lockallaction.connect(item, self.lockAllPackages, True)
        if inconsistent:
            menu.setItemEnabled(item, False)

        priorityaction = PackagesAction(pkgs)
        
        item = menu.insertItem(_("Priority"), priorityaction.slot)
        priorityaction.connect(item, self.priorityPackages)
        if len(pkgs) != 1:
            menu.setItemEnabled(item, False)

        menu.show()
        menu.exec_loop(packageview.mapToGlobal(pnt))
Esempio n. 25
0
    def __init__(self, parent=None):

        self._changed = False

        self._window = qt.QDialog(None)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Channels"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)

        self._treeview = qt.QListView(vbox)
        self._treeview.setSizePolicy(qt.QSizePolicy.Expanding,qt.QSizePolicy.Expanding)
        self._treeview.setAllColumnsShowFocus(True)
        self._treeview.setSelectionMode(qt.QListView.Single)
        self._treeview.show()

        qt.QObject.connect(self._treeview, qt.SIGNAL("selectionChanged()"), self.selectionChanged)
        qt.QObject.connect(self._treeview, qt.SIGNAL("doubleClicked(QListViewItem *, const QPoint &, int)"), self.doubleClicked)

        self._treeview.addColumn("")
        self._treeview.addColumn(_("Pri"))
        self._treeview.addColumn(_("Alias"))
        self._treeview.addColumn(_("Type"))
        self._treeview.addColumn(_("Name"))
        
        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("New"), bbox)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-add")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newChannel)
        self._newchannel = button

        button = qt.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-delete")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delChannel)
        self._delchannel = button

        button = qt.QPushButton(_("Edit"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-edit")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.editChannel)
        self._editchannel = button

        button = qt.QPushButton(_("Close"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        button.setDefault(True)
        vbox.adjustSize()
Esempio n. 26
0
    def __init__(self, ctrl, argv=None):
        QtInterface.__init__(self, ctrl, argv)

        self._changeset = None

        self._window = qt.QMainWindow()
        self._window.setCaption("Smart Package Manager %s" % VERSION)
        centerWindow(self._window)
        self._window.setMinimumSize(640, 480)
        app.connect(app, qt.SIGNAL('lastWindowClosed()'), app, qt.SLOT('quit()'))

        self._undo = []
        self._redo = []

        globals = {"self": self, "qt": qt}
        group = qt.QActionGroup(self._window, "Actions")
        self._actions = compileActions(group, ACTIONS, globals)

        class ToggleAction(qt.QAction):
        
            def __init__(self, group, name, label):
                qt.QAction.__init__(self, group, name)
                self.setToggleAction(True)
                self.setMenuText(label.replace("&","&&"))
                self._name = name
            
            def connect(self, signal, callback, userdata):
                self._callback = callback
                self._userdata = userdata
                qt.QObject.connect(self, qt.SIGNAL(signal), self.slot)
            
            def slot(self):
                self._callback(self._userdata)
         
        self._filters = {}
        for name, label in [("hide-non-upgrades", _("Hide Non-upgrades")),
                            ("hide-installed", _("Hide Installed")),
                            ("hide-uninstalled", _("Hide Uninstalled")),
                            ("hide-unmarked", _("Hide Unmarked")),
                            ("hide-unlocked", _("Hide Unlocked")),
                            ("hide-requested", _("Hide Requested")),
                            ("hide-old", _("Hide Old"))]:
            act = ToggleAction(None, name, label)
            act.connect("activated()", self.toggleFilter, name)
            self._actions[name] = act

        treestyle = sysconf.get("package-tree")
        for name, label in [("groups", _("Groups")),
                            ("channels", _("Channels")),
                            ("channels-groups", _("Channels & Groups")),
                            ("none", _("None"))]:
            act = ToggleAction(group, "tree-style-"+name, label)
            if name == treestyle:
                act.setOn(True)
            act.connect("activated()", self.setTreeStyle, name)
            self._actions["tree-style-"+name] = act

        self._menubar = self._window.menuBar()
        for MENU in MENUBAR:
             def insertmenu(menubar, menu):
                item = menu[0]
                action = self._actions[item]
                m = qt.QPopupMenu(menubar)
                text = action.menuText()
                menubar.insertItem(text, m)
                for item in menu[1]:
                    if isinstance(item, tuple):
                        insertmenu(m, item)
                    elif item:
                        action = self._actions[item]
                        #i = qt.QPopupMenu(m)
                        #text = action.menuText()
                        #m.insertItem(text, i)
                        action.addTo(m)
                    else:
                        m.insertSeparator()
             insertmenu(self._menubar, MENU)

        self._toolbar = qt.QToolBar(self._window)
        for TOOL in TOOLBAR:
            def inserttool(toolbar, tool):
                if tool:
                    action = self._actions[tool]
                    #b = qt.QToolButton(toolbar, TOOL)
                    #b.setTextLabel(action.toolTip())
                    pixmap = getPixmap(TOOLBARICONS[tool])
                    #b.setIconSet(qt.QIconSet(pixmap))
                    action.setIconSet(qt.QIconSet(pixmap))
                    action.addTo(toolbar)
                else:
                    toolbar.addSeparator()
            inserttool(self._toolbar, TOOL)

        #self._window.add_accel_group(self._ui.get_accel_group())

        self._actions["exec-changes"].setAccel(qt.QKeySequence("Ctrl+C"))
        self._actions["find"].setAccel(qt.QKeySequence("Ctrl+F"))
        self._actions["expand-all"].setAccel(qt.QKeySequence("Ctrl+O"))
        self._actions["collapse-all"].setAccel(qt.QKeySequence("Ctrl+W"))
        self._actions["summary-window"].setAccel(qt.QKeySequence("Ctrl+S"))

        self._actions["exec-changes"].setEnabled(False)
        self._actions["clear-changes"].setEnabled(False)
        self._actions["undo"].setEnabled(False)
        self._actions["redo"].setEnabled(False)

        # Search bar

        self._searchbar = qt.QToolBar(self._window)
        self._searchbar.hide()
       
        label = qt.QLabel(_("Search:"), self._searchbar)
        label.show()

        self._searchentry = qt.QLineEdit(self._searchbar)
        qt.QObject.connect(self._searchentry, qt.SIGNAL("returnPressed()"), self.refreshPackages)
        self._searchentry.show()

        button = qt.QPushButton(self._searchbar)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.refreshPackages)
        pixmap = getPixmap("crystal-search")
        button.setIconSet(qt.QIconSet(pixmap))
        button.show()

        buttongroup = qt.QButtonGroup(self._searchbar)
        buttongroup.hide()
        
        self._searchname = qt.QRadioButton(_("Automatic"), self._searchbar)
        self._searchname.setChecked(True)
        qt.QObject.connect(self._searchname, qt.SIGNAL("clicked()"), self.refreshPackages)
        buttongroup.insert(self._searchname)
        self._searchname.show()
        self._searchdesc = qt.QRadioButton(_("Description"), self._searchbar)
        self._searchdesc.setChecked(False)
        qt.QObject.connect(self._searchdesc, qt.SIGNAL("clicked()"), self.refreshPackages)
        self._searchdesc.show()
        buttongroup.insert(self._searchdesc)

        # Packages and information

        self._splitter = qt.QSplitter(qt.Qt.Vertical, self._window)
        self._window.setCentralWidget(self._splitter)
        
        self._pv = QtPackageView(self._splitter)
        self._pv.show()

        self._pi = QtPackageInfo(self._splitter)
        self._pi.show()
        qt.QObject.connect(self._pv, qt.PYSIGNAL("packageSelected"), self._pi.setPackage)
        qt.QObject.connect(self._pv, qt.PYSIGNAL("packageActivated"), self.actOnPackages)
        qt.QObject.connect(self._pv, qt.PYSIGNAL("packagePopup"), self.packagePopup)

        self._status = self._window.statusBar()
        self._status.show()
        
        self._legend = QtLegend(self._window)
Esempio n. 27
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(None)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Flags"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        topvbox = qt.QVBox(self._window)
        topvbox.setMargin(10)
        topvbox.setSpacing(10)
        topvbox.show()

        layout.addWidget(topvbox)

        tophbox = qt.QHBox(topvbox)
        tophbox.setSpacing(20)
        tophbox.show()

        # Left side
        vbox = qt.QVGroupBox(tophbox)
        vbox.setInsideSpacing(10)
        vbox.show()

        self._flagsview = qt.QListView(vbox)
        self._flagsview.show()

        qt.QObject.connect(self._flagsview, qt.SIGNAL("selectionChanged()"),
                           self.flagSelectionChanged)

        self._flagsview.addColumn(_("Flags"))

        bbox = qt.QHBox(vbox)
        bbox.setMargin(5)
        bbox.setSpacing(10)
        bbox.show()

        button = qt.QPushButton(_("New"), bbox)
        button.setEnabled(True)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-add")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newFlag)
        self._newflag = button

        button = qt.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-delete")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delFlag)
        self._delflag = button

        # Right side
        vbox = qt.QVGroupBox(tophbox)
        vbox.setInsideSpacing(10)
        vbox.show()

        self._targetsview = qt.QListView(vbox)
        self._targetsview.show()

        qt.QObject.connect(self._targetsview, qt.SIGNAL("selectionChanged()"),
                           self.targetSelectionChanged)

        self._targetsview.addColumn(_("Targets"))

        bbox = qt.QHBox(vbox)
        bbox.setMargin(5)
        bbox.setSpacing(10)
        bbox.show()

        button = qt.QPushButton(_("New"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-add")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newTarget)
        self._newtarget = button

        button = qt.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-delete")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delTarget)
        self._deltarget = button

        # Bottom
        sep = qt.QFrame(topvbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(topvbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Close"), bbox)
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window,
                           qt.SLOT("accept()"))

        button.setDefault(True)
Esempio n. 28
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(parent)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("New Channel"))
        self._window.setModal(True)

        vbox = qt.QVBox(self._window)
        vbox.setMargin(10)
        vbox.setSpacing(10)
        vbox.show()

        table = qt.QGrid(1, vbox)
        table.setSpacing(10)
        table.show()
        
        label = qt.QLabel(_("Method:"), table)

        methodvbox = qt.QVButtonGroup(table)
        methodvbox.show()

        sep = qt.QFrame(vbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(vbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Cancel"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("reject()"))

        button = qt.QPushButton(_("OK"), bbox)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        self._ok = button
        self._ok.setEnabled(False)
        
        self._method = None
        for method, descr in [("manual",
                               _("Provide channel information")),
                              ("descriptionpath",
                               _("Read channel description from local path")),
                              ("descriptionurl",
                               _("Read channel description from URL")),
                              ("detectmedia",
                               _("Detect channel in media (CDROM, DVD, etc)")),
                              ("detectpath",
                               _("Detect channel in local path"))]:
            if not self._method:
                self._method = method
            radio = qt.QRadioButton(descr, methodvbox, method)
            qt.QObject.connect(radio, qt.SIGNAL("clicked()"), self.ok)
            act = RadioAction(radio, method, descr)
            act.connect(self, "_method", method)
            radio.show()
        
        methodvbox.adjustSize()
        vbox.adjustSize()
        self._window.adjustSize()
Esempio n. 29
0
    def __init__(self, hassub, parent=None):
        Progress.__init__(self)
        qt.QDialog.__init__(self, parent)

        self._hassub = hassub
        self._shorturl = ShortURL(50)
        self._ticking = False
        self._stopticking = False
        self._fetcher = None

        self._beenshown = False
        self._mainthread = None

        if hassub:
            self.setMinimumSize(500, 400)
        else:
            self.setMinimumSize(300, 80)

        self.setIcon(getPixmap("smart"))
        self.setCaption(_("Operation Progress"))

        vbox = qt.QVBoxLayout(self, 10, 10)
        vbox.setResizeMode(qt.QLayout.FreeResize)
        vbox.setMargin(10)
        vbox.setSpacing(10)

        self._topic = qt.QLabel(self)
        vbox.addWidget(self._topic)

        self._progressbar = qt.QProgressBar(self)
        self._progressbar.setPercentageVisible(True)
        self._progressbar.show()
        vbox.addWidget(self._progressbar)

        if hassub:
            self._listview = qt.QListView(self)
            self._listview.setSorting(-1, False)
            self._listview.setSelectionMode(qt.QListView.NoSelection)
            self._listview.show()
            vbox.addWidget(self._listview)

            column = self._listview.addColumn(_("Progress"))
            self._listview.setColumnWidthMode(column, qt.QListView.Manual)
            self._listview.setColumnWidth(column, 55)
            column = self._listview.addColumn(_("Current"))
            self._currentcolumn = column
            column = self._listview.addColumn(_("Total"))
            self._totalcolumn = column
            column = self._listview.addColumn(_("Speed"))
            self._speedcolumn = column
            column = self._listview.addColumn(_("ETA"))
            self._etacolumn = column
            column = self._listview.addColumn(_("Description"))
            self._listview.setColumnWidthMode(column, qt.QListView.Manual)
            self._listview.setColumnWidth(column, 165)
            self._desccolumn = column

            self._subiters = {}
            self._subindex = 0

            self._bbox = qt.QHBox(self)
            self._bbox.setSpacing(10)
            self._bbox.layout().addStretch(1)
            vbox.addWidget(self._bbox)

            button = qt.QPushButton(_("Cancel"), self._bbox)
            button.show()
            qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._cancel)
Esempio n. 30
0
    def __init__(self, parent=None):

        self._window = qt.QDialog(None)
        self._window.setIcon(getPixmap("smart"))
        self._window.setCaption(_("Flags"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = qt.QVBoxLayout(self._window)
        layout.setResizeMode(qt.QLayout.FreeResize)

        topvbox = qt.QVBox(self._window)
        topvbox.setMargin(10)
        topvbox.setSpacing(10)
        topvbox.show()

        layout.addWidget(topvbox)

        tophbox = qt.QHBox(topvbox)
        tophbox.setSpacing(20)
        tophbox.show()

        # Left side
        vbox = qt.QVGroupBox(tophbox)
        vbox.setInsideSpacing(10)
        vbox.show()

        self._flagsview = qt.QListView(vbox)
        self._flagsview.show()

        qt.QObject.connect(self._flagsview, qt.SIGNAL("selectionChanged()"), self.flagSelectionChanged)

        self._flagsview.addColumn(_("Flags"))

        bbox = qt.QHBox(vbox)
        bbox.setMargin(5)
        bbox.setSpacing(10)
        bbox.show()

        button = qt.QPushButton(_("New"), bbox)
        button.setEnabled(True)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-add")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newFlag)
        self._newflag = button

        button = qt.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-delete")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delFlag)
        self._delflag = button

        # Right side
        vbox = qt.QVGroupBox(tophbox)
        vbox.setInsideSpacing(10)
        vbox.show()

        self._targetsview = qt.QListView(vbox)
        self._targetsview.show()

        qt.QObject.connect(self._targetsview, qt.SIGNAL("selectionChanged()"), self.targetSelectionChanged)

        self._targetsview.addColumn(_("Targets"))

        bbox = qt.QHBox(vbox)
        bbox.setMargin(5)
        bbox.setSpacing(10)
        bbox.show()

        button = qt.QPushButton(_("New"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-add")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newTarget)
        self._newtarget = button

        button = qt.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIconSet(qt.QIconSet(getPixmap("crystal-delete")))
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delTarget)
        self._deltarget = button

        # Bottom
        sep = qt.QFrame(topvbox)
        sep.setFrameShape(qt.QFrame.HLine)
        sep.setFrameShadow(qt.QFrame.Sunken)
        sep.show()

        bbox = qt.QHBox(topvbox)
        bbox.setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = qt.QPushButton(_("Close"), bbox)
        button.show()
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()"))

        button.setDefault(True)
Esempio n. 31
0
    def __init__(self, hassub, parent=None):
        Progress.__init__(self)
        qt.QDialog.__init__(self, parent)

        self._hassub = hassub
        self._shorturl = ShortURL(50)
        self._ticking = False
        self._stopticking = False
        self._fetcher = None

        self._beenshown = False
        self._mainthread = None

        if hassub:
            self.setMinimumSize(500, 400)
        else:
            self.setMinimumSize(300, 80)

        self.setIcon(getPixmap("smart"))
        self.setCaption(_("Operation Progress"))

        vbox = qt.QVBoxLayout(self, 10, 10)
        vbox.setResizeMode(qt.QLayout.FreeResize)
        vbox.setMargin(10)
        vbox.setSpacing(10)

        self._topic = qt.QLabel(self)
        vbox.addWidget(self._topic)

        self._progressbar = qt.QProgressBar(self)
        self._progressbar.setPercentageVisible(True)
        self._progressbar.show()
        vbox.addWidget(self._progressbar)

        if hassub:
            self._listview = qt.QListView(self)
            self._listview.setSorting(-1, False);
            self._listview.setSelectionMode(qt.QListView.NoSelection )
            self._listview.show()
            vbox.addWidget(self._listview)

            column = self._listview.addColumn(_("Progress"))
            self._listview.setColumnWidthMode(column, qt.QListView.Manual)
            self._listview.setColumnWidth(column, 55)
            column = self._listview.addColumn(_("Current"))
            self._currentcolumn = column
            column = self._listview.addColumn(_("Total"))
            self._totalcolumn = column
            column = self._listview.addColumn(_("Speed"))
            self._speedcolumn = column
            column = self._listview.addColumn(_("ETA"))
            self._etacolumn = column
            column = self._listview.addColumn(_("Description"))
            self._listview.setColumnWidthMode(column, qt.QListView.Manual)
            self._listview.setColumnWidth(column, 165)
            self._desccolumn = column

            self._subiters = {}
            self._subindex = 0

            self._bbox = qt.QHBox(self)
            self._bbox.setSpacing(10)
            self._bbox.layout().addStretch(1)
            vbox.addWidget(self._bbox)
            
            button = qt.QPushButton(_("Cancel"), self._bbox)
            button.show()
            qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._cancel)