KisMouseInputEditor::KisMouseInputEditor(QWidget *parent) : KPushButton(parent), d(new Private) { QWidget *popup = new QWidget(); d->ui = new Ui::KisMouseInputEditor; d->ui->setupUi(popup); d->ui->mouseButton->setType(KisInputButton::MouseType); d->ui->clearModifiersButton->setIcon(koIcon("edit-clear-locationbar-rtl")); d->ui->clearMouseButton->setIcon(koIcon("edit-clear-locationbar-rtl")); QWidgetAction *action = new QWidgetAction(this); action->setDefaultWidget(popup); QMenu *menu = new QMenu(this); menu->addAction(action); setMenu(menu); QTimer::singleShot(0, this, SLOT(showMenu())); connect(d->ui->mouseButton, SIGNAL(dataChanged()), SLOT(updateLabel())); connect(d->ui->modifiersButton, SIGNAL(dataChanged()), SLOT(updateLabel())); connect(d->ui->clearMouseButton, SIGNAL(clicked(bool)), d->ui->mouseButton, SLOT(clear())); connect(d->ui->clearModifiersButton, SIGNAL(clicked(bool)), d->ui->modifiersButton, SLOT(clear())); }
KoPAConfigureDialog::KoPAConfigureDialog(KoPAView* parent) : KPageDialog(parent) { setFaceType(List); setWindowTitle(i18n("Configure")); setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults); button(QDialogButtonBox::Ok)->setDefault(true); m_miscPage = new KoConfigMiscPage( parent->koDocument(), parent->kopaCanvas()->shapeController()->resourceManager() ); KPageWidgetItem *item = addPage( m_miscPage, i18n( "Misc" ) ); item->setHeader( i18n( "Misc" ) ); item->setIcon(koIcon("preferences-other")); m_gridPage = new KoConfigGridPage(parent->koDocument()); item = addPage(m_gridPage, i18n("Grid")); item->setHeader(i18n("Grid")); item->setIcon(koIcon("grid")); connect(m_miscPage, SIGNAL(unitChanged(KoUnit)), m_gridPage, SLOT(slotUnitChanged(KoUnit))); m_docPage = new KoConfigDocumentPage( parent->koDocument() ); item = addPage( m_docPage, i18nc( "@title:tab Document settings page", "Document" ) ); item->setHeader( i18n( "Document Settings" ) ); item->setIcon(koIcon("document-properties")); m_authorPage = new KoConfigAuthorPage(); item = addPage(m_authorPage, i18nc("@title:tab Author page", "Author")); item->setHeader(i18n("Author")); item->setIcon(koIcon("user-identity")); connect( this, SIGNAL(accepted()), this, SLOT(slotApply()) ); connect( button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), this, SLOT(slotDefault())); connect( button(QDialogButtonBox::Apply), SIGNAL(clicked(bool)), this, SLOT(slotApply()) ); connect(this, SIGNAL(changed()), parent, SLOT(slotUpdateAuthorProfileActions())); }
void ImageItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { Q_UNUSED(option); Q_UNUSED(widget); if(m_loader->isImageLoaded(this)) { QImage image = m_loader->getImage(this); if(!image.isNull()) { QPointF offset((m_size-image.width()) / 2.0, (m_size-image.height()) / 2.0); painter->drawImage(offset, image); } else { QIcon icon = koIcon("image-missing"); QRect rect = boundingRect().toRect(); QPixmap img = icon.pixmap(rect.size()); painter->drawPixmap(rect, img, img.rect()); } } else { QIcon icon = koIcon("image-loading"); QRect rect = boundingRect().toRect(); QPixmap img = icon.pixmap(rect.size()); painter->drawPixmap(rect, img, img.rect()); } if(isSelected()) { QPen pen(palette().color(QPalette::Active, QPalette::Highlight), 3); painter->setPen(pen); } painter->drawRect(boundingRect()); }
KexiTemplateSelectionPage::KexiTemplateSelectionPage(QWidget* parent) : KexiAssistantPage(i18n("New Project"), i18n("Kexi will create a new database project. Select blank database or template."), parent) { m_templatesList = new KexiCategorizedView; setFocusWidget(m_templatesList); m_templatesList->setFrameShape(QFrame::NoFrame); m_templatesList->setContentsMargins(0, 0, 0, 0); int margin = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, 0) + KDialog::marginHint(); //m_templatesList->setCategorySpacing(5 + margin); //not needed in grid: m_templatesList->setSpacing(margin); m_templatesList->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); connect(m_templatesList, SIGNAL(clicked(QModelIndex)), this, SLOT(slotItemClicked(QModelIndex))); KexiTemplateCategoryInfoList templateCategories; KexiTemplateCategoryInfo templateCategory; templateCategory.name = "blank"; templateCategory.caption = i18n("Blank Projects"); KexiTemplateInfo info; info.name = "blank"; info.caption = i18n("Blank database"); info.description = i18n("Database project without any objects"); info.icon = KIcon(KexiDB::defaultFileBasedDriverIconName()); //"x-office-document"); templateCategory.addTemplate(info); templateCategories.append(templateCategory); #ifdef KEXI_SHOW_UNIMPLEMENTED templateCategory = KexiTemplateCategoryInfo(); templateCategory.name = "office"; templateCategory.caption = i18n("Office Templates"); info = KexiTemplateInfo(); info.name = "contacts"; info.caption = i18n("Contacts"); info.description = i18n("Database for collecting and managing contacts"); info.icon = koIcon("view-pim-contacts"); templateCategory.addTemplate(info); info = KexiTemplateInfo(); info.name = "movie"; info.caption = i18n("Movie catalog"); info.description = i18n("Database for collecting movies"); info.icon = koIcon("video-x-generic"); templateCategory.addTemplate(info); templateCategories.append(templateCategory); #endif // KEXI_SHOW_UNIMPLEMENTED KexiTemplatesProxyModel* proxyModel = new KexiTemplatesProxyModel(m_templatesList); KexiTemplatesModel* model = new KexiTemplatesModel(templateCategories); proxyModel->setSourceModel(model); m_templatesList->setModel(proxyModel); kDebug() << "templatesCategoryDrawer:" << m_templatesList->categoryDrawer(); setContents(m_templatesList); }
KWConfigureDialog::KWConfigureDialog(KWView* parent) : KPageDialog(parent) { setFaceType(List); setCaption(i18n("Configure")); setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel | KDialog::Default); setDefaultButton(KDialog::Ok); m_miscPage = new KoConfigMiscPage(parent->koDocument(), parent->canvasBase()->shapeController()->resourceManager()); KPageWidgetItem *item = addPage(m_miscPage, i18n("Misc")); item->setHeader(i18n("Misc")); item->setIcon(koIcon("preferences-other")); m_gridPage = new KoConfigGridPage(parent->koDocument()); item = addPage(m_gridPage, i18n("Grid")); item->setHeader(i18n("Grid")); item->setIcon(koIcon("grid")); connect(m_miscPage, SIGNAL(unitChanged(KoUnit)), m_gridPage, SLOT(slotUnitChanged(KoUnit))); m_docPage = new KoConfigDocumentPage(parent->koDocument()); item = addPage(m_docPage, i18nc("@title:tab Document settings page", "Document")); item->setHeader(i18n("Document Settings")); item->setIcon(koIcon("document-properties")); m_authorPage = new KoConfigAuthorPage(); item = addPage(m_authorPage, i18nc("@title:tab Author page", "Author")); item->setHeader(i18n("Author")); item->setIcon(koIcon("user-identity")); connect(this, SIGNAL(okClicked()), this, SLOT(slotApply())); connect(this, SIGNAL(defaultClicked()), this, SLOT(slotDefault())); connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()) ); connect(this, SIGNAL(changed()), parent, SLOT(slotUpdateAuthorProfileActions())); }
//-------------------------------------------- IntervalEditImpl::IntervalEditImpl(QWidget *parent) : IntervalEditBase(parent) { intervalList->setColumnCount( 2 ); QStringList lst; lst << i18nc( "Interval start time", "Start" ) << i18nc( "Interval length", "Length" ); intervalList->setHeaderLabels( lst ); intervalList->setRootIsDecorated( false ); intervalList->setSortingEnabled( true ); intervalList->sortByColumn( 0, Qt::AscendingOrder ); bAddInterval->setIcon(koIcon("list-add")); bRemoveInterval->setIcon(koIcon("list-remove")); bClear->setIcon(koIcon("edit-clear-list")); connect(bClear, SIGNAL(clicked()), SLOT(slotClearClicked())); connect(bAddInterval, SIGNAL(clicked()), SLOT(slotAddIntervalClicked())); connect(bRemoveInterval, SIGNAL(clicked()), SLOT(slotRemoveIntervalClicked())); connect(intervalList, SIGNAL(itemSelectionChanged()), SLOT(slotIntervalSelectionChanged())); connect( startTime, SIGNAL(timeChanged(QTime)), SLOT(enableButtons()) ); connect( length, SIGNAL(valueChanged(double)), SLOT(enableButtons()) ); }
Private(KoToolDocker *dock) : q(dock) , tabbed(false) , tabIcon(koIcon("tab-new")) , unTabIcon(koIcon("tab-close")) { }
void PixmapCollectionEditor::displayMenu(Q3IconViewItem *it, const QPoint &p) { if (!it) return; KMenu *menu = new KMenu(); menu->insertItem(koIcon("edit-rename"), i18n("Rename Item"), this, SLOT(renameItem())); menu->insertItem(koIcon("list-remove"), i18n("Remove Item"), this, SLOT(removeItem())); menu->exec(p); }
/// Pixmap Collection Editor Dialog PixmapCollectionEditor::PixmapCollectionEditor(PixmapCollection *collection, QWidget *parent) : KDialog(parent, "pixcollection_dialog", true, i18n("Edit Pixmap Collection: %1", collection->collectionName()), Close, Close, false) { m_collection = collection; QFrame *frame = makeMainWidget(); QHBoxLayout *l = new QHBoxLayout(frame); setInitialSize(QSize(400, 200), true); //// Setup the icon toolbar ///////////////// QVBoxLayout *vlayout = new QVBoxLayout(l); QToolButton *newItemPath = new QToolButton(frame); newItemPath->setIconSet(koIcon("document-open")); newItemPath->setTextLabel(i18n("&Add File"), true); vlayout->addWidget(newItemPath); m_buttons.insert(BNewItemPath, newItemPath); connect(newItemPath, SIGNAL(clicked()), this, SLOT(newItemByPath())); QToolButton *newItemName = new QToolButton(frame); newItemName->setIconSet(koIcon("list-add")); newItemName->setTextLabel(i18n("&Add an Icon"), true); vlayout->addWidget(newItemName); m_buttons.insert(BNewItemName, newItemName); connect(newItemName, SIGNAL(clicked()), this, SLOT(newItemByName())); QToolButton *delItem = new QToolButton(frame); delItem->setIconSet(koIcon("list-remove")); delItem->setTextLabel(i18n("&Remove Selected Item"), true); vlayout->addWidget(delItem); m_buttons.insert(BDelItem, delItem); connect(delItem, SIGNAL(clicked()), this, SLOT(removeItem())); vlayout->addStretch(); // Setup the iconView m_iconView = new K3IconView(frame, "pixcollection_iconView"); m_iconView->resize(100, 100); m_iconView->setArrangement(Q3IconView::LeftToRight); m_iconView->setAutoArrange(true); m_iconView->setMode(K3IconView::Select); l->addWidget(m_iconView); connect(m_iconView, SIGNAL(contextMenuRequested(Q3IconViewItem*,QPoint)), this, SLOT(displayMenu(Q3IconViewItem*,QPoint))); connect(m_iconView, SIGNAL(itemRenamed(Q3IconViewItem*,QString)), this, SLOT(renameCollectionItem(Q3IconViewItem*,QString))); PixmapMap::ConstIterator it; PixmapMap::ConstIterator endIt = collection->m_pixmaps.end(); for (it = collection->m_pixmaps.constBegin(); it != endIt; ++it) createIconViewItem(it.key()); }
KisProgressWidget::KisProgressWidget(QWidget* parent) : QWidget(parent) { QHBoxLayout* layout = new QHBoxLayout(this); m_cancelButton = new EscapeButton(this); m_cancelButton->setIcon(koIcon("process-stop")); QSizePolicy sizePolicy = m_cancelButton->sizePolicy(); sizePolicy.setVerticalPolicy(QSizePolicy::Ignored); m_cancelButton->setSizePolicy(sizePolicy); connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(cancel())); m_progressBar = new KoProgressBar(this); connect(m_progressBar, SIGNAL(valueChanged(int)), SLOT(correctVisibility(int))); layout->addWidget(m_progressBar); layout->addWidget(m_cancelButton); layout->setContentsMargins(0, 0, 0, 0); m_progressBar->setVisible(false); m_cancelButton->setVisible(false); setMaximumWidth(225); setMinimumWidth(225); }
KexiDBDriverComboBox::KexiDBDriverComboBox(QWidget* parent, const KexiDB::Driver::InfoHash& driversInfo, Options options) : KComboBox(parent) , d(new Private) { //retrieve list of drivers and sort it: file-based first, then server-based QStringList captionsForFileBasedDrivers, captionsForServerBasedDrivers; QHash<QString, QString> fileBasedDriversDict, serverBasedDriversDict; //a map from caption to name foreach(const KexiDB::Driver::Info& info, driversInfo) { if (info.fileBased) { captionsForFileBasedDrivers += info.caption; fileBasedDriversDict[info.caption] = info.name.toLower(); } else { captionsForServerBasedDrivers += info.caption; serverBasedDriversDict[info.caption] = info.name.toLower(); } } captionsForFileBasedDrivers.sort(); captionsForServerBasedDrivers.sort(); //insert file-based if (options & ShowFileDrivers) { foreach(const QString &caption, captionsForFileBasedDrivers) { const KexiDB::Driver::Info& info = driversInfo[ fileBasedDriversDict[ caption ] ]; //! @todo change this if better icon is available addItem(koIcon("application-x-executable"), info.caption); d->drivers.insert(info.caption, info.name.toLower()); } }
KisCompositeOpOption::KisCompositeOpOption(bool createConfigWidget): KisPaintOpOption(i18n("Blending Mode"), KisPaintOpOption::brushCategory(), true), m_createConfigWidget(createConfigWidget) { m_checkable = false; m_prevCompositeOpID = KoCompositeOpRegistry::instance().getDefaultCompositeOp().id(); m_currCompositeOpID = m_prevCompositeOpID; if(createConfigWidget) { QWidget* widget = new QWidget(); Ui_wdgCompositeOpOption ui; ui.setupUi(widget); ui.bnEraser->setIcon(koIcon("draw-eraser")); m_label = ui.lbChoosenMode; m_list = ui.list; m_bnEraser = ui.bnEraser; setConfigurationPage(widget); connect(ui.list , SIGNAL(activated(const QModelIndex&)), this, SLOT(slotCompositeOpChanged(const QModelIndex&))); connect(ui.bnEraser, SIGNAL(toggled(bool)) , this, SLOT(slotEraserToggled(bool))); } }
KoZoomAction::KoZoomAction( KoZoomMode::Modes zoomModes, const QString& text, QObject *parent) : QSelectAction(text, parent) ,d(new Private) { d->zoomModes = zoomModes; d->slider = 0; d->input = 0; d->specialButtons = 0; setIcon(koIcon("zoom-original")); setEditable( true ); setMaxComboViewCount( 15 ); d->sliderLookup[0] = KoZoomMode::minimumZoom(); d->sliderLookup[32] = KoZoomMode::maximumZoom(); int steps = 32; int halfSteps = steps / 2; qreal zoomStep = pow(1.0 / KoZoomMode::minimumZoom(), 1.0/halfSteps); for(int i = 1; i < steps; ++i) { d->sliderLookup[i] = pow(zoomStep, i - halfSteps); } d->effectiveZoom = 1.0; regenerateItems(d->effectiveZoom, true); connect( this, SIGNAL( triggered( const QString& ) ), SLOT( triggered( const QString& ) ) ); }
LanguageTab::LanguageTab(/*KSpell2::Loader::Ptr loader,*/bool uniqueFormat, QWidget* parent, Qt::WFlags fl) : QWidget(parent), m_uniqueFormat(uniqueFormat) { widget.setupUi(this); Q_UNUSED(fl); widget.languageListSearchLine->setListWidget(widget.languageList); //TODO use fl const QStringList langNames = KoGlobal::listOfLanguages(); const QStringList langTags = KoGlobal::listOfLanguageTags(); QSet<QString> spellCheckLanguages; widget.languageList->addItem(QString("None")); #if 0 //Port it if (loader) spellCheckLanguages = QSet<QString>::fromList(loader->languages()); #endif QStringList::ConstIterator itName = langNames.begin(); QStringList::ConstIterator itTag = langTags.begin(); for (; itName != langNames.end() && itTag != langTags.end(); ++itName, ++itTag) { if (spellCheckLanguages.contains(*itTag)) { QListWidgetItem* item = new QListWidgetItem(); item->setText(*itName); item->setIcon(koIcon("tools-check-spelling")); widget.languageList->addItem(item); } else widget.languageList->addItem(*itName); } connect(widget.languageList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SIGNAL(languageChanged())); }
KoTagFilterWidget::KoTagFilterWidget(QWidget* parent): QWidget(parent) ,d( new Private()) { d->tagSearchBarTooltip_saving_disabled = i18nc ( "@info:tooltip", "<qt>Entering search terms here will add to, or remove resources from the current tag view." "<para>To filter based on the partial, case insensitive name of a resource:<br>" "<icode>partialname</icode> or <icode>!partialname</icode>.</para>" "<para>In-/exclusion of other tag sets:<br>" "<icode>[Tagname]</icode> or <icode>![Tagname]</icode>.</para>" "<para>Case sensitive and full name matching in-/exclusion:<br>" "<icode>\"ExactMatch\"</icode> or <icode>!\"ExactMatch\"</icode>.</para>" "Filter results cannot be saved for the <interface>All Presets</interface> view.<br>" "In this view, pressing <interface>Enter</interface> or clearing the filter box will restore all items.<br>" "Create and/or switch to a different tag if you want to save filtered resources into named sets.</qt>" ); d->tagSearchBarTooltip_saving_enabled = i18nc ( "@info:tooltip", "<qt>Entering search terms here will add to, or remove resources from the current tag view." "<para>To filter based on the partial, case insensitive name of a resource:<br>" "<icode>partialname</icode> or <icode>!partialname</icode>.</para>" "<para>In-/exclusion of other tag sets:<br>" "<icode>[Tagname]</icode> or <icode>![Tagname]</icode>.</para>" "<para>Case sensitive and full name matching in-/exclusion:<br>" "<icode>\"ExactMatch\"</icode> or <icode>!\"ExactMatch\"</icode>.</para>" "Pressing <interface>Enter</interface> or clicking the <interface>Save</interface> button will save the changes.</qt>" ); QGridLayout* filterBarLayout = new QGridLayout; d->tagSearchLineEdit = new KLineEdit(this); d->tagSearchLineEdit->setClearButtonEnabled(true); d->tagSearchLineEdit->setPlaceholderText(i18n("Enter resource filters here")); d->tagSearchLineEdit->setToolTip(d->tagSearchBarTooltip_saving_disabled); d->tagSearchLineEdit->setEnabled(true); filterBarLayout->setSpacing(0); filterBarLayout->setMargin(0); filterBarLayout->setColumnStretch(0, 1); filterBarLayout->addWidget(d->tagSearchLineEdit, 0, 0); d->tagSearchSaveButton = new QPushButton(this); d->tagSearchSaveButton->setIcon(koIcon("media-floppy")); d->tagSearchSaveButton->setToolTip(i18nc("@info:tooltip", "<qt>Save the currently filtered set as the new members of the current tag.</qt>")); d->tagSearchSaveButton->setEnabled(false); filterBarLayout->addWidget(d->tagSearchSaveButton, 0, 1); connect(d->tagSearchSaveButton, SIGNAL(pressed()), this, SLOT(onSaveButtonClicked())); connect(d->tagSearchLineEdit, SIGNAL(returnPressed()), this, SLOT(onSaveButtonClicked())); connect(d->tagSearchLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString))); allowSave(false); this->setLayout(filterBarLayout); }
KisPaintOpPresetsChooserPopup::KisPaintOpPresetsChooserPopup(QWidget * parent) : QWidget(parent) , m_d(new Private()) { m_d->uiWdgPaintOpPresets.setupUi(this); KMenu* menu = new KMenu(this); QActionGroup *actionGroup = new QActionGroup(this); KisPresetChooser::ViewMode mode = (KisPresetChooser::ViewMode)KisConfig().presetChooserViewMode(); bool showAll = KisConfig().presetShowAllMode(); QAction* action = menu->addAction(koIcon("view-preview"), i18n("Thumbnails"), this, SLOT(slotThumbnailMode())); action->setCheckable(true); action->setChecked(mode == KisPresetChooser::THUMBNAIL); action->setActionGroup(actionGroup); action = menu->addAction(koIcon("view-list-details"), i18n("Details"), this, SLOT(slotDetailMode())); action->setCheckable(true); action->setChecked(mode == KisPresetChooser::DETAIL); action->setActionGroup(actionGroup); m_d->uiWdgPaintOpPresets.viewModeButton->setIcon(koIcon("view-choose")); m_d->uiWdgPaintOpPresets.viewModeButton->setMenu(menu); m_d->uiWdgPaintOpPresets.viewModeButton->setPopupMode(QToolButton::InstantPopup); m_d->uiWdgPaintOpPresets.wdgPresetChooser->setViewMode(mode); m_d->uiWdgPaintOpPresets.wdgPresetChooser->showTaggingBar(false,true); connect(m_d->uiWdgPaintOpPresets.wdgPresetChooser, SIGNAL(resourceSelected(KoResource*)), this, SIGNAL(resourceSelected(KoResource*))); connect(m_d->uiWdgPaintOpPresets.searchBar, SIGNAL(textChanged(QString)), m_d->uiWdgPaintOpPresets.wdgPresetChooser, SLOT(searchTextChanged(QString))); connect(m_d->uiWdgPaintOpPresets.searchBar, SIGNAL(textChanged(QString)), this, SLOT(setLineEditCompleter(QString))); connect(m_d->uiWdgPaintOpPresets.searchBar, SIGNAL(returnPressed(QString)), this, SLOT(returnKeyPressed(QString))); connect(m_d->uiWdgPaintOpPresets.showAllCheckBox, SIGNAL(toggled(bool)), m_d->uiWdgPaintOpPresets.wdgPresetChooser, SLOT(setShowAll(bool))); m_d->firstShown = true; m_d->uiWdgPaintOpPresets.showAllCheckBox->setChecked(showAll); }
/* * Constructs a SectionEditor as a child of 'parent'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ SectionEditor::SectionEditor(QWidget* parent) : KDialog(parent) { setButtons(Close); setCaption(i18n("Section Editor")); QWidget *widget = new QWidget(this); m_ui.setupUi(widget); m_btnAdd = new KPushButton(koIcon("list-add"), i18n("Add..."), this); m_ui.lGroupSectionsButtons->addWidget(m_btnAdd); m_btnEdit = new KPushButton(koIcon("document-edit"), i18n("Edit..."), this); m_ui.lGroupSectionsButtons->addWidget(m_btnEdit); m_btnRemove = new KPushButton(koIcon("list-remove"), i18n("Delete"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnRemove); m_btnMoveUp = new KPushButton(koIcon("arrow-up"), i18n("Move Up"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnMoveUp); m_btnMoveDown = new KPushButton(koIcon("arrow-down"), i18n("Move Down"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnMoveDown); m_ui.lGroupSectionsButtons->addStretch(); setMainWidget(widget); // signals and slots connections connect(m_ui.cbReportHeader, SIGNAL(toggled(bool)), this, SLOT(cbReportHeader_toggled(bool))); connect(m_ui.cbReportFooter, SIGNAL(toggled(bool)), this, SLOT(cbReportFooter_toggled(bool))); connect(m_ui.cbHeadFirst, SIGNAL(toggled(bool)), this, SLOT(cbHeadFirst_toggled(bool))); connect(m_ui.cbHeadLast, SIGNAL(toggled(bool)), this, SLOT(cbHeadLast_toggled(bool))); connect(m_ui.cbHeadEven, SIGNAL(toggled(bool)), this, SLOT(cbHeadEven_toggled(bool))); connect(m_ui.cbHeadOdd, SIGNAL(toggled(bool)), this, SLOT(cbHeadOdd_toggled(bool))); connect(m_ui.cbFootFirst, SIGNAL(toggled(bool)), this, SLOT(cbFootFirst_toggled(bool))); connect(m_ui.cbFootLast, SIGNAL(toggled(bool)), this, SLOT(cbFootLast_toggled(bool))); connect(m_ui.cbFootEven, SIGNAL(toggled(bool)), this, SLOT(cbFootEven_toggled(bool))); connect(m_ui.cbFootOdd, SIGNAL(toggled(bool)), this, SLOT(cbFootOdd_toggled(bool))); connect(m_ui.cbHeadAny, SIGNAL(toggled(bool)), this, SLOT(cbHeadAny_toggled(bool))); connect(m_ui.cbFootAny, SIGNAL(toggled(bool)), this, SLOT(cbFootAny_toggled(bool))); connect(m_ui.lbGroups, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateButtonsForItem(QListWidgetItem*))); connect(m_ui.lbGroups, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonsForRow(int))); connect(m_btnAdd, SIGNAL(clicked(bool)), this, SLOT(btnAdd_clicked())); connect(m_btnEdit, SIGNAL(clicked(bool)), this, SLOT(btnEdit_clicked())); connect(m_btnRemove, SIGNAL(clicked(bool)), this, SLOT(btnRemove_clicked())); connect(m_btnMoveUp, SIGNAL(clicked(bool)), this, SLOT(btnMoveUp_clicked())); connect(m_btnMoveDown, SIGNAL(clicked(bool)), this, SLOT(brnMoveDown_clicked())); }
SimpleFootEndNotesWidget::SimpleFootEndNotesWidget(TextTool *tool ,QWidget *parent) : QWidget(parent) { widget.setupUi(this); widget.addFootnote->addAction(tool->action("insert_autofootnote")); widget.addFootnote->addAction(tool->action("insert_labeledfootnote")); widget.addFootnote->addAction(tool->action("format_footnotes")); widget.addFootnote->setIcon(koIcon("insert-footnote")); widget.addFootnote->setToolTip(i18n("Inserts a footnote at the current cursor position")); widget.addEndnote->addAction(tool->action("insert_autoendnote")); widget.addEndnote->addAction(tool->action("insert_labeledendnote")); widget.addEndnote->addAction(tool->action("format_endnotes")); widget.addEndnote->setIcon(koIcon("insert-endnote")); widget.addEndnote->setToolTip(i18n("Inserts an endnote at the current cursor position")); connect(widget.addFootnote, SIGNAL(doneWithFocus()), this, SIGNAL(doneWithFocus())); connect(widget.addEndnote, SIGNAL(doneWithFocus()), this, SIGNAL(doneWithFocus())); }
AddTabAction::AddTabAction(KFormDesigner::Container *container, TabWidgetBase *receiver, QObject *parent) : QAction(koIcon("tab-new"), xi18nc("Add page to tab widget", "Add Page"), parent) , m_container(container) , m_receiver(receiver) { connect(this, SIGNAL(triggered()), this, SLOT(slotTriggered())); }
RenameTabAction::RenameTabAction(KFormDesigner::Container *container, TabWidgetBase *receiver, QObject *parent) : QAction(koIcon("edit-rename"), xi18nc("Rename tab widget's page", "Rename Page..."), parent) , m_container(container) , m_receiver(receiver) { connect(this, SIGNAL(triggered()), this, SLOT(slotTriggered())); }
AddStackPageAction::AddStackPageAction(KFormDesigner::Container *container, QWidget *receiver, QObject *parent) : QAction(koIcon("tab-new"), xi18nc("Add page to a stacked widget", "Add Page..."), parent) , m_container(container) , m_receiver(receiver) { connect(this, SIGNAL(triggered()), this, SLOT(slotTriggered())); }
KexiDBConnectionWidget::KexiDBConnectionWidget(QWidget* parent) : QWidget(parent) , d(new Private) { setupUi(this); setObjectName("KexiConnectionSelectorWidget"); iconLabel->setPixmap(DesktopIcon(KEXI_DATABASE_SERVER_ICON_NAME)); QVBoxLayout *driversComboLyr = new QVBoxLayout(frmEngine); d->driversCombo = new KexiDBDriverComboBox(frmEngine, Kexi::driverManager().driversInfo(), KexiDBDriverComboBox::ShowServerDrivers); driversComboLyr->addWidget(d->driversCombo); frmEngine->setFocusProxy(d->driversCombo); lblEngine->setBuddy(d->driversCombo); QWidget::setTabOrder(lblEngine, d->driversCombo); #ifdef NO_LOAD_DB_LIST btnLoadDBList->hide(); #endif btnLoadDBList->setIcon(koIcon("view-refresh")); btnLoadDBList->setToolTip(i18n("Load database list from the server")); btnLoadDBList->setWhatsThis( i18n("Loads database list from the server, so you can select one using the \"Name\" combo box.")); QHBoxLayout *hbox = new QHBoxLayout(frmBottom); hbox->addStretch(2); d->btnSaveChanges = new KPushButton( KGuiItem( i18n("Save Changes"), "document-save", i18n("Save all changes made to this connection information"), i18n("Save all changes made to this connection information. " "You can later reuse this information.")), frmBottom); d->btnSaveChanges->setObjectName("savechanges"); hbox->addWidget(d->btnSaveChanges); hbox->addSpacing(KDialog::spacingHint()); QWidget::setTabOrder(titleEdit, d->btnSaveChanges); d->btnSaveChanges->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); d->btnTestConnection = new KPushButton( // @todo add Test Connection icon KGuiItem(i18n("&Test Connection"), QString(), i18n("Test database connection"), i18n("Tests database connection. " "You can ensure that valid connection information is provided.")), frmBottom); d->btnTestConnection->setObjectName("testConnection"); hbox->addWidget(d->btnTestConnection); setTabOrder(d->btnSaveChanges, d->btnTestConnection); d->btnTestConnection->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); connect(locationBGrp, SIGNAL(clicked(int)), this, SLOT(slotLocationBGrpClicked(int))); connect(chkPortDefault, SIGNAL(toggled(bool)), this , SLOT(slotCBToggled(bool))); connect(btnLoadDBList, SIGNAL(clicked()), this, SIGNAL(loadDBList())); connect(d->btnSaveChanges, SIGNAL(clicked()), this, SIGNAL(saveChanges())); }
RefinePathPlugin::RefinePathPlugin(QObject *parent, const QVariantList &) : QObject(parent) { setXMLFile(KStandardDirs::locate("data", "karbon/plugins/RefinePathPlugin.rc"), true); QAction *actionRefinePath = new QAction(koIcon("effect_refine"), i18n("&Refine Path..."), this); actionCollection()->addAction("path_refine", actionRefinePath); connect(actionRefinePath, SIGNAL(triggered()), this, SLOT(slotRefinePath())); m_RefinePathDlg = new RefinePathDlg(qobject_cast<QWidget*>(parent)); }
void KexiFormPart::setupCustomPropertyPanelTabs(QTabWidget *tab) { if (!d->dataSourcePage) { d->dataSourcePage = new KexiDataSourcePage(0); d->dataSourcePage->setObjectName("dataSourcePage"); connect(d->dataSourcePage, SIGNAL(jumpToObjectRequested(QString,QString)), KexiMainWindowIface::global()->thisWidget(), SLOT(highlightObject(QString,QString))); connect(d->dataSourcePage, SIGNAL(formDataSourceChanged(QString,QString)), KexiFormManager::self(), SLOT(setFormDataSource(QString,QString))); connect(d->dataSourcePage, SIGNAL(dataSourceFieldOrExpressionChanged(QString,QString,KDbField::Type)), KexiFormManager::self(), SLOT(setDataSourceFieldOrExpression(QString,QString,KDbField::Type))); #ifdef KEXI_AUTOFIELD_FORM_WIDGET_SUPPORT connect(d->dataSourcePage, SIGNAL(insertAutoFields(QString,QString,QStringList)), KexiFormManager::self(), SLOT(insertAutoFields(QString,QString,QStringList))); #endif } KexiProject *prj = KexiMainWindowIface::global()->project(); d->dataSourcePage->setProject(prj); tab->addTab(d->dataSourcePage, koIcon("server-database"), QString()); tab->setTabToolTip(tab->indexOf(d->dataSourcePage), xi18n("Data Source")); if (!d->widgetTreeWidget) { d->widgetTreeWidget = new QWidget; QVBoxLayout *lyr = new QVBoxLayout(d->widgetTreeWidget); lyr->setContentsMargins(2, 2, 2, 2); d->widgetTree = new KFormDesigner::WidgetTreeWidget; d->widgetTree->setObjectName("KexiFormPart:WidgetTreeWidget"); lyr->addWidget(d->widgetTree); } tab->addTab(d->widgetTreeWidget, koIcon("widgets"), QString()); tab->setTabToolTip(tab->indexOf(d->widgetTreeWidget), xi18n("Widgets")); }
RoundCornersPlugin::RoundCornersPlugin(QObject * parent, const QVariantList &) { setXMLFile(KStandardDirs::locate("data", "karbon/plugins/RoundCornersPlugin.rc")); QAction *actionRoundCorners = new QAction(koIcon("effect_roundcorners"), i18n("&Round Corners..."), this); actionCollection()->addAction("path_round_corners", actionRoundCorners); connect(actionRoundCorners, SIGNAL(triggered()), this, SLOT(slotRoundCorners())); m_roundCornersDlg = new RoundCornersDlg(qobject_cast<QWidget*>(parent)); m_roundCornersDlg->setRadius(10.0); }
KoReportCheckPlugin::KoReportCheckPlugin(QObject *parent, const QVariantList &args) : KoReportPluginInterface(parent) { Q_UNUSED(args) KoReportPluginInfo *info = new KoReportPluginInfo(); info->setClassName("report:check"); info->setIcon(koIcon("checkbox")); info->setName(i18n("Check")); info->setPriority(5); setInfo(info); }
NewTagAction::NewTagAction(KoResource* resource, QMenu* parent) :KoLineEditAction (parent) { m_resource = resource; setIcon(koIcon("document-new")); setPlaceholderText(i18n("New tag")); closeParentOnTrigger(true); connect (this, SIGNAL(triggered(QString)), this, SLOT(onTriggered(QString))); }
FlattenPathPlugin::FlattenPathPlugin(QObject *parent, const QVariantList &) { setXMLFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "karbon/plugins/FlattenPathPlugin.rc"), true); QAction *actionFlattenPath = new QAction(koIcon("effect_flatten"), i18n("&Flatten Path..."), this); actionCollection()->addAction("path_flatten", actionFlattenPath); connect(actionFlattenPath, SIGNAL(triggered()), this, SLOT(slotFlattenPath())); m_flattenPathDlg = new FlattenDlg(qobject_cast<QWidget *>(parent)); m_flattenPathDlg->setFlatness(10.0); }
KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo) : KPageDialog(parent) , d(new KoDocumentInfoDlgPrivate) { d->info = docInfo; setWindowTitle(i18n("Document Information")); // setInitialSize(QSize(500, 500)); setFaceType(KPageDialog::List); setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); button(QDialogButtonBox::Ok)->setDefault(true); d->aboutUi = new Ui::KoDocumentInfoAboutWidget(); QWidget *infodlg = new QWidget(); d->aboutUi->setupUi(infodlg); d->aboutUi->cbLanguage->addItems(KoGlobal::listOfLanguages()); d->aboutUi->cbLanguage->setCurrentIndex(-1); KPageWidgetItem *page = new KPageWidgetItem(infodlg, i18n("General")); page->setHeader(i18n("General")); // Ugly hack, the mimetype should be a parameter, instead KoDocumentBase* doc = dynamic_cast< KoDocumentBase* >(d->info->parent()); if (doc) { QMimeDatabase db; QMimeType mime = db.mimeTypeForName(doc->mimeType()); if (mime.isValid()) { page->setIcon(KisIconUtils::loadIcon(mime.iconName())); } } else { // hide all entries not used in pages for KoDocumentInfoPropsPage d->aboutUi->filePathInfoLabel->setVisible(false); d->aboutUi->filePathLabel->setVisible(false); d->aboutUi->filePathSeparatorLine->setVisible(false); d->aboutUi->lblTypeDesc->setVisible(false); d->aboutUi->lblType->setVisible(false); } addPage(page); d->pages.append(page); initAboutTab(); d->authorUi = new Ui::KoDocumentInfoAuthorWidget(); QWidget *authordlg = new QWidget(); d->authorUi->setupUi(authordlg); page = new KPageWidgetItem(authordlg, i18n("Author")); page->setHeader(i18n("Last saved by")); page->setIcon(koIcon("user-identity")); addPage(page); d->pages.append(page); initAuthorTab(); }
//And now for the button itself QuickTableButton::QuickTableButton(QWidget *parent) : QToolButton(parent) { setToolTip(i18n("Insert a table")); setToolButtonStyle(Qt::ToolButtonIconOnly); setIcon(koIcon("insert-table")); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_menu = new QMenu(this); setMenu(m_menu); setPopupMode(InstantPopup); }