diff --git a/krusader/Konfigurator/kgdependencies.cpp b/krusader/Konfigurator/kgdependencies.cpp --- a/krusader/Konfigurator/kgdependencies.cpp +++ b/krusader/Konfigurator/kgdependencies.cpp @@ -138,7 +138,7 @@ addLabel(grid, row, 0, name, parent); KonfiguratorURLRequester *fullPath = - createURLRequester("Dependencies", name, defaultValue, parent, false, page); + createURLRequester("Dependencies", name, defaultValue, parent, false, QString(), page); connect(fullPath->extension(), &KonfiguratorExtension::applyManually, this, &KgDependencies::slotApply); grid->addWidget(fullPath, row, 1); } diff --git a/krusader/Konfigurator/kggeneral.cpp b/krusader/Konfigurator/kggeneral.cpp --- a/krusader/Konfigurator/kggeneral.cpp +++ b/krusader/Konfigurator/kggeneral.cpp @@ -118,10 +118,12 @@ QWidget * hboxWidget4 = new QWidget(vboxWidget); auto * hbox4 = new QHBoxLayout(hboxWidget4); + const QString listerLimitTip = i18n("If a text file is bigger than this size then lister will be used."); QLabel *label5 = new QLabel(i18n("Use lister if the text file is bigger than:"), hboxWidget4); + label5->setWhatsThis(listerLimitTip); hbox4->addWidget(label5); KonfiguratorSpinBox *spinBox = createSpinBox("General", "Lister Limit", _ListerLimit, - 0, 0x7FFFFFFF, hboxWidget4, false, PAGE_VIEWER); + 0, 0x7FFFFFFF, hboxWidget4, false, listerLimitTip, PAGE_VIEWER); hbox4->addWidget(spinBox); QLabel *label6 = new QLabel(i18n("MB"), hboxWidget4); hbox4->addWidget(label6); @@ -142,7 +144,7 @@ QLabel *label1 = new QLabel(i18n("Editor:"), editorGrp); editorGrid->addWidget(label1, 0, 0); KonfiguratorURLRequester *urlReq = createURLRequester("General", "Editor", "internal editor", - editorGrp, false, PAGE_VIEWER, false); + editorGrp, false, QString(), PAGE_VIEWER, false); editorGrid->addWidget(urlReq, 0, 1); QLabel *label2 = new QLabel(i18n("Hint: use 'internal editor' if you want to use Krusader's fast built-in editor"), editorGrp); @@ -197,7 +199,8 @@ defaultAtomicExtensions += ".moc.cpp"; listBox = createListBox("Look&Feel", "Atomic Extensions", - defaultAtomicExtensions, vboxWidget2, true, PAGE_EXTENSIONS); + defaultAtomicExtensions, vboxWidget2, true, + QString(), PAGE_EXTENSIONS); vbox2->addWidget(listBox); } diff --git a/krusader/Konfigurator/kgpanel.cpp b/krusader/Konfigurator/kgpanel.cpp --- a/krusader/Konfigurator/kgpanel.cpp +++ b/krusader/Konfigurator/kgpanel.cpp @@ -144,7 +144,8 @@ }; KonfiguratorComboBox *cmb = createComboBox("Look&Feel", "Tab Bar Position", - "bottom", positions, 2, groupBox, true, false, PAGE_GENERAL); + "bottom", positions, 2, groupBox, true, false, + QString(), PAGE_GENERAL); hbox->addWidget(cmb); gridLayout->addLayout(hbox, 1, 0, Qt::AlignLeft); @@ -178,7 +179,8 @@ hbox = new QHBoxLayout(); hbox->addWidget(new QLabel(i18n("Position:"), groupBox)); cmb = createComboBox("Look&Feel", "Quicksearch Position", - "bottom", positions, 2, groupBox, true, false, PAGE_GENERAL); + "bottom", positions, 2, groupBox, true, false, + QString(), PAGE_GENERAL); hbox->addWidget(cmb); hbox->addWidget(createSpacer(groupBox)); gridLayout->addLayout(hbox, 1, 0); @@ -193,7 +195,7 @@ {i18n("Filter"), QString::number(KrSearchBar::MODE_FILTER)}}; cmb = createComboBox("Look&Feel", "Default Search Mode", QString::number(KrSearchBar::MODE_SEARCH), modes, 3, groupBox, true, false, - PAGE_GENERAL); + QString(), PAGE_GENERAL); cmb->setToolTip(i18n("Set the default mode on first usage")); hbox->addWidget(cmb); hbox->addWidget(createSpacer(groupBox)); @@ -263,7 +265,8 @@ layouts[ i ].value = layoutNames[i]; } KonfiguratorComboBox *cmb = createComboBox("PanelLayout", "Layout", "default", - layouts, numLayouts, tab, true, false, PAGE_LAYOUT); + layouts, numLayouts, tab, true, false, + QString(), PAGE_LAYOUT); grid->addWidget(cmb, 0, 1); delete [] layouts; @@ -276,7 +279,8 @@ { i18nc("Frame color", "Statusbar"), "Statusbar" } }; cmb = createComboBox("PanelLayout", "FrameColor", - "default", frameColor, 3, tab, true, false, PAGE_LAYOUT); + "default", frameColor, 3, tab, true, false, + QString(), PAGE_LAYOUT); grid->addWidget(cmb, 1, 1); @@ -290,7 +294,8 @@ { i18nc("Frame shape", "Panel"), "Panel" }, }; cmb = createComboBox("PanelLayout", "FrameShape", - "default", frameShape, 4, tab, true, false, PAGE_LAYOUT); + "default", frameShape, 4, tab, true, false, + QString(), PAGE_LAYOUT); grid->addWidget(cmb, 2, 1); @@ -304,7 +309,8 @@ { i18nc("Frame shadow", "Sunken"), "Sunken" }, }; cmb = createComboBox("PanelLayout", "FrameShadow", - "default", frameShadow, 4, tab, true, false, PAGE_LAYOUT); + "default", frameShadow, 4, tab, true, false, + QString(), PAGE_LAYOUT); grid->addWidget(cmb, 3, 1); } @@ -320,7 +326,9 @@ auto *iconSizes = new KONFIGURATOR_NAME_VALUE_PAIR[KrView::iconSizes.count()]; for(int i = 0; i < KrView::iconSizes.count(); i++) iconSizes[i].text = iconSizes[i].value = QString::number(KrView::iconSizes[i]); - KonfiguratorComboBox *cmb = createComboBox(instance->name(), "IconSize", _FilelistIconSize, iconSizes, KrView::iconSizes.count(), parent, true, true, PAGE_VIEW); + KonfiguratorComboBox *cmb = createComboBox(instance->name(), "IconSize", _FilelistIconSize, + iconSizes, KrView::iconSizes.count(), parent, true, true, + QString(), PAGE_VIEW); delete [] iconSizes; cmb->lineEdit()->setValidator(new QRegExpValidator(QRegExp("[1-9]\\d{0,1}"), cmb)); hbox->addWidget(cmb); @@ -378,12 +386,13 @@ // -------------------- Panel Tooltip ---------------------------------- auto *tooltipLayout = new QHBoxLayout(); + const QString delayTip = i18n("The duration after a tooltip is shown for a file item, in " + "milliseconds. Set a negative value to disable tooltips."); QLabel *tooltipLabel = new QLabel(i18n("Tooltip delay (msec):")); - tooltipLabel->setWhatsThis(i18n("The duration after a tooltip is shown for a file item, in " - "milliseconds. Set a negative value to disable tooltips.")); + tooltipLabel->setWhatsThis(delayTip); tooltipLayout->addWidget(tooltipLabel); KonfiguratorSpinBox *tooltipSpinBox = createSpinBox("Look&Feel", "Panel Tooltip Delay", 1000, - -100, 5000, panelGrp, false, PAGE_VIEW); + -100, 5000, panelGrp, false, delayTip, PAGE_VIEW); tooltipSpinBox->setSingleStep(100); tooltipLayout->addWidget(tooltipSpinBox); tooltipLayout->addStretch(1); @@ -423,7 +432,8 @@ { i18nc("Krusader sort", "Krusader"), QString::number(KrViewProperties::Krusader) } }; KonfiguratorComboBox *cmb = createComboBox("Look&Feel", "Sort method", QString::number(_DefaultSortMethod), - sortMethods, 5, panelGrp, true, false, PAGE_VIEW); + sortMethods, 5, panelGrp, true, false, + QString(), PAGE_VIEW); hbox->addWidget(cmb); hbox->addWidget(createSpacer(panelGrp)); @@ -477,7 +487,9 @@ defType = QString("%1").arg(inst->id()); } - cmb = createComboBox("Look&Feel", "Default Panel Type", defType, panelTypes, viewsSize, panelGrp, false, false, PAGE_VIEW); + cmb = createComboBox("Look&Feel", "Default Panel Type", defType, + panelTypes, viewsSize, panelGrp, false, false, + QString(), PAGE_VIEW); hbox->addWidget(cmb); hbox->addWidget(createSpacer(panelGrp)); @@ -702,7 +714,8 @@ createComboBox("MediaMenu", "ShowSize", "Always", showSizeValues, sizeof(showSizeValues) / sizeof(*showSizeValues), - tab, false, false, PAGE_MEDIA_MENU); + tab, false, false, + QString(), PAGE_MEDIA_MENU); showSizeHBox->addWidget(showSizeCmb); createIgnoredMountpointsList(tab, tabLayout); showSizeHBox->addStretch(); @@ -744,7 +757,8 @@ QStringList defaultHiddenMountpoints; // Empty list listBox = createListBox("MediaMenu", "Hidden Mountpoints", - defaultHiddenMountpoints, vboxWidget2, true, PAGE_MEDIA_MENU); + defaultHiddenMountpoints, vboxWidget2, true, + QString(), PAGE_MEDIA_MENU); vbox2->addWidget(listBox); } diff --git a/krusader/Konfigurator/konfiguratorpage.h b/krusader/Konfigurator/konfiguratorpage.h --- a/krusader/Konfigurator/konfiguratorpage.h +++ b/krusader/Konfigurator/konfiguratorpage.h @@ -124,7 +124,7 @@ */ KonfiguratorCheckBox *createCheckBox(QString configGroup, QString name, bool defaultValue, QString text, QWidget *parent = nullptr, bool restart = false, - const QString& toolTip = QString(), int page = FIRST_PAGE); + const QString &toolTip = QString(), int page = FIRST_PAGE); /** * Adds a new spinbox item to the page. @@ -141,13 +141,14 @@ * @param max The maximum value of the spinbox * @param parent Reference to the parent widget * @param restart The change of this parameter requires Krusader restart + * @param toolTip Tooltip used for this spinbox * @param page The subpage of a Konfigurator page (because of setDefaults) * * @return reference to the newly created spinbox */ KonfiguratorSpinBox *createSpinBox(QString configGroup, QString configName, int defaultValue, int min, int max, QWidget *parent = nullptr, bool restart = false, - int page = FIRST_PAGE); + const QString &toolTip = QString(), int page = FIRST_PAGE); /** * Adds a new editbox item to the page. @@ -162,13 +163,14 @@ * @param defaultValue The default value of the editbox * @param parent Reference to the parent widget * @param restart The change of this parameter requires Krusader restart + * @param toolTip Tooltip used for this editbox * @param page The subpage of a Konfigurator page (because of setDefaults) * * @return reference to the newly created editbox */ KonfiguratorEditBox *createEditBox(QString configGroup, QString name, QString defaultValue, QWidget *parent = nullptr, bool restart = false, - int page = FIRST_PAGE); + const QString &toolTip = QString(), int page = FIRST_PAGE); /** * Adds a new listbox item to the page. @@ -185,13 +187,14 @@ * @param defaultValue The default value of the listbox * @param parent Reference to the parent widget * @param restart The change of this parameter requires Krusader restart + * @param toolTip Tooltip used for this listbox * @param page The subpage of a Konfigurator page (because of setDefaults) * * @return reference to the newly created editbox */ KonfiguratorListBox *createListBox(QString configGroup, QString name, QStringList defaultValue, QWidget *parent = nullptr, bool restart = false, - int page = FIRST_PAGE); + const QString &toolTip = QString(), int page = FIRST_PAGE); /** * Adds a new URL requester item to the page. @@ -206,15 +209,16 @@ * @param defaultValue The default value of the URL requester * @param parent Reference to the parent widget * @param restart The change of this parameter requires Krusader restart + * @param toolTip Tooltip used for this URL requester * @param page The subpage of a Konfigurator page (because of setDefaults) * @param expansion Whether to perform url expansion * * @return reference to the newly created URL requester */ KonfiguratorURLRequester *createURLRequester(QString configGroup, QString name, QString defaultValue, QWidget *parent, - bool restart, int page = FIRST_PAGE, - bool expansion = true); + bool restart, const QString &toolTip = QString(), + int page = FIRST_PAGE, bool expansion = true); /** * Adds a new font chooser item to the page. @@ -257,14 +261,16 @@ * @param parent Reference to the parent widget * @param restart The change of this parameter requires Krusader restart * @param editable Flag indicates that the combo can be edited + * @param toolTip Tooltip used for this combobox * @param page The subpage of a Konfigurator page (because of setDefaults) * * @return reference to the newly created combobox */ KonfiguratorComboBox *createComboBox(QString configGroup, QString name, QString defaultValue, KONFIGURATOR_NAME_VALUE_PAIR *params, int paramNum, QWidget *parent = nullptr, bool restart = false, - bool editable = false, int page = FIRST_PAGE); + bool editable = false, const QString &toolTip = QString(), + int page = FIRST_PAGE); /** * Creates a frame on the page. diff --git a/krusader/Konfigurator/konfiguratorpage.cpp b/krusader/Konfigurator/konfiguratorpage.cpp --- a/krusader/Konfigurator/konfiguratorpage.cpp +++ b/krusader/Konfigurator/konfiguratorpage.cpp @@ -76,7 +76,7 @@ } KonfiguratorCheckBox* KonfiguratorPage::createCheckBox(QString configGroup, QString name, - bool defaultValue, QString text, QWidget *parent, bool restart, const QString& toolTip, int page) + bool defaultValue, QString text, QWidget *parent, bool restart, const QString &toolTip, int page) { KonfiguratorCheckBox *checkBox = new KonfiguratorCheckBox(std::move(configGroup), std::move(name), defaultValue, std::move(text), parent, restart, page); @@ -90,40 +90,56 @@ } KonfiguratorSpinBox* KonfiguratorPage::createSpinBox(QString configGroup, QString configName, - int defaultValue, int min, int max, QWidget *parent, bool restart, int page) + int defaultValue, int min, int max, QWidget *parent, bool restart, const QString &toolTip, int page) { KonfiguratorSpinBox *spinBox = new KonfiguratorSpinBox(std::move(configGroup), std::move(configName), defaultValue, min, max, parent, restart, page); + if (!toolTip.isEmpty()) { + spinBox->setWhatsThis(toolTip); + spinBox->setToolTip(toolTip); + } registerObject(spinBox->extension()); return spinBox; } KonfiguratorEditBox* KonfiguratorPage::createEditBox(QString configGroup, QString name, - QString defaultValue, QWidget *parent, bool restart, int page) + QString defaultValue, QWidget *parent, bool restart, const QString &toolTip, int page) { KonfiguratorEditBox *editBox = new KonfiguratorEditBox(std::move(configGroup), std::move(name), std::move(defaultValue), parent, restart, page); + if (!toolTip.isEmpty()) { + editBox->setWhatsThis(toolTip); + editBox->setToolTip(toolTip); + } registerObject(editBox->extension()); return editBox; } KonfiguratorListBox* KonfiguratorPage::createListBox(QString configGroup, QString name, - QStringList defaultValue, QWidget *parent, bool restart, int page) + QStringList defaultValue, QWidget *parent, bool restart, const QString &toolTip, int page) { KonfiguratorListBox *listBox = new KonfiguratorListBox(std::move(configGroup), std::move(name), std::move(defaultValue), parent, restart, page); + if (!toolTip.isEmpty()) { + listBox->setWhatsThis(toolTip); + listBox->setToolTip(toolTip); + } registerObject(listBox->extension()); return listBox; } KonfiguratorURLRequester* KonfiguratorPage::createURLRequester(QString configGroup, QString name, - QString defaultValue, QWidget *parent, bool restart, int page, bool expansion) + QString defaultValue, QWidget *parent, bool restart, const QString &toolTip, int page, bool expansion) { KonfiguratorURLRequester *urlRequester = new KonfiguratorURLRequester(std::move(configGroup), std::move(name), std::move(defaultValue), parent, restart, page, expansion); + if (!toolTip.isEmpty()) { + urlRequester->setWhatsThis(toolTip); + urlRequester->setToolTip(toolTip); + } registerObject(urlRequester->extension()); return urlRequester; @@ -244,10 +260,15 @@ } KonfiguratorComboBox *KonfiguratorPage::createComboBox(QString configGroup, QString name, QString defaultValue, - KONFIGURATOR_NAME_VALUE_PAIR *params, int paramNum, QWidget *parent, bool restart, bool editable, int page) + KONFIGURATOR_NAME_VALUE_PAIR *params, int paramNum, QWidget *parent, bool restart, bool editable, + const QString &toolTip, int page) { KonfiguratorComboBox *comboBox = new KonfiguratorComboBox(std::move(configGroup), std::move(name), std::move(defaultValue), params, paramNum, parent, restart, editable, page); + if (!toolTip.isEmpty()) { + comboBox->setWhatsThis(toolTip); + comboBox->setToolTip(toolTip); + } registerObject(comboBox->extension()); return comboBox;