void ImportView::slotImageSelected() { // delay to slotDispatchImageSelected d->needDispatchSelection = true; d->selectionTimer->start(); emit signalSelectionChanged(d->iconView->numberOfSelectedIndexes()); }
void AlbumSelectors::slotUpdateClearButtons() { d->albumClearButton->animateVisible(!d->albumSelectCB->model()->checkedAlbums().isEmpty()); d->tagClearButton->animateVisible(!d->tagSelectCB->model()->checkedAlbums().isEmpty()); emit signalSelectionChanged(); }
void Canvas::slotSelected() { QRect sel = QRect(0, 0, 0, 0); if (d->wrapItem) { cancelAddItem(); return; } if (d->rubber) { sel = calcSelectedArea(); } d->core->setSelectedArea(sel); emit signalSelectionChanged(sel); }
void AltLangStrEdit::slotSelectionChanged() { d->currentLanguage = d->languageCB->currentText(); // There are bogus signals caused by spell checking, see bug #141663. // so we must block signals here. d->valueEdit->blockSignals(true); QString langISO3066 = d->currentLanguage; langISO3066.replace('-', '_'); d->valueEdit->setSpellCheckingLanguage(langISO3066); QString text = d->values.value(d->currentLanguage); d->valueEdit->setText(text); d->delValueButton->setEnabled(!text.isNull()); d->valueEdit->blockSignals(false); d->languageCB->setToolTip(d->languageCodeMap.value(d->currentLanguage)); emit signalSelectionChanged(d->currentLanguage); }
void GUIWidget::createGUI () { QVBoxLayout *vbox = new QVBoxLayout; vbox->setSpacing(2); vbox->setMargin(5); setLayout(vbox); QFormLayout *form = new QFormLayout; form->setSpacing(2); form->setMargin(0); vbox->addLayout(form); // csv file _csvButton = new FileButton(0); connect(_csvButton, SIGNAL(signalSelectionChanged(QStringList)), this, SLOT(buttonStatus())); // _csvButton->setFiles(QStringList() << "/tmp/yahoo.csv"); form->addRow (tr("CSV File"), _csvButton); // format _format = new QLineEdit; form->addRow (tr("Format"), _format); // date format _dateFormat = new QLineEdit; form->addRow (tr("Date Format"), _dateFormat); // delimiter Delimiter d; _delimiter = new QComboBox; _delimiter->addItems(d.list()); _delimiter->setCurrentIndex(Delimiter::_SEMICOLON); form->addRow (tr("Delimiter"), _delimiter); // type Quote q; _type = new QComboBox; _type->addItems(q.list()); _type->setCurrentIndex(Quote::_STOCK); form->addRow (tr("Quote Type"), _type); // exchange _exchange = new QLineEdit; form->addRow (tr("Exchange Override"), _exchange); // filename as symbol _filename = new QCheckBox; form->addRow (tr("Use Filename As Symbol"), _filename); // log _log = new QTextEdit; _log->setReadOnly(TRUE); vbox->addWidget(_log); // buttonbox QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Help); vbox->addWidget(bb); // ok button _okButton = bb->addButton(QDialogButtonBox::Ok); _okButton->setText(tr("&OK")); connect(_okButton, SIGNAL(clicked()), this, SLOT(importThread())); // cancel button _cancelButton = bb->addButton(QDialogButtonBox::Cancel); _cancelButton->setText(tr("&Cancel")); _cancelButton->setDefault(TRUE); _cancelButton->setFocus(); _cancelButton->setEnabled(TRUE); // help button QPushButton *b = bb->button(QDialogButtonBox::Help); b->setText(tr("&Help")); connect(b, SIGNAL(clicked()), this, SIGNAL(signalHelp())); }
void GUIWidget::createGUI () { _timer = new QTimer(this); connect(_timer, SIGNAL(timeout()), this, SLOT(updateGUI())); QVBoxLayout *vbox = new QVBoxLayout; vbox->setSpacing(2); vbox->setMargin(5); setLayout(vbox); QFormLayout *form = new QFormLayout; form->setSpacing(2); form->setMargin(0); vbox->addLayout(form); // templates _templates = new QComboBox; form->addRow (tr("Templates"), _templates); // range DateRange dr; _range = new QComboBox; _range->addItems(dr.list()); _range->setCurrentIndex(5); form->addRow (tr("Range"), _range); // symbol file _symbolButton = new FileButton(0); connect(_symbolButton, SIGNAL(signalSelectionChanged(QStringList)), this, SLOT(buttonStatus())); _symbolButton->setFiles(QStringList() << "/tmp/yahoo_symbols"); form->addRow (tr("Symbol File"), _symbolButton); // log QGroupBox *gbox = new QGroupBox; gbox->setTitle(tr("Log")); vbox->addWidget(gbox); QVBoxLayout *tvbox = new QVBoxLayout; gbox->setLayout(tvbox); _log = new QTextEdit; _log->setReadOnly(TRUE); tvbox->addWidget(_log); // buttonbox QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Help); vbox->addWidget(bb); // ok button _okButton = bb->addButton(QDialogButtonBox::Ok); _okButton->setText(tr("&OK")); connect(_okButton, SIGNAL(clicked()), this, SLOT(downloadHistory())); // cancel button _cancelButton = bb->addButton(QDialogButtonBox::Cancel); _cancelButton->setText(tr("&Cancel")); _cancelButton->setDefault(TRUE); _cancelButton->setFocus(); _cancelButton->setEnabled(FALSE); // help button QPushButton *b = bb->button(QDialogButtonBox::Help); b->setText(tr("&Help")); connect(b, SIGNAL(clicked()), this, SIGNAL(signalHelp())); }
TimelineSideBarWidget::TimelineSideBarWidget(QWidget* parent, SearchModel* searchModel, SearchModificationHelper* searchModificationHelper) : SidebarWidget(parent), d(new TimelineSideBarWidgetPriv) { setObjectName("TimeLine Sidebar"); d->searchModificationHelper = searchModificationHelper; d->timer = new QTimer(this); setAttribute(Qt::WA_DeleteOnClose); QVBoxLayout* vlay = new QVBoxLayout(this); QFrame* panel = new QFrame(this); panel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); panel->setLineWidth(1); QGridLayout* grid = new QGridLayout(panel); // --------------------------------------------------------------- QWidget* hbox1 = new QWidget(panel); QHBoxLayout* hlay = new QHBoxLayout(hbox1); QLabel* label1 = new QLabel(i18n("Time Unit:"), hbox1); d->timeUnitCB = new KComboBox(hbox1); d->timeUnitCB->addItem(i18n("Day"), TimeLineWidget::Day); d->timeUnitCB->addItem(i18n("Week"), TimeLineWidget::Week); d->timeUnitCB->addItem(i18n("Month"), TimeLineWidget::Month); d->timeUnitCB->addItem(i18n("Year"), TimeLineWidget::Year); d->timeUnitCB->setCurrentIndex((int)TimeLineWidget::Month); d->timeUnitCB->setFocusPolicy(Qt::NoFocus); d->timeUnitCB->setWhatsThis(i18n("<p>Select the histogram time unit.</p>" "<p>You can change the graph decade to zoom in or zoom out over time.</p>")); QWidget* scaleBox = new QWidget(hbox1); QHBoxLayout* hlay2 = new QHBoxLayout(scaleBox); d->scaleBG = new QButtonGroup(scaleBox); d->scaleBG->setExclusive(true); scaleBox->setWhatsThis( i18n("<p>Select the histogram scale.</p>" "<p>If the date's maximal counts are small, you can use the linear scale.</p>" "<p>Logarithmic scale can be used when the maximal counts are big; " "if it is used, all values (small and large) will be visible on the " "graph.</p>")); QToolButton* linHistoButton = new QToolButton(scaleBox); linHistoButton->setToolTip( i18n( "Linear" ) ); linHistoButton->setIcon(KIcon("view-object-histogram-linear")); linHistoButton->setCheckable(true); d->scaleBG->addButton(linHistoButton, TimeLineWidget::LinScale); QToolButton* logHistoButton = new QToolButton(scaleBox); logHistoButton->setToolTip( i18n( "Logarithmic" ) ); logHistoButton->setIcon(KIcon("view-object-histogram-logarithmic")); logHistoButton->setCheckable(true); d->scaleBG->addButton(logHistoButton, TimeLineWidget::LogScale); hlay2->setMargin(0); hlay2->setSpacing(0); hlay2->addWidget(linHistoButton); hlay2->addWidget(logHistoButton); hlay->setMargin(0); hlay->setSpacing(KDialog::spacingHint()); hlay->addWidget(label1); hlay->addWidget(d->timeUnitCB); hlay->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum)); hlay->addWidget(scaleBox); // --------------------------------------------------------------- d->timeLineWidget = new TimeLineWidget(panel); d->scrollBar = new QScrollBar(panel); d->scrollBar->setOrientation(Qt::Horizontal); d->scrollBar->setMinimum(0); d->scrollBar->setSingleStep(1); d->cursorDateLabel = new KSqueezedTextLabel(0, panel); d->cursorCountLabel = new QLabel(panel); d->cursorCountLabel->setAlignment(Qt::AlignRight); // --------------------------------------------------------------- KHBox* hbox2 = new KHBox(panel); hbox2->setMargin(0); hbox2->setSpacing(KDialog::spacingHint()); d->resetButton = new QToolButton(hbox2); d->resetButton->setIcon(SmallIcon("document-revert")); d->resetButton->setToolTip(i18n("Clear current selection")); d->resetButton->setWhatsThis(i18n("If you press this button, the current date selection on the time-line will be cleared.")); d->nameEdit = new KLineEdit(hbox2); d->nameEdit->setClearButtonShown(true); d->nameEdit->setWhatsThis(i18n("Enter the name of the current dates search to save in the " "\"My Date Searches\" view")); d->saveButton = new QToolButton(hbox2); d->saveButton->setIcon(SmallIcon("document-save")); d->saveButton->setEnabled(false); d->saveButton->setToolTip(i18n("Save current selection to a new virtual Album")); d->saveButton->setWhatsThis(i18n("If you press this button, the dates selected on the time-line will be " "saved to a new search virtual Album using the name set on the left.")); // --------------------------------------------------------------- grid->addWidget(hbox1, 0, 0, 1, 4); grid->addWidget(d->cursorDateLabel, 1, 0, 1, 3); grid->addWidget(d->cursorCountLabel, 1, 3, 1, 1); grid->addWidget(d->timeLineWidget, 2, 0, 1, 4); grid->addWidget(d->scrollBar, 3, 0, 1, 4); grid->addWidget(hbox2, 4, 0, 1, 4); grid->setColumnStretch(2, 10); grid->setMargin(KDialog::spacingHint()); grid->setSpacing(KDialog::spacingHint()); // --------------------------------------------------------------- d->timeLineFolderView = new EditableSearchTreeView(this, searchModel, searchModificationHelper); d->timeLineFolderView->setConfigGroup(getConfigGroup()); d->timeLineFolderView->filteredModel()->listTimelineSearches(); d->timeLineFolderView->filteredModel()->setListTemporarySearches(false); d->timeLineFolderView->setAlbumManagerCurrentAlbum(true); d->searchDateBar = new SearchTextBar(this, "TimeLineViewSearchDateBar"); d->searchDateBar->setModel(d->timeLineFolderView->filteredModel(), AbstractAlbumModel::AlbumIdRole, AbstractAlbumModel::AlbumTitleRole); d->searchDateBar->setFilterModel(d->timeLineFolderView->albumFilterModel()); vlay->addWidget(panel); vlay->addWidget(d->timeLineFolderView); vlay->addItem(new QSpacerItem(KDialog::spacingHint(), KDialog::spacingHint(), QSizePolicy::Minimum, QSizePolicy::Minimum)); vlay->addWidget(d->searchDateBar); vlay->setMargin(0); vlay->setSpacing(0); // --------------------------------------------------------------- connect(AlbumManager::instance(), SIGNAL(signalDatesMapDirty(const QMap<QDateTime, int>&)), d->timeLineWidget, SLOT(slotDatesMap(const QMap<QDateTime, int>&))); connect(d->timeLineFolderView, SIGNAL(currentAlbumChanged(Album*)), this, SLOT(slotAlbumSelected(Album*))); connect(d->timeUnitCB, SIGNAL(activated(int)), this, SLOT(slotTimeUnitChanged(int))); connect(d->scaleBG, SIGNAL(buttonReleased(int)), this, SLOT(slotScaleChanged(int))); connect(d->timeLineWidget, SIGNAL(signalDateMapChanged()), this, SLOT(slotInit())); connect(d->timeLineWidget, SIGNAL(signalCursorPositionChanged()), this, SLOT(slotCursorPositionChanged())); connect(d->timeLineWidget, SIGNAL(signalSelectionChanged()), this, SLOT(slotSelectionChanged())); connect(d->timeLineWidget, SIGNAL(signalRefDateTimeChanged()), this, SLOT(slotRefDateTimeChanged())); connect(d->timer, SIGNAL(timeout()), this, SLOT(slotUpdateCurrentDateSearchAlbum())); connect(d->resetButton, SIGNAL(clicked()), this, SLOT(slotResetSelection())); connect(d->saveButton, SIGNAL(clicked()), this, SLOT(slotSaveSelection())); connect(d->scrollBar, SIGNAL(valueChanged(int)), this, SLOT(slotScrollBarValueChanged(int))); connect(d->nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckAboutSelection())); connect(d->nameEdit, SIGNAL(returnPressed(const QString&)), d->saveButton, SLOT(animateClick())); }