def __init__(self, parent, label): ClientGUIScrolledPanels.ResizingScrolledPanel.__init__(self, parent) self._commit = ClientGUICommon.BetterButton(self, 'commit and continue', self.parentWidget().done, QW.QDialog.Accepted) self._commit.setObjectName('HydrusAccept') self._back = ClientGUICommon.BetterButton(self, 'go back', self.parentWidget().done, QW.QDialog.Rejected) vbox = QP.VBoxLayout() QP.AddToLayout( vbox, QP.MakeQLabelWithAlignment(label, self, QC.Qt.AlignVCenter | QC.Qt.AlignHCenter), CC.FLAGS_EXPAND_PERPENDICULAR) QP.AddToLayout(vbox, self._commit, CC.FLAGS_EXPAND_SIZER_PERPENDICULAR) QP.AddToLayout( vbox, QP.MakeQLabelWithAlignment('-or-', self, QC.Qt.AlignVCenter | QC.Qt.AlignHCenter), CC.FLAGS_EXPAND_PERPENDICULAR) QP.AddToLayout(vbox, self._back, CC.FLAGS_EXPAND_PERPENDICULAR) self.widget().setLayout(vbox) HG.client_controller.CallAfterQtSafe(self._commit, self._commit.setFocus, QC.Qt.OtherFocusReason)
def __init__( self, parent, label ): ClientGUIScrolledPanels.ResizingScrolledPanel.__init__( self, parent ) self._commit = ClientGUICommon.BetterButton( self, 'commit', self.parentWidget().done, QW.QDialog.Accepted ) self._commit.setObjectName( 'HydrusAccept' ) self._forget = ClientGUICommon.BetterButton( self, 'forget', self.parentWidget().done, QW.QDialog.Rejected ) self._forget.setObjectName( 'HydrusCancel' ) def cancel_callback( parent ): parent.SetCancelled( True ) parent.done( QW.QDialog.Rejected ) self._back = ClientGUICommon.BetterButton( self, 'back to filtering', cancel_callback, parent ) hbox = QP.HBoxLayout() QP.AddToLayout( hbox, self._commit, CC.FLAGS_EXPAND_BOTH_WAYS ) QP.AddToLayout( hbox, self._forget, CC.FLAGS_EXPAND_BOTH_WAYS ) vbox = QP.VBoxLayout() QP.AddToLayout( vbox, QP.MakeQLabelWithAlignment( label, self, QC.Qt.AlignVCenter | QC.Qt.AlignHCenter ), CC.FLAGS_EXPAND_PERPENDICULAR ) QP.AddToLayout( vbox, hbox, CC.FLAGS_EXPAND_SIZER_PERPENDICULAR ) QP.AddToLayout( vbox, QP.MakeQLabelWithAlignment( '-or-', self, QC.Qt.AlignVCenter | QC.Qt.AlignHCenter ), CC.FLAGS_EXPAND_PERPENDICULAR ) QP.AddToLayout( vbox, self._back, CC.FLAGS_EXPAND_PERPENDICULAR ) self.widget().setLayout( vbox ) ClientGUIFunctions.SetFocusLater( self._commit )
def __init__( self, parent ): Dialog.__init__( self, parent, 'how to set up the account?', position = 'center' ) register_message = 'I want to initialise a new account with the server. I have a registration key (a key starting with \'r\').' self._register = QW.QPushButton( register_message, self ) self._register.clicked.connect( self.EventRegister ) setup_message = 'The account is already initialised; I just want to add it to this client. I have a normal access key.' self._setup = QW.QPushButton( setup_message, self ) self._setup.clicked.connect( self.accept ) vbox = QP.VBoxLayout() QP.AddToLayout( vbox, self._register, CC.FLAGS_EXPAND_PERPENDICULAR ) QP.AddToLayout( vbox, QP.MakeQLabelWithAlignment('-or-', self, QC.Qt.AlignHCenter | QC.Qt.AlignVCenter ), CC.FLAGS_EXPAND_PERPENDICULAR ) QP.AddToLayout( vbox, self._setup, CC.FLAGS_EXPAND_PERPENDICULAR ) self.setLayout( vbox ) size_hint = self.sizeHint() QP.SetInitialSize( self, size_hint ) self._should_register = False HG.client_controller.CallAfterQtSafe( self._register, self._register.setFocus, QC.Qt.OtherFocusReason )