mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
patch from John Levon, fixes to kde
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1022 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
525c430bc7
commit
b2b9fd9c89
21
ChangeLog
21
ChangeLog
@ -1,3 +1,24 @@
|
|||||||
|
2000-09-15 John Levon <moz@compsoc.man.ac.uk>
|
||||||
|
|
||||||
|
* acconfig.h
|
||||||
|
* configure.in: remove unused KDE/GTKGUI define
|
||||||
|
|
||||||
|
* src/frontends/kde/FormRef.C
|
||||||
|
* src/frontends/kde/FormRef.h
|
||||||
|
* src/frontends/kde/formrefdialog.C
|
||||||
|
* src/frontends/kde/formrefdialog.h: double click will
|
||||||
|
go to reference, now it is possible to change a cross-ref
|
||||||
|
after the fact
|
||||||
|
|
||||||
|
* src/frontends/kde/FormToc.C
|
||||||
|
* src/frontends/kde/FormToc.h
|
||||||
|
* src/frontends/kde/formtocdialog.C
|
||||||
|
* src/frontends/kde/formtocdialog.h: add a depth
|
||||||
|
slider
|
||||||
|
|
||||||
|
* src/frontends/kde/Makefile.am: add QtLyXView.h
|
||||||
|
to the sources list
|
||||||
|
|
||||||
2000-09-15 Angus Leeming <a.leeming@ic.ac.uk>
|
2000-09-15 Angus Leeming <a.leeming@ic.ac.uk>
|
||||||
|
|
||||||
* src/frontends/kde/FormCitation.h: added some using directives.
|
* src/frontends/kde/FormCitation.h: added some using directives.
|
||||||
|
@ -40,11 +40,6 @@
|
|||||||
e.g. <xpm.h> */
|
e.g. <xpm.h> */
|
||||||
#undef XPM_H_LOCATION
|
#undef XPM_H_LOCATION
|
||||||
|
|
||||||
/* here are the defines for what Toolkit to use (default is XForms) */
|
|
||||||
#undef KDEGUI
|
|
||||||
|
|
||||||
#undef GTKGUI
|
|
||||||
|
|
||||||
#undef HAVE_LIBSM
|
#undef HAVE_LIBSM
|
||||||
|
|
||||||
#undef USE_PSPELL
|
#undef USE_PSPELL
|
||||||
|
@ -168,8 +168,7 @@ case "$lyx_use_frontend" in
|
|||||||
FRONTEND_GUILIB="\${top_builddir}/src/frontends/kde/libkde.la"
|
FRONTEND_GUILIB="\${top_builddir}/src/frontends/kde/libkde.la"
|
||||||
FRONTEND_LDFLAGS="\$(QT_LDFLAGS) \$(KDE_LDFLAGS)"
|
FRONTEND_LDFLAGS="\$(QT_LDFLAGS) \$(KDE_LDFLAGS)"
|
||||||
FRONTEND_INCLUDES="-I\${srcdir}/kde \$(QT_INCLUDES) \$(KDE_INCLUDES)"
|
FRONTEND_INCLUDES="-I\${srcdir}/kde \$(QT_INCLUDES) \$(KDE_INCLUDES)"
|
||||||
FRONTEND_LIBS="\$(KDE_LIBS)"
|
FRONTEND_LIBS="\$(KDE_LIBS)";;
|
||||||
AC_DEFINE(KDEGUI);;
|
|
||||||
xforms)
|
xforms)
|
||||||
# for now don't set it for xforms as this is always entered
|
# for now don't set it for xforms as this is always entered
|
||||||
FRONTEND=""
|
FRONTEND=""
|
||||||
@ -183,8 +182,7 @@ case "$lyx_use_frontend" in
|
|||||||
FRONTEND_GUILIB="\${top_builddir}/src/frontends/gnome/libgnome.la"
|
FRONTEND_GUILIB="\${top_builddir}/src/frontends/gnome/libgnome.la"
|
||||||
FRONTEND_LDFLAGS="\$(GNOMEMM_LIBDIR)"
|
FRONTEND_LDFLAGS="\$(GNOMEMM_LIBDIR)"
|
||||||
FRONTEND_INCLUDES="-I\${srcdir}/gnome \$(GNOMEMM_INCLUDEDIR) \$(GTKMM_CFLAGS)"
|
FRONTEND_INCLUDES="-I\${srcdir}/gnome \$(GNOMEMM_INCLUDEDIR) \$(GTKMM_CFLAGS)"
|
||||||
FRONTEND_LIBS="\$(GNOMEMM_LIBS) \$(GTKMM_LIBS)"
|
FRONTEND_LIBS="\$(GNOMEMM_LIBS) \$(GTKMM_LIBS)";;
|
||||||
AC_DEFINE(GTKGUI);;
|
|
||||||
*)
|
*)
|
||||||
LYX_ERROR(Unknown frontend $lyx_use_frontend);;
|
LYX_ERROR(Unknown frontend $lyx_use_frontend);;
|
||||||
esac
|
esac
|
||||||
|
@ -66,10 +66,15 @@ void FormRef::createRef(string const & arg)
|
|||||||
|
|
||||||
void FormRef::select(const char *text)
|
void FormRef::select(const char *text)
|
||||||
{
|
{
|
||||||
params.setContents(text);
|
highlight(text);
|
||||||
lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK);
|
goto_ref();
|
||||||
gotowhere = GOTOREF;
|
}
|
||||||
dialog_->buttonGoto->setText(_("&Goto reference"));
|
|
||||||
|
void FormRef::highlight(const char *text)
|
||||||
|
{
|
||||||
|
if (gotowhere==GOTOBACK)
|
||||||
|
goto_ref();
|
||||||
|
|
||||||
dialog_->buttonGoto->setEnabled(true);
|
dialog_->buttonGoto->setEnabled(true);
|
||||||
if (!readonly) {
|
if (!readonly) {
|
||||||
dialog_->type->setEnabled(true);
|
dialog_->type->setEnabled(true);
|
||||||
@ -91,12 +96,12 @@ void FormRef::goto_ref()
|
|||||||
{
|
{
|
||||||
switch (gotowhere) {
|
switch (gotowhere) {
|
||||||
case GOTOREF:
|
case GOTOREF:
|
||||||
lv_->getLyXFunc()->Dispatch(LFUN_REF_GOTO, params.getContents().c_str());
|
lv_->getLyXFunc()->Dispatch(LFUN_REF_GOTO, dialog_->reference->text());
|
||||||
gotowhere=GOTOBACK;
|
gotowhere=GOTOBACK;
|
||||||
dialog_->buttonGoto->setText(_("&Go back"));
|
dialog_->buttonGoto->setText(_("&Go back"));
|
||||||
break;
|
break;
|
||||||
case GOTOBACK:
|
case GOTOBACK:
|
||||||
lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK, params.getContents().c_str());
|
lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK);
|
||||||
gotowhere=GOTOREF;
|
gotowhere=GOTOREF;
|
||||||
dialog_->buttonGoto->setText(_("&Goto reference"));
|
dialog_->buttonGoto->setText(_("&Goto reference"));
|
||||||
break;
|
break;
|
||||||
@ -105,8 +110,19 @@ void FormRef::goto_ref()
|
|||||||
|
|
||||||
void FormRef::updateRefs()
|
void FormRef::updateRefs()
|
||||||
{
|
{
|
||||||
|
// list will be re-done, should go back if necessary
|
||||||
|
if (gotowhere==GOTOBACK) {
|
||||||
|
lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK);
|
||||||
|
gotowhere = GOTOREF;
|
||||||
|
dialog_->buttonGoto->setText(_("&Goto reference"));
|
||||||
|
}
|
||||||
|
|
||||||
dialog_->refs->setAutoUpdate(false);
|
dialog_->refs->setAutoUpdate(false);
|
||||||
|
|
||||||
|
// need this because Qt will send a highlight() here for
|
||||||
|
// the first item inserted
|
||||||
|
string tmp(dialog_->reference->text());
|
||||||
|
|
||||||
for (vector< string >::const_iterator iter = refs.begin();
|
for (vector< string >::const_iterator iter = refs.begin();
|
||||||
iter != refs.end(); ++iter) {
|
iter != refs.end(); ++iter) {
|
||||||
if (sort)
|
if (sort)
|
||||||
@ -114,19 +130,34 @@ void FormRef::updateRefs()
|
|||||||
else
|
else
|
||||||
dialog_->refs->insertItem(iter->c_str());
|
dialog_->refs->insertItem(iter->c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dialog_->reference->setText(tmp.c_str());
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < dialog_->refs->count(); ++i) {
|
||||||
|
if (!strcmp(dialog_->reference->text(),dialog_->refs->text(i)))
|
||||||
|
dialog_->refs->setCurrentItem(i);
|
||||||
|
}
|
||||||
|
|
||||||
dialog_->refs->setAutoUpdate(true);
|
dialog_->refs->setAutoUpdate(true);
|
||||||
dialog_->refs->update();
|
dialog_->refs->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormRef::do_ref_update()
|
||||||
|
{
|
||||||
|
refs.clear();
|
||||||
|
dialog_->refs->clear();
|
||||||
|
refs = lv_->buffer()->getLabelList();
|
||||||
|
if (!refs.empty())
|
||||||
|
dialog_->sort->setEnabled(true);
|
||||||
|
updateRefs();
|
||||||
|
}
|
||||||
|
|
||||||
void FormRef::update()
|
void FormRef::update()
|
||||||
{
|
{
|
||||||
dialog_->reference->setText(params.getContents().c_str());
|
dialog_->reference->setText(params.getContents().c_str());
|
||||||
dialog_->refname->setText(params.getOptions().c_str());
|
dialog_->refname->setText(params.getOptions().c_str());
|
||||||
|
|
||||||
if (params.getCmdName()=="prettyref") {
|
if (params.getCmdName()=="pageref") {
|
||||||
type = PRETTYREF;
|
|
||||||
dialog_->type->setCurrentItem(4);
|
|
||||||
} else if (params.getCmdName()=="pageref") {
|
|
||||||
type = PAGEREF;
|
type = PAGEREF;
|
||||||
dialog_->type->setCurrentItem(1);
|
dialog_->type->setCurrentItem(1);
|
||||||
} else if (params.getCmdName()=="vref") {
|
} else if (params.getCmdName()=="vref") {
|
||||||
@ -135,6 +166,9 @@ void FormRef::update()
|
|||||||
} else if (params.getCmdName()=="vpageref") {
|
} else if (params.getCmdName()=="vpageref") {
|
||||||
type = VPAGEREF;
|
type = VPAGEREF;
|
||||||
dialog_->type->setCurrentItem(3);
|
dialog_->type->setCurrentItem(3);
|
||||||
|
} else if (params.getCmdName()=="prettyref") {
|
||||||
|
type = PRETTYREF;
|
||||||
|
dialog_->type->setCurrentItem(4);
|
||||||
} else {
|
} else {
|
||||||
type = REF;
|
type = REF;
|
||||||
dialog_->type->setCurrentItem(0);
|
dialog_->type->setCurrentItem(0);
|
||||||
@ -146,46 +180,20 @@ void FormRef::update()
|
|||||||
|
|
||||||
dialog_->sort->setChecked(sort);
|
dialog_->sort->setChecked(sort);
|
||||||
|
|
||||||
dialog_->refs->clear();
|
do_ref_update();
|
||||||
dialog_->type->setEnabled(false);
|
|
||||||
|
|
||||||
if (inset_) {
|
dialog_->buttonGoto->setEnabled(params.getContents()!="");
|
||||||
// FIXME: should totally remove and re-size dialog,
|
dialog_->buttonOk->setEnabled(params.getContents()!="");
|
||||||
// but doesn't seem easily possible
|
|
||||||
dialog_->refs->hide();
|
|
||||||
dialog_->labelrefs->hide();
|
|
||||||
dialog_->sort->hide();
|
|
||||||
dialog_->buttonUpdate->hide();
|
|
||||||
dialog_->buttonGoto->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
dialog_->refs->show();
|
|
||||||
dialog_->labelrefs->show();
|
|
||||||
dialog_->sort->show();
|
|
||||||
dialog_->buttonUpdate->show();
|
|
||||||
refs = lv_->buffer()->getLabelList();
|
|
||||||
if (!refs.empty())
|
|
||||||
dialog_->sort->setEnabled(true);
|
|
||||||
updateRefs();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.getContents()=="") {
|
dialog_->type->setEnabled(!readonly);
|
||||||
dialog_->buttonGoto->setEnabled(false);
|
dialog_->sort->setEnabled(!readonly);
|
||||||
dialog_->buttonOk->setEnabled(false);
|
dialog_->refs->setEnabled(!readonly);
|
||||||
} else {
|
dialog_->buttonOk->setEnabled(!readonly);
|
||||||
dialog_->buttonGoto->setEnabled(true);
|
dialog_->buttonUpdate->setEnabled(!readonly);
|
||||||
dialog_->buttonOk->setEnabled(true);
|
if (readonly)
|
||||||
}
|
|
||||||
|
|
||||||
if (readonly) {
|
|
||||||
dialog_->type->setEnabled(false);
|
|
||||||
dialog_->buttonOk->setEnabled(false);
|
|
||||||
dialog_->buttonUpdate->setEnabled(false);
|
|
||||||
dialog_->buttonCancel->setText(_("&Close"));
|
dialog_->buttonCancel->setText(_("&Close"));
|
||||||
} else {
|
else
|
||||||
dialog_->type->setEnabled(true);
|
|
||||||
dialog_->buttonUpdate->setEnabled(true);
|
|
||||||
dialog_->buttonCancel->setText(_("&Cancel"));
|
dialog_->buttonCancel->setText(_("&Cancel"));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormRef::apply()
|
void FormRef::apply()
|
||||||
@ -216,6 +224,7 @@ void FormRef::apply()
|
|||||||
lyxerr[Debug::GUI] << "Unknown Ref Type" << endl;
|
lyxerr[Debug::GUI] << "Unknown Ref Type" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params.setContents(dialog_->reference->text());
|
||||||
params.setOptions(dialog_->refname->text());
|
params.setOptions(dialog_->refname->text());
|
||||||
|
|
||||||
if (inset_ != 0) {
|
if (inset_ != 0) {
|
||||||
|
@ -34,14 +34,18 @@ public:
|
|||||||
~FormRef();
|
~FormRef();
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/// select a ref
|
/// double-click a ref
|
||||||
void select(const char *);
|
void select(const char *);
|
||||||
|
/// highlight a ref
|
||||||
|
void highlight(const char *);
|
||||||
/// set sort
|
/// set sort
|
||||||
void set_sort(bool);
|
void set_sort(bool);
|
||||||
/// goto a ref (or back)
|
/// goto a ref (or back)
|
||||||
void goto_ref();
|
void goto_ref();
|
||||||
/// update dialog
|
/// update dialog
|
||||||
void update();
|
void update();
|
||||||
|
/// update just the refs
|
||||||
|
void do_ref_update();
|
||||||
/// Apply changes
|
/// Apply changes
|
||||||
void apply();
|
void apply();
|
||||||
/// close the connections
|
/// close the connections
|
||||||
|
@ -34,7 +34,7 @@ using std::stack;
|
|||||||
|
|
||||||
FormToc::FormToc(LyXView *v, Dialogs *d)
|
FormToc::FormToc(LyXView *v, Dialogs *d)
|
||||||
: dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0),
|
: dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0),
|
||||||
toclist(0), type(Buffer::TOC_TOC)
|
toclist(0), type(Buffer::TOC_TOC), depth(1)
|
||||||
{
|
{
|
||||||
// let the dialog be shown
|
// let the dialog be shown
|
||||||
// This is a permanent connection so we won't bother
|
// This is a permanent connection so we won't bother
|
||||||
@ -70,7 +70,7 @@ void FormToc::createTOC(string const & arg)
|
|||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormToc::updateToc()
|
void FormToc::updateToc(int newdepth)
|
||||||
{
|
{
|
||||||
if (!lv_->view()->available()) {
|
if (!lv_->view()->available()) {
|
||||||
toclist.clear();
|
toclist.clear();
|
||||||
@ -82,7 +82,7 @@ void FormToc::updateToc()
|
|||||||
lv_->view()->buffer()->getTocList();
|
lv_->view()->buffer()->getTocList();
|
||||||
|
|
||||||
// Check if all elements are the same.
|
// Check if all elements are the same.
|
||||||
if (toclist.size() == tmp[type].size()) {
|
if (newdepth==depth && toclist.size() == tmp[type].size()) {
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
for (; i < toclist.size(); ++i) {
|
for (; i < toclist.size(); ++i) {
|
||||||
if (toclist[i] != tmp[type][i])
|
if (toclist[i] != tmp[type][i])
|
||||||
@ -92,13 +92,17 @@ void FormToc::updateToc()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
depth=newdepth;
|
||||||
|
|
||||||
toclist = tmp[type];
|
toclist = tmp[type];
|
||||||
|
|
||||||
dialog_->tree->clear();
|
dialog_->tree->clear();
|
||||||
|
if (toclist.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
dialog_->tree->setUpdatesEnabled(false);
|
dialog_->tree->setUpdatesEnabled(false);
|
||||||
|
|
||||||
int depth = 0;
|
int curdepth = 0;
|
||||||
stack< pair< QListViewItem *, QListViewItem *> > istack;
|
stack< pair< QListViewItem *, QListViewItem *> > istack;
|
||||||
QListViewItem *last = 0;
|
QListViewItem *last = 0;
|
||||||
QListViewItem *parent = 0;
|
QListViewItem *parent = 0;
|
||||||
@ -110,21 +114,21 @@ void FormToc::updateToc()
|
|||||||
|
|
||||||
for (vector< Buffer::TocItem >::const_iterator iter = toclist.begin();
|
for (vector< Buffer::TocItem >::const_iterator iter = toclist.begin();
|
||||||
iter != toclist.end(); ++iter) {
|
iter != toclist.end(); ++iter) {
|
||||||
if (iter->depth == depth) {
|
if (iter->depth == curdepth) {
|
||||||
// insert it after the last one we processed
|
// insert it after the last one we processed
|
||||||
if (!parent)
|
if (!parent)
|
||||||
item = (last) ? (new QListViewItem(dialog_->tree,last)) : (new QListViewItem(dialog_->tree));
|
item = (last) ? (new QListViewItem(dialog_->tree,last)) : (new QListViewItem(dialog_->tree));
|
||||||
else
|
else
|
||||||
item = (last) ? (new QListViewItem(parent,last)) : (new QListViewItem(parent));
|
item = (last) ? (new QListViewItem(parent,last)) : (new QListViewItem(parent));
|
||||||
} else if (iter->depth > depth) {
|
} else if (iter->depth > curdepth) {
|
||||||
int diff = iter->depth - depth;
|
int diff = iter->depth - curdepth;
|
||||||
// first save old parent and last
|
// first save old parent and last
|
||||||
while (diff--)
|
while (diff--)
|
||||||
istack.push(pair< QListViewItem *, QListViewItem * >(parent,last));
|
istack.push(pair< QListViewItem *, QListViewItem * >(parent,last));
|
||||||
item = (last) ? (new QListViewItem(last)) : (new QListViewItem(dialog_->tree));
|
item = (last) ? (new QListViewItem(last)) : (new QListViewItem(dialog_->tree));
|
||||||
parent = last;
|
parent = last;
|
||||||
} else {
|
} else {
|
||||||
int diff = depth - iter->depth;
|
int diff = curdepth - iter->depth;
|
||||||
pair< QListViewItem *, QListViewItem * > top;
|
pair< QListViewItem *, QListViewItem * > top;
|
||||||
// restore context
|
// restore context
|
||||||
while (diff--) {
|
while (diff--) {
|
||||||
@ -143,7 +147,8 @@ void FormToc::updateToc()
|
|||||||
<< " at depth " << iter->depth << ", previous sibling \"" << (last ? last->text(0) : "0")
|
<< " at depth " << iter->depth << ", previous sibling \"" << (last ? last->text(0) : "0")
|
||||||
<< "\", parent \"" << (parent ? parent->text(0) : "0") << "\"" << endl;
|
<< "\", parent \"" << (parent ? parent->text(0) : "0") << "\"" << endl;
|
||||||
item->setText(0,iter->str.c_str());
|
item->setText(0,iter->str.c_str());
|
||||||
depth = iter->depth;
|
item->setOpen(iter->depth < depth);
|
||||||
|
curdepth = iter->depth;
|
||||||
last = item;
|
last = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,22 +163,32 @@ void FormToc::setType(Buffer::TocType toctype)
|
|||||||
case Buffer::TOC_TOC:
|
case Buffer::TOC_TOC:
|
||||||
dialog_->setCaption(_("Table of Contents"));
|
dialog_->setCaption(_("Table of Contents"));
|
||||||
dialog_->tree->setColumnText(0,_("Table of Contents"));
|
dialog_->tree->setColumnText(0,_("Table of Contents"));
|
||||||
|
dialog_->depth->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case Buffer::TOC_LOF:
|
case Buffer::TOC_LOF:
|
||||||
dialog_->setCaption(_("List of Figures"));
|
dialog_->setCaption(_("List of Figures"));
|
||||||
dialog_->tree->setColumnText(0,_("List of Figures"));
|
dialog_->tree->setColumnText(0,_("List of Figures"));
|
||||||
|
dialog_->depth->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case Buffer::TOC_LOT:
|
case Buffer::TOC_LOT:
|
||||||
dialog_->setCaption(_("List of Tables"));
|
dialog_->setCaption(_("List of Tables"));
|
||||||
dialog_->tree->setColumnText(0,_("List of Tables"));
|
dialog_->tree->setColumnText(0,_("List of Tables"));
|
||||||
|
dialog_->depth->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case Buffer::TOC_LOA:
|
case Buffer::TOC_LOA:
|
||||||
dialog_->setCaption(_("List of Algorithms"));
|
dialog_->setCaption(_("List of Algorithms"));
|
||||||
dialog_->tree->setColumnText(0,_("List of Algorithms"));
|
dialog_->tree->setColumnText(0,_("List of Algorithms"));
|
||||||
|
dialog_->depth->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormToc::set_depth(int newdepth)
|
||||||
|
{
|
||||||
|
if (newdepth!=depth)
|
||||||
|
updateToc(newdepth);
|
||||||
|
}
|
||||||
|
|
||||||
void FormToc::update()
|
void FormToc::update()
|
||||||
{
|
{
|
||||||
if (params.getCmdName()=="tableofcontents") {
|
if (params.getCmdName()=="tableofcontents") {
|
||||||
@ -190,7 +205,7 @@ void FormToc::update()
|
|||||||
dialog_->menu->setCurrentItem(3);
|
dialog_->menu->setCurrentItem(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateToc();
|
updateToc(depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormToc::select(const char *text)
|
void FormToc::select(const char *text)
|
||||||
@ -218,7 +233,7 @@ void FormToc::set_type(Buffer::TocType toctype)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
setType(toctype);
|
setType(toctype);
|
||||||
updateToc();
|
updateToc(depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormToc::show()
|
void FormToc::show()
|
||||||
|
@ -40,6 +40,8 @@ public:
|
|||||||
void set_type(Buffer::TocType);
|
void set_type(Buffer::TocType);
|
||||||
/// Update the dialog.
|
/// Update the dialog.
|
||||||
void update();
|
void update();
|
||||||
|
/// change the depth shown
|
||||||
|
void set_depth(int);
|
||||||
/// close the connections
|
/// close the connections
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
@ -54,10 +56,8 @@ private:
|
|||||||
/// view a Toc inset
|
/// view a Toc inset
|
||||||
void showTOC(InsetCommand * const);
|
void showTOC(InsetCommand * const);
|
||||||
|
|
||||||
/// hierarchical tree
|
|
||||||
int doTree(vector < Buffer::TocItem>::const_iterator & , int, int, int);
|
|
||||||
/// update the Toc
|
/// update the Toc
|
||||||
void updateToc(void);
|
void updateToc(int);
|
||||||
|
|
||||||
/// set the type
|
/// set the type
|
||||||
void setType(Buffer::TocType);
|
void setType(Buffer::TocType);
|
||||||
@ -89,6 +89,9 @@ private:
|
|||||||
|
|
||||||
/// type currently being shown
|
/// type currently being shown
|
||||||
Buffer::TocType type;
|
Buffer::TocType type;
|
||||||
|
|
||||||
|
/// depth of list shown
|
||||||
|
int depth;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,6 +39,7 @@ ETAGS_ARGS = --lang=c++
|
|||||||
libkde_la_SOURCES = \
|
libkde_la_SOURCES = \
|
||||||
Dialogs.C \
|
Dialogs.C \
|
||||||
GUIRunTime.C \
|
GUIRunTime.C \
|
||||||
|
QtLyXView.h \
|
||||||
FormCopyright.C \
|
FormCopyright.C \
|
||||||
FormCopyright.h \
|
FormCopyright.h \
|
||||||
formcopyrightdialog.C \
|
formcopyrightdialog.C \
|
||||||
|
@ -156,6 +156,7 @@ FormRefDialog::FormRefDialog(FormRef *form, QWidget *parent, const char *name, b
|
|||||||
// connections
|
// connections
|
||||||
|
|
||||||
connect(refs, SIGNAL(highlighted(const char *)), this, SLOT(highlight_adaptor(const char *)));
|
connect(refs, SIGNAL(highlighted(const char *)), this, SLOT(highlight_adaptor(const char *)));
|
||||||
|
connect(refs, SIGNAL(selected(const char *)), this, SLOT(select_adaptor(const char *)));
|
||||||
connect(sort, SIGNAL(toggled(bool)), this, SLOT(sort_adaptor(bool)));
|
connect(sort, SIGNAL(toggled(bool)), this, SLOT(sort_adaptor(bool)));
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply_adaptor()));
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply_adaptor()));
|
||||||
connect(buttonUpdate, SIGNAL(clicked()), this, SLOT(update_adaptor()));
|
connect(buttonUpdate, SIGNAL(clicked()), this, SLOT(update_adaptor()));
|
||||||
|
@ -73,10 +73,15 @@ private:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/// adaptor to FormRef::select
|
/// adaptor to FormRef::select
|
||||||
void highlight_adaptor(const char *sel) {
|
void select_adaptor(const char *sel) {
|
||||||
form_->select(sel);
|
form_->select(sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// adaptor to FormRef::highlight
|
||||||
|
void highlight_adaptor(const char *sel) {
|
||||||
|
form_->highlight(sel);
|
||||||
|
}
|
||||||
|
|
||||||
/// adaptor to FormRef::set_sort
|
/// adaptor to FormRef::set_sort
|
||||||
void sort_adaptor(bool sort) {
|
void sort_adaptor(bool sort) {
|
||||||
form_->set_sort(sort);
|
form_->set_sort(sort);
|
||||||
@ -89,7 +94,7 @@ private slots:
|
|||||||
|
|
||||||
/// adaptor to FormRef::update
|
/// adaptor to FormRef::update
|
||||||
void update_adaptor(void) {
|
void update_adaptor(void) {
|
||||||
form_->update();
|
form_->do_ref_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// adaptor to FormRef::apply
|
/// adaptor to FormRef::apply
|
||||||
|
@ -47,6 +47,16 @@ FormTocDialog::FormTocDialog(FormToc *form, QWidget *parent, const char *name, b
|
|||||||
buttonClose->setText(_("&Close"));
|
buttonClose->setText(_("&Close"));
|
||||||
buttonClose->setDefault(true);
|
buttonClose->setDefault(true);
|
||||||
|
|
||||||
|
depth = new QSlider(0, 5, 1, 1, QSlider::Horizontal, this);
|
||||||
|
depth->setMinimumSize(depth->sizeHint());
|
||||||
|
depth->setTickInterval(1);
|
||||||
|
depth->setTracking(true);
|
||||||
|
|
||||||
|
depthlabel = new QLabel(this);
|
||||||
|
depthlabel->setText(_("Depth"));
|
||||||
|
depthlabel->setMinimumSize(depthlabel->sizeHint());
|
||||||
|
depthlabel->setMaximumSize(depthlabel->sizeHint());
|
||||||
|
|
||||||
// layouts
|
// layouts
|
||||||
|
|
||||||
topLayout = new QHBoxLayout(this,10);
|
topLayout = new QHBoxLayout(this,10);
|
||||||
@ -57,6 +67,8 @@ FormTocDialog::FormTocDialog(FormToc *form, QWidget *parent, const char *name, b
|
|||||||
|
|
||||||
layout->addWidget(menu,0);
|
layout->addWidget(menu,0);
|
||||||
layout->addWidget(tree,1);
|
layout->addWidget(tree,1);
|
||||||
|
layout->addWidget(depthlabel,0,AlignLeft);
|
||||||
|
layout->addWidget(depth,0);
|
||||||
|
|
||||||
buttonLayout = new QHBoxLayout();
|
buttonLayout = new QHBoxLayout();
|
||||||
|
|
||||||
@ -73,6 +85,7 @@ FormTocDialog::FormTocDialog(FormToc *form, QWidget *parent, const char *name, b
|
|||||||
connect(menu, SIGNAL(activated(int)), this, SLOT(activate_adaptor(int)));
|
connect(menu, SIGNAL(activated(int)), this, SLOT(activate_adaptor(int)));
|
||||||
connect(buttonUpdate, SIGNAL(clicked()), this, SLOT(update_adaptor()));
|
connect(buttonUpdate, SIGNAL(clicked()), this, SLOT(update_adaptor()));
|
||||||
connect(buttonClose, SIGNAL(clicked()), this, SLOT(close_adaptor()));
|
connect(buttonClose, SIGNAL(clicked()), this, SLOT(close_adaptor()));
|
||||||
|
connect(depth, SIGNAL(valueChanged(int)), this, SLOT(depth_adaptor(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormTocDialog::closeEvent(QCloseEvent *e)
|
void FormTocDialog::closeEvent(QCloseEvent *e)
|
||||||
|
@ -20,11 +20,13 @@
|
|||||||
#include <gettext.h>
|
#include <gettext.h>
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <qlabel.h>
|
||||||
#include <qdialog.h>
|
#include <qdialog.h>
|
||||||
#include <qlayout.h>
|
#include <qlayout.h>
|
||||||
#include <qpushbutton.h>
|
#include <qpushbutton.h>
|
||||||
#include <qcombobox.h>
|
#include <qcombobox.h>
|
||||||
#include <qlistview.h>
|
#include <qlistview.h>
|
||||||
|
#include <qslider.h>
|
||||||
|
|
||||||
#include "FormToc.h"
|
#include "FormToc.h"
|
||||||
|
|
||||||
@ -41,6 +43,8 @@ public:
|
|||||||
QListView *tree;
|
QListView *tree;
|
||||||
QPushButton *buttonUpdate;
|
QPushButton *buttonUpdate;
|
||||||
QPushButton *buttonClose;
|
QPushButton *buttonClose;
|
||||||
|
QSlider *depth;
|
||||||
|
QLabel *depthlabel;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *e);
|
void closeEvent(QCloseEvent *e);
|
||||||
@ -60,6 +64,11 @@ private slots:
|
|||||||
form_->select(item->text(0));
|
form_->select(item->text(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// adaptor to FormToc::set_depth
|
||||||
|
void depth_adaptor(int depth) {
|
||||||
|
form_->set_depth(depth);
|
||||||
|
}
|
||||||
|
|
||||||
/// adaptor to FormToc::update
|
/// adaptor to FormToc::update
|
||||||
void update_adaptor(void) {
|
void update_adaptor(void) {
|
||||||
form_->update();
|
form_->update();
|
||||||
|
Loading…
Reference in New Issue
Block a user