diff options
| author | Philippe Mavridis <philippe.mavridis@yandex.com> | 2025-11-22 14:13:01 +0200 |
|---|---|---|
| committer | Philippe Mavridis <philippe.mavridis@yandex.com> | 2026-01-02 11:34:45 +0200 |
| commit | 59e49db8870a64a2eca80e6271c1aac1553761b3 (patch) | |
| tree | d0dabaf534cfe54a5aad38f876e981c536220538 /kcontrol/ebrowsing/plugins/ikws/searchproviderdlg.cpp | |
| parent | be5a0967f061e5c8f197fc95b090dbf52b05feed (diff) | |
| download | tdebase-feat/searchproviders-update-2025.tar.gz tdebase-feat/searchproviders-update-2025.zip | |
Web Shortcuts: add support for groupsfeat/searchproviders-update-2025
The web shortcuts can now be displayed in groups based on their
category (Web, Images, Development, etc.). The user can modify
the category of an item by picking one of the built-in categories
or creating custom groups by providing a different category name.
When the category groups are hidden, the user can still see
the categories appear in a third column in the list view.
This commit also updates the search engines enabled by default to
some sensible defaults and makes the minimum size of the dialog
smaller.
Signed-off-by: Philippe Mavridis <philippe.mavridis@yandex.com>
Diffstat (limited to 'kcontrol/ebrowsing/plugins/ikws/searchproviderdlg.cpp')
| -rw-r--r-- | kcontrol/ebrowsing/plugins/ikws/searchproviderdlg.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/kcontrol/ebrowsing/plugins/ikws/searchproviderdlg.cpp b/kcontrol/ebrowsing/plugins/ikws/searchproviderdlg.cpp index bf295462f..2af0aaa80 100644 --- a/kcontrol/ebrowsing/plugins/ikws/searchproviderdlg.cpp +++ b/kcontrol/ebrowsing/plugins/ikws/searchproviderdlg.cpp @@ -33,17 +33,19 @@ #include "searchproviderdlg.h" #include "searchprovider.h" -SearchProviderDialog::SearchProviderDialog(SearchProvider *provider, +SearchProviderDialog::SearchProviderDialog(SearchProvider *provider, const TQString& category, TQWidget *parent, const char *name) - :KDialogBase(parent, name, true, TQString::null, Ok|Cancel), - m_provider(provider) + : KDialogBase(parent, name, true, TQString::null, Ok|Cancel), + m_provider(provider) { m_dlg = new SearchProviderDlgUI (this); setMainWidget(m_dlg); enableButtonSeparator(true); - m_dlg->leQuery->setMinimumWidth(tdeApp->fontMetrics().maxWidth() * 40); + m_dlg->leQuery->setMinimumWidth(tdeApp->fontMetrics().maxWidth() * 16); + m_dlg->cbCategory->setDuplicatesEnabled(false); + m_dlg->cbCategory->setEditable(true); connect(m_dlg->leName, TQ_SIGNAL(textChanged(const TQString &)), TQ_SLOT(slotChanged())); connect(m_dlg->leQuery, TQ_SIGNAL(textChanged(const TQString &)), TQ_SLOT(slotChanged())); @@ -54,12 +56,19 @@ SearchProviderDialog::SearchProviderDialog(SearchProvider *provider, charsets.prepend(i18n("Default")); m_dlg->cbCharset->insertStringList(charsets); + m_dlg->cbCategory->insertStringList(SearchProvider::searchCategories.values()); + if (!category.isNull()) + { + m_dlg->cbCategory->setCurrentText(SearchProvider::searchCategoryName(category)); + } + if (m_provider) { setPlainCaption(i18n("Modify Search Provider")); m_dlg->leName->setText(m_provider->name()); m_dlg->leQuery->setText(m_provider->query()); m_dlg->leShortcut->setText(m_provider->keys().join(",")); + m_dlg->cbCategory->setCurrentText(SearchProvider::searchCategoryName(m_provider->category())); m_dlg->cbCharset->setCurrentItem(m_provider->charset().isEmpty() ? 0 : charsets.findIndex(m_provider->charset())); m_dlg->leName->setEnabled(false); m_dlg->leQuery->setFocus(); @@ -95,6 +104,7 @@ void SearchProviderDialog::slotOk() m_provider->setQuery(m_dlg->leQuery->text().stripWhiteSpace()); m_provider->setKeys(TQStringList::split(",", m_dlg->leShortcut->text().stripWhiteSpace())); m_provider->setCharset(m_dlg->cbCharset->currentItem() ? m_dlg->cbCharset->currentText() : TQString::null); + m_provider->setCategory(m_dlg->cbCategory->currentText()); KDialog::accept(); } |
