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> <string>Search for &lt;br&gt;documents&lt;br&gt;satisfying:</string>
</property> </property>
<property name="toolTip" stdset="0"> <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> </property>
</widget> </widget>
<widget class="QComboBox"> <widget class="QComboBox">
@ -81,6 +81,9 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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> </widget>
<spacer> <spacer>
<property name="name"> <property name="name">
@ -179,7 +182,7 @@
</widget> </widget>
<widget class="Line"> <widget class="Line">
<property name="name"> <property name="name">
<cstring>line3</cstring> <cstring>line4</cstring>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>HLine</enum> <enum>HLine</enum>
@ -413,7 +416,7 @@
</widget> </widget>
<widget class="Line"> <widget class="Line">
<property name="name"> <property name="name">
<cstring>line3</cstring> <cstring>line5</cstring>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>HLine</enum> <enum>HLine</enum>

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>224</width> <width>400</width>
<height>132</height> <height>132</height>
</rect> </rect>
</property> </property>
@ -27,6 +27,14 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </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"> <widget class="QListView">
<column> <column>
<property name="text"> <property name="text">

View File

@ -28,11 +28,13 @@ using namespace std;
#if (QT_VERSION < 0x040000) #if (QT_VERSION < 0x040000)
#include <qlistview.h> #include <qlistview.h>
#define QLVEXACTMATCH Qt::ExactMatch
#else #else
#include <q3listview.h> #include <q3listview.h>
#define QListView Q3ListView #define QListView Q3ListView
#define QListViewItem Q3ListViewItem #define QListViewItem Q3ListViewItem
#define QListViewItemIterator Q3ListViewItemIterator #define QListViewItemIterator Q3ListViewItemIterator
#define QLVEXACTMATCH Q3ListView::ExactMatch
#endif #endif
#include <qmessagebox.h> #include <qmessagebox.h>
@ -57,7 +59,7 @@ void ViewAction::init()
#endif #endif
this, SLOT(editAction())); this, SLOT(editAction()));
fillLists(); fillLists();
resize(QSize(450, 250).expandedTo(minimumSizeHint()) ); resize(QSize(640, 250).expandedTo(minimumSizeHint()) );
} }
void ViewAction::fillLists() 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 // To avoid modifying the listview state from the dbl click signal, as
// advised by the manual // advised by the manual
void ViewAction::listDblClicked() void ViewAction::listDblClicked()

View File

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