FlagsList::FlagsList(QWidget* parent, Qt::WFlags fl) : QDialog(parent, fl), Ui::flagsDialog() { setupUi(this); connect(checkAllButton, SIGNAL(pressed()), this, SLOT(checkAll())); connect(uncheckAllButton, SIGNAL(pressed()), this, SLOT(uncheckAll())); }
void Monitor::sortByMemoryUsage(void){ sortColumn = STACK_HEAP_COL; uncheckAll(); if( sortByMemoryUsageAction != 0 ){ sortByMemoryUsageAction->setChecked(true); } }
KGetLinkView::KGetLinkView(QWidget *parent) : KDialog(parent), m_linkImporter(0) { setCaption(i18n("Import Links")); // proxy model to filter links m_proxyModel = new KGetSortFilterProxyModel(); m_proxyModel->setDynamicSortFilter(true); m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); QWidget *widget = new QWidget(this); ui.setupUi(widget); // set the Icons ui.importLinks->setIcon(KIcon("document-import")); ui.showAll->setIcon(KIcon("view-list-icons")); ui.showArchives->setIcon(KIcon("package-x-generic")); ui.showAudio->setIcon(KIcon("audio-x-generic")); ui.showImages->setIcon(KIcon("image-x-generic")); ui.showVideos->setIcon(KIcon("video-x-generic")); // set the ids for the filterButtonGroup ui.filterButtonGroup->setId(ui.showAll, KGetSortFilterProxyModel::NoFilter); ui.filterButtonGroup->setId(ui.showArchives, KGetSortFilterProxyModel::CompressedFiles); ui.filterButtonGroup->setId(ui.showAudio, KGetSortFilterProxyModel::AudioFiles); ui.filterButtonGroup->setId(ui.showImages, KGetSortFilterProxyModel::ImageFiles); ui.filterButtonGroup->setId(ui.showVideos, KGetSortFilterProxyModel::VideoFiles); ui.treeView->setModel(m_proxyModel); ui.progressBar->hide(); connect(ui.treeView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(uncheckItem(const QModelIndex &))); connect(ui.textFilter, SIGNAL(textChanged(QString)), SLOT(setTextFilter(QString))); connect(ui.filterMode, SIGNAL(currentIndexChanged(int)), m_proxyModel, SLOT(setFilterMode(int))); connect(ui.filterButtonGroup, SIGNAL(buttonClicked(int)), m_proxyModel, SLOT(setFilterType(int))); connect(ui.filterButtonGroup, SIGNAL(buttonClicked(int)), SLOT(updateSelectionButtons())); connect(ui.urlRequester, SIGNAL(textChanged(const QString &)), SLOT(updateImportButtonStatus(const QString &))); connect(ui.selectAll, SIGNAL(clicked()), this, SLOT(checkAll())); connect(ui.deselectAll, SIGNAL(clicked()), this, SLOT(uncheckAll())); connect(ui.checkSelected, SIGNAL(clicked()), this, SLOT(slotCheckSelected())); connect(ui.invertSelection, SIGNAL(clicked()), this, SLOT(slotInvertSelection())); connect(this, SIGNAL(okClicked()), this, SLOT(slotStartLeech())); connect(ui.showWebContent, SIGNAL(stateChanged(int)), m_proxyModel, SLOT(setShowWebContent(int))); connect(ui.importLinks, SIGNAL(clicked()), this, SLOT(slotStartImport())); connect(ui.treeView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), SLOT(selectionChanged())); setMainWidget(widget); setButtonText(KDialog::Ok, i18nc("Download the items which have been selected","&Download Checked")); setButtonIcon(KDialog::Ok, KIcon("kget")); checkClipboard(); }
ContentSelectorModel::ContentModel::ContentModel(QObject *parent) : QAbstractTableModel(parent), mMimeType ("application/omwcontent"), mMimeTypes (QStringList() << mMimeType), mColumnCount (1), mDragDropFlags (Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled), mDropActions (Qt::CopyAction | Qt::MoveAction) { setEncoding ("win1252"); uncheckAll(); }
void SubmitEditorWidget::fileListCustomContextMenuRequested(const QPoint & pos) { // Execute menu offering to check/uncheck all QMenu menu; //: Check all for submit QAction *checkAllAction = menu.addAction(tr("Select All")); //: Uncheck all for submit QAction *uncheckAllAction = menu.addAction(tr("Unselect All")); QAction *action = menu.exec(d->m_ui.fileView->mapToGlobal(pos)); if (action == checkAllAction) { checkAll(); return; } if (action == uncheckAllAction) { uncheckAll(); return; } }
MaemoProFilesUpdateDialog::MaemoProFilesUpdateDialog(const QList<MaemoDeployableListModel *> &models, QWidget *parent) : QDialog(parent), m_models(models), ui(new Ui::MaemoProFilesUpdateDialog) { ui->setupUi(this); ui->tableWidget->setRowCount(models.count()); ui->tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Updateable Project Files"))); for (int row = 0; row < models.count(); ++row) { QTableWidgetItem *const item = new QTableWidgetItem(QDir::toNativeSeparators(models.at(row)->proFilePath())); item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); item->setCheckState(Qt::Unchecked); ui->tableWidget->setItem(row, 0, item); } ui->tableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); ui->tableWidget->resizeRowsToContents(); connect(ui->checkAllButton, SIGNAL(clicked()), this, SLOT(checkAll())); connect(ui->uncheckAllButton, SIGNAL(clicked()), this, SLOT(uncheckAll())); }
void Monitor::sortByCpuUsage(void){ sortColumn = CPU_COL; uncheckAll(); sortByCpuUsageAction->setChecked(true); }
void Monitor::sortByName(void){ sortColumn = NAME_COL; uncheckAll(); sortByNameAction->setChecked(true); }
void Monitor::sortByProcessId(void){ sortColumn = PROCESS_ID_COL; uncheckAll(); sortByProcessIdAction->setChecked(true); }
void UIRadioBoxGrp::vOnCheck(lw::UICheckBox* pCb){ uncheckAll(); pCb->check(true); _pCallback->vOnCheck(pCb, true); }
/* watch for users signing ON and OFF */ void *watchuser(void *args) { struct userarg *userargs; struct userelement *users; pthread_mutex_t lock; struct utmpx *up; int contains; time_t last_check; struct userelement *tmp; /* get the current time */ time(&last_check); while(1) { userargs = (struct userarg *)args; users = (struct userelement *)userargs->users; lock = (pthread_mutex_t)userargs->lock; setutxent(); while(up = getutxent()) { /* if we have a user process */ if(up->ut_type == USER_PROCESS) { /* check if the user is a watched user */ pthread_mutex_lock(&lock); contains = contains_user(users, up->ut_user); pthread_mutex_unlock(&lock); /* if the user is watched and has logged on since we last checked, print */ if(contains == 1 && (int)up->ut_tv.tv_sec > (int)last_check) { printf("\n%s has logged on %s from %s\n", up->ut_user, up->ut_line, up->ut_host); /* Mark the user as having logged in */ pthread_mutex_lock(&lock); users = login(users, up->ut_user); pthread_mutex_unlock(&lock); } if (contains == 1) { /* If the user is in the loop they are logged on. Mark as checked regardless of when they logged on */ pthread_mutex_lock(&lock); users = check(users, up->ut_user); pthread_mutex_unlock(&lock); } } } /* Check for users that have logged off */ pthread_mutex_lock(&lock); tmp = users; while(tmp != NULL) { /* If we didn't see the user logged in this time but they had logged on before consider the user logged off */ if(tmp->checked == 0 && tmp->logged_on) { /* Mark the user as logged off, and print (in the logoff function) */ users = logoff(users, tmp->username); } tmp = tmp->next; } /* Uncheck all users for the next loop */ users = uncheckAll(users); pthread_mutex_unlock(&lock); /* update when we last checked */ time(&last_check); sleep(10); } }