Add pref for using click vs shift+click to display text in restable detail area. Compactify prefs pane

This commit is contained in:
Jean-Francois Dockes 2021-03-16 09:52:14 +01:00
parent c461f8549c
commit 7878db7dbe
5 changed files with 124 additions and 81 deletions

View File

@ -291,25 +291,21 @@ void rwSettings(bool writing)
"/Recoll/prefs/query/asearchIgnFilTyps").toStringList();
}
SETTING_RW(prefs.fileTypesByCats, "/Recoll/prefs/query/asearchFilTypByCat",
Bool, false);
SETTING_RW(prefs.fileTypesByCats, "/Recoll/prefs/query/asearchFilTypByCat", Bool, false);
SETTING_RW(prefs.noClearSearch, "/Recoll/prefs/noClearSearch", Bool, false);
SETTING_RW(prefs.noToolbars, "/Recoll/prefs/noToolbars", Bool, false);
SETTING_RW(prefs.noStatusBar, "/Recoll/prefs/noStatusBar", Bool, false);
SETTING_RW(prefs.noMenuBar, "/Recoll/prefs/noMenuBar", Bool, false);
SETTING_RW(prefs.noSSTypCMB, "/Recoll/prefs/noSSTypCMB", Bool, false);
SETTING_RW(prefs.noResTableHeader, "/Recoll/prefs/noResTableHeader",
Bool, false);
SETTING_RW(prefs.showResTableVHeader, "/Recoll/prefs/showResTableVHeader",
Bool, false);
SETTING_RW(prefs.noResTableRowJumpSC, "/Recoll/prefs/noResTableRowJumpSC",
Bool, false);
SETTING_RW(prefs.resTableTextNoShift, "/Recoll/prefs/resTableTextNoShift", Bool, false);
SETTING_RW(prefs.noResTableHeader, "/Recoll/prefs/noResTableHeader", Bool, false);
SETTING_RW(prefs.showResTableVHeader, "/Recoll/prefs/showResTableVHeader", Bool, false);
SETTING_RW(prefs.noResTableRowJumpSC, "/Recoll/prefs/noResTableRowJumpSC", Bool, false);
SETTING_RW(prefs.showTrayIcon, "/Recoll/prefs/showTrayIcon", Bool, false);
SETTING_RW(prefs.closeToTray, "/Recoll/prefs/closeToTray", Bool, false);
SETTING_RW(prefs.trayMessages, "/Recoll/prefs/trayMessages", Bool, false);
// See qxtconfirmationmessage. Needs to be -1 for the dialog to show.
SETTING_RW(prefs.showTempFileWarning, "Recoll/prefs/showTempFileWarning",
Int, -1);
SETTING_RW(prefs.showTempFileWarning, "Recoll/prefs/showTempFileWarning", Int, -1);
if (g_dynconf == 0) {
// Happens

View File

@ -145,6 +145,7 @@ public:
bool noStatusBar{false};
bool noMenuBar{false};
bool noSSTypCMB{false};
bool resTableTextNoShift{false};
bool noResTableHeader{false};
bool showResTableVHeader{false};
bool noResTableRowJumpSC{false};

View File

@ -103,8 +103,16 @@ bool ResTablePager::append(const string& data)
m_data += data;
return true;
}
bool ResTablePager::flush()
{
#ifdef helps_discoverability_of_shiftclick_but_is_ennoying
QString msg = QApplication::translate(
"ResTable", "Use Shift+click to display the text instead.");
if (!prefs.resTableTextNoShift) {
m_data += std::string("<p>") + qs2utf8s(msg) + "</p>";
}
#endif
m_parent->m_detail->setHtml(u8s2qs(m_data));
m_data = "";
return true;
@ -881,7 +889,9 @@ void ResTable::onTableView_currentChanged(const QModelIndex& index)
m_detaildocnum = index.row();
m_detaildoc = doc;
Qt::KeyboardModifiers mods = QApplication::keyboardModifiers();
if (tableView->selectionModel()->hasSelection() && (mods &= Qt::ShiftModifier)) {
bool showtext = (mods &= Qt::ShiftModifier);
showtext ^= prefs.resTableTextNoShift;
if (tableView->selectionModel()->hasSelection() && showtext) {
bool loadok = rcldb->getDocRawText(m_detaildoc);
if (loadok) {
m_detail->setText(u8s2qs(m_detaildoc.text));

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>700</width>
<height>850</height>
<height>760</height>
</rect>
</property>
<property name="windowTitle">
@ -189,39 +189,79 @@
</layout>
</item>
<item>
<widget class="QCheckBox" name="noToolbarsCB">
<property name="text">
<string>Hide toolbars.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="labeltb">
<property name="toolTip">
<string>Hide some user interface elements.</string>
</property>
<property name="text">
<string>Hide:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="noToolbarsCB">
<property name="text">
<string>Toolbars</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="noStatusBarCB">
<property name="text">
<string>Status bar</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="noMenuBarCB">
<property name="toolTip">
<string>Show button instead.</string>
</property>
<property name="text">
<string>Menu bar</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="noSSTypCMBCB">
<property name="toolTip">
<string>Show choice in menu only.</string>
</property>
<property name="text">
<string>Simple search type</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="noClearSearchCB">
<property name="text">
<string>Clear/Search buttons</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="noStatusBarCB">
<widget class="QCheckBox" name="restabShowTxtNoShiftCB">
<property name="text">
<string>Hide status bar.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="noMenuBarCB">
<property name="text">
<string>Hide menu bar (show button instead).</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="noSSTypCMBCB">
<property name="text">
<string>Hide simple search type (show in menu only).</string>
<string>Show text contents when clicking result table row (else use Shift+click).</string>
</property>
<property name="checked">
<bool>false</bool>
@ -259,44 +299,38 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="noClearSearchCB">
<property name="text">
<string>Hide Clear and Search buttons.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showTrayIconCB">
<property name="text">
<string>Show system tray icon.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="closeToTrayCB">
<property name="text">
<string>Close to tray instead of exiting.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="trayMessagesCB">
<property name="text">
<string>Generate desktop notifications.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
<layout class="QHBoxLayout">
<item>
<widget class="QCheckBox" name="showTrayIconCB">
<property name="text">
<string>Show system tray icon.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="closeToTrayCB">
<property name="text">
<string>Close to tray instead of exiting.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="trayMessagesCB">
<property name="text">
<string>Generate desktop notifications.</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="noBeepsCB">
@ -1527,7 +1561,7 @@ May be slow for big documents.</string>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_2"/>
</buttongroups>
</ui>

View File

@ -158,6 +158,7 @@ void UIPrefsDialog::setFromPrefs()
noStatusBarCB->setChecked(prefs.noStatusBar);
noMenuBarCB->setChecked(prefs.noMenuBar);
noSSTypCMBCB->setChecked(prefs.noSSTypCMB);
restabShowTxtNoShiftCB->setChecked(prefs.resTableTextNoShift);
noResTableHeaderCB->setChecked(prefs.noResTableHeader);
showResTableVHeaderCB->setChecked(prefs.showResTableVHeader);
noRowJumpShortcutsCB->setChecked(prefs.noResTableRowJumpSC);
@ -432,6 +433,7 @@ void UIPrefsDialog::accept()
prefs.noMenuBar = noMenuBarCB->isChecked();
m_mainWindow->setupMenus();
prefs.noSSTypCMB = noSSTypCMBCB->isChecked();
prefs.resTableTextNoShift = restabShowTxtNoShiftCB->isChecked();
prefs.noResTableHeader = noResTableHeaderCB->isChecked();
prefs.showResTableVHeader = showResTableVHeaderCB->isChecked();
prefs.noResTableRowJumpSC = noRowJumpShortcutsCB->isChecked();