Esempio n. 1
0
    def __init__(self, url, username, password):
        KDialog.__init__(self)
        decorateWindow(self, i18n('Create User Account'))
        self.setButtons(KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel))
        vbox = QVBoxLayout()
        grid = QFormLayout()
        self.lbServer = QLabel()
        self.lbServer.setText(url)
        grid.addRow(i18n('Game server:'), self.lbServer)
        self.lbUser = QLabel()
        grid.addRow(i18n('Username:'******'Password:'******'Repeat password:'), self.edPassword2)
        vbox.addLayout(grid)
        widget = QWidget(self)
        widget.setLayout(vbox)
        self.setMainWidget(widget)
        pol = QSizePolicy()
        pol.setHorizontalPolicy(QSizePolicy.Expanding)
        self.lbUser.setSizePolicy(pol)

        self.edPassword.textChanged.connect(self.passwordChanged)
        self.edPassword2.textChanged.connect(self.passwordChanged)
        StateSaver(self)
        self.username = username
        self.password = password
        self.passwordChanged()
        self.edPassword2.setFocus()
Esempio n. 2
0
class RunnerWidget(QWidget):
    def __init__(self, parent, umlmachines, name='RunnerWidget'):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.umlmachines = umlmachines
        self.proc = self.umlmachines.run_machine()
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText('Running Umlmachine %s' %
                               self.umlmachines.current)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)

    def update_progress(self):
        #retval = self.proc.poll()
        #print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Esempio n. 3
0
class RunnerWidget(QWidget):
    def __init__(self, parent, umlmachines, name='RunnerWidget'):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.umlmachines = umlmachines
        self.proc = self.umlmachines.run_machine()
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText('Running Umlmachine %s' % self.umlmachines.current)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)
        
    def update_progress(self):
        #retval = self.proc.poll()
        #print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Esempio n. 4
0
    def __init__(self, phl_obj=None, simp_widg=None, parent=None, upper_label=None):
        super(ParamMainWidget, self).__init__()

        self.command_lst = [[None]]
        self.lst_pair = []

        try:
            self.my_phl_obj = phl_obj
            self.simp_widg_in = simp_widg

        except BaseException as e:
            # We don't want to catch bare exceptions but don't know
            # what this was supposed to catch. Log it.
            logger.info("Caught unknown exception #1 type %s: %s", type(e).__name__, e)
            logger.info("\n\n\n something went wrong here wiht the phil object \n\n\n")

        self.build_param_widget()

        label_font = QFont()
        sys_font_point_size = label_font.pointSize()
        label_font.setPointSize(sys_font_point_size + 2)
        self.step_label = QLabel(str(upper_label))
        self.step_label.setFont(label_font)

        self._vbox = QVBoxLayout()
        self._vbox.addWidget(self.step_label)
        self._vbox.addWidget(self.dual_level_tab)

        self.setLayout(self._vbox)
Esempio n. 5
0
    def test_profile_button_clicked(self):
        self.__run_test(self.__runner.run_profile)
        profile = self.__runner.profile_data

        dialog = QDialog(self)

        tabs = QTabWidget(dialog)

        for i, output in enumerate(profile):
            browser = QTextEdit(tabs, 'profile')
            browser.setReadOnly(True)
            browser.setWordWrap(browser.NoWrap)
            browser.setTextFormat(browser.PlainText)
            browser.setFamily('Monospace')
            browser.setText(output)
            tabs.addTab(browser, "profile %d" % i)

        layout = QVBoxLayout(dialog, 1, 1, "DialogLayout")
        layout.setResizeMode(QVBoxLayout.FreeResize)
        layout.addWidget(tabs)

        dialog.setCaption(self.tr("Profile"))
        dialog.setMinimumSize(QSize(400,500))

        dialog.show()
Esempio n. 6
0
    def __init__(self, parent):
        QDialog.__init__(self)
        self.parent = parent
        self._data = {}
        self.table = QTableWidget(self)
        self.table.horizontalHeader().setStretchLastSection(True)
        self.table.verticalHeader().setVisible(False)
        self.table.setEditTriggers(QTableWidget.NoEditTriggers)
        self.table.itemChanged.connect(self.itemChanged)
        self.updateTable()
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setStandardButtons(
            QDialogButtonBox.Close)  # Close has the Rejected role
        self.buttonBox.rejected.connect(self.accept)
        self.newButton = self.buttonBox.addButton(
            m18nc('define a new player',
                  "&New"),
            QDialogButtonBox.ActionRole)
        self.newButton.setIcon(KIcon("document-new"))
        self.newButton.clicked.connect(self.slotInsert)
        self.deleteButton = self.buttonBox.addButton(
            m18n("&Delete"), QDialogButtonBox.ActionRole)
        self.deleteButton.setIcon(KIcon("edit-delete"))
        self.deleteButton.clicked.connect(self.delete)

        cmdLayout = QHBoxLayout()
        cmdLayout.addWidget(self.buttonBox)
        layout = QVBoxLayout()
        layout.addWidget(self.table)
        layout.addLayout(cmdLayout)
        self.setLayout(layout)
        decorateWindow(self, m18n("Players"))
        self.setObjectName('Players')
Esempio n. 7
0
    def __init__(self, names, values, message='', title=''):
        assert len(names) == len(values)

        super(Dialog, self).__init__()

        if title:
            self.setWindowTitle(title)

        self.names = names
        self.values = values
        self.message_label = QLabel(message)

        self.buttons_layout = QVBoxLayout()
        self.button_group = QButtonGroup(self)
        for i, button_name in enumerate(self.names, start=1):
            button = QPushButton(button_name)
            self.button_group.addButton(button, i)
            self.buttons_layout.addWidget(button)

        self.layout = QVBoxLayout()
        self.layout.addWidget(self.message_label)
        self.layout.addLayout(self.buttons_layout)
        self.setLayout(self.layout)

        self.button_group.buttonClicked.connect(self.button_clicked_slot)
Esempio n. 8
0
class BootStrapperWidget(QWidget):
    def __init__(self, parent, suite, name='RunnerWidget'):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        cfg = self.app.umlcfg
        basefile = make_base_filesystem(suite,
                                        '%s.base' % suite,
                                        cfg=cfg,
                                        size=300,
                                        mkfs='mke2fs')
        self.bootstrapper = UmlBootstrapper(suite, basefile, cfg=self.cfg)
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText('Bootstrapping suite %s' % suite)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)

    def update_progress(self):
        #retval = self.proc.poll()
        #print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Esempio n. 9
0
    def __init__(self, parent, nombre, lista):
        """el ultimo parametro es la lista de posibles valores"""
        ElementoWidgetOpciones.__init__(self)
        QGroupBox.__init__(self, parent, "ListaSimple")
        self.nombre = nombre
        self.setTitle(nombre)
        self.setColumnLayout(0, Qt.Vertical)
        self.layout().setSpacing(6)
        self.layout().setMargin(11)
        llayout = QVBoxLayout(self.layout())
        llayout.setAlignment(Qt.AlignTop)
        layout12 = QHBoxLayout(None, 0, 6, "layout12")
        label = QLabel(self, "label")
        layout12.addWidget(label)
        spacer7 = QSpacerItem(51, 31, QSizePolicy.Expanding, QSizePolicy.Minimum)
        layout12.addItem(spacer7)
        
        self.combo1 = QComboBox(0, self, "comboBox1")
        layout12.addWidget(self.combo1)
        spacer8 = QSpacerItem(131, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        layout12.addItem(spacer8)
        llayout.addLayout(layout12)


        for elemento in lista:
            self.combo1.insertItem(elemento)    
Esempio n. 10
0
File: chat.py Progetto: KDE/kajongg
 def __init__(self, scene=None, table=None):
     super(ChatWindow, self).__init__(None)
     self.scene = scene
     self.table = table or scene.game.client.table
     self.table.chatWindow = self
     self.setObjectName('chatWindow')
     title = m18n(
         'Chat on table %1 at %2',
         self.table.tableid,
         self.table.client.connection.url)
     decorateWindow(self, title)
     self.messageView = ChatView()
     self.messageView.setModel(ChatModel())
     self.messageView.setFocusPolicy(Qt.NoFocus)
     self.messageView.setShowGrid(False)
     self.messageView.setWordWrap(False)
     self.messageView.setSelectionMode(QAbstractItemView.NoSelection)
     if Debug.modelTest:
         self.debugModelTest = ModelTest(
             self.messageView.model(),
             self.messageView)
     self.edit = QLineEdit()
     layout = QVBoxLayout()
     layout.addWidget(self.messageView)
     layout.addWidget(self.edit)
     self.setLayout(layout)
     self.edit.returnPressed.connect(self.sendLine)
     self.edit.setFocus()
     self.show()
     StateSaver(self)
Esempio n. 11
0
    def __init__(self, parent, name='SuiteTraitComboBox'):
        QFrame.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.conn = self.app.conn
        self.suiteCursor = Suites(self.conn)
        self.suites = self.suiteCursor.list()
        self.traits = Traits(self.conn, self.suites[0])
        self.scombo = KComboBox(self, 'SuiteComboBox')
        self.scombo.insertStrList(self.suites)
        self.tcombo = KComboBox(self, 'TypeComboBox')
        self.tcombo.insertStrList(['template', 'script'])
        self.trcombo = KComboBox(self, 'TraitComboBox')
        self.update_btn = KPushButton('update', self)
        self.listView = TraitListView(self)
        self.vbox = QVBoxLayout(self)
        for attribute in [
                'listView', 'scombo', 'tcombo', 'trcombo', 'update_btn'
        ]:
            widget = getattr(self, attribute)
            self.vbox.addWidget(widget)
        # we need to redo the signals and the methods that are called
        self.connect(self.scombo, SIGNAL('activated(int)'), self.update_traits)

        self.connect(self.update_btn, SIGNAL('clicked()'),
                     self.refreshlistView)
Esempio n. 12
0
class BootStrapperWidget(QWidget):
    def __init__(self, parent, suite, name="RunnerWidget"):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        cfg = self.app.umlcfg
        basefile = make_base_filesystem(suite, "%s.base" % suite, cfg=cfg, size=300, mkfs="mke2fs")
        self.bootstrapper = UmlBootstrapper(suite, basefile, cfg=self.cfg)
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText("Bootstrapping suite %s" % suite)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL("timeout()"), self.update_progress)
        self.timer.startTimer(1000)

    def update_progress(self):
        # retval = self.proc.poll()
        # print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
Esempio n. 13
0
    def __init__(self, parent=None):
        super(RefineSimplerParamTab, self).__init__()
        # self.param_widget_parent = parent.param_widget_parent
        localLayout = QVBoxLayout()

        hbox_lay_scan_varying = QHBoxLayout()

        label_scan_varying = QLabel("Scan varying refinement")

        hbox_lay_scan_varying.addWidget(label_scan_varying)

        box_scan_varying = DefaultComboBox(
            "refinement.parameterisation.scan_varying",
            ["True", "False", "Auto"],
            default_index=2)
        box_scan_varying.currentIndexChanged.connect(self.combobox_changed)
        hbox_lay_scan_varying.addWidget(box_scan_varying)
        localLayout.addLayout(hbox_lay_scan_varying)

        ###########################################################################

        hbox_lay_outlier_algorithm = QHBoxLayout()
        label_outlier_algorithm = QLabel("Outlier rejection algorithm")

        hbox_lay_outlier_algorithm.addWidget(label_outlier_algorithm)
        box_outlier_algorithm = DefaultComboBox(
            "refinement.reflections.outlier.algorithm",
            ["null", "Auto", "mcd", "tukey", "sauter_poon"],
            default_index=1)
        box_outlier_algorithm.currentIndexChanged.connect(
            self.combobox_changed)

        hbox_lay_outlier_algorithm.addWidget(box_outlier_algorithm)
        localLayout.addLayout(hbox_lay_outlier_algorithm)

        self.inner_reset_btn = ResetButton()
        localLayout.addWidget(self.inner_reset_btn)
        localLayout.addStretch()

        self.setLayout(localLayout)

        self.lst_var_widg = []
        self.lst_var_widg.append(box_scan_varying)
        self.lst_var_widg.append(label_scan_varying)

        # self.lst_var_widg.append(box_beam_fix)
        # self.lst_var_widg.append(label_beam_fix)

        # self.lst_var_widg.append(box_crystal_fix)
        # self.lst_var_widg.append(label_crystal_fix)

        # self.lst_var_widg.append(box_detector_fix)
        # self.lst_var_widg.append(label_detector_fix)

        # self.lst_var_widg.append(box_goniometer_fix)
        # self.lst_var_widg.append(label_goniometer_fix)

        self.lst_var_widg.append(box_outlier_algorithm)
        self.lst_var_widg.append(label_outlier_algorithm)
Esempio n. 14
0
    def __init__(self, parent=None):
        super(ResetButton, self).__init__()
        self.setContentsMargins(-5, -1, -5, -1)

        my_label = QLabel("Reset to Default")
        v_box = QVBoxLayout()
        v_box.addWidget(my_label)
        self.setLayout(v_box)
Esempio n. 15
0
    def __init__(self, phl_obj=None, parent=None):
        super(IndexSimplerParamTab, self).__init__()

        # self.param_widget_parent = parent.param_widget_parent
        # indexing_method_check = QCheckBox("indexing.method")

        hbox_method = QHBoxLayout()
        label_method_62 = QLabel("Indexing method")
        hbox_method.addWidget(label_method_62)
        box_method_62 = DefaultComboBox(
            "indexing.method",
            ["fft3d", "fft1d", "real_space_grid_search", "low_res_spot_match"])
        box_method_62.currentIndexChanged.connect(self.combobox_changed)

        hbox_method.addWidget(box_method_62)

        max_cell_label = QLabel("Max cell")
        max_cell_spn_bx = QDoubleSpinBox()
        max_cell_spn_bx.setSingleStep(5.0)
        max_cell_spn_bx.local_path = "indexing.max_cell"
        max_cell_spn_bx.setSpecialValueText("Auto")
        max_cell_spn_bx.editingFinished.connect(self.spnbox_finished)

        space_group_label = QLabel("Space group")
        space_group_line = QLineEdit()
        # Simple validator to allow only characters in H-M symbols
        regex = QRegExp("[ABCPIFR][0-9a-d\-/:nmHR]+")
        validatorHM = QRegExpValidator(regex)
        space_group_line.setValidator(validatorHM)
        space_group_line.local_path = "indexing.known_symmetry.space_group"
        space_group_line.editingFinished.connect(self.line_changed)

        unit_cell_label = QLabel("Unit cell")
        unit_cell_line = QLineEdit()
        regex = QRegExp("[0-9\., ]+")
        validatorUC = QRegExpValidator(regex)
        unit_cell_line.setValidator(validatorUC)
        unit_cell_line.local_path = "indexing.known_symmetry.unit_cell"
        unit_cell_line.editingFinished.connect(self.line_changed)

        localLayout = QVBoxLayout()

        localLayout.addLayout(hbox_method)

        qf = QFormLayout()
        qf.addRow(max_cell_label, max_cell_spn_bx)
        qf.addRow(space_group_label, space_group_line)
        qf.addRow(unit_cell_label, unit_cell_line)
        localLayout.addLayout(qf)

        self.inner_reset_btn = ResetButton()
        localLayout.addWidget(self.inner_reset_btn)
        localLayout.addStretch()

        self.setLayout(localLayout)

        self.lst_var_widg = _get_all_direct_layout_widget_children(localLayout)
Esempio n. 16
0
    def __init__(self):
        QDialog.__init__(self)
        self.l = QVBoxLayout(self)

        self.passwd = QLineEdit(self, "password")
        self.passwd.setEchoMode(QLineEdit.Password)
        self.l.addWidget(self.passwd)

        self.connect(self.passwd, SIGNAL("returnPressed()"), self.slotSetPass)
Esempio n. 17
0
    def __init__(self, phl_obj=None, parent=None):
        super(TstTmpWidget, self).__init__(parent)
        # self.param_widget_parent = self
        inner_widget = PhilWidget(
            phl_obj, self)  # TODO fix the order of this two parameters
        inner_widget.item_changed.connect(self.update_lin_txt)

        my_box = QVBoxLayout()
        my_box.addWidget(inner_widget)
        self.setLayout(my_box)
Esempio n. 18
0
    def __init__(self, parent=None):
        super(InnerMask, self).__init__(parent=None)

        self.outher_box = QVBoxLayout()
        self.list_widg = QVBoxLayout()
        self.list_widg.addWidget(QLabel(str("empty List ... for now")))
        self.outher_box.addStretch()
        self.outher_box.addLayout(self.list_widg)
        self.outher_box.addStretch()
        self.setLayout(self.outher_box)
        self.show()
Esempio n. 19
0
    def __init__(self, parent=None):
        super(TmpTstWidget, self).__init__()
        # self.param_widget_parent = self

        my_widget = RefineSimplerParamTab(self)
        # my_widget = FindspotsSimplerParameterTab(self)
        # my_widget = SymmetrySimplerParamTab(self)
        # my_widget = ScaleSimplerParamTab(self)

        my_box = QVBoxLayout()
        my_box.addWidget(my_widget)
        self.setLayout(my_box)
Esempio n. 20
0
    def __init__(self, phl_obj, parent=None):
        # TODO fix the order of this two parameters
        super(PhilWidget, self).__init__(parent)

        self.bg_box = QVBoxLayout(self)

        lst_obj = tree_2_lineal(phl_obj.objects)
        lst_phil_obj = lst_obj()

        self.phil_list2gui(lst_phil_obj)

        self.setLayout(self.bg_box)
class TicketDialog(KDialogBase):
    def __init__(self, parent, name='TicketDialog'):
        KDialogBase.__init__(self, parent, name)
        self.page = QFrame(self)
        self.setMainWidget(self.page)
        self.vbox = QVBoxLayout(self.page, 5, 7)
        self.titleEdit = KLineEdit('new ticket', self.page)
        self.dataEdit = KTextEdit(self.page)
        self.vbox.addWidget(self.titleEdit)
        self.vbox.addWidget(self.dataEdit)
        self.showButtonApply(False)
        self.setButtonOKText('insert', 'insert')
        self.show()
Esempio n. 22
0
File: games.py Progetto: KDE/kajongg
    def __init__(self, parent=None):
        super(Games, self).__init__(parent)
        self.selectedGame = None
        self.onlyPending = True
        decorateWindow(self, m18nc('kajongg', 'Games'))
        self.setObjectName('Games')
        self.resize(700, 400)
        self.model = GamesModel()
        if Debug.modelTest:
            self.modelTest = ModelTest(self.model, self)

        self.view = MJTableView(self)
        self.view.setModel(self.model)
        self.selection = QItemSelectionModel(self.model, self.view)
        self.view.setSelectionModel(self.selection)
        self.view.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.view.setSelectionMode(QAbstractItemView.SingleSelection)

        self.buttonBox = QDialogButtonBox(self)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel)
        self.newButton = self.buttonBox.addButton(
            m18nc('start a new game', "&New"), QDialogButtonBox.ActionRole)
        self.newButton.setIcon(KIcon("document-new"))
        self.newButton.clicked.connect(self.accept)
        self.loadButton = self.buttonBox.addButton(
            m18n("&Load"), QDialogButtonBox.AcceptRole)
        self.loadButton.clicked.connect(self.loadGame)
        self.loadButton.setIcon(KIcon("document-open"))
        self.deleteButton = self.buttonBox.addButton(
            m18n("&Delete"), QDialogButtonBox.ActionRole)
        self.deleteButton.setIcon(KIcon("edit-delete"))
        self.deleteButton.clicked.connect(self.delete)

        chkPending = QCheckBox(m18n("Show only pending games"), self)
        chkPending.setChecked(True)
        cmdLayout = QHBoxLayout()
        cmdLayout.addWidget(chkPending)
        cmdLayout.addWidget(self.buttonBox)

        layout = QVBoxLayout()
        layout.addWidget(self.view)
        layout.addLayout(cmdLayout)
        self.setLayout(layout)
        StateSaver(self)

        self.selection.selectionChanged.connect(self.selectionChanged)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        self.view.doubleClicked.connect(self.loadGame)
        chkPending.stateChanged.connect(self.pendingOrNot)
Esempio n. 23
0
 def setupUi(self):
     """setup UI elements"""
     self.viewLeft = ScoreViewLeft(self)
     self.viewRight = ScoreViewRight(self)
     self.viewRight.setHorizontalScrollBar(HorizontalScrollBar(self))
     self.viewRight.setHorizontalScrollMode(QAbstractItemView.ScrollPerItem)
     self.viewRight.setFocusPolicy(Qt.NoFocus)
     self.viewRight.header().setSectionsClickable(False)
     self.viewRight.header().setSectionsMovable(False)
     self.viewRight.setSelectionMode(QAbstractItemView.NoSelection)
     windowLayout = QVBoxLayout(self)
     self.splitter = QSplitter(Qt.Vertical)
     self.splitter.setObjectName('ScoreTableSplitter')
     windowLayout.addWidget(self.splitter)
     scoreWidget = QWidget()
     self.scoreLayout = QHBoxLayout(scoreWidget)
     leftLayout = QVBoxLayout()
     leftLayout.addWidget(self.viewLeft)
     self.leftLayout = leftLayout
     self.scoreLayout.addLayout(leftLayout)
     self.scoreLayout.addWidget(self.viewRight)
     self.splitter.addWidget(scoreWidget)
     self.ruleTree = RuleTreeView(i18nc('kajongg', 'Used Rules'))
     self.splitter.addWidget(self.ruleTree)
     # this shows just one line for the ruleTree - so we just see the
     # name of the ruleset:
     self.splitter.setSizes(list([1000, 1]))
Esempio n. 24
0
    def __init__(self, parent=None):
        super(RefineBravaiSimplerParamTab, self).__init__()

        localLayout = QVBoxLayout()
        hbox_lay_outlier_algorithm = QHBoxLayout()
        label_outlier_algorithm = QLabel("Outlier rejection algorithm")

        hbox_lay_outlier_algorithm.addWidget(label_outlier_algorithm)
        box_outlier_algorithm = DefaultComboBox(
            "refinement.reflections.outlier.algorithm",
            ["null", "Auto", "mcd", "tukey", "sauter_poon"],
            default_index=1)
        box_outlier_algorithm.currentIndexChanged.connect(
            self.combobox_changed)
        hbox_lay_outlier_algorithm.addWidget(box_outlier_algorithm)
        localLayout.addLayout(hbox_lay_outlier_algorithm)

        self.inner_reset_btn = ResetButton()
        localLayout.addWidget(self.inner_reset_btn)
        localLayout.addStretch()

        self.setLayout(localLayout)

        self.lst_var_widg = []
        self.lst_var_widg.append(box_outlier_algorithm)
        self.lst_var_widg.append(label_outlier_algorithm)
Esempio n. 25
0
    def __init__(self, parent=None):
        super(SymmetrySimplerParamTab, self).__init__()

        hbox_d_min = QHBoxLayout()
        localLayout = QVBoxLayout()
        label_d_min = QLabel("d_min")

        hbox_d_min.addWidget(label_d_min)

        d_min_spn_bx = QDoubleSpinBox()
        d_min_spn_bx.local_path = "d_min"
        d_min_spn_bx.setSpecialValueText("Auto")
        d_min_spn_bx.setValue(0.0)
        hbox_d_min.addWidget(d_min_spn_bx)

        d_min_spn_bx.valueChanged.connect(self.spnbox_changed)

        localLayout.addLayout(hbox_d_min)

        self.inner_reset_btn = ResetButton()
        localLayout.addWidget(self.inner_reset_btn)
        localLayout.addStretch()

        self.setLayout(localLayout)

        self.lst_var_widg = []
        self.lst_var_widg.append(d_min_spn_bx)
        self.lst_var_widg.append(label_d_min)
Esempio n. 26
0
    def __init__(self, phl_obj=None, parent=None):
        super(IndexSimplerParamTab, self).__init__()

        # self.param_widget_parent = parent.param_widget_parent
        # indexing_method_check = QCheckBox("indexing.method")

        hbox_method = QHBoxLayout()
        label_method_62 = QLabel("Indexing Method")
        hbox_method.addWidget(label_method_62)
        box_method_62 = QComboBox()
        box_method_62.tmp_lst = []
        box_method_62.local_path = "indexing.method"
        box_method_62.tmp_lst.append("fft3d")
        box_method_62.tmp_lst.append("fft1d")
        box_method_62.tmp_lst.append("real_space_grid_search")
        box_method_62.tmp_lst.append("low_res_spot_match")

        for lst_itm in box_method_62.tmp_lst:
            box_method_62.addItem(lst_itm)
        box_method_62.currentIndexChanged.connect(self.combobox_changed)

        hbox_method.addWidget(box_method_62)

        localLayout = QVBoxLayout()
        localLayout.addLayout(hbox_method)

        self.inner_reset_btn = ResetButton()
        localLayout.addWidget(self.inner_reset_btn)
        localLayout.addStretch()

        self.setLayout(localLayout)

        self.lst_var_widg = _get_all_direct_layout_widget_children(localLayout)
Esempio n. 27
0
class PassDialog(QDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.l = QVBoxLayout(self)

        self.passwd = QLineEdit(self, "password")
        self.passwd.setEchoMode(QLineEdit.Password)
        self.l.addWidget(self.passwd)

        self.connect(self.passwd, SIGNAL("returnPressed()"), self.slotSetPass)

    def slotSetPass(self):
        global password
        password = str(self.passwd.text())
        self.done(0)
Esempio n. 28
0
class SuiteTraitCombo(QWidget):
    def __init__(self, app, parent, name='SuiteTraitCombo'):
        QWidget.__init__(self, parent, name)
        dbwidget(self, app)
        self.suiteCursor = Suites(self.conn)
        self.suites = self.suiteCursor.list()
        self.traits = Traits(self.conn, self.suites[0])
        self.scombo = SuiteCombo(self, self.suites)
        self.tcombo = MyCombo(self, 'TypeCombo')
        self.tcombo.fill(['template', 'script'])
        self.trcombo = MyCombo(self, 'TraitCombo')
        self.ubutton = KPushButton('update', self)
        self.listView = TraitList(self.app, self)
        self.vbox = QVBoxLayout(self)
        for member in ['listView', 'scombo', 'tcombo', 'trcombo', 'ubutton']:
            widget = getattr(self, member)
            self.vbox.addWidget(widget)
        self.connect(self.scombo,
                     SIGNAL('highlighted(int)'), self.update_traits)
        self.connect(self.ubutton,
                     SIGNAL('clicked()'), self.refreshlistView)
        

    def update_traits(self):
        suite = str(self.scombo.currentText())
        self.traits.set_suite(suite)
        self.listView.set_suite(suite)
        self.listView.ftype = str(self.tcombo.currentText())
        
    def refreshlistView(self):
        trait = str(self.trcombo.currentText())
        if trait:
            self.listView.set_trait(trait)
        self.listView.ftype = str(self.tcombo.currentText())
        suite = str(self.scombo.currentText())
        self.listView.set_suite(suite)
        self.traits.set_suite(suite)
        traits = [row.trait for row in self.traits.select()]
        self.trcombo.fill(traits)
        if trait in traits:
            self.trcombo.setCurrentItem(traits.index(trait))
        self.listView.refreshlistView()

    def getData(self):
        return self.listView.getData()

    def updateData(self, data):
        self.listView.updateData(data)
Esempio n. 29
0
 def __init__(self, server=None):
     QDialog.__init__(self, None)
     decorateWindow(self, m18n('Select a ruleset'))
     self.buttonBox = KDialogButtonBox(self)
     self.buttonBox.setStandardButtons(
         QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
     self.buttonBox.accepted.connect(self.accept)
     self.buttonBox.rejected.connect(self.reject)
     self.cbRuleset = ListComboBox(Ruleset.selectableRulesets(server))
     self.grid = QGridLayout()  # our child SelectPlayers needs this
     self.grid.setColumnStretch(0, 1)
     self.grid.setColumnStretch(1, 6)
     vbox = QVBoxLayout(self)
     vbox.addLayout(self.grid)
     vbox.addWidget(self.cbRuleset)
     vbox.addWidget(self.buttonBox)
Esempio n. 30
0
    def create_sidebar_widget(self):
        self.lcd_widget = QLCDNumber(self)
        self.lcd_widget.setFixedHeight(100)
        self.set_score(0, 0)
        self.log_widget = QPlainTextEdit(self)

        sidebar = QWidget(self)
        sidebar_layout = QVBoxLayout()
        sidebar_layout.addWidget(self.lcd_widget)
        sidebar_layout.addWidget(self.log_widget)
        sidebar.setLayout(sidebar_layout)

        sidebar.setFixedWidth(250)


        return sidebar
Esempio n. 31
0
class SuiteTraitCombo(QWidget):
    def __init__(self, app, parent, name='SuiteTraitCombo'):
        QWidget.__init__(self, parent, name)
        dbwidget(self, app)
        self.suiteCursor = Suites(self.conn)
        self.suites = self.suiteCursor.list()
        self.traits = Traits(self.conn, self.suites[0])
        self.scombo = SuiteCombo(self, self.suites)
        self.tcombo = MyCombo(self, 'TypeCombo')
        self.tcombo.fill(['template', 'script'])
        self.trcombo = MyCombo(self, 'TraitCombo')
        self.ubutton = KPushButton('update', self)
        self.listView = TraitList(self.app, self)
        self.vbox = QVBoxLayout(self)
        for member in ['listView', 'scombo', 'tcombo', 'trcombo', 'ubutton']:
            widget = getattr(self, member)
            self.vbox.addWidget(widget)
        self.connect(self.scombo, SIGNAL('highlighted(int)'),
                     self.update_traits)
        self.connect(self.ubutton, SIGNAL('clicked()'), self.refreshlistView)

    def update_traits(self):
        suite = str(self.scombo.currentText())
        self.traits.set_suite(suite)
        self.listView.set_suite(suite)
        self.listView.ftype = str(self.tcombo.currentText())

    def refreshlistView(self):
        trait = str(self.trcombo.currentText())
        if trait:
            self.listView.set_trait(trait)
        self.listView.ftype = str(self.tcombo.currentText())
        suite = str(self.scombo.currentText())
        self.listView.set_suite(suite)
        self.traits.set_suite(suite)
        traits = [row.trait for row in self.traits.select()]
        self.trcombo.fill(traits)
        if trait in traits:
            self.trcombo.setCurrentItem(traits.index(trait))
        self.listView.refreshlistView()

    def getData(self):
        return self.listView.getData()

    def updateData(self, data):
        self.listView.updateData(data)
Esempio n. 32
0
 def __init__(self, app, parent, name='SuiteTraitCombo'):
     QWidget.__init__(self, parent, name)
     dbwidget(self, app)
     self.suiteCursor = Suites(self.conn)
     self.suites = self.suiteCursor.list()
     self.traits = Traits(self.conn, self.suites[0])
     self.scombo = SuiteCombo(self, self.suites)
     self.tcombo = MyCombo(self, 'TypeCombo')
     self.tcombo.fill(['template', 'script'])
     self.ubutton = KPushButton('update', self)
     self.listView = TraitList(self.app, self)
     self.vbox = QVBoxLayout(self)
     for member in ['listView', 'scombo', 'tcombo', 'ubutton']:
         widget = getattr(self, member)
         self.vbox.addWidget(widget)
     self.connect(self.scombo, SIGNAL('highlighted(int)'),
                  self.update_traits)
     self.connect(self.ubutton, SIGNAL('clicked()'), self.refreshlistView)
Esempio n. 33
0
    def __init__(self, leftRulesets, rightRulesets, parent=None):
        QDialog.__init__(self, parent)
        if not isinstance(leftRulesets, list):
            leftRulesets = list([leftRulesets])
        if not isinstance(rightRulesets, list):
            rightRulesets = list([rightRulesets])
        leftRulesets, rightRulesets = leftRulesets[:], rightRulesets[:]
        # remove rulesets from right which are also on the left side
        for left in leftRulesets:
            left.load()
        for right in rightRulesets:
            right.load()
        for left in leftRulesets:
            for right in rightRulesets[:]:
                if left == right and left.name == right.name:
                    # rightRulesets.remove(right) this is wrong because it
                    # removes the first ruleset with the same hash
                    rightRulesets = list(
                        x for x in rightRulesets if id(x) != id(right))
        self.leftRulesets = leftRulesets
        self.rightRulesets = rightRulesets
        self.model = None
        self.modelTest = None
        self.view = MJTableView(self)
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setStandardButtons(QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)

        cbLayout = QHBoxLayout()
        self.cbRuleset1 = ListComboBox(self.leftRulesets)
        if len(self.leftRulesets) == 1:
            self.lblRuleset1 = QLabel(self.leftRulesets[0].name)
            cbLayout.addWidget(self.lblRuleset1)
        else:
            cbLayout.addWidget(self.cbRuleset1)
        self.cbRuleset2 = ListComboBox(self.rightRulesets)
        cbLayout.addWidget(self.cbRuleset2)
        cmdLayout = QHBoxLayout()
        cmdLayout.addWidget(self.buttonBox)
        layout = QVBoxLayout()
        layout.addLayout(cbLayout)
        layout.addWidget(self.view)
        layout.addLayout(cmdLayout)
        self.setLayout(layout)

        decorateWindow(self, i18n("Compare"))
        self.setObjectName('RulesetDiffer')

        self.cbRuleset1.currentIndexChanged.connect(self.leftRulesetChanged)
        self.cbRuleset2.currentIndexChanged.connect(self.rulesetChanged)
        self.leftRulesetChanged()
        StateSaver(self)
Esempio n. 34
0
    def set_ref(self, in_json_path, lin_num):
        my_box = QVBoxLayout()
        self.my_inner_table = ReindexTable(self)

        cwd_path = os.path.join(sys_arg.directory, "dui_files")
        full_json_path = os.path.join(cwd_path, in_json_path)

        self.my_inner_table.add_opts_lst(json_path=full_json_path)

        if self.my_inner_table.rec_col is not None:
            my_solu = self.my_inner_table.find_best_solu()
            self.my_inner_table.opt_clicked(my_solu, 0)

        recomd_str = "Select a bravais lattice to enforce: \n"
        try:
            recomd_str += "(best guess solution = row {})".format(
                self.my_inner_table.tmp_sel + 1)

        except BaseException as e:
            # Since we don't know exactly what this was supposed to be
            # - AttributeError? We don't know how to cleanly catch
            logger.error("Unknown exception catch caught. Was: %s", e)
            recomd_str += "(no best solution could be automatically determined)"

        bot_box = QHBoxLayout()
        bot_box.addWidget(QLabel(recomd_str))
        bot_box.addStretch()
        ok_but = QPushButton("     OK      ")
        ok_but.clicked.connect(self.my_inner_table.ok_clicked)
        bot_box.addWidget(ok_but)
        heather_text, v_heather_size = heather_text_from_lin(
            lin_num, full_json_path)
        my_box.addWidget(QLabel(heather_text))
        my_box.addWidget(self.my_inner_table)
        my_box.addLayout(bot_box)

        self.setLayout(my_box)

        n_col = self.my_inner_table.columnCount()
        tot_width = 80
        for col in range(n_col):
            loc_width = self.my_inner_table.columnWidth(col)
            tot_width += loc_width

        n_row = self.my_inner_table.rowCount()
        row_height = self.my_inner_table.rowHeight(1)
        tot_heght = int((float(n_row)) * float(row_height))
        tot_heght += int(
            (float(v_heather_size + 2)) * float(row_height * 0.62))

        self.resize(tot_width, tot_heght)
        # self.adjustSize()
        self.show()
Esempio n. 35
0
 def setupUiForPlayer(self, pGrid, idx):
     """setup UI elements for a player"""
     self.spValues[idx] = QSpinBox()
     self.nameLabels[idx] = QLabel()
     self.nameLabels[idx].setBuddy(self.spValues[idx])
     self.windLabels[idx] = WindLabel()
     pGrid.addWidget(self.nameLabels[idx], idx + 2, 0)
     pGrid.addWidget(self.windLabels[idx], idx + 2, 1)
     pGrid.addWidget(self.spValues[idx], idx + 2, 2)
     self.wonBoxes[idx] = QCheckBox("")
     pGrid.addWidget(self.wonBoxes[idx], idx + 2, 3)
     self.wonBoxes[idx].clicked.connect(self.wonChanged)
     self.spValues[idx].valueChanged.connect(self.slotInputChanged)
     detailTab = QWidget()
     self.detailTabs.addTab(detailTab, "")
     self.details[idx] = QWidget()
     detailTabLayout = QVBoxLayout(detailTab)
     detailTabLayout.addWidget(self.details[idx])
     detailTabLayout.addStretch()
     self.detailsLayout[idx] = QVBoxLayout(self.details[idx])
Esempio n. 36
0
 def setupUi(self):
     """create all Ui elements but do not fill them"""
     self.buttonBox = KDialogButtonBox(self)
     self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                       | QDialogButtonBox.Ok)
     # Ubuntu 11.10 unity is a bit strange - without this, it sets focus on
     # the cancel button (which it shows on the left). I found no obvious
     # way to use setDefault and setAutoDefault for fixing this.
     self.buttonBox.button(QDialogButtonBox.Ok).setFocus(True)
     self.buttonBox.accepted.connect(self.accept)
     self.buttonBox.rejected.connect(self.reject)
     vbox = QVBoxLayout(self)
     self.grid = QFormLayout()
     self.cbServer = QComboBox()
     self.cbServer.setEditable(True)
     self.grid.addRow(i18n('Game server:'), self.cbServer)
     self.cbUser = QComboBox()
     self.cbUser.setEditable(True)
     self.grid.addRow(i18n('Username:'******'Password:'******'kajongg', 'Ruleset:'), self.cbRuleset)
     vbox.addLayout(self.grid)
     vbox.addWidget(self.buttonBox)
     pol = QSizePolicy()
     pol.setHorizontalPolicy(QSizePolicy.Expanding)
     self.cbUser.setSizePolicy(pol)
     self.__port = None
Esempio n. 37
0
 def setupUi(self):
     """setup UI elements"""
     self.viewLeft = ScoreViewLeft(self)
     self.viewRight = ScoreViewRight(self)
     self.viewRight.setHorizontalScrollBar(HorizontalScrollBar(self))
     self.viewRight.setHorizontalScrollMode(QAbstractItemView.ScrollPerItem)
     self.viewRight.setFocusPolicy(Qt.NoFocus)
     if usingQt5:
         self.viewRight.header().setSectionsClickable(False)
         self.viewRight.header().setSectionsMovable(False)
     else:
         self.viewRight.header().setClickable(False)
         self.viewRight.header().setMovable(False)
     self.viewRight.setSelectionMode(QAbstractItemView.NoSelection)
     windowLayout = QVBoxLayout(self)
     self.splitter = QSplitter(Qt.Vertical)
     self.splitter.setObjectName("ScoreTableSplitter")
     windowLayout.addWidget(self.splitter)
     scoreWidget = QWidget()
     self.scoreLayout = QHBoxLayout(scoreWidget)
     leftLayout = QVBoxLayout()
     leftLayout.addWidget(self.viewLeft)
     self.leftLayout = leftLayout
     self.scoreLayout.addLayout(leftLayout)
     self.scoreLayout.addWidget(self.viewRight)
     self.splitter.addWidget(scoreWidget)
     self.ruleTree = RuleTreeView(m18nc("kajongg", "Used Rules"))
     self.splitter.addWidget(self.ruleTree)
     # this shows just one line for the ruleTree - so we just see the
     # name of the ruleset:
     self.splitter.setSizes(list([1000, 1]))
Esempio n. 38
0
    def __init__(self, label_str):
        super(ParamWidget, self).__init__()
        self.my_label = label_str

        inner_widgs = {
            "find_spots":
            [phil_scope_find_spots, FindspotsSimplerParameterTab],
            "index": [phil_scope_index, IndexSimplerParamTab],
            "refine_bravais_settings": [
                phil_scope_r_b_settings,
                RefineBravaiSimplerParamTab,
            ],
            "refine": [phil_scope_refine, RefineSimplerParamTab],
            "integrate": [phil_scope_integrate, IntegrateSimplerParamTab],
            "symmetry": [phil_scope_symetry, SymmetrySimplerParamTab],
            "scale": [phil_scope_scale, ScaleSimplerParamTab],
        }

        if label_str == "import":
            self.my_widget = ImportPage()

        elif label_str == "export":
            self.my_widget = ExportPage()

        else:
            self.my_widget = ParamMainWidget(
                phl_obj=inner_widgs[label_str][0],
                simp_widg=inner_widgs[label_str][1],
                parent=self,
                upper_label=label_str,
            )

        self.my_widget.command_lst = [[label_str]]

        self.my_widget.update_command_lst_low_level.connect(
            self.update_parent_lst)

        v_left_box = QVBoxLayout()
        v_left_box.addWidget(self.my_widget)
        self.setLayout(v_left_box)
Esempio n. 39
0
    def __init__(self, padre, interfazdatos, porterodatos):
        from Driza.datos.conversion import AgenteConversion
        self.__portero = porterodatos
        QTabWidget.__init__(self, padre, "Grid")
        self.setTabPosition(QTabWidget.Bottom)
        self.tab = QWidget(self, "tab")
        tabLayout = QVBoxLayout(self.tab, 11, 6, "tabLayout")
        self.table1 = QTable(self.tab, "table1")
        tabLayout.addWidget(self.table1)
        self.insertTab(self.tab,  QString.fromLatin1("&Registros"))
        self.tab_2 = QWidget(self, "tab_2")
        tabLayout_2 = QVBoxLayout(self.tab_2, 11, 6, "tabLayout_2")
        self.table2 = QTable(self.tab_2, "table2")
        tabLayout_2.addWidget(self.table2)
        self.insertTab(self.tab_2, QString.fromLatin1("&Variables"))
        from Driza.iuqt3.vprincipal.dcasos import DCasos
        self.dcasos = DCasos(self.table1, interfazdatos)
        self.modoetiqueta = False # Variable que guarda si estamos en modo etiqueta o normal

        self.__nreg = 10 
        self.__nvar = 10
        self.__idu = interfazdatos
        self.__init_t_reg()
        self.__init_t_var()
        self.__conexiones()
        self.__agenteconversion = AgenteConversion(self.__idu)
Esempio n. 40
0
 def __init__(self, scene=None, table=None):
     super(ChatWindow, self).__init__(None)
     self.scene = scene
     self.table = table or scene.game.client.table
     self.table.chatWindow = self
     self.setObjectName('chatWindow')
     title = i18n('Chat on table %1 at %2', self.table.tableid,
                  self.table.client.connection.url)
     decorateWindow(self, title)
     self.messageView = ChatView()
     self.messageView.setModel(ChatModel())
     self.messageView.setFocusPolicy(Qt.NoFocus)
     self.messageView.setShowGrid(False)
     self.messageView.setWordWrap(False)
     self.messageView.setSelectionMode(QAbstractItemView.NoSelection)
     if Debug.modelTest:
         self.debugModelTest = ModelTest(self.messageView.model(),
                                         self.messageView)
     self.edit = QLineEdit()
     layout = QVBoxLayout()
     layout.addWidget(self.messageView)
     layout.addWidget(self.edit)
     self.setLayout(layout)
     self.edit.returnPressed.connect(self.sendLine)
     self.edit.setFocus()
     self.show()
     StateSaver(self)
Esempio n. 41
0
    def __init__(self, parent):
        QDialog.__init__(self)
        self.parent = parent
        self._data = {}
        self.table = QTableWidget(self)
        self.table.horizontalHeader().setStretchLastSection(True)
        self.table.verticalHeader().setVisible(False)
        self.table.setEditTriggers(QTableWidget.NoEditTriggers)
        self.table.itemChanged.connect(self.itemChanged)
        self.updateTable()
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setStandardButtons(
            QDialogButtonBox.Close)  # Close has the Rejected role
        self.buttonBox.rejected.connect(self.accept)
        self.newButton = self.buttonBox.addButton(
            i18nc('define a new player',
                  "&New"),
            QDialogButtonBox.ActionRole)
        self.newButton.setIcon(KIcon("document-new"))
        self.newButton.clicked.connect(self.slotInsert)
        self.deleteButton = self.buttonBox.addButton(
            i18n("&Delete"), QDialogButtonBox.ActionRole)
        self.deleteButton.setIcon(KIcon("edit-delete"))
        self.deleteButton.clicked.connect(self.delete)

        cmdLayout = QHBoxLayout()
        cmdLayout.addWidget(self.buttonBox)
        layout = QVBoxLayout()
        layout.addWidget(self.table)
        layout.addLayout(cmdLayout)
        self.setLayout(layout)
        decorateWindow(self, i18n("Players"))
        self.setObjectName('Players')
Esempio n. 42
0
    def __init__(self, client):
        super(TableList, self).__init__(None)
        self.autoStarted = False
        self.client = client
        self.setObjectName('TableList')
        self.resize(700, 400)
        self.view = MJTableView(self)
        self.differ = None
        self.debugModelTest = None
        self.requestedNewTable = False
        self.view.setItemDelegateForColumn(2,
                                           RichTextColumnDelegate(self.view))

        buttonBox = QDialogButtonBox(self)
        self.newButton = buttonBox.addButton(
            i18nc('allocate a new table', "&New"), QDialogButtonBox.ActionRole)
        self.newButton.setIcon(KIcon("document-new"))
        self.newButton.setToolTip(i18n("Allocate a new table"))
        self.newButton.clicked.connect(self.client.newTable)
        self.joinButton = buttonBox.addButton(i18n("&Join"),
                                              QDialogButtonBox.AcceptRole)
        self.joinButton.clicked.connect(client.joinTable)
        self.joinButton.setIcon(KIcon("list-add-user"))
        self.joinButton.setToolTip(i18n("Join a table"))
        self.leaveButton = buttonBox.addButton(i18n("&Leave"),
                                               QDialogButtonBox.AcceptRole)
        self.leaveButton.clicked.connect(self.leaveTable)
        self.leaveButton.setIcon(KIcon("list-remove-user"))
        self.leaveButton.setToolTip(i18n("Leave a table"))
        self.compareButton = buttonBox.addButton(
            i18nc('Kajongg-Ruleset', 'Compare'), QDialogButtonBox.AcceptRole)
        self.compareButton.clicked.connect(self.compareRuleset)
        self.compareButton.setIcon(KIcon("preferences-plugin-script"))
        self.compareButton.setToolTip(
            i18n('Compare the rules of this table with my own rulesets'))
        self.chatButton = buttonBox.addButton(i18n('&Chat'),
                                              QDialogButtonBox.AcceptRole)
        self.chatButton.setIcon(KIcon("call-start"))
        self.chatButton.clicked.connect(self.chat)
        self.startButton = buttonBox.addButton(i18n('&Start'),
                                               QDialogButtonBox.AcceptRole)
        self.startButton.clicked.connect(self.startGame)
        self.startButton.setIcon(KIcon("arrow-right"))
        self.startButton.setToolTip(
            i18n("Start playing on a table. "
                 "Empty seats will be taken by robot players."))

        cmdLayout = QHBoxLayout()
        cmdLayout.addWidget(buttonBox)

        layout = QVBoxLayout()
        layout.addWidget(self.view)
        layout.addLayout(cmdLayout)
        self.setLayout(layout)

        self.view.doubleClicked.connect(client.joinTable)
        StateSaver(self, self.view.horizontalHeader())
        self.updateButtonsForTable(None)
Esempio n. 43
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        self.btn1 = QPushButton("Click me", self)

        vbox = QVBoxLayout()
        vbox.addWidget(QLabel("A1"))
        vbox.addWidget(self.btn1)
        vbox.addWidget(QLabel("B2"))

        self.btn1.clicked.connect(self.doit)
        self.my_pop = None

        self.main_widget = QWidget(self)
        self.main_widget.setLayout(vbox)
        self.setCentralWidget(self.main_widget)
Esempio n. 44
0
 def __init__(self, app, parent, profile):
     KMainWindow.__init__(self, parent, 'TraitAssigner')
     self.page = QFrame(self)
     self.vbox = QVBoxLayout(self.page, 5, 7)
     self.listBox = KActionSelector(self.page)
     self.listBox.setShowUpDownButtons(True)
     self.setCentralWidget(self.page)
     self.vbox.addWidget(self.listBox)
     hbox = QHBoxLayout(self.page, 5, 7)
     self.vbox.addLayout(hbox)
     self.ok_button = KPushButton('ok', self.page)
     self.cancel_button = KPushButton('cancel', self.page)
     hbox.addWidget(self.ok_button)
     hbox.addWidget(self.cancel_button)
     self.app = app
     self.db = app.db
     self.profile = Profile(app.conn)
     self.profile.set_profile(profile)
     self.suite = self.profile.current.suite
     self.traits = StatementCursor(app.conn)
     self.traits.set_table('%s_traits'  % self.suite)
     self.initlistView()
     self.show()
Esempio n. 45
0
 def __init__(self, app, parent, dtype='trait', name='BaseDiffer'):
     QWidget.__init__(self, parent, name)
     dbwidget(self, app)
     self.dtype = dtype
     if dtype == 'trait':
         boxtype = SuiteTraitCombo
     elif dtype == 'family':
         boxtype = FamilyList
     self.leftBox = boxtype(self.app, self, 'leftBox')
     self.rightBox = boxtype(self.app, self, 'rightBox')
     self.vbox = QVBoxLayout(self)
     self.list_hbox = QHBoxLayout(self.vbox, 5)
     self.list_hbox.addWidget(self.leftBox)
     self.list_hbox.addWidget(self.rightBox)
Esempio n. 46
0
    def __init__(self, leftRulesets, rightRulesets, parent=None):
        QDialog.__init__(self, parent)
        if not isinstance(leftRulesets, list):
            leftRulesets = list([leftRulesets])
        if not isinstance(rightRulesets, list):
            rightRulesets = list([rightRulesets])
        leftRulesets, rightRulesets = leftRulesets[:], rightRulesets[:]
        # remove rulesets from right which are also on the left side
        for left in leftRulesets:
            left.load()
        for right in rightRulesets:
            right.load()
        for left in leftRulesets:
            for right in rightRulesets[:]:
                if left == right and left.name == right.name:
                    # rightRulesets.remove(right) this is wrong because it
                    # removes the first ruleset with the same hash
                    rightRulesets = list(x for x in rightRulesets if id(x) != id(right))
        self.leftRulesets = leftRulesets
        self.rightRulesets = rightRulesets
        self.model = None
        self.modelTest = None
        self.view = MJTableView(self)
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setStandardButtons(QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)

        cbLayout = QHBoxLayout()
        self.cbRuleset1 = ListComboBox(self.leftRulesets)
        if len(self.leftRulesets) == 1:
            self.lblRuleset1 = QLabel(self.leftRulesets[0].name)
            cbLayout.addWidget(self.lblRuleset1)
        else:
            cbLayout.addWidget(self.cbRuleset1)
        self.cbRuleset2 = ListComboBox(self.rightRulesets)
        cbLayout.addWidget(self.cbRuleset2)
        cmdLayout = QHBoxLayout()
        cmdLayout.addWidget(self.buttonBox)
        layout = QVBoxLayout()
        layout.addLayout(cbLayout)
        layout.addWidget(self.view)
        layout.addLayout(cmdLayout)
        self.setLayout(layout)

        decorateWindow(self, m18n("Compare"))
        self.setObjectName("RulesetDiffer")

        self.cbRuleset1.currentIndexChanged.connect(self.leftRulesetChanged)
        self.cbRuleset2.currentIndexChanged.connect(self.rulesetChanged)
        self.leftRulesetChanged()
        StateSaver(self)
Esempio n. 47
0
class TraitAssignerOrig(KMainWindow):
    def __init__(self, app, parent, profile):
        KMainWindow.__init__(self, parent, 'TraitAssigner')
        self.page = QFrame(self)
        self.vbox = QVBoxLayout(self.page, 5, 7)
        self.listBox = KActionSelector(self.page)
        self.listBox.setShowUpDownButtons(True)
        self.setCentralWidget(self.page)
        self.vbox.addWidget(self.listBox)
        hbox = QHBoxLayout(self.page, 5, 7)
        self.vbox.addLayout(hbox)
        self.ok_button = KPushButton('ok', self.page)
        self.cancel_button = KPushButton('cancel', self.page)
        hbox.addWidget(self.ok_button)
        hbox.addWidget(self.cancel_button)
        self.app = app
        self.db = app.db
        self.profile = Profile(app.conn)
        self.profile.set_profile(profile)
        self.suite = self.profile.current.suite
        self.traits = StatementCursor(app.conn)
        self.traits.set_table('%s_traits'  % self.suite)
        self.initlistView()
        self.show()

    def initlistView(self):
        ptrows = self.profile.get_trait_rows()
        pt = [r.trait for r in ptrows]
        all_trows = self.traits.select(fields=['trait'], order=['trait'])
        trows = [r for r in all_trows if r.trait not in pt]
        abox = self.listBox.availableListBox()
        sbox = self.listBox.selectedListBox()
        for row in ptrows:
            QListBoxText(sbox, row.trait)
        for row in trows:
            QListBoxText(abox, row.trait)
Esempio n. 48
0
 def __init__(self, chows, propose, deferred):
     KDialogIgnoringEscape.__init__(self)
     decorateWindow(self)
     self.setButtons(KDialog.NoButton)
     self.chows = chows
     self.selectedChow = None
     self.deferred = deferred
     layout = QVBoxLayout()
     label = QLabel(m18n('Which chow do you want to expose?'))
     layout.addWidget(label)
     layout.setAlignment(label, Qt.AlignHCenter)
     self.buttons = []
     for chow in chows:
         button = QRadioButton('{}-{}-{}'.format(*(x.value for x in chow)))
         self.buttons.append(button)
         layout.addWidget(button)
         layout.setAlignment(button, Qt.AlignHCenter)
         button.toggled.connect(self.toggled)
     widget = QWidget(self)
     widget.setLayout(layout)
     self.setMainWidget(widget)
     for idx, chow in enumerate(chows):
         if chow == propose:
             self.buttons[idx].setFocus()
Esempio n. 49
0
 def __init__(self, app, parent, name='SuiteTraitCombo'):
     QWidget.__init__(self, parent, name)
     dbwidget(self, app)
     self.suiteCursor = Suites(self.conn)
     self.suites = self.suiteCursor.list()
     self.traits = Traits(self.conn, self.suites[0])
     self.scombo = SuiteCombo(self, self.suites)
     self.tcombo = MyCombo(self, 'TypeCombo')
     self.tcombo.fill(['template', 'script'])
     self.ubutton = KPushButton('update', self)
     self.listView = TraitList(self.app, self)
     self.vbox = QVBoxLayout(self)
     for member in ['listView', 'scombo', 'tcombo', 'ubutton']:
         widget = getattr(self, member)
         self.vbox.addWidget(widget)
     self.connect(self.scombo,
                  SIGNAL('highlighted(int)'), self.update_traits)
     self.connect(self.ubutton,
                  SIGNAL('clicked()'), self.refreshlistView)
Esempio n. 50
0
 def __init__(self, kongs, deferred):
     KDialogIgnoringEscape.__init__(self)
     decorateWindow(self)
     self.setButtons(0)
     self.kongs = kongs
     self.selectedKong = None
     self.deferred = deferred
     layout = QVBoxLayout()
     label = QLabel(m18n('Which kong do you want to declare?'))
     layout.addWidget(label)
     layout.setAlignment(label, Qt.AlignHCenter)
     self.buttons = []
     for kong in kongs:
         button = QRadioButton((kong[0].name()), self)
         self.buttons.append(button)
         layout.addWidget(button)
         button.toggled.connect(self.toggled)
     widget = QWidget(self)
     widget.setLayout(layout)
     self.setMainWidget(widget)
Esempio n. 51
0
 def __init__(self, parent, name='SuiteTraitComboBox'):
     QFrame.__init__(self, parent, name)
     self.app = get_application_pointer()
     self.conn = self.app.conn
     self.suiteCursor = Suites(self.conn)
     self.suites = self.suiteCursor.list()
     self.traits = Traits(self.conn, self.suites[0])
     self.scombo = KComboBox(self, 'SuiteComboBox')
     self.scombo.insertStrList(self.suites)
     self.tcombo = KComboBox(self, 'TypeComboBox')
     self.tcombo.insertStrList(['template', 'script'])
     self.trcombo = KComboBox(self, 'TraitComboBox')
     self.update_btn = KPushButton('update', self)
     self.listView = TraitListView(self)
     self.vbox = QVBoxLayout(self)
     for attribute in ['listView', 'scombo', 'tcombo', 'trcombo', 'update_btn']:
         widget = getattr(self, attribute)
         self.vbox.addWidget(widget)
     # we need to redo the signals and the methods that are called
     self.connect(self.scombo,
                  SIGNAL('activated(int)'), self.update_traits)
     
     self.connect(self.update_btn,
                  SIGNAL('clicked()'), self.refreshlistView)
Esempio n. 52
0
class SuiteTraitComboBox(QFrame):
    def __init__(self, parent, name='SuiteTraitComboBox'):
        QFrame.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.conn = self.app.conn
        self.suiteCursor = Suites(self.conn)
        self.suites = self.suiteCursor.list()
        self.traits = Traits(self.conn, self.suites[0])
        self.scombo = KComboBox(self, 'SuiteComboBox')
        self.scombo.insertStrList(self.suites)
        self.tcombo = KComboBox(self, 'TypeComboBox')
        self.tcombo.insertStrList(['template', 'script'])
        self.trcombo = KComboBox(self, 'TraitComboBox')
        self.update_btn = KPushButton('update', self)
        self.listView = TraitListView(self)
        self.vbox = QVBoxLayout(self)
        for attribute in ['listView', 'scombo', 'tcombo', 'trcombo', 'update_btn']:
            widget = getattr(self, attribute)
            self.vbox.addWidget(widget)
        # we need to redo the signals and the methods that are called
        self.connect(self.scombo,
                     SIGNAL('activated(int)'), self.update_traits)
        
        self.connect(self.update_btn,
                     SIGNAL('clicked()'), self.refreshlistView)

    def update_traits(self, suite_index):
        suite = self.suites[suite_index]
        self.traits.set_suite(suite)
        self.listView.set_suite(suite)
        self.listView.file_type = str(self.tcombo.currentText())
        self._update_traits_combobox()
        

    def _update_traits_combobox(self):
        traits = [row.trait for row in self.traits.select()]
        traits.sort()
        self.trcombo.clear()
        self.trcombo.insertStrList(traits)
        return traits
    
    def refreshlistView(self):
        trait = str(self.trcombo.currentText())
        if trait:
            self.listView.set_trait(trait)
        self.listView.file_type = str(self.tcombo.currentText())
        suite = str(self.scombo.currentText())
        self.traits.set_suite(suite)
        self.listView.set_suite(suite)
        traits = self._update_traits_combobox()
        if trait in traits:
            self.trcombo.setCurrentItem(traits.index(trait))
        self.listView.refreshlistView()

    # returns template or script contents
    def getData(self):
        return self.listView.getData()

    # replace template or script contents
    def updateData(self, data):
        self.listView.updateData(data)
Esempio n. 53
0
    def __init__(self, client):
        super(TableList, self).__init__(None)
        self.autoStarted = False
        self.client = client
        self.setObjectName('TableList')
        self.resize(700, 400)
        self.view = MJTableView(self)
        self.differ = None
        self.debugModelTest = None
        self.requestedNewTable = False
        self.view.setItemDelegateForColumn(
            2,
            RichTextColumnDelegate(self.view))

        buttonBox = QDialogButtonBox(self)
        self.newButton = buttonBox.addButton(
            m18nc('allocate a new table',
                  "&New"),
            QDialogButtonBox.ActionRole)
        self.newButton.setIcon(KIcon("document-new"))
        self.newButton.setToolTip(m18n("Allocate a new table"))
        self.newButton.clicked.connect(self.client.newTable)
        self.joinButton = buttonBox.addButton(
            m18n("&Join"),
            QDialogButtonBox.AcceptRole)
        self.joinButton.clicked.connect(client.joinTable)
        self.joinButton.setIcon(KIcon("list-add-user"))
        self.joinButton.setToolTip(m18n("Join a table"))
        self.leaveButton = buttonBox.addButton(
            m18n("&Leave"),
            QDialogButtonBox.AcceptRole)
        self.leaveButton.clicked.connect(self.leaveTable)
        self.leaveButton.setIcon(KIcon("list-remove-user"))
        self.leaveButton.setToolTip(m18n("Leave a table"))
        self.compareButton = buttonBox.addButton(
            m18nc('Kajongg-Ruleset',
                  'Compare'),
            QDialogButtonBox.AcceptRole)
        self.compareButton.clicked.connect(self.compareRuleset)
        self.compareButton.setIcon(KIcon("preferences-plugin-script"))
        self.compareButton.setToolTip(
            m18n('Compare the rules of this table with my own rulesets'))
        self.chatButton = buttonBox.addButton(
            m18n('&Chat'),
            QDialogButtonBox.AcceptRole)
        self.chatButton.setIcon(KIcon("call-start"))
        self.chatButton.clicked.connect(self.chat)
        self.startButton = buttonBox.addButton(
            m18n('&Start'),
            QDialogButtonBox.AcceptRole)
        self.startButton.clicked.connect(self.startGame)
        self.startButton.setIcon(KIcon("arrow-right"))
        self.startButton.setToolTip(
            m18n("Start playing on a table. "
                 "Empty seats will be taken by robot players."))

        cmdLayout = QHBoxLayout()
        cmdLayout.addWidget(buttonBox)

        layout = QVBoxLayout()
        layout.addWidget(self.view)
        layout.addLayout(cmdLayout)
        self.setLayout(layout)

        self.view.doubleClicked.connect(client.joinTable)
        StateSaver(self, self.view.horizontalHeader())
        self.updateButtonsForTable(None)
Esempio n. 54
0
 def setupUi(self):
     """layout the window"""
     self.setContentsMargins(0, 0, 0, 0)
     vlayout = QVBoxLayout(self)
     vlayout.setContentsMargins(0, 0, 0, 0)
     sliderLayout = QHBoxLayout()
     self.kcfg_showShadows = QCheckBox(m18n('Show tile shadows'), self)
     self.kcfg_showShadows.setObjectName('kcfg_showShadows')
     self.kcfg_rearrangeMelds = QCheckBox(
         m18n('Rearrange undisclosed tiles to melds'), self)
     self.kcfg_rearrangeMelds.setObjectName('kcfg_rearrangeMelds')
     self.kcfg_showOnlyPossibleActions = QCheckBox(m18n(
         'Show only possible actions'))
     self.kcfg_showOnlyPossibleActions.setObjectName(
         'kcfg_showOnlyPossibleActions')
     self.kcfg_propose = QCheckBox(m18n('Propose what to do'))
     self.kcfg_propose.setObjectName('kcfg_propose')
     self.kcfg_animationSpeed = QSlider(self)
     self.kcfg_animationSpeed.setObjectName('kcfg_animationSpeed')
     self.kcfg_animationSpeed.setOrientation(Qt.Horizontal)
     self.kcfg_animationSpeed.setSingleStep(1)
     lblSpeed = QLabel(m18n('Animation speed:'))
     lblSpeed.setBuddy(self.kcfg_animationSpeed)
     sliderLayout.addWidget(lblSpeed)
     sliderLayout.addWidget(self.kcfg_animationSpeed)
     self.kcfg_useSounds = QCheckBox(m18n('Use sounds if available'), self)
     self.kcfg_useSounds.setObjectName('kcfg_useSounds')
     self.kcfg_uploadVoice = QCheckBox(m18n(
         'Let others hear my voice'), self)
     self.kcfg_uploadVoice.setObjectName('kcfg_uploadVoice')
     pol = QSizePolicy()
     pol.setHorizontalPolicy(QSizePolicy.Expanding)
     pol.setVerticalPolicy(QSizePolicy.Expanding)
     spacerItem = QSpacerItem(
         20, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)
     vlayout.addWidget(self.kcfg_showShadows)
     vlayout.addWidget(self.kcfg_rearrangeMelds)
     vlayout.addWidget(self.kcfg_showOnlyPossibleActions)
     vlayout.addWidget(self.kcfg_propose)
     vlayout.addWidget(self.kcfg_useSounds)
     vlayout.addWidget(self.kcfg_uploadVoice)
     vlayout.addLayout(sliderLayout)
     vlayout.addItem(spacerItem)
     self.setSizePolicy(pol)
     self.retranslateUi()
Esempio n. 55
0
 def setupUi(self):
     """layout the window"""
     decorateWindow(self, m18n('Customize rulesets'))
     self.setObjectName('Rulesets')
     hlayout = QHBoxLayout(self)
     v1layout = QVBoxLayout()
     self.v1widget = QWidget()
     v1layout = QVBoxLayout(self.v1widget)
     v2layout = QVBoxLayout()
     hlayout.addWidget(self.v1widget)
     hlayout.addLayout(v2layout)
     for widget in [self.v1widget, hlayout, v1layout, v2layout]:
         widget.setContentsMargins(0, 0, 0, 0)
     hlayout.setStretchFactor(self.v1widget, 10)
     self.btnCopy = QPushButton()
     self.btnRemove = QPushButton()
     self.btnCompare = QPushButton()
     self.btnClose = QPushButton()
     self.rulesetView = RuleTreeView(
         m18nc('kajongg',
               'Rule'),
         self.btnCopy,
         self.btnRemove,
         self.btnCompare)
     v1layout.addWidget(self.rulesetView)
     self.rulesetView.setWordWrap(True)
     self.rulesetView.setMouseTracking(True)
     spacerItem = QSpacerItem(
         20,
         20,
         QSizePolicy.Minimum,
         QSizePolicy.Expanding)
     v2layout.addWidget(self.btnCopy)
     v2layout.addWidget(self.btnRemove)
     v2layout.addWidget(self.btnCompare)
     self.btnCopy.clicked.connect(self.rulesetView.copyRow)
     self.btnRemove.clicked.connect(self.rulesetView.removeRow)
     self.btnCompare.clicked.connect(self.rulesetView.compareRow)
     self.btnClose.clicked.connect(self.hide)
     v2layout.addItem(spacerItem)
     v2layout.addWidget(self.btnClose)
     self.retranslateUi()
     StateSaver(self)
     self.show()
  def setupPlotSettingsFrame(self):
    self.plotSettingsFrame = ctk.ctkCollapsibleButton()
    self.plotSettingsFrame.text = "Plotting Settings"
    self.plotSettingsFrame.collapsed = 1
    plotSettingsFrameLayout = QFormLayout(self.plotSettingsFrame)
    self.layout.addWidget(self.plotSettingsFrame)

    # label map for probing
    self.labelMapSelector = slicer.qMRMLNodeComboBox()
    self.labelMapSelector.nodeTypes = ['vtkMRMLLabelMapVolumeNode']
    self.labelMapSelector.toolTip = 'Label map to be probed'
    self.labelMapSelector.setMRMLScene(slicer.mrmlScene)
    self.labelMapSelector.addEnabled = 0
    self.chartButton = QPushButton('Chart')
    self.chartButton.setEnabled(False)

    hbox = QHBoxLayout()
    hbox.addWidget(QLabel('Probed label volume'))
    hbox.addWidget(self.labelMapSelector)
    hbox.addWidget(self.chartButton)
    plotSettingsFrameLayout.addRow(hbox)

    self.iCharting = QCheckBox('Interactive charting')
    self.iCharting.setChecked(True)
    plotSettingsFrameLayout.addRow(self.iCharting)

    self.iChartingMode = QButtonGroup()
    self.iChartingIntensity = QRadioButton('Signal intensity')
    self.iChartingIntensityFixedAxes = QRadioButton('Fixed range intensity')
    self.iChartingPercent = QRadioButton('Percentage change')
    self.iChartingIntensity.setChecked(1)
    self.iChartingMode.addButton(self.iChartingIntensity)
    self.iChartingMode.addButton(self.iChartingIntensityFixedAxes)
    self.iChartingMode.addButton(self.iChartingPercent)

    hbox = QHBoxLayout()
    self.plottingModeGroupBox = QGroupBox('Plotting mode:')
    plottingModeLayout = QVBoxLayout()
    self.plottingModeGroupBox.setLayout(plottingModeLayout)
    plottingModeLayout.addWidget(self.iChartingIntensity)
    plottingModeLayout.addWidget(self.iChartingIntensityFixedAxes)
    plottingModeLayout.addWidget(self.iChartingPercent)
    hbox.addWidget(self.plottingModeGroupBox)

    self.showLegendCheckBox = QCheckBox('Display legend')
    self.showLegendCheckBox.setChecked(0)
    self.xLogScaleCheckBox = QCheckBox('Use log scale for X axis')
    self.xLogScaleCheckBox.setChecked(0)
    self.yLogScaleCheckBox = QCheckBox('Use log scale for Y axis')
    self.yLogScaleCheckBox.setChecked(0)

    self.plotGeneralSettingsGroupBox = QGroupBox('General Plot options:')
    plotGeneralSettingsLayout = QVBoxLayout()
    self.plotGeneralSettingsGroupBox.setLayout(plotGeneralSettingsLayout)
    plotGeneralSettingsLayout.addWidget(self.showLegendCheckBox)
    plotGeneralSettingsLayout.addWidget(self.xLogScaleCheckBox)
    plotGeneralSettingsLayout.addWidget(self.yLogScaleCheckBox)
    hbox.addWidget(self.plotGeneralSettingsGroupBox)
    plotSettingsFrameLayout.addRow(hbox)

    self.nFramesBaselineCalculation = QSpinBox()
    self.nFramesBaselineCalculation.minimum = 1
    hbox = QHBoxLayout()
    hbox.addWidget(QLabel('Frame count(baseline calculation):'))
    hbox.addWidget(self.nFramesBaselineCalculation)
    plotSettingsFrameLayout.addRow(hbox)
Esempio n. 57
0
    def __init__(self, parent):
    
        cfg = LoviConfig().getInstance()
        
        KConfigDialog.__init__(self, parent, "settings",
            cfg, KDialogBase.IconList, KDialogBase.Ok | KDialogBase.Cancel)
            
        fontPage = QWidget(self, "Font")

        box = QVBoxLayout(fontPage, 3, 3)
        fontGrp = QVButtonGroup("", fontPage)
        fontGrp.setFrameStyle(QFrame.NoFrame)
        self.kcfg_fontDefault = \
            QRadioButton(i18n("Default font"), fontGrp, "kcfg_fontDefault")
        self.kcfg_fontFixed = \
            QRadioButton(i18n("Default fixed font"), fontGrp, "kcfg_fontFixed")
        self.kcfg_fontCustom = \
            QRadioButton(i18n("Custom:"), fontGrp, "kcfg_fontCustom")
        fontGrp.setExclusive(True)
        box.addWidget(fontGrp)
        self.kcfg_font = \
            KFontChooser(fontPage, "kcfg_font", False, QStringList(), False)
        box.addWidget(self.kcfg_font)
        
        filtersPage = QWidget(self, "filters")
        
        box = QGridLayout(filtersPage, 3, 2, 3, 7)
        box.addWidget(QLabel(i18n("Errors:"), filtersPage), 0, 0)
        self.kcfg_filterErrors = QLineEdit(cfg.filterErrorsVal, filtersPage, 
            "kcfg_filterErrors")
        box.addWidget(self.kcfg_filterErrors, 0, 1)
        box.addWidget(QLabel(i18n("Warnings:"), filtersPage), 1, 0)
        self.kcfg_filterWarnings = QLineEdit(cfg.filterWarningsVal, 
            filtersPage, "kcfg_filterWarnings")
        box.addWidget(self.kcfg_filterWarnings, 1, 1)
        box.setRowStretch(2, 1)

        # actionsPage = QWidget(self, "actions")

        self.addPage(fontPage, i18n("Font"), "fonts")
        self.addPage(filtersPage, i18n("Filters"), "2downarrow")
Esempio n. 58
0
    def __init__(self, interfazdato, cajadisponible):
        """Caja disponible son los elementos que aparecen a la izquierda en el selector"""
        #VARIABLES PUBLICAS
        QWidget.__init__(self, None, "selector", 0)

        image1 = QPixmap(IMAGE1DATA)
        image2 = QPixmap(IMAGE2DATA)

        selectorsimplelayout = QHBoxLayout(self, 11, 6, "WSelectorSimpleLayout")
        layout2 = QVBoxLayout(None, 0, 6, "layout2")
        widgetstack1 = QWidgetStack(self, "staaack")
        widgetstack1.addWidget(cajadisponible)
        widgetstack1.raiseWidget(cajadisponible)
        widgetstack1.setSizePolicy(QSizePolicy(\
                QSizePolicy.Expanding, QSizePolicy.Expanding, \
                0, 0, widgetstack1.sizePolicy().hasHeightForWidth()))
        self._cajadisponible = cajadisponible
        layout2.addWidget(widgetstack1)
        selectorsimplelayout.addLayout(layout2)
        
        layout1 = QVBoxLayout(None, 0, 6, "layout1")
        
        self.__pushbutton1 = QPushButton(self, "pushButton1")
        self.__pushbutton1.setMaximumSize(QSize(30, 30))
        self.__pushbutton1.setPixmap(image1)
        layout1.addWidget(self.__pushbutton1)
        spacer1 = QSpacerItem(30, 122, QSizePolicy.Minimum, QSizePolicy.Expanding)
        layout1.addItem(spacer1)
        
        self.__pushbutton2 = QPushButton(self,"pushButton2")
        self.__pushbutton2.setMaximumSize(QSize(30, 30))
        self.__pushbutton2.setPixmap(image2)
        self.__pushbutton2.setAccel("Del")
        layout1.addWidget(self.__pushbutton2)
        selectorsimplelayout.addLayout(layout1)
        
        layout3 = QVBoxLayout(None, 0, 6, "layout3")
        
        self._textlabel2 = QLabel(self, "textLabel2")
        layout3.addWidget(self._textlabel2)
        
        self._cajaseleccion = QListBox(self,"cajaseleccion")
        self._cajaseleccion.setMinimumSize(QSize(0, 60))
        layout3.addWidget(self._cajaseleccion)
        selectorsimplelayout.addLayout(layout3)
        self._cajaseleccion.setSizePolicy(QSizePolicy(\
                QSizePolicy.Expanding,QSizePolicy.Expanding, 0, 0, \
                self._cajaseleccion.sizePolicy().hasHeightForWidth()))
        
        self.setCaption("Form1")
        self._textlabel2.setText(u"Selección")
        
        self.resize(QSize(294, 240).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)
        self.__conexiones()
        #Miembros !qt

        self.seleccion = []
        self._dato = interfazdato