mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
basic context menu for InsetExternal.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24531 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
74d1f2cb2f
commit
c778f093ea
@ -276,6 +276,16 @@ Menuset
|
||||
Item "Edit externally...|x" "inset-edit"
|
||||
End
|
||||
|
||||
#
|
||||
# InsetExternal context menu
|
||||
#
|
||||
|
||||
Menu "context-external"
|
||||
Item "Settings...|S" "next-inset-toggle"
|
||||
Separator
|
||||
Item "Edit externally...|x" "inset-edit"
|
||||
End
|
||||
|
||||
#
|
||||
# InsetTabular context menu
|
||||
#
|
||||
|
@ -109,8 +109,6 @@ GuiExternal::GuiExternal(GuiView & lv)
|
||||
this, SLOT(change_adaptor()));
|
||||
connect(browsePB, SIGNAL(clicked()),
|
||||
this, SLOT(browseClicked()));
|
||||
connect(editPB, SIGNAL(clicked()),
|
||||
this, SLOT(editClicked()));
|
||||
connect(externalCO, SIGNAL(activated(QString)),
|
||||
this, SLOT(templateChanged()));
|
||||
connect(extraED, SIGNAL(textChanged(QString)),
|
||||
@ -166,7 +164,6 @@ GuiExternal::GuiExternal(GuiView & lv)
|
||||
|
||||
bc().addReadOnly(fileED);
|
||||
bc().addReadOnly(browsePB);
|
||||
bc().addReadOnly(editPB);
|
||||
bc().addReadOnly(externalCO);
|
||||
bc().addReadOnly(draftCB);
|
||||
bc().addReadOnly(displayscaleED);
|
||||
@ -268,12 +265,6 @@ void GuiExternal::change_adaptor()
|
||||
}
|
||||
|
||||
|
||||
void GuiExternal::editClicked()
|
||||
{
|
||||
editExternal();
|
||||
}
|
||||
|
||||
|
||||
void GuiExternal::extraChanged(const QString & text)
|
||||
{
|
||||
extra_[extraFormatCO->currentText()] = text;
|
||||
@ -698,14 +689,6 @@ void GuiExternal::dispatchParams()
|
||||
}
|
||||
|
||||
|
||||
void GuiExternal::editExternal()
|
||||
{
|
||||
applyView();
|
||||
string const lfun = InsetExternal::params2string(params_, buffer());
|
||||
dispatch(FuncRequest(LFUN_INSET_EDIT, lfun));
|
||||
}
|
||||
|
||||
|
||||
static QStringList templateFilters(QString const & template_name)
|
||||
{
|
||||
/// Determine the template file extension
|
||||
|
@ -35,7 +35,6 @@ private Q_SLOTS:
|
||||
void bbChanged();
|
||||
void browseClicked();
|
||||
void change_adaptor();
|
||||
void editClicked();
|
||||
void extraChanged(const QString &);
|
||||
void formatChanged(const QString &);
|
||||
void getbbClicked();
|
||||
@ -65,8 +64,6 @@ private:
|
||||
///
|
||||
bool isBufferDependent() const { return true; }
|
||||
|
||||
///
|
||||
void editExternal();
|
||||
///
|
||||
QString browse(QString const & input_file,
|
||||
QString const & template_name) const;
|
||||
|
@ -6,7 +6,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>390</width>
|
||||
<height>367</height>
|
||||
<height>346</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
@ -23,6 +23,14 @@
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -38,10 +46,45 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4" >
|
||||
<item>
|
||||
<widget class="QPushButton" name="okPB" >
|
||||
<property name="text" >
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="applyPB" >
|
||||
<property name="text" >
|
||||
<string>&Apply</string>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="closePB" >
|
||||
<property name="text" >
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QTabWidget" name="tab" >
|
||||
<property name="currentIndex" >
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="filetab" >
|
||||
<attribute name="title" >
|
||||
@ -54,54 +97,7 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="3" column="0" colspan="3" >
|
||||
<widget class="QCheckBox" name="draftCB" >
|
||||
<property name="text" >
|
||||
<string>&Draft</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<widget class="QPushButton" name="editPB" >
|
||||
<property name="toolTip" >
|
||||
<string>Edit the file externally</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Edit File...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<widget class="QPushButton" name="browsePB" >
|
||||
<property name="toolTip" >
|
||||
<string>Select a file</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="fileLA" >
|
||||
<property name="toolTip" >
|
||||
<string>Filename</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&File:</string>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>fileED</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLineEdit" name="fileED" >
|
||||
<property name="toolTip" >
|
||||
<string>Filename</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3" >
|
||||
<item row="1" column="0" colspan="3" >
|
||||
<widget class="QGroupBox" name="GroupBox3" >
|
||||
<property name="title" >
|
||||
<string>Template</string>
|
||||
@ -150,6 +146,43 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLineEdit" name="fileED" >
|
||||
<property name="toolTip" >
|
||||
<string>Filename</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="fileLA" >
|
||||
<property name="toolTip" >
|
||||
<string>Filename</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&File:</string>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>fileED</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<widget class="QPushButton" name="browsePB" >
|
||||
<property name="toolTip" >
|
||||
<string>Select a file</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3" >
|
||||
<widget class="QCheckBox" name="draftCB" >
|
||||
<property name="text" >
|
||||
<string>&Draft</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="lyxviewtab" >
|
||||
@ -660,39 +693,6 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="okPB" >
|
||||
<property name="text" >
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<widget class="QPushButton" name="applyPB" >
|
||||
<property name="text" >
|
||||
<string>&Apply</string>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QPushButton" name="closePB" >
|
||||
<property name="text" >
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
@ -706,7 +706,6 @@
|
||||
<tabstop>tab</tabstop>
|
||||
<tabstop>fileED</tabstop>
|
||||
<tabstop>browsePB</tabstop>
|
||||
<tabstop>editPB</tabstop>
|
||||
<tabstop>externalCO</tabstop>
|
||||
<tabstop>externalTB</tabstop>
|
||||
<tabstop>draftCB</tabstop>
|
||||
|
@ -840,6 +840,12 @@ void InsetExternal::addPreview(graphics::PreviewLoader & ploader) const
|
||||
}
|
||||
|
||||
|
||||
docstring InsetExternal::contextMenu(BufferView const &, int, int) const
|
||||
{
|
||||
return from_ascii("context-external");
|
||||
}
|
||||
|
||||
|
||||
void InsetExternal::string2params(string const & in, Buffer const & buffer,
|
||||
InsetExternalParams & params)
|
||||
{
|
||||
|
@ -120,6 +120,8 @@ public:
|
||||
void setParams(InsetExternalParams const &);
|
||||
/// \returns the number of rows (\n's) of generated code.
|
||||
int latex(odocstream &, OutputParams const &) const;
|
||||
///
|
||||
docstring contextMenu(BufferView const & bv, int x, int y) const;
|
||||
|
||||
private:
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user