void ShiptoEdit::setCustid(int pCustid) { if (pCustid != _custid) { clear(); _custid = pCustid; emit newCustid(pCustid); if (_custid == -1) { setEnabled(FALSE); emit disableList(TRUE); } else { setEnabled(TRUE); emit disableList(FALSE); } } }
void ShiptoEdit::setCustid(int pCustid) { if (pCustid == _custid) return; clear(); _custid = pCustid; if (_custid != -1) { _extraClause = QString(" (shipto_cust_id=%1) ").arg(_custid); setNewPriv("MaintainShiptos"); } else { _extraClause = " (false) "; setNewPriv(""); } sUpdateMenu(); emit newCustid(pCustid); emit disableList(_custid == -1); }
void ThemeWidget::createWidgets () { QGraphicsLinearLayout *mainLayout; /* * Creating and setting up the main layout */ mainLayout = new QGraphicsLinearLayout(Qt::Vertical); mainLayout->setContentsMargins (0., 0., 0., 0.); mainLayout->setSpacing (0.); /* * Creating the list with the available themes. */ m_List = new MList(); m_List->setObjectName ("ThemeList"); // We only connect the themeChangeStarted if we have a chance to sense the // end of the theme change too. just to be sure. if (connect (m_ThemeBusinessLogic, SIGNAL (themeChanged (QString)), SLOT (enableList ()))) { connect (m_ThemeBusinessLogic, SIGNAL (themeChangeStarted (QString)), SLOT (disableList ())); } // Cellcreator m_CellCreator = new ThemeCellCreator; m_List->setCellCreator (m_CellCreator); m_List->setSelectionMode (MList::SingleSelection); // This function will create the m_LiveFilterEditor widget. readLocalThemes (); /* * An item to activate the OVI link. */ m_OviItem = new MBasicListItem (MBasicListItem::IconWithTitle); m_OviItem->setObjectName("OviItem"); // Currently we use the default. //m_OviItem->setLayoutPosition (M::VerticalCenterPosition); m_OviItem->imageWidget()->setImage ("icon-m-common-ovi"); /* * Adding everything to the layout. */ m_LiveFilterEditor->setParentLayoutItem (mainLayout); mainLayout->addItem (m_OviItem); mainLayout->addItem (m_List); /* * Connecting to the signals. */ connect (m_OviItem, SIGNAL(clicked()), this, SLOT(oviActivated())); connect (m_LiveFilterEditor, SIGNAL(textChanged()), this, SLOT(textChanged ())); connect (m_List, SIGNAL(panningStarted()), this, SLOT(hideEmptyTextEdit())); connect (m_ThemeBusinessLogic, SIGNAL(refreshNeeded()), this, SLOT(refreshNeeded ())); setLayout(mainLayout); retranslateUi (); }