void jobManWindow::on_refresh_complete() { loadServices(); initRightPanel(); unsetWaitCursor(); refreshMutex.unlock(); this->set_sensitive(true); }
void DimmableLight::loadDeviceData(const QString &rootDevicePath) { _deviceDescription = loadXml(rootDevicePath, "Root Device"); if (_deviceDescription == NULL) { fprintf(stderr, "Failed to load device description!"); return; } setDeviceProperties(_deviceDescription); readDeviceProperties(_deviceDescription); QHash<QString, ServiceInfo *> infos; QFileInfo rootFileInfo(rootDevicePath); QDir rootDirectory = rootFileInfo.dir(); loadServices(_deviceDescription, infos, rootDirectory); QHash<QString, ServiceInfo *>::const_iterator it = infos.constBegin(); for (; it != infos.constEnd(); it++) { QString name = it.key(); ServiceInfo *info = it.value(); if (name == DIMMING_SERV_ID) { _dimming = new (std::nothrow) DimmingService(info); } else if (name == SWITCHPOWER_SERV_ID) { _switch = new (std::nothrow) SwitchPowerService(info); } } }
void BackendSelection::load() { const KService::List offers = KServiceTypeTrader::self()->query("PhononBackend", "Type == 'Service' and [X-KDE-PhononBackendInfo-InterfaceVersion] == 1"); // the offers are already sorted for preference loadServices(offers); foreach (KCModuleProxy *proxy, m_kcms) { if (proxy) { proxy->load(); } } }
/*! Creates a UsbGadgetSelector instance with the given \a parent and \a flags. */ UsbGadgetSelector::UsbGadgetSelector(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags), m_selectedItem(0) { setObjectName(QLatin1String("usbgadgetselector")); setWindowTitle(tr("USB Connection Mode")); QSettings settings("Trolltech", "Usb"); settings.beginGroup("ConnectionMode"); m_service = settings.value("Service", QString()).toString(); m_application = settings.value("Application", QString()).toString(); m_manager = new QUsbManager(this); connect(m_manager, SIGNAL(cableConnectedChanged(bool)), this, SLOT(cableConnectedChanged(bool))); QVBoxLayout *layout = new QVBoxLayout; if (m_manager->cableConnected()) { m_label = new QLabel(tr("USB cable connected. Choose connection mode.")); } else { m_label = new QLabel(tr("USB cable not connected.")); } m_label->setWordWrap(true); layout->addWidget(m_label); m_services = new QListWidget; m_services->setWordWrap(true); m_services->setSortingEnabled(true); m_services->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); layout->addWidget(m_services); connect(m_services, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(itemActivated(QListWidgetItem*))); m_rememberChoice = new QAction(tr("Don't ask again"), this); m_rememberChoice->setCheckable(true); if (settings.value("RememberChoice", false).toBool()) m_rememberChoice->setChecked(true); QMenu *menu = QSoftMenuBar::menuFor(this); menu->addAction(m_rememberChoice); loadServices(); setLayout(layout); }
void PyEntityInput::readProfile( boost::shared_ptr<PyProfile>& profile_ptr ) { fProfile = profile_ptr; python::object services = profile_ptr->get("SERVICES"); //check for none if ( services == python::api::object()) { Logger::warn() << "PyEntityInput: No SERVICES specification in profile" << endl; } else { python::dict serv_dict; try { serv_dict = python::extract<python::dict>(services); } catch (...) { PyErr_Print(); PyErr_Clear(); Logger::error() << "PyEntityInput: SERVICES object is not a python dictionary" << endl; } loadServices(serv_dict); } }
void MainWindow::createActions() { // file updateAction = new QAction(trUtf8("Обновить"), this); updateAction->setShortcut(tr("F5")); connect(updateAction, SIGNAL(triggered()), this, SLOT(update())); loadServicesAction = new QAction(trUtf8("Загрузка услуг"), this); connect(loadServicesAction, SIGNAL(triggered()), this, SLOT(loadServices())); loadServicesMtsAction = new QAction(trUtf8("Загрузка услуг MTC"), this); connect(loadServicesMtsAction, SIGNAL(triggered()), this, SLOT(loadServicesMts())); loadPaysAction = new QAction(trUtf8("Загрузка платежей"), this); connect(loadPaysAction, SIGNAL(triggered()), this, SLOT(loadPays())); exitAction = new QAction(trUtf8("Выход"), this); exitAction->setShortcut(tr("Ctrl+Q")); exitAction->setStatusTip(trUtf8("Выйти из программы")); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); // refs clientsAction = new QAction(trUtf8("Клиенты"), this); // clientsAction->setStatusTip(trUtf8("Информация по клиентам")); connect(clientsAction, SIGNAL(triggered()), this, SLOT(clients())); abonentTypesAction = new QAction(trUtf8("Типы абонентов"), this); // abonentTypesAction->setStatusTip(trUtf8("Информация по клиентам")); connect(abonentTypesAction, SIGNAL(triggered()), this, SLOT(abonentTypes())); tplansAction = new QAction(trUtf8("Тарифные планы"), this); // tplansAction->setStatusTip(trUtf8("Информация по клиентам")); connect(tplansAction, SIGNAL(triggered()), this, SLOT(tplans())); operatorsAction = new QAction(trUtf8("Операторы"), this); operatorsAction->setStatusTip(trUtf8("Операторы")); connect(operatorsAction, SIGNAL(triggered()), this, SLOT(operators())); servicesAction = new QAction(trUtf8("Услуги"), this); // tplansAction->setStatusTip(trUtf8("Информация по клиентам")); connect(servicesAction, SIGNAL(triggered()), this, SLOT(services())); paysAction = new QAction(trUtf8("Платежи"), this); paysAction->setStatusTip(trUtf8("Информация по платежам")); connect(paysAction, SIGNAL(triggered()), this, SLOT(pays())); correctionsAction = new QAction(trUtf8("Корректировки"), this); connect(correctionsAction, SIGNAL(triggered()), this, SLOT(corrections())); arcsAction = new QAction(trUtf8("Архив"), this); arcsAction->setStatusTip(trUtf8("Архив")); arcsAction->setEnabled(userGr_ == 0); connect(arcsAction, SIGNAL(triggered()), this, SLOT(arcs())); // operations calc4abonentsAction = new QAction(trUtf8("1 Рассчет по абонентам"), this); connect(calc4abonentsAction, SIGNAL(triggered()), this, SLOT(calc4abonents())); calc4clientsAction = new QAction(trUtf8("2 Рассчет по клиентам (+счета)"), this); connect(calc4clientsAction, SIGNAL(triggered()), this, SLOT(calc4clients())); files4clientsAction = new QAction(trUtf8("Счета по по клиентам"), this); connect(files4clientsAction, SIGNAL(triggered()), this, SLOT(files4clients())); // reports noAbonentsAction = new QAction(trUtf8("Начисления без абонентов"), this); connect(noAbonentsAction, SIGNAL(triggered()), this, SLOT(noAbonents())); noAccrualsAction = new QAction(trUtf8("Абоненты без начислений"), this); connect(noAccrualsAction, SIGNAL(triggered()), this, SLOT(noAccruals())); aboutAction = new QAction(tr("&About"), this); aboutAction->setStatusTip(tr("Show the application's About box")); connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); }