Guify forward search.

No viewer set by default, which keeps context menu clean for uninterested users.
Settings are hinted at combobox.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34149 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2010-04-16 08:09:07 +00:00
parent ba57ee8a24
commit 98f106f2ca
6 changed files with 102 additions and 4 deletions

View File

@ -299,6 +299,7 @@ Menuset
Submenu "Paste Recent|e" "edit_pasterecent"
Separator
Item "Jump Back to Saved Bookmark|B" "bookmark-goto 0"
OptItem "Forward search|F" "forward-search"
Separator
Item "Move Paragraph Up|o" "paragraph-move-up"
Item "Move Paragraph Down|v" "paragraph-move-down"

View File

@ -508,6 +508,7 @@ Menuset
Item "Next Change|C" "change-next"
Item "Next Cross-Reference|R" "reference-next"
OptItem "Go to Label|L" "label-goto"
Item "Forward search|F" "forward-search"
Separator
Toc
End

View File

@ -328,7 +328,7 @@ void LyXRC::setDefaults()
user_email = to_utf8(support::user_email());
open_buffers_in_tabs = true;
single_close_tab_button = false;
forward_search_dvi = "xdvi -sourceposition $$n:$$t $$o";
forward_search_dvi = string();
forward_search_pdf = string();
// Fullscreen settings

View File

@ -368,6 +368,15 @@ PrefOutput::PrefOutput(GuiPreferences * form)
this, SIGNAL(changed()));
connect(plaintextLinelengthSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
connect(dviCB, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(pdfCB, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
dviCB->addItem("");
dviCB->addItem("xdvi -sourceposition $$n:$$t $$o");
dviCB->addItem("yap -1 -s $$n$$t $$o");
pdfCB->addItem("");
pdfCB->addItem("CMCDDE SUMATRA control [ForwardSearch(\\\"$$o\\\",\\\"$$t\\\",$$n,0,0,1)]");
}
@ -385,6 +394,8 @@ void PrefOutput::apply(LyXRC & rc) const
{
rc.date_insert_format = fromqstr(DateED->text());
rc.plaintext_linelen = plaintextLinelengthSB->value();
rc.forward_search_dvi = fromqstr(dviCB->currentText());
rc.forward_search_pdf = fromqstr(pdfCB->currentText());
}
@ -392,6 +403,8 @@ void PrefOutput::update(LyXRC const & rc)
{
DateED->setText(toqstr(rc.date_insert_format));
plaintextLinelengthSB->setValue(rc.plaintext_linelen);
dviCB->setEditText(toqstr(rc.forward_search_dvi));
pdfCB->setEditText(toqstr(rc.forward_search_pdf));
}

View File

@ -1657,7 +1657,9 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break;
case LFUN_SERVER_GOTO_FILE_ROW:
break;
case LFUN_FORWARD_SEARCH:
enable = !(lyxrc.forward_search_dvi.empty() && lyxrc.forward_search_pdf.empty());
break;
default:

View File

@ -5,14 +5,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>270</width>
<height>128</height>
<width>307</width>
<height>234</height>
</rect>
</property>
<property name="windowTitle" >
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<item>
@ -96,6 +96,87 @@
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Forward search</string>
</property>
<property name="flat" >
<bool>true</bool>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<item>
<widget class="QLabel" name="label" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>DV&amp;I command:</string>
</property>
<property name="buddy" >
<cstring>dviCB</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="dviCB" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5" >
<item>
<widget class="QLabel" name="label_2" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;PDF command:</string>
</property>
<property name="buddy" >
<cstring>pdfCB</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="pdfCB" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >