void ContextMenu::resetActions() { _width = st::dropdownPadding.left() + st::dropdownPadding.right(); _height = st::dropdownPadding.top() + st::dropdownPadding.bottom(); resize(_width, _height); clearActions(); }
void processResetCommand() { Serial.print("Free memory: "); Serial.println(freeMemory()); clearActions(); Serial.print("Free memory: "); Serial.println(freeMemory()); }
void Database::prepareTableForActions() { char* _errMsg = NULL; int _res = 0; _res = sqlite3_exec( m_db, "CREATE TABLE IF NOT EXISTS Actions ( id INTEGER PRIMARY KEY, \ scriptName TEXT NOT NULL, \ date TEXT, \ time TEXT, \ xdays INTEGER, \ days TINYINT );", NULL, NULL, &_errMsg ); if( _res != SQLITE_OK ) { QMessageBox _msg( QMessageBox::Critical, "Error", "SQL error: " + QString( _errMsg ), QMessageBox::Ok ); _msg.exec(); sqlite3_free( _errMsg ); } _res = sqlite3_exec( m_db, "CREATE TABLE IF NOT EXISTS ExcludedDates ( id INTEGER PRIMARY KEY, \ refId INTEGER NOT NULL, \ time TIME );", NULL, NULL, &_errMsg ); if( _res != SQLITE_OK ) { QMessageBox _msg( QMessageBox::Critical, "Error", "SQL error: " + QString( _errMsg ), QMessageBox::Ok ); _msg.exec(); sqlite3_free( _errMsg ); } clearActions(); }
void Animal::stopMoving() { if (!_moving) return; _moving = false; clearActions(); }
PopupMenu::~PopupMenu() { clearActions(true); delete _menu; #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 if (App::wnd()) { App::wnd()->activateWindow(); } #endif }
void MainWindow::connectPixy(bool state) { if (state) // connect { try { if (m_pixyDFUConnected) // we're in programming mode { m_flash = new Flash(); if (m_firmwareFile!="") program(m_firmwareFile); else { QString dir; QFileDialog fd(this); dir = m_settings->value("fw_dialog").toString(); fd.setWindowTitle("Select a Firmware File"); fd.setDirectory(QDir(dir)); fd.setNameFilter("Firmware (*.hex)"); if (fd.exec()) { QStringList slist = fd.selectedFiles(); if (slist.size()==1 && m_flash) { program(slist.at(0)); } } dir = fd.directory().absolutePath(); m_settings->setValue("fw_dialog", QVariant(dir)); } } else { m_console->print("Pixy detected.\n"); m_interpreter = new Interpreter(m_console, m_video); m_initScriptExecuted = false; // reset so we'll execute for this instance connect(m_interpreter, SIGNAL(runState(uint)), this, SLOT(handleRunState(uint))); connect(m_interpreter, SIGNAL(finished()), this, SLOT(interpreterFinished())); connect(m_interpreter, SIGNAL(connected(Device,bool)), this, SLOT(handleConnected(Device,bool))); connect(m_interpreter, SIGNAL(actionScriptlet(int,QString,QStringList)), this, SLOT(handleActionScriptlet(int,QString,QStringList))); clearActions(); m_interpreter->getAction(0); // start action query process } m_pixyConnected = true; } catch (std::runtime_error &exception) { m_console->error(QString(exception.what())+"\n"); m_flash = NULL; m_pixyDFUConnected = false; m_pixyConnected = false; } } else // disconnect {
PopupMenu::~PopupMenu() { clearActions(true); #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 if (auto w = App::wnd()) { w->onReActivate(); QTimer::singleShot(200, w, SLOT(onReActivate())); } #endif }
void MainWindow::connectPixy(bool state) { if (state) // connect { try { if (m_pixyDFUConnected) // we're in programming mode { m_flash = new Flash(); if (m_argvFirmwareFile!="") program(m_argvFirmwareFile); else if (m_firmwareFile!="") { program(m_firmwareFile); m_firmwareFile = ""; } else { QString dir; QFileDialog fd(this); dir = m_settings->value("fw_dialog").toString(); fd.setWindowTitle("Select a Firmware File"); fd.setDirectory(QDir(dir)); fd.setNameFilter("Firmware (*.hex)"); if (fd.exec()) { QStringList slist = fd.selectedFiles(); if (slist.size()==1 && m_flash) { program(slist.at(0)); } } dir = fd.directory().absolutePath(); m_settings->setValue("fw_dialog", QVariant(dir)); } } else if (m_interpreter==NULL) { m_console->print("Pixy detected.\n"); clearActions(); m_interpreter = new Interpreter(m_console, m_video, &m_parameters, m_initScript); connect(m_interpreter, SIGNAL(runState(int)), this, SLOT(handleRunState(int))); connect(m_interpreter, SIGNAL(finished()), this, SLOT(interpreterFinished())); // thread will send finished event when it exits connect(m_interpreter, SIGNAL(connected(Device,bool)), this, SLOT(handleConnected(Device,bool))); connect(m_interpreter, SIGNAL(actionScriptlet(QString,QStringList)), this, SLOT(handleActionScriptlet(QString,QStringList))); connect(m_interpreter, SIGNAL(paramLoaded()), this, SLOT(handleLoadParams())); connect(m_interpreter, SIGNAL(version(ushort,ushort,ushort)), this, SLOT(handleVersion(ushort,ushort,ushort))); m_interpreter->start(); } m_pixyConnected = true; } catch (std::runtime_error &exception)
void pTabbedWorkspaceCorner::setActions( QList<QAction*> l ) { // hide to avoid flickering hide(); // delete all buttons clearActions(); // create button associated with actions foreach ( QAction* a, l ) addAction( a ); // show corner show(); }
void CntActionPopupPrivate::showPopup() { for (int i= 0 ;i< mDataItemList.count() ;i++) { mListModel->appendRow(mDataItemList.at(i)); } mListModel->setSortRole(Qt::UserRole+2); mListModel->sort(0, Qt::AscendingOrder); clearActions(); mListView->setModel(mListModel); mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); mListView->setFrictionEnabled(true); mListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum ); QString contactName = mContact->displayLabel(); if (contactName.isEmpty()) { contactName = hbTrId("txt_phob_list_unnamed"); } HbLabel *label = new HbLabel(); label->setPlainText(contactName); setHeadingWidget(label); setContentWidget(mListView); mCancelAction = new HbAction(hbTrId("txt_common_button_cancel"), this); addAction(mCancelAction); setTimeout(HbDialog::NoTimeout); setDismissPolicy(HbDialog::NoDismiss); setModal(true); connect(mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(listItemSelected(QModelIndex))); connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,const QPointF&)), this, SLOT(onLongPressed(HbAbstractViewItem*,const QPointF&)) ); //launch dialog asyncronously open(this, SLOT(handleUserResponse(HbAction*))); }
void ActionManager::clear() { clearActionGroups(); clearActions(); }
void PopupMenu::resetActions() { clearActions(); resize(_padding.left() + _st.widthMin + _padding.right(), _padding.top() + (_st.skip * 2) + _padding.bottom()); }
void StateObject::removeState() { clearActions(); clearCreatedEvents(); //stateManager->getState(name)->eraseRenderObjects(); }
InputList::~InputList() { clearActions(); }
ContextMenu::~ContextMenu() { clearActions(); }
void WTrackTableViewHeader::setModel(QAbstractItemModel* model) { TrackModel* oldTrackModel = getTrackModel(); if (dynamic_cast<QAbstractItemModel*>(oldTrackModel) == model) { // If the models are the same, do nothing but the redundant call. QHeaderView::setModel(model); return; } // Won't happen in practice since the WTrackTableView new's a new // WTrackTableViewHeader each time a new TrackModel is loaded. // if (oldTrackModel) { // saveHeaderState(); // } // First clear all the context menu actions for the old model. clearActions(); // Now set the header view to show the new model QHeaderView::setModel(model); // Now build actions for the new TrackModel TrackModel* trackModel = dynamic_cast<TrackModel*>(model); if (!trackModel) { return; } // Restore saved header state to get sizes, column positioning, etc. back. restoreHeaderState(); // Here we can override values to prevent restoring corrupt values from database setMovable(true); // Setting true in the next line causes Bug #925619 at least with Qt 4.6.1 setCascadingSectionResizes(false); setMinimumSectionSize(WTTVH_MINIMUM_SECTION_SIZE); int columns = model->columnCount(); for (int i = 0; i < columns; ++i) { if (trackModel->isColumnInternal(i)) { continue; } QString title = model->headerData(i, orientation()).toString(); QAction* action = new QAction(title, &m_menu); action->setCheckable(true); /* If Mixxx starts the first time or the header states have been cleared * due to database schema evolution we gonna hide all columns that may * contain a potential large number of NULL values. Here we uncheck * item in the context menu that are hidden by defualt (e.g., key * column) */ if (!hasPersistedHeaderState() && trackModel->isColumnHiddenByDefault(i)) { action->setChecked(false); } else { action->setChecked(!isSectionHidden(i)); } // Map this action's signals via our QSignalMapper m_signalMapper.setMapping(action, i); m_columnActions.insert(i, action); connect(action, SIGNAL(triggered()), &m_signalMapper, SLOT(map())); m_menu.addAction(action); // force the section size to be a least WTTVH_MINIMUM_SECTION_SIZE if (sectionSize(i) < WTTVH_MINIMUM_SECTION_SIZE) { // This might happen if WTTVH_MINIMUM_SECTION_SIZ has changed or // the header state from database was corrupt resizeSection(i,WTTVH_MINIMUM_SECTION_SIZE); } } // Safety check against someone getting stuck with all columns hidden // (produces an empty library table). Just re-show them all. if (hiddenCount() == columns) { for (int i = 0; i < columns; ++i) { showSection(i); } } }
pTabbedWorkspaceCorner::~pTabbedWorkspaceCorner() { clearActions(); }
GenericArtefactModel::~GenericArtefactModel() { clearActions(); }