clarified the dialog used to choose viewer apps
This commit is contained in:
parent
360c3b4f2b
commit
89603e6244
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>632</width>
|
<width>635</width>
|
||||||
<height>726</height>
|
<height>726</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -82,20 +82,67 @@
|
|||||||
<column/>
|
<column/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Recoll action:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="currentLBL">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::Box</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>current value</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="selSamePB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Select same</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="frame">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::Box</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_new">
|
||||||
|
<property name="text">
|
||||||
|
<string><b>New Values:</b></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="setExceptCB">
|
<widget class="QCheckBox" name="setExceptCB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -108,7 +155,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Action (empty -> recoll default)</string>
|
<string>Action (empty -> recoll default)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@ -40,16 +40,21 @@ using namespace std;
|
|||||||
|
|
||||||
void ViewAction::init()
|
void ViewAction::init()
|
||||||
{
|
{
|
||||||
|
selSamePB->setEnabled(false);
|
||||||
connect(closePB, SIGNAL(clicked()), this, SLOT(close()));
|
connect(closePB, SIGNAL(clicked()), this, SLOT(close()));
|
||||||
connect(chgActPB, SIGNAL(clicked()), this, SLOT(editActions()));
|
connect(chgActPB, SIGNAL(clicked()), this, SLOT(editActions()));
|
||||||
connect(actionsLV,SIGNAL(itemDoubleClicked(QTableWidgetItem *)),
|
connect(actionsLV,SIGNAL(itemDoubleClicked(QTableWidgetItem *)),
|
||||||
this, SLOT(onItemDoubleClicked(QTableWidgetItem *)));
|
this, SLOT(onItemDoubleClicked(QTableWidgetItem *)));
|
||||||
|
connect(actionsLV,SIGNAL(itemClicked(QTableWidgetItem *)),
|
||||||
|
this, SLOT(onItemClicked(QTableWidgetItem *)));
|
||||||
useDesktopCB->setChecked(prefs.useDesktopOpen);
|
useDesktopCB->setChecked(prefs.useDesktopOpen);
|
||||||
onUseDesktopCBToggled(prefs.useDesktopOpen);
|
onUseDesktopCBToggled(prefs.useDesktopOpen);
|
||||||
connect(useDesktopCB, SIGNAL(stateChanged(int)),
|
connect(useDesktopCB, SIGNAL(stateChanged(int)),
|
||||||
this, SLOT(onUseDesktopCBToggled(int)));
|
this, SLOT(onUseDesktopCBToggled(int)));
|
||||||
connect(setExceptCB, SIGNAL(stateChanged(int)),
|
connect(setExceptCB, SIGNAL(stateChanged(int)),
|
||||||
this, SLOT(onSetExceptCBToggled(int)));
|
this, SLOT(onSetExceptCBToggled(int)));
|
||||||
|
connect(selSamePB, SIGNAL(clicked()),
|
||||||
|
this, SLOT(onSelSameClicked()));
|
||||||
resize(QSize(640, 480).expandedTo(minimumSizeHint()));
|
resize(QSize(640, 480).expandedTo(minimumSizeHint()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +72,7 @@ void ViewAction::onSetExceptCBToggled(int onoff)
|
|||||||
|
|
||||||
void ViewAction::fillLists()
|
void ViewAction::fillLists()
|
||||||
{
|
{
|
||||||
|
currentLBL->clear();
|
||||||
actionsLV->clear();
|
actionsLV->clear();
|
||||||
actionsLV->verticalHeader()->setDefaultSectionSize(20);
|
actionsLV->verticalHeader()->setDefaultSectionSize(20);
|
||||||
vector<pair<string, string> > defs;
|
vector<pair<string, string> > defs;
|
||||||
@ -111,6 +117,51 @@ void ViewAction::selectMT(const QString& mt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ViewAction::onSelSameClicked()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "onSelSameClicked()\n");
|
||||||
|
actionsLV->clearSelection();
|
||||||
|
QString value = currentLBL->text();
|
||||||
|
if (value.isEmpty())
|
||||||
|
return;
|
||||||
|
string action = qs2utf8s(value);
|
||||||
|
fprintf(stderr, "value: %s\n", action.c_str());
|
||||||
|
vector<pair<string, string> > defs;
|
||||||
|
theconfig->getMimeViewerDefs(defs);
|
||||||
|
for (unsigned int i = 0; i < defs.size(); i++) {
|
||||||
|
if (defs[i].second == action) {
|
||||||
|
QList<QTableWidgetItem *>items =
|
||||||
|
actionsLV->findItems(QString::fromAscii(defs[i].first.c_str()),
|
||||||
|
Qt::MatchFixedString|Qt::MatchCaseSensitive);
|
||||||
|
for (QList<QTableWidgetItem *>::iterator it = items.begin();
|
||||||
|
it != items.end(); it++) {
|
||||||
|
(*it)->setSelected(true);
|
||||||
|
QTableWidgetItem *item1 = actionsLV->item((*it)->row(), 1);
|
||||||
|
item1->setSelected(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fill the input fields with the row's values when the user clicks
|
||||||
|
void ViewAction::onItemClicked(QTableWidgetItem * item)
|
||||||
|
{
|
||||||
|
QTableWidgetItem *item0 = actionsLV->item(item->row(), 0);
|
||||||
|
string mtype = (const char *)item0->text().toLocal8Bit();
|
||||||
|
|
||||||
|
vector<pair<string, string> > defs;
|
||||||
|
theconfig->getMimeViewerDefs(defs);
|
||||||
|
for (unsigned int i = 0; i < defs.size(); i++) {
|
||||||
|
if (defs[i].first == mtype) {
|
||||||
|
currentLBL->setText(QString::fromAscii(defs[i].second.c_str()));
|
||||||
|
selSamePB->setEnabled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
currentLBL->clear();
|
||||||
|
selSamePB->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
void ViewAction::onItemDoubleClicked(QTableWidgetItem * item)
|
void ViewAction::onItemDoubleClicked(QTableWidgetItem * item)
|
||||||
{
|
{
|
||||||
actionsLV->clearSelection();
|
actionsLV->clearSelection();
|
||||||
|
|||||||
@ -42,9 +42,11 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void editActions();
|
virtual void editActions();
|
||||||
|
virtual void onItemClicked(QTableWidgetItem *);
|
||||||
virtual void onItemDoubleClicked(QTableWidgetItem *);
|
virtual void onItemDoubleClicked(QTableWidgetItem *);
|
||||||
virtual void onUseDesktopCBToggled(int);
|
virtual void onUseDesktopCBToggled(int);
|
||||||
virtual void onSetExceptCBToggled(int);
|
virtual void onSetExceptCBToggled(int);
|
||||||
|
virtual void onSelSameClicked();
|
||||||
private:
|
private:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void fillLists();
|
virtual void fillLists();
|
||||||
|
|||||||
@ -44,8 +44,16 @@ versions.</i></p>
|
|||||||
Preferences->Query configuration->User interface </blockquote>
|
Preferences->Query configuration->User interface </blockquote>
|
||||||
and erase the result paragraph format string (^A DEL in the text area),
|
and erase the result paragraph format string (^A DEL in the text area),
|
||||||
this will reset the string to the default value.</li>
|
this will reset the string to the default value.</li>
|
||||||
|
|
||||||
|
<li>A release 1.19 change in the way we handle minus characters
|
||||||
|
('-') broke support for wildcard character ranges (e.g.: <tt>[a-z]</tt>).
|
||||||
|
A fix would be relatively complicated, so please speak up if you
|
||||||
|
need it because I won't probably do it without further
|
||||||
|
motivation.</li>
|
||||||
|
|
||||||
<li>Real time indexer: when running with gamin on FreeBSD, the indexer can
|
<li>Real time indexer: when running with gamin on FreeBSD, the indexer can
|
||||||
deadlock in the gamin dialog in some cases.</li>
|
deadlock in the gamin dialog in some cases.</li>
|
||||||
|
|
||||||
<li>After an upgrade, the recoll GUI sometimes crashes on startup. This is
|
<li>After an upgrade, the recoll GUI sometimes crashes on startup. This is
|
||||||
fixed by removing (back it up just in case)
|
fixed by removing (back it up just in case)
|
||||||
~/.config/Recoll.org/recoll.conf, the QSettings storage for recoll.</li>
|
~/.config/Recoll.org/recoll.conf, the QSettings storage for recoll.</li>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user