def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(None)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Mirrors"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = QtWidgets.QVBoxLayout(self._window)
        #layout.setResizeMode(QtGui.QLayout.FreeResize)

        vbox = QtWidgets.QWidget(self._window)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setMargin(10)
        vbox.layout().setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)

        self._treeview = QtWidgets.QTreeWidget(vbox)
        self._treeview.setHeaderHidden(True)
        self._treeview.show()
        vbox.layout().addWidget(self._treeview)

        #self._treeview.addColumn(_("Mirror"))
        self._treeview.setHeaderLabels([_("Mirror")])
        #self._treeview.itemChanged[QTreeWidgetItem.connect(self.itemChanged)
        #self._treeview.itemSelectionChanged.connect(self.selectionChanged)

        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("New"), bbox)
        button.setEnabled(True)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-add")))
        button.show()
        button.clicked[()].connect(self.newMirror)
        self._newmirror = button
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-delete")))
        button.show()
        button.clicked[()].connect(self.delMirror)
        self._delmirror = button
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Close"), bbox)
        button.clicked[()].connect(self._window.accept)
        bbox.layout().addWidget(button)
        
        button.setDefault(True)
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("New Channel"))
        self._window.setModal(True)

        layout = QtWidgets.QVBoxLayout(self._window) 
        
        #vbox = QtGui.QVBox(self._window)
        vbox = QtWidgets.QWidget(self._window)
        layout.addWidget(vbox)
        layout = QtWidgets.QVBoxLayout(vbox) 
        layout.setContentsMargins(1, 0, 1, 0, 1, 0, 1, 0)
        layout.setSpacing(10)
        vbox.show()
        self._vbox = vbox

        #table = QtGui.QGrid(2, vbox)
        table = QtWidgets.QWidget(vbox)
        layout.addWidget(table)
        QtWidgets.QGridLayout(table)
        table.layout().setSpacing(10)
        table.show()
        self._table = table
        
        label = QtWidgets.QLabel(_("Type:"), table)
        table.layout().addWidget(label)

        self._typevbox = QtWidgets.QGroupBox(table)
        QtWidgets.QVBoxLayout(self._typevbox)
        #self._typevbox.setFrameStyle(QtGui.QFrame.NoFrame)
        self._typevbox.show()
        table.layout().addWidget(self._typevbox)

        sep = QtWidgets.QFrame(vbox)
        sep.setFrameShape(QtWidgets.QFrame.HLine)
        sep.setFrameShadow(QtWidgets.QFrame.Sunken)
        sep.show()
        layout.addWidget(sep)

        #bbox = QtGui.QHBox(vbox)
        bbox = QtWidgets.QWidget(vbox)
        layout.addWidget(bbox)
        layout = QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = QtWidgets.QPushButton(_("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)
        layout.addWidget(button)

        button = QtWidgets.QPushButton(_("OK"), bbox)
        button.clicked[()].connect(self._window.accept)
        layout.addWidget(button)

        self._ok = button
        self._ok.setEnabled(False)
    def __init__(self, parent=None):

        self._fields = {}
        self._fieldn = 0

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Edit Channel"))
        self._window.setModal(True)

        layout = QtWidgets.QVBoxLayout(self._window)
        #layout.setResizeMode(QtGui.QLayout.FreeResize)

        vbox = QtWidgets.QWidget(self._window)
        layout.addWidget(vbox)
        layout = QtWidgets.QVBoxLayout(vbox) 
        layout.setContentsMargins(1, 0, 1, 0, 1, 0, 1, 0)
        layout.setSpacing(10)
        vbox.show()

        #layout.addWidget(vbox)
        self._vbox = vbox

        #self._table = QtGui.QGrid(2, vbox)
        self._table = QtWidgets.QWidget(vbox)
        QtWidgets.QGridLayout(self._table)
        self._table.layout().setSpacing(10)
        self._table.show()
        layout.addWidget(self._table)

        sep = QtWidgets.QFrame(vbox)
        sep.setFrameShape(QtWidgets.QFrame.HLine)
        sep.setFrameShadow(QtWidgets.QFrame.Sunken)
        sep.show()
        layout.addWidget(sep)

        #bbox = QtGui.QHBox(vbox)
        bbox = QtWidgets.QWidget(vbox)
        layout.addWidget(bbox)
        layout = QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = QtWidgets.QPushButton(_("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)
        layout.addWidget(button)

        button = QtWidgets.QPushButton(_("OK"), bbox)
        button.clicked[()].connect(self._window.accept)
        layout.addWidget(button)

        button.setDefault(True)
    def __init__(self):
        self._window = QtGui.QDialog()
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Status"))
        self._window.setModal(True)
        self._vbox = QtGui.QWidget(self._window)
        #self._vbox.setMargin(20)
        #self._vbox.setMargin(0)
        #self._vbox.setSpacing(5)

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

        self._lastshown = 0
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("New Target"))
        self._window.setModal(True)

        #self._window.setMinimumSize(600, 400)

        vbox = QtWidgets.QWidget(self._window)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setMargin(10)
        vbox.layout().setSpacing(10)
        vbox.show()

        table = QtWidgets.QWidget(vbox) # 2
        QtWidgets.QGridLayout(table)
        table.layout().setSpacing(10)
        table.show()
        
        label = QtWidgets.QLabel(_("Target:"), table)

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

        blank = QtWidgets.QWidget(table)

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

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

        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = QtWidgets.QPushButton(bbox.tr("OK"), bbox)
        button.clicked[()].connect(self._window.accept)

        button = QtWidgets.QPushButton(bbox.tr("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)

        vbox.adjustSize()
        self._window.adjustSize()
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("New Channel"))
        self._window.setModal(True)

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

        table = QtWidgets.QWidget(vbox)
        QtWidgets.QGridLayout(table) 
        table.layout().setSpacing(10)
        table.show()
        
        label = QtWidgets.QLabel(_("Media path:"), table)

        self._mpvbox = QtWidgets.QWidget(table)
        QtWidgets.QVBoxLayout(self._mpvbox) 
        self._mpvbox.layout().setSpacing(10)
        self._mpvbox.show()

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

        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox) 
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = QtWidgets.QPushButton(_("OK"), bbox)
        button.clicked[()].connect(self._window.accept)
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)
        bbox.layout().addWidget(button)
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Package Priority"))
        self._window.setModal(True)
        
        #self._window.setMinimumSize(600, 400)

        vbox = QtWidgets.QWidget(self._window)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setMargin(10)
        vbox.layout().setSpacing(10)
        vbox.show()

        self._vbox = vbox

        self._table = QtWidgets.QWidget(vbox)
        QtWidgets.QGridLayout(self._table)
        self._table.layout().setSpacing(10)
        self._table.show()
        vbox.layout().addWidget(self._table)

        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("Close"), bbox)
        button.clicked[()].connect(self._window.hide)
        bbox.layout().addWidget(button)

        self._vbox.adjustSize()
        self._window.adjustSize()
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("New Package Priority"))
        self._window.setModal(True)

        #self._window.setMinimumSize(600, 400)

        vbox = QtWidgets.QWidget(self._window)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setMargin(10)
        vbox.layout().setSpacing(10)
        vbox.show()

        table = QtWidgets.QWidget(self._window)
        QtWidgets.QGridLayout(table)
        table.layout().setSpacing(10)
        table.show()
        vbox.layout().addWidget(table)
        
        label = QtWidgets.QLabel(_("Package Name:"), table)
        table.layout().addWidget(label)

        self._name = QtWidgets.QLineEdit(table)
        self._name.show()
        table.layout().addWidget(self._name)

        label = QtWidgets.QLabel(_("Channel Alias:"), table)
        table.layout().addWidget(label)

        self._alias = QtWidgets.QLineEdit(table)
        self._alias.setText("*")
        self._alias.show()
        table.layout().addWidget(self._alias)

        label = QtWidgets.QLabel(_("Priority:"), table)
        table.layout().addWidget(label)

        self._priority = QtWidgets.QSpinBox(table)
        self._priority.setSingleStep(1)
        self._priority.setRange(-100000,+100000)
        self._priority.show()
        table.layout().addWidget(self._priority)

        sep = QtWidgets.QFrame(vbox)
        sep.setFrameShape(QtWidgets.QFrame.HLine)
        sep.setFrameShadow(QtWidgets.QFrame.Sunken)
        sep.show()
        vbox.layout().addWidget(sep)

        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("OK"), bbox)
        button.clicked[()].connect(self._window.accept)
        bbox.layout().addWidget(button)

        button.setDefault(True)
        vbox.adjustSize()
        self._window.adjustSize()
    def __init__(self, parent=None):
        QtWidgets.QDialog.__init__(self, parent)

        self.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self.setWindowTitle(_("Icon Legend"))

        layout = QtWidgets.QVBoxLayout(self)

        self._vbox = QtWidgets.QWidget(self)
        QtWidgets.QVBoxLayout(self._vbox)
        self._vbox.layout().setMargin(10)
        self._vbox.layout().setSpacing(10)

        layout.addWidget(self._vbox)

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

        grid = QtWidgets.QWidget(self)
        QtWidgets.QGridLayout(grid)
        grid.layout().setSpacing(5)
        grid.layout().setMargin(5)
        grid.layout().setColumnStretch(1, 1)
        grid.show()
        self._vbox.layout().addWidget(grid)
  
        row = 0
        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 = QtWidgets.QLabel("", grid)
            image.setPixmap(icon)
            image.show()
            grid.layout().addWidget(image, row, 0, QtCore.Qt.AlignLeft)
            label = QtWidgets.QLabel(legend, grid)
            label.show()
            grid.layout().addWidget(label, row, 1, QtCore.Qt.AlignLeft)
            row = row + 1
        
        self._buttonbox = QtWidgets.QWidget(self._vbox)
        QtWidgets.QHBoxLayout(self._buttonbox)
        self._buttonbox.layout().setSpacing(10)
        self._buttonbox.layout().addStretch(1)
        self._buttonbox.show()
        self._vbox.layout().addWidget(self._buttonbox)

        self._closebutton = QtWidgets.QPushButton(_("Close"), self._buttonbox)
        self._closebutton.show()
        self._closebutton.clicked[()].connect(self.hide)
        self._buttonbox.layout().addWidget(self._closebutton)
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("New Channel"))
        self._window.setModal(True)

        vbox = QtWidgets.QWidget(self._window)
        layout = QtWidgets.QVBoxLayout(vbox) 
        vbox.layout().setMargin(10)
        vbox.layout().setSpacing(10)
        vbox.show()

        table = QtWidgets.QWidget(vbox)
        QtWidgets.QGridLayout(table) 
        table.layout().setSpacing(10)
        table.show()
        layout.addWidget(table)
        
        label = QtWidgets.QLabel(_("Method:"), table)
        table.layout().addWidget(label)
 
        methodvbox = QtWidgets.QGroupBox(table)
        QtWidgets.QVBoxLayout(methodvbox) 
        methodvbox.show()
        table.layout().addWidget(methodvbox)
 
        sep = QtWidgets.QFrame(vbox)
        sep.setFrameShape(QtWidgets.QFrame.HLine)
        sep.setFrameShadow(QtWidgets.QFrame.Sunken)
        sep.show()
        vbox.layout().addWidget(sep)

        bbox = QtWidgets.QWidget(vbox)
        layout = QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)
        layout.addWidget(button)

        button = QtWidgets.QPushButton(_("OK"), bbox)
        button.clicked[()].connect(self._window.accept)
        layout.addWidget(button)

        self._ok = button
        self._ok.setEnabled(False)
        
        self._method = None
        #group = QtGui.QButtonGroup(methodvbox)
        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 = QtWidgets.QRadioButton(method, methodvbox)
            radio.setText(descr)
            methodvbox.layout().addWidget(radio)
            #group.addButton(radio)
            radio.clicked[()].connect(self.ok)
            act = RadioAction(radio, method, descr)
            act.connect(self, "_method", method)
            radio.show()
        
        methodvbox.adjustSize()
        vbox.adjustSize()
        self._window.adjustSize()
    def __init__(self, parent=None):

        self._changed = False

        self._window = QtWidgets.QDialog(None)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Channels"))
        self._window.setModal(True)

        self._window.setMinimumSize(580, 350)

        vbox = QtWidgets.QWidget(self._window)
        layout = QtWidgets.QVBoxLayout(vbox) 
        #layout.setResizeMode(QtGui.QLayout.FreeResize)

        #vbox = QtGui.QVBox(self._window)
        layout.setContentsMargins(1, 0, 1, 0, 1, 0, 1, 0)
        layout.setSpacing(10)
        vbox.show()

        self._vbox = vbox

        self._treeview = QtWidgets.QTreeWidget(vbox)
        self._treeview.setSizePolicy(QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding)
        self._treeview.setMinimumSize(570, 320)
        #QTreeView.expandAll(self._treeview)
        #self._treeview.setAllColumnsShowFocus(True)
        #self._treeview.setSelectionMode(QtGui.QListView.Single)
        self._treeview.show()
        layout.addWidget(self._treeview)

        self._treeview.itemSelectionChanged .connect(self.selectionChanged)
        self._treeview.itemDoubleClicked [QTableWidgetItem].connect(self.doubleClicked)

        #self._treeview.addColumn("")
        #self._treeview.addColumn(_("Pri"))
        #self._treeview.addColumn(_("Alias"))
        #self._treeview.addColumn(_("Type"))
        #self._treeview.addColumn(_("Name"))
        self._treeview.setHeaderLabels(["", _("Pri"), _("Alias"), _("Type"), _("Name")])
        
        #bbox = QtGui.QHBox(vbox)
        bbox = QtWidgets.QWidget(vbox)
        layout.addWidget(bbox)
        layout = QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = QtWidgets.QPushButton(_("New"), bbox)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-add")))
        button.show()
        button.clicked[()].connect(self.newChannel)
        self._newchannel = button
        layout.addWidget(button)

        button = QtWidgets.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-delete")))
        button.show()
        button.clicked[()].connect(self.delChannel)
        self._delchannel = button
        layout.addWidget(button)

        button = QtWidgets.QPushButton(_("Edit"), bbox)
        button.setEnabled(False)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-edit")))
        button.show()
        button.clicked[()].connect(self.editChannel)
        self._editchannel = button
        layout.addWidget(button)

        button = QtWidgets.QPushButton(_("Close"), bbox)
        button.clicked[()].connect(self._window.accept)
        layout.addWidget(button)

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

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Select Channels"))
        self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = QtWidgets.QVBoxLayout(self._window) 
        #layout.setResizeMode(QtGui.QLayout.FreeResize)
        
        #vbox = QtGui.QVBox(self._window)
        vbox = QtWidgets.QWidget(self._window)
        layout.addWidget(vbox)
        layout = QtWidgets.QVBoxLayout(vbox)
        layout.setContentsMargins(1, 0, 1, 0, 1, 0, 1, 0)
        layout.setSpacing(10)
        vbox.show()

        self._treeview = QtWidgets.QTableWidget(vbox)
        self._treeview.setSizePolicy(QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding)
        #self._treeview.setAllColumnsShowFocus(True)
        self._treeview.show()
        layout.addWidget(self._treeview)

        #self._treeview.addColumn("")
        #self._treeview.addColumn(_("Alias"))
        #self._treeview.addColumn(_("Type"))
        #self._treeview.addColumn(_("Name"))
        self._treeview.setHorizontalHeaderLabels(["", _("Alias"), _("Type"), _("Name")])

        ## temporary
        self.imagesTable = QtWidgets.QTableWidget()
        self.imagesTable.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
        #self.imagesTable.setItemDelegate(ImageDelegate(self))

        self.imagesTable.horizontalHeader().setDefaultSectionSize(90)
        self.imagesTable.setColumnCount(3)
        self.imagesTable.setHorizontalHeaderLabels(("Image", "Mode", "State"))
        self.imagesTable.horizontalHeader().setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch)
        self.imagesTable.horizontalHeader().setSectionResizeMode(1, QtWidgets.QHeaderView.Fixed)
        self.imagesTable.horizontalHeader().setSectionResizeMode(2, QtWidgets.QHeaderView.Fixed)
        self.imagesTable.verticalHeader().hide()


        bbox = QtWidgets.QWidget(vbox)
        layout.addWidget(bbox)
        layout = QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()

        button = QtWidgets.QPushButton(_("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)
        layout.addWidget(button)

        button = QtWidgets.QPushButton(_("OK"), bbox)
        button.clicked[()].connect(self._window.accept)
        layout.addWidget(button)

        button.setDefault(True)
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(parent)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("New Mirror"))
        self._window.setModal(True)

        #self._window.setMinimumSize(600, 400)

        vbox = QtWidgets.QWidget(self._window)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setMargin(10)
        vbox.layout().setSpacing(10)
        vbox.show()

        table = QtWidgets.QWidget(vbox)
        QtWidgets.QGridLayout(table)
        table.layout().setSpacing(10)
        table.show()
        vbox.layout().addWidget(table)
        
        label = QtWidgets.QLabel(_("Origin URL:"), table)
        label.show()
        table.layout().addWidget(label)

        self._origin = QtWidgets.QLineEdit(table)
        self._origin.setMaxLength(40)
        self._origin.show()
        table.layout().addWidget(self._origin)

        label = QtWidgets.QLabel(_("Mirror URL:"), table)
        label.show()
        table.layout().addWidget(label)

        self._mirror = QtWidgets.QLineEdit(table)
        self._mirror.setMaxLength(40)
        self._mirror.show()
        table.layout().addWidget(self._mirror)

        sep = QtWidgets.QFrame(vbox)
        sep.setFrameStyle(QtWidgets.QFrame.HLine)
        sep.show()
        vbox.layout().addWidget(sep)

        bbox = QtWidgets.QWidget(self._window)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("OK"), bbox)
        button.clicked[()].connect(self._window.accept)
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Cancel"), bbox)
        button.clicked[()].connect(self._window.reject)
        bbox.layout().addWidget(button)
        
        vbox.adjustSize()
        self._window.adjustSize()
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(None)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Flags"))
        self._window.setModal(True)
        
        self._window.setMinimumSize(600, 400)

        layout = QtWidgets.QVBoxLayout(self._window)
        #layout.setResizeMode(QtGui.QLayout.FreeResize)

        topvbox = QtWidgets.QWidget(self._window)
        QtWidgets.QVBoxLayout(topvbox)
        topvbox.layout().setMargin(10)
        topvbox.layout().setSpacing(10)
        topvbox.show()

        layout.addWidget(topvbox)

        tophbox = QtWidgets.QWidget(topvbox)
        QtWidgets.QHBoxLayout(tophbox)
        tophbox.layout().setSpacing(20)
        tophbox.show()
        topvbox.layout().addWidget(tophbox)

        # Left side
        vbox = QtWidgets.QGroupBox(tophbox)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setSpacing(10)
        vbox.show()
        tophbox.layout().addWidget(vbox)

        self._flagsview = QtWidgets.QTableWidget(vbox)
        self._flagsview.show()
        vbox.layout().addWidget(self._flagsview)

        self._flagsview.selectionChanged.connect(self.flagSelectionChanged)

        #self._flagsview.addColumn(_("Flags"))
        self._flagsview.setHorizontalHeaderLabels([_("Flags")])
        self._flagsview.horizontalHeader().show()

        #bbox = QtGui.QHBox(vbox)
        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setMargin(5)
        bbox.layout().setSpacing(10)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("New"), bbox)
        button.setEnabled(True)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-add")))
        button.show()
        button.clicked[()].connect(self.newFlag)
        self._newflag = button
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-delete")))
        button.show()
        button.clicked[()].connect(self.delFlag)
        self._delflag = button
        bbox.layout().addWidget(button)

        # Right side
        vbox = QtWidgets.QGroupBox(tophbox)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setSpacing(10)
        vbox.show()
        tophbox.layout().addWidget(vbox)

        self._targetsview = QtWidgets.QTableWidget(vbox)
        self._targetsview.show()
        vbox.layout().addWidget(self._targetsview)

        self._targetsview.selectionChanged.connect(self.targetSelectionChanged)

        #self._targetsview.addColumn(_("Targets"))
        self._targetsview.setHorizontalHeaderLabels([_("Targets")])
        self._targetsview.horizontalHeader().show()

        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setMargin(5)
        bbox.layout().setSpacing(10)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("New"), bbox)
        button.setEnabled(False)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-add")))
        button.show()
        button.clicked[()].connect(self.newTarget)
        self._newtarget = button
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-delete")))
        button.show()
        button.clicked[()].connect(self.delTarget)
        self._deltarget = button
        bbox.layout().addWidget(button)


        # Bottom
        sep = QtWidgets.QFrame(topvbox)
        sep.setFrameShape(QtWidgets.QFrame.HLine)
        sep.setFrameShadow(QtWidgets.QFrame.Sunken)
        sep.show()
        topvbox.layout().addWidget(sep)

        bbox = QtWidgets.QWidget(topvbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()
        topvbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("Close"), bbox)
        button.show()
        button.clicked[()].connect(self._window.accept)
        bbox.layout().addWidget(button)
        
        button.setDefault(True)
    def __init__(self, parent=None):

        self._window = QtWidgets.QDialog(None)
        self._window.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self._window.setWindowTitle(_("Priorities"))
        #self._window.setModal(True)

        self._window.setMinimumSize(600, 400)

        layout = QtWidgets.QVBoxLayout(self._window)
        #layout.setResizeMode(QtGui.QLayout.FreeResize)

        vbox = QtWidgets.QWidget(self._window)
        QtWidgets.QVBoxLayout(vbox)
        vbox.layout().setMargin(10)
        vbox.layout().setSpacing(10)
        vbox.show()

        layout.addWidget(vbox)

        self._treeview = QtWidgets.QTableWidget(vbox)
        #self._treeview.setAllColumnsShowFocus(True)
        self._treeview.show()
        vbox.layout().addWidget(self._treeview)

        #self._treeview.itemChanged[QTableWidgetItem.connect(self.itemChanged)
        #self._treeview.selectionChanged.connect(self.selectionChanged)

        #self._treeview.addColumn(_("Package Name"))
        #self._treeview.addColumn(_("Channel Alias"))
        #self._treeview.addColumn(_("Priority"))
        
        bbox = QtWidgets.QWidget(vbox)
        QtWidgets.QHBoxLayout(bbox)
        bbox.layout().setSpacing(10)
        bbox.layout().addStretch(1)
        bbox.show()
        vbox.layout().addWidget(bbox)

        button = QtWidgets.QPushButton(_("New"), bbox)
        button.setEnabled(True)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-add")))
        button.show()
        button.clicked[()].connect(self.newPriority)
        self._newpriority = button
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Delete"), bbox)
        button.setEnabled(False)
        button.setIcon(QtGui.QIcon(getPixmap("crystal-delete")))
        button.show()
        button.clicked[()].connect(self.delPriority)
        self._delpriority = button
        bbox.layout().addWidget(button)

        button = QtWidgets.QPushButton(_("Close"), bbox)
        button.clicked[()].connect(self._window.accept)
        bbox.layout().addWidget(button)
        
        button.setDefault(True)
        vbox.adjustSize()
    def __init__(self, parent=None):
        QtWidgets.QDialog.__init__(self, parent)

        self.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self.setWindowTitle(_("Log"))
        self.setMinimumSize(400, 300)
        #self.setModal(True)

        layout = QtWidgets.QVBoxLayout(self)
        #layout.setResizeMode(QtGui.QLayout.FreeResize)

        self._vbox = QtWidgets.QWidget(self)
        QtWidgets.QVBoxLayout(self._vbox)
        self._vbox.layout().setMargin(10)
        self._vbox.layout().setSpacing(10)
        self._vbox.show()

        layout.addWidget(self._vbox)

        self._scrollview = BackgroundScrollView(self._vbox)

        #self._scrollview = QtGui.QScrollArea(self._vbox)
        self._scrollview.setGeometry(QtCore.QRect(5, 1, 380, 225))
        self._scrollview.setMinimumSize(QtCore.QSize(380, 225))
        self._scrollview.setFrameShape(QtWidgets.QFrame.Box)
        self._scrollview.setFrameShadow(QtWidgets.QFrame.Plain)
        self._scrollview.setLineWidth(0)
        self._scrollview.setMidLineWidth(0)
        self._scrollview.setWidgetResizable(True)
        self._scrollview.setObjectName(_fromUtf8("_scrollview"))
        self.scrollAreaWidgetContents = QtWidgets.QWidget()
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 378, 223))
        self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
        self._scrollview.setWidget(self.scrollAreaWidgetContents)

        self._vbox.layout().addWidget(self._scrollview)

        self._textview = QtWidgets.QLabel(self._scrollview.viewport())
        self._textview.setAlignment(QtCore.Qt.AlignTop)
        self._textview.setTextFormat(QtCore.Qt.LogText)
        self._textview.setAutoFillBackground(True)
        self._textview.setBackgroundRole(QtGui.QPalette.Base)
        self._textview.show()
        self._textview.adjustSize()
        
        #self._textview.setEraseColor(self._scrollview.eraseColor())
        self._scrollview.setWidget(self._textview)

        self._buttonbox = QtWidgets.QWidget(self._vbox)
        QtWidgets.QHBoxLayout(self._buttonbox)
        self._buttonbox.layout().setSpacing(10)
        self._buttonbox.layout().addStretch(1)
        self._buttonbox.show()
        self._buttonbox.setMinimumSize(QtCore.QSize(500, 50))
        self._vbox.layout().addWidget(self._buttonbox)

        self._clearbutton = QtWidgets.QPushButton(_("Clear"), self._buttonbox)
        self._clearbutton.show()
        self._clearbutton.clicked[()].connect(self.clearText)
        self._buttonbox.layout().addWidget(self._clearbutton)

        self._closebutton = QtWidgets.QPushButton(_("Close"), self._buttonbox)
        self._closebutton.show()
        self._closebutton.clicked[()].connect(self.hide)
        self._buttonbox.layout().addWidget(self._closebutton)

        self._closebutton.setDefault(True)
    def __init__(self, parent=None):
        QtWidgets.QDialog.__init__(self, parent)

        self.setWindowIcon(QtGui.QIcon(getPixmap("smart")))
        self.setWindowTitle(_("Change Summary"))
        self.setModal(True)
        self.resize(520, 250)
        #self.setMaximumSize(QtCore.QSize(520, 400))
        self.setMinimumSize(QtCore.QSize(520, 300))
        #self.setMinimumSize(500, 350)
        centerWindow(self)
        
        self._vbox = QtWidgets.QVBoxLayout(self)
        self._vbox.setContentsMargins(5, 5, 5, 5)
        self._vbox.setSpacing(5)

        # Label summary
        self._label = QtWidgets.QLabel(self)
        # Label style start
        self._label.setGeometry(QtCore.QRect(20, 220, 490, 35))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self._label.sizePolicy().hasHeightForWidth())
        self._label.setSizePolicy(sizePolicy)
        self._label.setMinimumSize(QtCore.QSize(490, 30))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("FreeSans"))
        font.setPointSize(11)
        font.setBold(False)
        font.setWeight(50)
        self._label.setFont(font)
        self._label.setCursor(QtGui.QCursor(QtCore.Qt.WhatsThisCursor))
        self._label.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self._label.setFrameShadow(QtWidgets.QFrame.Raised)
        self._label.setLineWidth(2)
        self._label.setWordWrap(True)
        self._label.setMargin(7)
        self._label.setIndent(0)
        self._label.setObjectName(_fromUtf8("_label"))

        # Label style end

        self._vbox.addWidget(self._label)

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

        self._lineLabel = QtWidgets.QLabel(self)
        self._lineLabel.setGeometry(QtCore.QRect(10, 250, 500, 10))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self._lineLabel.sizePolicy().hasHeightForWidth())
        self._lineLabel.setSizePolicy(sizePolicy)
        self._lineLabel.setMinimumSize(QtCore.QSize(500, 1))
        self._lineLabel.setMaximumSize(QtCore.QSize(16777215, 10))
        self._lineLabel.setMouseTracking(True)
        self._lineLabel.setToolTip(_fromUtf8("Information"))
        self._lineLabel.setWhatsThis(_fromUtf8("We will apply this changes on sytem..."))
        self._lineLabel.setLayoutDirection(QtCore.Qt.LeftToRight)
        self._lineLabel.setFrameShape(QtWidgets.QFrame.HLine)
        self._lineLabel.setFrameShadow(QtWidgets.QFrame.Plain)
        self._lineLabel.setLineWidth(1)
        self._lineLabel.setText(_fromUtf8(""))
        self._lineLabel.setAlignment(QtCore.Qt.AlignCenter)
        self._lineLabel.setWordWrap(False)
        self._lineLabel.setMargin(0)
        self._lineLabel.setIndent(0)
        self._lineLabel.setObjectName(_fromUtf8("_lineLabel"))
        self._vbox.addWidget(self._lineLabel)

        # Size Label

        self._sizelabel = QtWidgets.QLabel("", self)
        
        # Size Label Style start
        
        self._sizelabel.setGeometry(QtCore.QRect(10, 250, 500, 35))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self._sizelabel.sizePolicy().hasHeightForWidth())
        self._sizelabel.setSizePolicy(sizePolicy)
        self._sizelabel.setMinimumSize(QtCore.QSize(500, 20))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("FreeSans"))
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self._sizelabel.setFont(font)
        self._sizelabel.setCursor(QtGui.QCursor(QtCore.Qt.WhatsThisCursor))
        self._sizelabel.setMouseTracking(True)
        self._sizelabel.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self._sizelabel.setFrameShadow(QtWidgets.QFrame.Plain)
        self._sizelabel.setLineWidth(2)
        self._sizelabel.setWordWrap(True)
        self._sizelabel.setMargin(5)
        self._sizelabel.setIndent(0)
        self._sizelabel.setObjectName(_fromUtf8("_sizelabel"))
        # Size Label Style end

        self._vbox.addWidget(self._sizelabel)

        self._confirmbbox = QtWidgets.QWidget(self)
        layout = QtWidgets.QHBoxLayout(self._confirmbbox)
        layout.setSpacing(10)
        layout.addStretch(1)
        #self._confirmbbox = QtGui.QWidget(self)
        #self._confirmbbox.setGeometry(QtCore.QRect(20, 210, 351, 80))
        #self._confirmbbox.setObjectName("widget")
        self._confirmbbox.setMinimumSize(QtCore.QSize(500, 50))

        self._vbox.addWidget(self._confirmbbox)

#        self.frame = QtWidgets.QFrame(Dialog)
#        self.frame.setGeometry(QtCore.QRect(10, 230, 361, 61))
#        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
#        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
#        self.frame.setObjectName("frame")

        self._okbutton = QtWidgets.QPushButton(_("OK"), self._confirmbbox)
        self._okbutton.setGeometry(QtCore.QRect(10, 10, 90, 26))
        self._okbutton.setObjectName(_fromUtf8("_okbutton"))
#        self._okbutton.setGeometry(QtCore.QRect(10, 20, 90, 26))
        self._okbutton.clicked[()].connect(self.accept)
        self._cancelbutton = QtWidgets.QPushButton(_("Cancel"), self._confirmbbox)
        self._cancelbutton.setGeometry(QtCore.QRect(110, 10, 90, 26))
        #self._cancelbutton.setGeometry(QtCore.QRect(110, 20, 90, 26))
        self._cancelbutton.setObjectName(_fromUtf8("_cancelbutton"))
        self._cancelbutton.clicked[()].connect(self.reject)

        self._closebbox = QtWidgets.QWidget(self)
        layout = QtWidgets.QHBoxLayout(self._closebbox)
        layout.setSpacing(10)
        layout.addStretch(1)
        self._vbox.addWidget(self._closebbox)

        self._closebutton = QtWidgets.QPushButton(_("Close"), self._closebbox)
        self._closebutton.clicked[()].connect(self.close)