arrange so that the select action dialog is preselected on the right mime type after missing action

This commit is contained in:
dockes 2009-01-14 07:52:11 +00:00
parent 7a22709cab
commit 7cf12ddcdf
7 changed files with 40 additions and 9 deletions

View File

@ -66,7 +66,7 @@
<string>Search for &lt;br&gt;documents&lt;br&gt;satisfying:</string>
</property>
<property name="toolTip" stdset="0">
<string>All non blank fields will be combined with OR or AND conjunctions. &lt;br&gt;"Any" "All" and "None" field types can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;Fields with no data are ignored.</string>
<string>All non empty fields on the right will be combined with AND ("All clauses" choice) or OR ("Any clause" choice) conjunctions. &lt;br&gt;"Any" "All" and "None" field types can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;Fields with no data are ignored.</string>
</property>
</widget>
<widget class="QComboBox">
@ -81,6 +81,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" stdset="0">
<string>All non empty fields on the right will be combined with AND ("All clauses" choice) or OR ("Any clause" choice) conjunctions. &lt;br&gt;"Any" "All" and "None" field types can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;Fields with no data are ignored.</string>
</property>
</widget>
<spacer>
<property name="name">
@ -179,7 +182,7 @@
</widget>
<widget class="Line">
<property name="name">
<cstring>line3</cstring>
<cstring>line4</cstring>
</property>
<property name="frameShape">
<enum>HLine</enum>
@ -413,7 +416,7 @@
</widget>
<widget class="Line">
<property name="name">
<cstring>line3</cstring>
<cstring>line5</cstring>
</property>
<property name="frameShape">
<enum>HLine</enum>

View File

@ -847,18 +847,18 @@ void RclMain::startNativeViewer(Rcl::Doc doc)
}
if (cmdpath.empty()) {
QString mt = QString::fromAscii(doc.mimetype.c_str());
QString message = tr("The viewer specified in mimeconf for %1: %2"
" is not found.\nDo you want to start the "
" preferences dialog ?")
.arg(QString::fromAscii(doc.mimetype.c_str()))
.arg(QString::fromLocal8Bit(lcmd.front().c_str()));
.arg(mt).arg(QString::fromLocal8Bit(lcmd.front().c_str()));
switch(QMessageBox::warning(0, "Recoll", message,
"Yes", "No", 0, 0, 1)) {
case 0:
showUIPrefs();
if (uiprefs)
uiprefs->showViewAction();
uiprefs->showViewAction(mt);
break;
case 1:

View File

@ -316,6 +316,11 @@ void UIPrefsDialog::showViewAction()
}
m_viewAction->show();
}
void UIPrefsDialog::showViewAction(const QString& mt)
{
showViewAction();
m_viewAction->selectMT(mt);
}
////////////////////////////////////////////
// External / extra search indexes setup

View File

@ -66,9 +66,10 @@ public:
public slots:
virtual void showFontDialog();
virtual void showViewAction();
virtual void showViewAction(const QString& mt);
virtual void resetReslistFont();
virtual void showBrowserDialog();
virtual void extraDbTextChanged( const QString & text );
virtual void extraDbTextChanged(const QString& text);
virtual void addExtraDbPB_clicked();
virtual void delExtraDbPB_clicked();
virtual void browseDbPB_clicked();

View File

@ -8,7 +8,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>224</width>
<width>400</width>
<height>132</height>
</rect>
</property>
@ -27,6 +27,14 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="text">
<string>Select one or several mime types then click "Change Action"</string>
</property>
</widget>
<widget class="QListView">
<column>
<property name="text">

View File

@ -28,11 +28,13 @@ using namespace std;
#if (QT_VERSION < 0x040000)
#include <qlistview.h>
#define QLVEXACTMATCH Qt::ExactMatch
#else
#include <q3listview.h>
#define QListView Q3ListView
#define QListViewItem Q3ListViewItem
#define QListViewItemIterator Q3ListViewItemIterator
#define QLVEXACTMATCH Q3ListView::ExactMatch
#endif
#include <qmessagebox.h>
@ -57,7 +59,7 @@ void ViewAction::init()
#endif
this, SLOT(editAction()));
fillLists();
resize(QSize(450, 250).expandedTo(minimumSizeHint()) );
resize(QSize(640, 250).expandedTo(minimumSizeHint()) );
}
void ViewAction::fillLists()
@ -74,6 +76,16 @@ void ViewAction::fillLists()
}
void ViewAction::selectMT(const QString& mt)
{
QListViewItem *item = actionsLV->findItem(mt, 0, QLVEXACTMATCH);
if (item) {
actionsLV->ensureItemVisible(item);
actionsLV->setSelected(item, true);
actionsLV->setSelectionAnchor(item);
}
}
// To avoid modifying the listview state from the dbl click signal, as
// advised by the manual
void ViewAction::listDblClicked()

View File

@ -61,6 +61,8 @@ public:
}
~ViewAction() {}
void selectMT(const QString& mt);
public slots:
virtual void editAction();
virtual void listDblClicked();