diff --git a/krusader/Konfigurator/kgpanel.h b/krusader/Konfigurator/kgpanel.h --- a/krusader/Konfigurator/kgpanel.h +++ b/krusader/Konfigurator/kgpanel.h @@ -36,16 +36,13 @@ virtual int activeSubPage() Q_DECL_OVERRIDE; protected: - KonfiguratorCheckBoxGroup *cbs; - KonfiguratorCheckBoxGroup* quicksearchCheckboxes; KonfiguratorCheckBoxGroup *panelToolbarButtonsCheckboxes; KonfiguratorCheckBoxGroup *buttonsCheckboxes; KonfiguratorRadioButtons *mouseRadio; KonfiguratorCheckBoxGroup *mouseCheckboxes; KrTreeWidget* mousePreview; protected slots: - void slotDisable(); void slotEnablePanelToolbar(); void slotSelectionModeChanged(); void slotMouseCheckBoxChanged(); diff --git a/krusader/Konfigurator/kgpanel.cpp b/krusader/Konfigurator/kgpanel.cpp --- a/krusader/Konfigurator/kgpanel.cpp +++ b/krusader/Konfigurator/kgpanel.cpp @@ -93,7 +93,7 @@ {"Look&Feel", "Navigator Edit Mode", false, i18n("Edit Mode by default"), true, i18n("Show editable path in Navigator bar by default") }, {"Look&Feel", "Navigator Full Path", false, i18n("Show full path by default"), true, i18n("Always show full path in Navigator bar by default.") }, }; - cbs = createCheckBoxGroup(2, 0, navigatorbar_settings, 2 /*count*/, groupBox, PAGE_GENERAL); + KonfiguratorCheckBoxGroup* cbs = createCheckBoxGroup(2, 0, navigatorbar_settings, 2 /*count*/, groupBox, PAGE_GENERAL); gridLayout->addWidget(cbs, 0, 0); layout->addWidget(groupBox); @@ -125,7 +125,7 @@ {"Look&Feel", "Fullpath Tab Names", _FullPathTabNames, i18n("Use full path tab names"), true , i18n("Display the full path in the folder tabs. By default only the last part of the path is displayed.") }, {"Look&Feel", "Show Tab Buttons", true, i18n("Show new/close tab buttons"), true , i18n("Show the new/close tab buttons.") }, }; - KonfiguratorCheckBoxGroup *cbs = createCheckBoxGroup(2, 0, tabbar_settings, 2 /*count*/, groupBox, PAGE_GENERAL); + cbs = createCheckBoxGroup(2, 0, tabbar_settings, 2 /*count*/, groupBox, PAGE_GENERAL); gridLayout->addWidget(cbs, 0, 0, 1, 2); // ----------------- Tab Bar position ---------------------------------- @@ -165,10 +165,8 @@ {"Look&Feel", "Navigation with Right Arrow Quicksearch", _NavigationWithRightArrowQuicksearch, i18n("Directory navigation with Right Arrow"), false, i18n("Pressing the Right button enters directory if no search text editing intention is captured.") }, }; - quicksearchCheckboxes = createCheckBoxGroup(2, 0, quicksearch, 4 /*count*/, groupBox, PAGE_GENERAL); - gridLayout->addWidget(quicksearchCheckboxes, 0, 0, 1, -1); - connect(quicksearchCheckboxes->find("New Style Quicksearch"), SIGNAL(stateChanged(int)), this, SLOT(slotDisable())); - slotDisable(); + cbs = createCheckBoxGroup(2, 0, quicksearch, 4 /*count*/, groupBox, PAGE_GENERAL); + gridLayout->addWidget(cbs, 0, 0, 1, -1); // -------------- Search bar position ----------------------- @@ -179,23 +177,23 @@ hbox->addWidget(cmb); hbox->addWidget(createSpacer(groupBox)); gridLayout->addLayout(hbox, 1, 0); - layout->addWidget(groupBox); // -------------- Default search mode ----------------------- hbox = new QHBoxLayout(); hbox->addWidget(new QLabel(i18n("Default mode:"), groupBox)); KONFIGURATOR_NAME_VALUE_PAIR modes[] = { - { i18n("Search"), QString::number(KrSearchBar::MODE_SEARCH) }, - { i18n("Select"), QString::number(KrSearchBar::MODE_SELECT) }, - { i18n("Filter"), QString::number(KrSearchBar::MODE_FILTER) } - }; + {i18n("Search"), QString::number(KrSearchBar::MODE_SEARCH)}, + {i18n("Select"), QString::number(KrSearchBar::MODE_SELECT)}, + {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::number(KrSearchBar::MODE_SEARCH), modes, 3, groupBox, true, false, + PAGE_GENERAL); cmb->setToolTip(i18n("Set the default mode on first usage")); hbox->addWidget(cmb); hbox->addWidget(createSpacer(groupBox)); gridLayout->addLayout(hbox, 1, 1); + layout->addWidget(groupBox); // -------------------------------------------------------------------------------------------- @@ -706,12 +704,6 @@ tabLayout->addStretch(); } -void KgPanel::slotDisable() -{ - bool isNewStyleQuickSearch = quicksearchCheckboxes->find("New Style Quicksearch")->isChecked(); - quicksearchCheckboxes->find("Case Sensitive Quicksearch")->setEnabled(isNewStyleQuickSearch); -} - void KgPanel::slotEnablePanelToolbar() { bool enableTB = buttonsCheckboxes->find("Panel Toolbar visible")->isChecked(); diff --git a/krusader/Panel/krsearchbar.h b/krusader/Panel/krsearchbar.h --- a/krusader/Panel/krsearchbar.h +++ b/krusader/Panel/krsearchbar.h @@ -47,7 +47,7 @@ public: enum SearchMode { - MODE_LAST = -1, + MODE_DEFAULT = -1, // NOTE: values used for combobox index MODE_SEARCH = 0, MODE_SELECT = 1, @@ -62,7 +62,7 @@ void setView(KrView *view); public slots: - void showBar(SearchMode mode = MODE_LAST); + void showBar(SearchMode mode = MODE_DEFAULT); void hideBar(); /** * Reset search to empty string. diff --git a/krusader/Panel/krsearchbar.cpp b/krusader/Panel/krsearchbar.cpp --- a/krusader/Panel/krsearchbar.cpp +++ b/krusader/Panel/krsearchbar.cpp @@ -52,10 +52,6 @@ // combo box for changing search mode _modeBox = new QComboBox(this); _modeBox->addItems(QStringList() << i18n("Search") << i18n("Select") << i18n("Filter")); - int defaultIndex = KConfigGroup (krConfig, "Look&Feel") - .readEntry("Default Search Mode", - QString::number(KrSearchBar::MODE_SEARCH)).toInt(); - _modeBox->setCurrentIndex(defaultIndex); _modeBox->setToolTip(i18n("Change the search mode")); connect(_modeBox, SIGNAL(currentIndexChanged(int)), SLOT(onModeChange())); @@ -114,9 +110,13 @@ void KrSearchBar::showBar(SearchMode mode) { - if (mode != MODE_LAST) { - _modeBox->setCurrentIndex(mode); - } + int index = mode == MODE_DEFAULT ? + KConfigGroup(krConfig, "Look&Feel") + .readEntry("Default Search Mode", QString::number(KrSearchBar::MODE_SEARCH)) + .toInt() : + mode; + _modeBox->setCurrentIndex(index); + show(); _textBox->setFocus(); _rightArrowEntersDirFlag = true; diff --git a/krusader/Panel/listpanel.h b/krusader/Panel/listpanel.h --- a/krusader/Panel/listpanel.h +++ b/krusader/Panel/listpanel.h @@ -151,7 +151,8 @@ void toggleSyncBrowse(); void editLocation(); void showSearchBar(); - void showSearchFilter(); + void showSearchBarSelection(); + void showSearchBarFilter(); void jumpBack(); void setJumpBack() { setJumpBack(virtualPath()); diff --git a/krusader/Panel/listpanel.cpp b/krusader/Panel/listpanel.cpp --- a/krusader/Panel/listpanel.cpp +++ b/krusader/Panel/listpanel.cpp @@ -1184,10 +1184,15 @@ void ListPanel::showSearchBar() { - searchBar->showBar(); + searchBar->showBar(KrSearchBar::MODE_SEARCH); } -void ListPanel::showSearchFilter() +void ListPanel::showSearchBarSelection() +{ + searchBar->showBar(KrSearchBar::MODE_SELECT); +} + +void ListPanel::showSearchBarFilter() { searchBar->showBar(KrSearchBar::MODE_FILTER); } diff --git a/krusader/Panel/listpanelactions.h b/krusader/Panel/listpanelactions.h --- a/krusader/Panel/listpanelactions.h +++ b/krusader/Panel/listpanelactions.h @@ -57,7 +57,7 @@ QAction *actCopyDelayedF5, *actMoveDelayedShiftF6; QAction *actProperties, *actPack, *actUnpack, *actTest, *actCompDirs, *actCalculate, *actSync; QAction *actFTPConnect, *actFTPNewConnect, *actFTPDisconnect; - QAction *actLocationBar, *actSearchBar, *actJumpBack, *actSetJumpBack; + QAction *actLocationBar, *actJumpBack, *actSetJumpBack; QAction *actCreateChecksum, *actMatchChecksum; QAction *actCopy, *actCut, *actPaste; QAction *actHistoryBackward, *actHistoryForward, *actDirUp, *actRoot, *actHome, *actCdToOther; diff --git a/krusader/Panel/listpanelactions.cpp b/krusader/Panel/listpanelactions.cpp --- a/krusader/Panel/listpanelactions.cpp +++ b/krusader/Panel/listpanelactions.cpp @@ -116,8 +116,6 @@ actSetJumpBack = action(i18n("Set Jump Back Point"), "go-jump-definition", Qt::CTRL + Qt::SHIFT + Qt::Key_J, _gui, SLOT(setJumpBack()), "set_jump_back"); actSyncBrowse = action(i18n("S&ynchron Folder Changes"), "kr_syncbrowse_off", Qt::ALT + Qt::SHIFT + Qt::Key_Y, _gui, SLOT(toggleSyncBrowse()), "sync browse"); actLocationBar = action(i18n("Go to Location Bar"), 0, Qt::CTRL + Qt::Key_L, _gui, SLOT(editLocation()), "location_bar"); - actSearchBar = action(i18n("Find in folder..."), 0, Qt::CTRL + Qt::Key_F, _gui, SLOT(showSearchBar()), "search bar"); - action(i18n("Open search filter"), 0, Qt::CTRL + Qt::Key_I, _gui, SLOT(showSearchFilter()), "search bar filter"); toggleAction(i18n("Toggle Sidebar"), 0, Qt::ALT + Qt::Key_Down, _gui, SLOT(toggleSidebar()), "toggle sidebar"); action(i18n("Bookmarks"), 0, Qt::CTRL + Qt::Key_D, _gui, SLOT(openBookmarks()), "bookmarks"); action(i18n("Left Bookmarks"), 0, 0, this, SLOT(openLeftBookmarks()), "left bookmarks"); @@ -129,6 +127,11 @@ action(i18n("Left Media"), 0, Qt::CTRL + Qt::SHIFT + Qt::Key_Left, this, SLOT(openLeftMedia()), "left media"); action(i18n("Right Media"), 0, Qt::CTRL + Qt::SHIFT + Qt::Key_Right, this, SLOT(openRightMedia()), "right media"); + // quick search bar + action(i18n("Find in folder..."), 0, Qt::CTRL + Qt::Key_F, _gui, SLOT(showSearchBar()), "search bar"); + action(i18n("Select in folder..."), 0, Qt::CTRL + Qt::SHIFT + Qt::Key_S, _gui, SLOT(showSearchBarSelection()), "search bar selection"); + action(i18n("Filter in folder..."), 0, Qt::CTRL + Qt::Key_I, _gui, SLOT(showSearchBarFilter()), "search bar filter"); + // and at last we can set the tool-tips actRoot->setToolTip(i18n("ROOT (/)"));