void ObjectivesEditor::_preShow() { // Restore the position _windowPosition.applyPosition(); populateWidgets(); }
void ConversationDialog::_preShow() { // Restore the position _windowPosition.applyPosition(); populateWidgets(); }
// Add a new conversations entity button void ConversationDialog::onAddEntity() { // Obtain the entity class object IEntityClassPtr eclass = GlobalEntityClassManager().findClass(CONVERSATION_ENTITY_CLASS); if (eclass) { // Construct a Node of this entity type IEntityNodePtr node(GlobalEntityCreator().createEntity(eclass)); // Create a random offset node->getEntity().setKeyValue( "origin", RandomOrigin::generate(128) ); // Insert the node into the scene graph assert(GlobalSceneGraph().root()); GlobalSceneGraph().root()->addChildNode(node); // Refresh the widgets populateWidgets(); } else { // conversation entityclass was not found gtkutil::MessageBox::ShowError( (boost::format(_("Unable to create conversation Entity: class '%s' not found.")) % CONVERSATION_ENTITY_CLASS).str(), GlobalMainFrame().getTopLevelWindow() ); } }
ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent) { m_telemetry = new Ui_CC_HW_Widget(); m_telemetry->setupUi(this); ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); Core::Internal::GeneralSettings * settings=pm->getObject<Core::Internal::GeneralSettings>(); if(!settings->useExpertMode()) m_telemetry->saveTelemetryToRAM->setVisible(false); UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>(); int id = utilMngr->getBoardModel(); switch (id) { case 0x0101: m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0101.svg")); break; case 0x0301: m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0301.svg")); break; case 0x0401: m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg")); break; case 0x0402: m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg")); break; case 0x0201: m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0201.svg")); break; default: m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg")); break; } addApplySaveButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD); addUAVObjectToWidgetRelation("HwCopterControl","FlexiPort",m_telemetry->cbFlexi); addUAVObjectToWidgetRelation("HwCopterControl","MainPort",m_telemetry->cbTele); addUAVObjectToWidgetRelation("HwCopterControl","RcvrPort",m_telemetry->cbRcvr); addUAVObjectToWidgetRelation("HwCopterControl","USB_HIDPort",m_telemetry->cbUsbHid); addUAVObjectToWidgetRelation("HwCopterControl","USB_VCPPort",m_telemetry->cbUsbVcp); addUAVObjectToWidgetRelation("ModuleSettings","TelemetrySpeed",m_telemetry->telemetrySpeed); addUAVObjectToWidgetRelation("ModuleSettings","GPSSpeed",m_telemetry->gpsSpeed); addUAVObjectToWidgetRelation("ModuleSettings","ComUsbBridgeSpeed",m_telemetry->comUsbBridgeSpeed); // Load UAVObjects to widget relations from UI file // using objrelation dynamic property autoLoadWidgets(); connect(m_telemetry->cchwHelp,SIGNAL(clicked()),this,SLOT(openHelp())); enableControls(false); populateWidgets(); refreshWidgetsValues(); forceConnectedState(); }
MainWindow::MainWindow(mbp::PatcherConfig *pc, QWidget *parent) : QWidget(parent), d_ptr(new MainWindowPrivate()) { Q_D(MainWindow); setWindowIcon(QIcon(QStringLiteral(":/icons/icon.png"))); setWindowTitle(qApp->applicationName()); // If we're passed an argument, switch to automatic mode if (qApp->arguments().size() > 2) { d->autoMode = true; d->fileName = qApp->arguments().at(1); } else { d->autoMode = false; d->fileName.clear(); } d->pc = pc; d->patcher = pc->createPatcher("MultiBootPatcher"); addWidgets(); setWidgetActions(); populateWidgets(); setWidgetDefaults(); refreshInstallationLocations(); updateWidgetsVisibility(); // Create thread d->thread = new QThread(this); d->task = new PatcherTask(); d->task->moveToThread(d->thread); connect(d->thread, &QThread::finished, d->task, &QObject::deleteLater); connect(this, &MainWindow::runThread, d->task, &PatcherTask::patch); connect(d->task, &PatcherTask::finished, this, &MainWindow::onPatchingFinished); connect(d->task, &PatcherTask::progressUpdated, this, &MainWindow::onProgressUpdated); connect(d->task, &PatcherTask::filesUpdated, this, &MainWindow::onFilesUpdated); connect(d->task, &PatcherTask::detailsUpdated, this, &MainWindow::onDetailsUpdated); d->thread->start(); }
ConfigRevoNanoHWWidget::ConfigRevoNanoHWWidget(QWidget *parent) : ConfigTaskWidget(parent), m_refreshing(true) { m_ui = new Ui_RevoNanoHWWidget(); m_ui->setupUi(this); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>(); if (!settings->useExpertMode()) { m_ui->saveTelemetryToRAM->setEnabled(false); m_ui->saveTelemetryToRAM->setVisible(false); } addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD); forceConnectedState(); addWidgetBinding("HwSettings", "RM_FlexiPort", m_ui->cbFlexi); addWidgetBinding("HwSettings", "RM_MainPort", m_ui->cbMain); addWidgetBinding("HwSettings", "RM_RcvrPort", m_ui->cbRcvr, 0, 1, true); addWidgetBinding("HwSettings", "USB_HIDPort", m_ui->cbUSBHIDFunction); addWidgetBinding("HwSettings", "USB_VCPPort", m_ui->cbUSBVCPFunction); addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbUSBVCPSpeed); addWidgetBinding("HwSettings", "TelemetrySpeed", m_ui->cbFlexiTelemSpeed); addWidgetBinding("HwSettings", "GPSSpeed", m_ui->cbFlexiGPSSpeed); addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbFlexiComSpeed); addWidgetBinding("HwSettings", "TelemetrySpeed", m_ui->cbMainTelemSpeed); addWidgetBinding("HwSettings", "GPSSpeed", m_ui->cbMainGPSSpeed); addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbMainComSpeed); addWidgetBinding("HwSettings", "TelemetrySpeed", m_ui->cbRcvrTelemSpeed); addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbRcvrComSpeed); // Add Gps protocol configuration addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbMainGPSProtocol); addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbFlexiGPSProtocol); connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); setupCustomCombos(); enableControls(true); populateWidgets(); refreshWidgetsValues(); setDirty(false); m_refreshing = false; }
GroupWisePrivacyDialog::GroupWisePrivacyDialog( GroupWiseAccount * account, QWidget *parent, const char * /*name*/ ) : KDialog( parent) , m_account( account ), m_dirty( false ), m_searchDlg(0) { setCaption(i18nc( "Account specific privacy settings", "Manage Privacy for %1", account->accountId() )); setButtons(KDialog::Ok|KDialog::Apply|KDialog::Cancel); setDefaultButton(Ok); setModal(false); QWidget * wid = new QWidget( this ); m_privacy.setupUi( wid ); setMainWidget( wid ); PrivacyManager * mgr = m_account->client()->privacyManager(); // populate the widget; // admin lock if ( mgr->isPrivacyLocked() ) { m_privacy.status->setText( i18n( "Privacy settings have been administratively locked" ) ); disableWidgets(); } populateWidgets(); m_privacy.allowList->setSelectionMode( Q3ListBox::Extended ); m_privacy.denyList->setSelectionMode( Q3ListBox::Extended ); connect( m_privacy.btnAllow, SIGNAL(clicked()), SLOT(slotAllowClicked()) ); connect( m_privacy.btnBlock, SIGNAL(clicked()), SLOT(slotBlockClicked()) ); connect( m_privacy.btnAdd, SIGNAL(clicked()), SLOT(slotAddClicked()) ); connect( m_privacy.btnRemove, SIGNAL(clicked()), SLOT(slotRemoveClicked()) ); connect( m_privacy.allowList, SIGNAL(selectionChanged()), SLOT(slotAllowListClicked()) ); connect( m_privacy.denyList, SIGNAL(selectionChanged()), SLOT(slotDenyListClicked()) ); connect( mgr, SIGNAL(privacyChanged(QString,bool)), SLOT(slotPrivacyChanged()) ); connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply())); m_privacy.btnAdd->setEnabled( true ); m_privacy.btnAllow->setEnabled( false ); m_privacy.btnBlock->setEnabled( false ); m_privacy.btnRemove->setEnabled( false ); /* showButtonOK( true ); showButtonApply( true ); showButtonCancel( true ); */ show(); }
// Delete entity button void ConversationDialog::onDeleteEntity() { // Get the Node* from the tree model and remove it from the scenegraph Gtk::TreeModel::iterator iter = _entityView->get_selection()->get_selected(); if (iter) { // Get the name of the selected entity std::string name = Glib::ustring((*iter)[_convEntityColumns.entityName]); // Instruct the ConversationEntity to delete its world node, and then // remove it from the map _entities[name]->deleteWorldNode(); _entities.erase(name); // Update the widgets to remove the selection from the list populateWidgets(); } }
// Add a new objectives entity button void ObjectivesEditor::_onAddEntity() { if (_objectiveEClasses.empty()) { // Objective entityclass(es) not defined gtkutil::MessageBox::ShowError( _("Unable to create Objective Entity: classes not defined in registry."), GlobalMainFrame().getTopLevelWindow() ); return; } const std::string& objEClass = _objectiveEClasses.front(); // Obtain the entity class object IEntityClassPtr eclass = GlobalEntityClassManager().findClass(objEClass); if (eclass) { // Construct a Node of this entity type IEntityNodePtr node(GlobalEntityCreator().createEntity(eclass)); // Create a random offset node->getEntity().setKeyValue("origin", RandomOrigin::generate(128)); // Insert the node into the scene graph assert(GlobalSceneGraph().root()); GlobalSceneGraph().root()->addChildNode(node); // Refresh the widgets populateWidgets(); } else { // Objective entityclass was not found gtkutil::MessageBox::ShowError( (boost::format(_("Unable to create Objective Entity: class '%s' not found.")) % objEClass).str(), GlobalMainFrame().getTopLevelWindow() ); } }
// Delete entity button void ObjectivesEditor::_onDeleteEntity() { // Get the selection Gtk::TreeView* entityList = gladeWidget<Gtk::TreeView>( "entitiesTreeView" ); Gtk::TreeModel::iterator iter = entityList->get_selection()->get_selected(); if (iter) { // Get the name of the selected entity std::string name = Glib::ustring((*iter)[_objEntityColumns.entityName]); // Instruct the ObjectiveEntity to delete its world node, and then // remove it from the map _entities[name]->deleteWorldNode(); _entities.erase(name); // Update the widgets to remove the selection from the list populateWidgets(); } }
PreviewWidgetModel::PreviewWidgetModel(QObject* parent) : unity::shell::scopes::PreviewWidgetModelInterface(parent) { populateWidgets(); }
void GroupWisePrivacyDialog::slotPrivacyChanged() { m_privacy.denyList->clear(); m_privacy.allowList->clear(); populateWidgets(); }
ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent) { m_telemetry = new Ui_CC_HW_Widget(); m_telemetry->setupUi(this); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>(); if (!settings->useExpertMode()) { m_telemetry->saveTelemetryToRAM->setVisible(false); } UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>(); int id = utilMngr->getBoardModel(); switch (id) { case 0x0101: m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0101.svg")); break; case 0x0301: m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0301.svg")); break; case 0x0401: m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg")); break; case 0x0402: m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg")); break; case 0x0201: m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0201.svg")); break; default: m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg")); break; } addApplySaveButtons(m_telemetry->saveTelemetryToRAM, m_telemetry->saveTelemetryToSD); addWidgetBinding("HwSettings", "CC_FlexiPort", m_telemetry->cbFlexi); addWidgetBinding("HwSettings", "CC_MainPort", m_telemetry->cbTele); addWidgetBinding("HwSettings", "CC_RcvrPort", m_telemetry->cbRcvr); addWidgetBinding("HwSettings", "USB_HIDPort", m_telemetry->cbUsbHid); addWidgetBinding("HwSettings", "USB_VCPPort", m_telemetry->cbUsbVcp); addWidgetBinding("HwSettings", "TelemetrySpeed", m_telemetry->telemetrySpeed); addWidgetBinding("HwSettings", "GPSSpeed", m_telemetry->gpsSpeed); // Add Gps protocol configuration HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager()); HwSettings::DataFields hwSettingsData = hwSettings->getData(); if (hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_GPS] != HwSettings::OPTIONALMODULES_ENABLED) { m_telemetry->gpsProtocol->setEnabled(false); m_telemetry->gpsProtocol->setToolTip(tr("Enable GPS module and reboot the board to be able to select GPS protocol")); } else { addWidgetBinding("GPSSettings", "DataProtocol", m_telemetry->gpsProtocol); } addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_telemetry->comUsbBridgeSpeed); connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); enableSaveButtons(false); populateWidgets(); refreshWidgetsValues(); forceConnectedState(); }
void ConfigDlg::showDialog() { populateWidgets(); exec(); }