--- /dev/null
+/**
+ * \file Alert_pimpl.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+
+#include <qmessagebox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include "ui/QAskForTextDialog.h"
+
+#include FORMS_H_LOCATION
+
+#include <algorithm>
+
+#include <gettext.h>
+
+#include "Alert.h"
+#include "Alert_pimpl.h"
+#include "xforms_helpers.h"
+
+using std::pair;
+using std::make_pair;
+
+void alert_pimpl(string const & s1, string const & s2, string const & s3)
+{
+ QMessageBox::warning(0, "LyX", (s1 + "\n" + "\n" + s2 + "\n" + s3).c_str());
+}
+
+
+bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3)
+{
+ return !(QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
+ _("&Yes"), _("&No"), 0, 1));
+}
+
+
+int askConfirmation_pimpl(string const & s1, string const & s2, string const & s3)
+{
+ return (QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
+ _("&Yes"), _("&No"), _("&Cancel"), 0, 2)) + 1;
+}
+
+
+pair<bool, string> const askForText_pimpl(string const & msg, string const & dflt)
+{
+ string title = _("LyX: ");
+ title += msg;
+
+ QAskForTextDialog d(0, msg.c_str(), true);
+ // less than ideal !
+ d.askLA->setText((string("&") + msg).c_str());
+ d.askLE->setText(dflt.c_str());
+ int ret = d.exec();
+
+ d.hide();
+
+ if (ret)
+ return make_pair<bool, string>(true, d.askLE->text().latin1());
+ else
+ return make_pair<bool, string>(false, string());
+}
-2002-02-18 John Levon <moz@compsoc.man.ac.uk>
+2002-03-01 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
* moc/Makefile.am:
* ui/Makefile.am:
- * ui/moc/Makefile.am: use .o for libs
+ * ui/moc/Makefile.am: fix compile
+ * xforms/: compile the necessary files via symlinks
+
* QPreambleDialog.C: new systemcall interface
+ * Timeout_pimpl.h:
+ * Timeout_pimpl.C: add running()
+
+ * Dialogs.C: add init graphics, and doc/par xforms forms
+
2002-02-06 John Levon <moz@compsoc.man.ac.uk>
* QToc.C: fix crash
#include "Qt2BC.h"
// xforms stuff
-//#include "xforms/FormDocument.h"
+#include "xforms/FormDocument.h"
#include "xforms/FormMathsPanel.h"
-//#include "xforms/FormParagraph.h"
+#include "xforms/FormParagraph.h"
#include "xforms/FormPreferences.h"
#include "xforms/FormShowFile.h"
#include "xforms/FormTabular.h"
+#include "graphics/GraphicsImageXPM.h"
+
#include "GUI.h"
// this makes no real sense for Qt2
add(new GUIVCLog<QVCLog, Qt2BC>(*lv, *this));
// dialogs not yet MVCd
-// add(new FormDocument(lv, this));
+ add(new FormDocument(lv, this));
add(new FormMathsPanel(lv, this));
-// add(new FormParagraph(lv, this));
+ add(new FormParagraph(lv, this));
add(new FormPreferences(lv, this));
add(new FormTabular(lv, this));
// dialogs by a simple connection here.
hideAll.connect(hideBufferDependent.slot());
}
+
+
+// Called bu the graphics cache to connect the approriate frontend
+// image loading routines to the LyX kernel.
+void Dialogs::initialiseGraphics()
+{
+ using namespace grfx;
+ using SigC::slot;
+
+ // connect the image loader based on the XPM library
+ GImage::newImage.connect(slot(&GImageXPM::newImage));
+ GImage::loadableFormats.connect(slot(&GImageXPM::loadableFormats));
+}
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
noinst_LTLIBRARIES = libqt2.la
BOOST_INCLUDES = -I$(top_srcdir)/boost
-SUBDIRS=ui moc
+SUBDIRS=xforms ui moc
INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \
- ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \
+ ${SIGC_CFLAGS} -I$(top_srcdir)/images ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \
-I$(top_srcdir)/src/frontends/controllers
AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR
include Makefile.dialogs
+ETAGS_ARGS = --lang=c++
+
libqt2_la_LIBADD = \
- ui/libqt2ui.o \
- moc/libqt2moc.o \
- ui/moc/libqt2uimoc.o \
+ xforms/libqt2xforms.la \
+ ui/libqt2ui.la \
+ moc/libqt2moc.la \
+ ui/moc/libqt2uimoc.la \
@LYX_LIBS@ @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@
libqt2_la_SOURCES = \
$(DIALOGSOURCES) \
+ Alert_pimpl.C \
Dialogs.C \
GUIRunTime.C \
FileDialog.C \
qttableview.h \
qttableview.C
-xforms_objects = \
- ../xforms/combox.o \
- ../xforms/Alert_pimpl.o \
- ../xforms/Color.o \
- ../xforms/DropDown.o \
- ../xforms/FormBase.o \
- ../xforms/FormBaseDeprecated.o \
- ../xforms/FormMathsBitmap.o \
- ../xforms/FormMathsDeco.o \
- ../xforms/FormMathsDelim.o \
- ../xforms/FormMathsMatrix.o \
- ../xforms/FormMathsPanel.o \
- ../xforms/FormMathsStyle.o \
- ../xforms/FormMathsSpace.o \
- ../xforms/FormPreferences.o \
- ../xforms/FormTabular.o \
- ../xforms/FormInset.o \
- ../xforms/MathsSymbols.o \
- ../xforms/Menubar_pimpl.o \
- ../xforms/RadioButtonGroup.o \
- ../xforms/Toolbar_pimpl.o \
- ../xforms/bmtable.o \
- ../xforms/form_preferences.o \
- ../xforms/form_tabular.o \
- ../xforms/form_maths_deco.o \
- ../xforms/form_maths_delim.o \
- ../xforms/form_maths_matrix.o \
- ../xforms/form_maths_panel.o \
- ../xforms/form_maths_space.o \
- ../xforms/form_maths_style.o \
- ../xforms/input_validators.o \
- ../xforms/xformsBC.o \
- ../xforms/xforms_helpers.o
-
-libqt2.la: xforms.lo $(libqt2_la_OBJECTS) $(libqt2_la_DEPENDENCIES)
-
-xforms.lo: $(xforms_objects)
- $(CXXLINK) $(xforms_objects)
\ No newline at end of file
+libqt2.la: $(libqt2_la_OBJECTS) $(libqt2_la_DEPENDENCIES)
DIALOGS = \
QAbout \
+ QAskForText \
QBibitem \
QBibtex \
QCharacter \
UIDIALOGS = \
QAboutDialogBase.h \
QAboutDialogBase.C \
+ QAskForTextDialog.h \
+ QAskForTextDialog.C \
QBibitemDialogBase.h \
QBibitemDialogBase.C \
QBibtexDialogBase.h \
UIMOCDIALOGS = \
QAboutDialogBase_moc.C \
+ QAskForTextDialog_moc.C \
QBibitemDialogBase_moc.C \
QBibtexDialogBase_moc.C \
QCharacterDialogBase_moc.C \
QTocDialogBase_moc.C \
QURLDialogBase_moc.C \
QVCLogDialogBase_moc.C
-
-
-
-
-
-
#include "QPreamble.h"
#include "support/lyxlib.h"
-#include "support/syscall.h"
+#include "support/forkedcall.h"
#include "support/filetools.h"
#include "gettext.h"
editor += " " + filename;
- Systemcalls sys;
+ Forkedcall call;
- // FIXME: synchronous, ugh. Make async when moved to controllers ?
- if (sys.startscript(Systemcalls::Wait, editor)) {
+ // FIXME: make async
+ if (call.startscript(Forkedcall::Wait, editor)) {
lyx::unlink(filename);
return;
}
}
+bool Timeout::Pimpl::running() const
+{
+ return timeout_id != -1;
+}
+
+
void Timeout::Pimpl::start()
{
- if (timeout_id != -1)
+ if (running())
lyxerr << "Timeout::start: already running!" << endl;
timeout_id = startTimer(owner_->timeout_ms);
}
void Timeout::Pimpl::stop()
{
- if (timeout_id != -1)
+ if (running())
reset();
}
void stop();
/// reset
void reset();
+ /// is the timer running ?
+ bool running() const;
protected:
/// slot
SED=sed
SEDREPLACETR=s,[^A-Za-z]tr[ ]*(,_(,g
SEDREMOVEEMPTY=s,_[ ]*([ ]*""[ ]*),"",g
+
+QAskForTextDialog.h: QAskForTextDialog.ui
+ $(UIC) $< -o $@
+QAskForTextDialog.C: QAskForTextDialog.h QAskForTextDialog.ui
+ $(UIC) -impl $^ | $(SED) '$(SEDREPLACETR);$(SEDREMOVEEMPTY)' > $@
+
%Base.h: %.ui
$(UIC) $< -o $@
%Base.C: %Base.h %.ui
--- /dev/null
+<!DOCTYPE UI><UI>
+<class>QAskForTextDialog</class>
+<include location="global">config.h</include>
+<include location="local">gettext.h</include>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>QAskForTextDialog</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>277</width>
+ <height>116</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>LyX: Enter text</string>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>askLA</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Dummy</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>askLE</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>askLE</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer6</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>okPB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>OK</string>
+ </property>
+ <property stdset="1">
+ <name>default</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>cancelPB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Cancel</string>
+ </property>
+ <property stdset="1">
+ <name>default</name>
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>okPB</sender>
+ <signal>clicked()</signal>
+ <receiver>QAskForTextDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelPB</sender>
+ <signal>clicked()</signal>
+ <receiver>QAskForTextDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+</UI>
--- /dev/null
+Makefile.in
+Makefile
+*.deps
+*.lo
+.libs
+libqt2.la
+moc_*.C
+*_moc.C
--- /dev/null
+AUTOMAKE_OPTIONS = foreign 1.4
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
+noinst_LTLIBRARIES = libqt2xforms.la
+BOOST_INCLUDES = -I$(top_srcdir)/boost
+INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \
+ ${SIGC_CFLAGS} -I$(top_srcdir)/images ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \
+ -I$(top_srcdir)/src/frontends/controllers
+
+DISTCLEANFILES = $(XFORMS_SOURCES) $(BUILTSOURCES) *.orig *.rej *~ *.bak core
+
+LIBS=
+ETAGS_ARGS = --lang=c++
+
+XFORMS_SOURCES = \
+ bmtable.h \
+ bmtable.c \
+ combox.h \
+ combox.C \
+ Color.h \
+ Color.C \
+ DropDown.h \
+ DropDown.C \
+ FormBase.h \
+ FormBase.C \
+ FormBaseDeprecated.h \
+ FormBaseDeprecated.C \
+ FormDocument.h \
+ FormDocument.C \
+ FormParagraph.h \
+ FormParagraph.C \
+ FormMathsBitmap.h \
+ FormMathsBitmap.C \
+ FormMathsDeco.h \
+ FormMathsDeco.C \
+ FormMathsDelim.h \
+ FormMathsDelim.C \
+ FormMathsMatrix.h \
+ FormMathsMatrix.C \
+ FormMathsPanel.h \
+ FormMathsPanel.C \
+ FormMathsStyle.h \
+ FormMathsStyle.C \
+ FormMathsSpace.h \
+ FormMathsSpace.C \
+ FormPreferences.h \
+ FormPreferences.C \
+ FormTabular.h \
+ FormTabular.C \
+ FormInset.h \
+ FormInset.C \
+ MathsSymbols.h \
+ MathsSymbols.C \
+ Menubar_pimpl.h \
+ Menubar_pimpl.C \
+ RadioButtonGroup.h \
+ RadioButtonGroup.C \
+ Toolbar_pimpl.h \
+ Toolbar_pimpl.C \
+ Tooltips.h \
+ Tooltips.C \
+ form_document.h \
+ form_document.C \
+ form_paragraph.h \
+ form_paragraph.C \
+ form_preferences.h \
+ form_preferences.C \
+ form_tabular.h \
+ form_tabular.C \
+ form_maths_deco.h \
+ form_maths_deco.C \
+ form_maths_delim.h \
+ form_maths_delim.C \
+ form_maths_matrix.h \
+ form_maths_matrix.C \
+ form_maths_panel.h \
+ form_maths_panel.C \
+ form_maths_space.h \
+ form_maths_space.C \
+ form_maths_style.h \
+ form_maths_style.C \
+ input_validators.h \
+ input_validators.C \
+ xformsBC.h \
+ xformsBC.C \
+ xforms_helpers.h \
+ xforms_helpers.C
+
+$(XFORMS_SOURCES):
+ for i in $(XFORMS_SOURCES); do ln -sf "${top_srcdir}/src/frontends/xforms/$$i" . ; done
+
+ETAGS_ARGS = --lang=c++
+
+libqt2xforms_la_SOURCES = \
+ $(XFORMS_SOURCES)