Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 67c38ddf

Von martin vor mehr als 15 Jahren hinzugefügt

  • ID 67c38ddf28bd1480ecf30715e39a129d697d47ac
  • Vorgänger 2b38b21a
  • Nachfolger be8039b5

Started working on Qt4-Port of QBanking frontend.

git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@1789 5c42a225-8b10-0410-9873-89b7810ad06e

Unterschiede anzeigen:

Makefile.cvs
CFLAGS="$(MP_CFLAGS)" \
./configure $(MP_CONF_FLAGS) \
--with-backends="aqhbci aqofxconnect" \
--with-frontends="qbanking" \
--with-frontends="q4banking" \
--enable-aqfinance
make sources
......
CFLAGS="$(MP_CFLAGS)" \
./configure $(MP_CONF_FLAGS) \
--with-backends="aqhbci aqofxconnect" \
--with-frontends="qbanking" \
--with-frontends="q4banking" \
--disable-aqfinance
make sources
configure.ac
QBANKING_SO_EFFECTIVE="`echo \$(($QBANKING_SO_CURRENT-$QBANKING_SO_AGE))`"
Q4BANKING_SO_CURRENT=1
Q4BANKING_SO_REVISION=0
Q4BANKING_SO_AGE=0
Q4BANKING_SO_EFFECTIVE="`echo \$(($Q4BANKING_SO_CURRENT-$Q4BANKING_SO_AGE))`"
###-------------------------------------------------------------------------
#
......
QBANKING_VERSION_FULL_STRING="$AQBANKING_VERSION_FULL_STRING"
QBANKING_VERSION_STRING="$AQBANKING_VERSION_STRING"
Q4BANKING_VERSION_MAJOR=$AQBANKING_VERSION_MAJOR
Q4BANKING_VERSION_MINOR=$AQBANKING_VERSION_MINOR
Q4BANKING_VERSION_PATCHLEVEL=$AQBANKING_VERSION_PATCHLEVEL
Q4BANKING_VERSION_BUILD=$AQBANKING_VERSION_BUILD
Q4BANKING_VERSION_TAG=$AQBANKING_VERSION_TAG
Q4BANKING_VERSION_FULL_STRING="$AQBANKING_VERSION_FULL_STRING"
Q4BANKING_VERSION_STRING="$AQBANKING_VERSION_STRING"
###-------------------------------------------------------------------------
#
......
AQGELDKARTE_VERSION_RELEASE_STRING="$AQBANKING_RELEASE_STRING"
AQOFXCONNECT_VERSION_RELEASE_STRING="$AQBANKING_RELEASE_STRING"
QBANKING_VERSION_RELEASE_STRING="$AQBANKING_RELEASE_STRING"
Q4BANKING_VERSION_RELEASE_STRING="$AQBANKING_RELEASE_STRING"
......
#
# same for Q4Banking
#
AC_SUBST(Q4BANKING_VERSION_MAJOR)
AC_SUBST(Q4BANKING_VERSION_MINOR)
AC_SUBST(Q4BANKING_VERSION_PATCHLEVEL)
AC_SUBST(Q4BANKING_VERSION_BUILD)
AC_SUBST(Q4BANKING_VERSION_TAG)
AC_SUBST(Q4BANKING_VERSION_FULL_STRING)
AC_SUBST(Q4BANKING_VERSION_STRING)
AC_SUBST(Q4BANKING_VERSION_RELEASE_STRING)
AC_DEFINE_UNQUOTED(Q4BANKING_VERSION_MAJOR,$Q4BANKING_VERSION_MAJOR,
[major version])
AC_DEFINE_UNQUOTED(Q4BANKING_VERSION_MINOR,$Q4BANKING_VERSION_MINOR,
[minor version])
AC_DEFINE_UNQUOTED(Q4BANKING_VERSION_PATCHLEVEL,$Q4BANKING_VERSION_PATCHLEVEL,
[patchlevel])
AC_DEFINE_UNQUOTED(Q4BANKING_VERSION_BUILD,$Q4BANKING_VERSION_BUILD, [build])
AC_DEFINE_UNQUOTED(Q4BANKING_VERSION_STRING,"$Q4BANKING_VERSION_STRING",
[version string])
AC_DEFINE_UNQUOTED(Q4BANKING_VERSION_FULL_STRING,"$Q4BANKING_VERSION_FULL_STRING",
[full version string])
AC_DEFINE_UNQUOTED(Q4BANKING_VERSION_TAG,$Q4BANKING_VERSION_TAG, [tag])
AC_SUBST(Q4BANKING_SO_CURRENT)
AC_SUBST(Q4BANKING_SO_REVISION)
AC_SUBST(Q4BANKING_SO_AGE)
AC_SUBST(QBANKING_SO_EFFECTIVE)
AC_DEFINE_UNQUOTED(Q4BANKING_SO_EFFECTIVE_STR, "$Q4BANKING_SO_EFFECTIVE",
[effective SO version])
###-------------------------------------------------------------------------
#
......
)
# The ordering is important due to linker dependencies, so force
# the correct ordering here:
case "$aqbanking_frontends" in *q4banking*)
tmp_frontends="${tmp_frontends} q4banking"
;;
esac
case "$aqbanking_frontends" in *qbanking*)
tmp_frontends="${tmp_frontends} qbanking"
;;
......
###-------------------------------------------------------------------------
#
# QT4
#
UIC4="NO"
QT4_BINDIR=""
case "$aqbanking_frontends" in
*q4banking*)
AQ_CHECK_QT4
if test "$have_qt4" = "yes"; then
# Define this macro to disable the cast from QString to const char
# which implicitly uses latin1()!
AC_DEFINE(QT_NO_ASCII_CAST,[1],[Disable the cast from QString to const char.])
fi
dnl windows/mingw doesnt have the yes program, so add this emulation
AC_CHECK_PROG(YES, yes, yes, [[echo -e 'y\ny\ny\ny\n']])
dnl Store the bin dir for the windows dlls
QT4_BINDIR="` echo ${qt4_moc} | ${SED} 's-/moc--' | ${SED} 's-/c/-c:\\\\-' | ${SED} 's-/-\\\\-g' `"
UIC4="${qt4_uic}"
AC_DEFINE(BUILD_Q4BANKING_FRONTEND, 1, [if qbanking frontend is built])
with_q4banking="yes"
;;
*)
q4banking_internal_libs=""
;;
esac
dnl Store the bin dir for the windows dlls
AC_SUBST(QT4_BINDIR)
AM_CONDITIONAL(WITH_Q4BANKING, [test "$with_q4banking" = "yes"])
###-------------------------------------------------------------------------
#
# Check for GMP
......
###-------------------------------------------------------------------------
#
# Configure stuff for frontend q4banking
#
# Common settings
q4banking_internal_libs="${abs_top_builddir}/src/frontends/q4banking/lib/libq4banking.la"
q4banking_includes="-I\${includedir}"
q4banking_libs="-L\${libdir} -lq4banking"
q4banking_data="\${datadir}/q4banking"
q4banking_plugindir="\${aqbanking_plugindir}/frontends/q4banking"
q4banking_helpdir="\${datadir}/aqbanking/frontends/q4banking/help"
case "$OS_TYPE" in
posix)
;;
windows)
AC_DEFINE_UNQUOTED(BUILDING_Q4BANKING_DLL,1, [Define if DLL is built])
all_includes="$all_includes -mms-bitfields"
;;
esac
AC_SUBST(q4banking_includes)
AC_SUBST(q4banking_internal_libs)
AC_SUBST(q4banking_libs)
AC_SUBST(q4banking_data)
AC_SUBST(q4banking_plugindir)
AC_SUBST(q4banking_helpdir)
###-------------------------------------------------------------------------
#
# subst selected UIs
......
src/frontends/qbanking/help/Makefile
src/frontends/qbanking/help/de/Makefile
src/frontends/qbanking/help/de/images/Makefile
src/frontends/q4banking/Makefile
src/frontends/q4banking/lib/Makefile
src/frontends/q4banking/lib/dialogs/Makefile
src/frontends/q4banking/lib/views/Makefile
src/frontends/q4banking/lib/widgets/Makefile
src/frontends/q4banking/lib/gui/Makefile
src/frontends/q4banking/lib/version.h
src/frontends/q4banking/lib/ressource.rc
src/frontends/q4banking/bin/Makefile
src/frontends/q4banking/bin/wizard/Makefile
src/frontends/q4banking/bin/wizard/qt4_wizard.xml
src/frontends/q4banking/bin/helpbrowser/Makefile
src/frontends/q4banking/help/Makefile
src/frontends/q4banking/help/de/Makefile
src/frontends/q4banking/help/de/images/Makefile
src/plugins/Makefile
src/plugins/bankinfo/Makefile
src/plugins/bankinfo/at/Makefile
......
echo
echo "Plugins"
echo "----------------------------------------------------"
echo " Frontends : $aqbanking_frontends"
echo " Backends : $aqbanking_backends"
echo " Im-/Exporters : $aqbanking_imexporters"
echo " Parsers : $aqbanking_parsers"
m4/Makefile.am
kde3.m4 \
os.m4 \
qt3.m4 \
qt4.m4 \
searchfiles.m4 \
fox.pc
m4/qt4.m4
# $Id$
# (c) 2010 Martin Preuss<martin@libchipcard.de>
# These functions search for QT 4
AC_DEFUN([AQ_CHECK_QT4],[
dnl PREREQUISITES:
dnl AQ_CHECK_OS must be called before this
dnl IN:
dnl $1 = "yes" if QT4 is needed, "no" if QT4 is optional
dnl You may preset the return variables.
dnl All variables which already have a value will not be altered
dnl OUT:
dnl Variables:
dnl have_qt4 - set to "yes" if QT4 exists
dnl qt4_includes - path to includes
dnl qt4_libs - path to libraries
dnl qt4_uic - name and path of the uic tool
dnl qt4_moc - name and path of the moc tool
dnl Defines:
dnl HAVE_QT4
lforce="$1"
lsd="$2"
AC_MSG_CHECKING(if QT4 is allowed)
AC_ARG_ENABLE(qt4,
[ --enable-qt4 enable qt4 (default=yes)],
enable_qt4="$enableval",
enable_qt4="yes")
AC_MSG_RESULT($enable_qt4)
if test "$enable_qt4" = "no"; then
qt4_libs=""
qt4_includes=""
qt4_moc=""
qt4_uic=""
have_qt4="no"
else
dnl paths for qt4 includes
AC_MSG_CHECKING(for qt4 includes)
AC_ARG_WITH(qt4-includes,
[ --with-qt4-includes=DIR uses qt4 includes from given dir],
[local_qt4_includes="$withval"],
[local_qt4_includes="\
$QTDIR/include \
/usr/include/qt4 \
/usr/local/include/qt4 \
/usr/lib/qt4/include \
/usr/local/lib/qt4/include \
/opt/qt4/include \
/usr/include/qt \
/usr/local/include/qt \
/usr/lib/qt/include \
/usr/local/lib/qt/include \
/usr/include \
/usr/local/include \
/opt/qt/include \
/usr/X11R6/include \
"
]
)
if test -z "$qt4_includes"; then
for i in $local_qt4_includes; do
if test -z "$qt4_includes"; then
if test -f "$i/Qt/qglobal.h"; then
lv1=`grep -h "#define QT_VERSION_STR" $i/Qt/qglobal.h`
case $lv1 in
*4.*)
qt4_includes="-I$i -I$i/Qt -I$i/Qt3Support -I$i/QtCore -I$i/QtGui"
break;
;;
esac
fi
fi
done
fi
if test -n "$qt4_includes"; then
AC_MSG_RESULT($qt4_includes)
else
AC_MSG_RESULT(not found)
fi
# Check for x86_64 architecture; potentially set lib-directory suffix
if test "$target_cpu" = "x86_64"; then
libdirsuffix="64"
else
libdirsuffix=""
fi
dnl paths for qt4 libs
AC_MSG_CHECKING(for qt4 libraries)
AC_ARG_WITH(qt4-libs,
[ --with-qt4-libs=DIR uses qt4 libs from given dir],
[local_qt4_libs="$withval"],
[local_qt4_libs="\
$QTDIR/lib${libdirsuffix} \
/usr/lib/qt4 \
/usr/local/lib/qt4 \
/usr/lib/qt4/lib${libdirsuffix} \
/usr/local/lib/qt4/lib${libdirsuffix} \
/opt/qt4/lib${libdirsuffix} \
/usr/lib/qt \
/usr/local/lib/qt \
/usr/lib/qt/lib${libdirsuffix} \
/usr/local/lib/qt/lib${libdirsuffix} \
/usr/lib${libdirsuffix} \
/usr/lib${libdirsuffix}/qt4/lib \
/usr/lib${libdirsuffix}/qt-3.3/lib \
/usr/lib${libdirsuffix}/qt-3.2/lib \
/usr/local/lib${libdirsuffix} \
/opt/qt/lib${libdirsuffix} \
/usr/X11R6/lib${libdirsuffix} \
"
]
)
# Determine the extension of a shared library; the variable
# std_shrext comes from the AC_PROG_LIBTOOL macro. Copied from
# libtool.
# Shared library suffix. On linux this was set as
# shrext_cmds='.so'; but on darwin it is actually a text command.
eval std_shrext=\"$shrext_cmds\"
if test -n "${std_shrext}"; then
std_shrext='.so'
fi
qt_libname="QtGui"
# This is the name of the qt library to search for.
if test "x$OSYSTEM" = "xdarwin"; then
qt_searchname="lib${qt_libname}.4.dylib"
else
qt_searchname="lib${qt_libname}${std_shrext}.4"
fi
if test -z "$qt4_libs"; then
AQ_SEARCH_FOR_PATH([$qt_searchname],[$local_qt4_libs])
if test -n "$found_dir" ; then
qt4_libs="-L$found_dir -l${qt_libname}"
test "$OSYSTEM" = "freebsd" && \
qt4_libs="$qt4_libs -lc_r"
fi
fi
if test -n "$qt4_libs"; then
AC_MSG_RESULT($qt4_libs)
else
AC_MSG_RESULT(not found)
fi
dnl paths for qt4 moc
AC_MSG_CHECKING(for qt4 moc)
if test -z "$qt4_moc"; then
AC_ARG_WITH(qt4-moc,
[ --with-qt4-moc=FILE uses the given qt4 moc],
[qt4_moc="$withval"],
[qt4_moc=""]
)
fi
if test -z "$qt4_moc"; then
searchdir="\
$QTDIR/bin \
/usr/lib/qt4/bin \
/usr/local/lib/qt4/bin \
/opt/qt4/bin \
/usr/lib/qt/bin \
/usr/local/lib/qt/bin \
/usr/bin \
/usr/local/bin \
/opt/qt/bin \
/usr/X11R6/bin \
"
# search for "moc-qt4"
for f in $searchdir; do
if test -x $f/moc-qt4; then
qt4_moc="$f/moc-qt4"
break
fi
done
# fall back to "moc"
if test -z "$qt4_moc"; then
for f in $searchdir; do
if test -x $f/moc; then
qt4_moc="$f/moc"
break
fi
done
fi
fi
if test -n "$qt4_moc"; then
AC_MSG_RESULT($qt4_moc)
else
AC_MSG_RESULT(not found)
fi
dnl paths for qt4 uic
AC_MSG_CHECKING(for qt4 uic)
if test -z "$qt4_uic"; then
AC_ARG_WITH(qt4-uic,
[ --with-qt4-uic=FILE uses the given qt4 uic],
[qt4_uic="$withval"],
[qt4_uic=""]
)
searchdir="\
$QTDIR/bin \
/usr/lib/qt4/bin \
/usr/local/lib/qt4/bin \
/opt/qt4/bin \
/usr/lib/qt/bin \
/usr/local/lib/qt/bin \
/usr/bin \
/usr/local/bin \
/opt/qt/bin \
/usr/X11R6/bin \
"
# search for "uic-qt4"
for f in $searchdir; do
if test -x $f/uic-qt4; then
qt4_uic="$f/uic-qt4"
break
fi
done
# fall back to "uic"
if test -z "$qt4_uic"; then
for f in $searchdir; do
if test -x $f/uic; then
qt4_uic="$f/uic"
break
fi
done
fi
fi
if test -n "$qt4_uic"; then
AC_MSG_RESULT($qt4_uic)
else
AC_MSG_RESULT(not found)
fi
# check if all necessary qt4 components where found
if test -z "$qt4_includes" || \
test -z "$qt4_moc" || \
test -z "$qt4_uic" || \
test -z "$qt4_libs"; then
qt4_libs=""
qt4_moc=""
qt4_uic=""
qt4_includes=""
have_qt4="no"
if test "$lforce" = "yes"; then
AC_MSG_WARN([
Compilation of QT applications is enabled but I could not find some QT
components (see which are missing in messages above).
If you don't want to compile QT4 applications please use "--disable-qt4".
])
else
AC_MSG_WARN([
QT4 is not explicitly disabled and I could not find some QT4 components
(see which are missing in messages above).
If you don't want to compile QT4 applications please use "--disable-qt4".
])
fi
else
dnl TODO: AC_TRY_RUN, check whether qversion.h has matching versions
have_qt4="yes"
AC_DEFINE(HAVE_QT4, 1, [whether QT4 is available])
fi
dnl end of if "$enable_qt4"
fi
AS_SCRUB_INCLUDE(qt4_includes)
AC_SUBST(qt4_libs)
AC_SUBST(qt4_includes)
AC_SUBST(qt4_moc)
AC_SUBST(qt4_uic)
])
src/frontends/Makefile.am
SUBDIRS = $(aqbanking_frontends)
DIST_SUBDIRS = qbanking
DIST_SUBDIRS = qbanking q4banking
sources:
for d in $(DIST_SUBDIRS); do \
src/frontends/q4banking/.cvsignore
*-config.in
ressource.rc
version.h
*.moc.cpp
*.ui.h
*.ui.cpp
i18nsources
*-config
*.dll
*.lib
*.def
portinglog.txt
testlib
src/frontends/q4banking/Makefile.am
SUBDIRS=lib bin help
sources:
for d in $(SUBDIRS); do \
$(MAKE) -C $$d sources; \
done ;
built_sources: $(BUILT_SOURCES)
for d in $(SUBDIRS); do \
$(MAKE) -C $$d built_sources; \
done ;
src/frontends/q4banking/bin/Makefile.am
SUBDIRS=wizard helpbrowser
sources:
for d in $(SUBDIRS); do \
$(MAKE) -C $$d sources; \
done ;
built_sources: $(BUILT_SOURCES)
for d in $(SUBDIRS); do \
$(MAKE) -C $$d built_sources; \
done ;
src/frontends/q4banking/bin/helpbrowser/.cvsignore
*.moc
qb-help
*.ui.cpp
*.ui.h
src/frontends/q4banking/bin/helpbrowser/Makefile.am
INCLUDES = \
-I$(top_builddir)/headers \
$(qt4_includes) $(gwenhywfar_includes)
DEFS += -DPKGDATADIR=\"$(pkgdatadir)\" \
-DQ4BANKING_HELPDIR=\"@q4banking_helpdir@\"
#noinst_LTLIBRARIES=libqbhelp.la
UI_FILES=\
qbhelpbrowser.ui
noinst_HEADERS=\
qbhelpbrowser.h
nodist_noinst_HEADERS=\
qbhelpbrowser.ui.h
MOC_FILES=\
qbhelpbrowser.moc
bin_PROGRAMS = q4b-help@QBANKING_SO_EFFECTIVE@
q4b_help@QBANKING_SO_EFFECTIVE@_SOURCES = qb_help.cpp qbhelpbrowser.cpp
nodist_qb_help@QBANKING_SO_EFFECTIVE@_SOURCES =
q4b_help@QBANKING_SO_EFFECTIVE@_LDADD= \
$(qt4_libs) -lQt3Support \
$(gwenhywfar_libs)
BUILT_SOURCES = $(MOC_FILES) $(nodist_libqbhelp_la_SOURCES) $(nodist_noinst_HEADERS)
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = $(UI_FILES)
%.moc: %.h
$(qt4_moc) -o $@ $<
%.ui.h: %.ui
$(qt4_uic) $< -o $@
SUFFIXES = .ui .ui.h .moc
sources:
for f in $(libqbhelp_la_SOURCES); do \
echo $(subdir)/$$f >>$(top_srcdir)/qtsources; \
done
for d in $(SUBDIRS); do \
$(MAKE) -C $$d sources; \
done
# For qt3 compatibility of qt4
DEFS += -DQT3_SUPPORT
built_sources: $(BUILT_SOURCES)
src/frontends/q4banking/bin/helpbrowser/qb_help.cpp
/***************************************************************************
$RCSfile$
-------------------
cvs : $Id$
begin : Mon Mar 01 2004
copyright : (C) 2004 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* Please see toplevel file COPYING for license details *
***************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <qapplication.h>
#include <qtranslator.h>
#include <qtextcodec.h>
#include <gwenhywfar/logger.h>
#include <gwenhywfar/debug.h>
#include <stdio.h>
#include "qbhelpbrowser.h"
#include <qapplication.h>
#include <qstringlist.h>
#include <qtextcodec.h>
#include <qtranslator.h>
#include <qmessagebox.h>
#ifdef OS_WIN32
# define DIRSEP "\\"
#else
# define DIRSEP "/"
#endif
int main(int argc, char **argv) {
QApplication app(argc, argv);
QTranslator translator(0);
QStringList paths;
QString qs;
QString shortLoc;
const char *s;
int i;
QString datadir(PKGDATADIR);
if (translator.load(QTextCodec::locale()+QString(".qm"),
datadir + QString("/i18n/"))) {
DBG_INFO(0, "I18N available for your language");
app.installTranslator(&translator);
}
else {
DBG_WARN(0, "Internationalisation is not available for your language");
}
QObject::connect(&app,SIGNAL(lastWindowClosed()),
&app,SLOT(quit()));
if (app.argc()<2) {
QMessageBox::critical(0,
QWidget::tr("Argument Error"),
QWidget::tr("Missing URL"),
QWidget::tr("Dismiss"));
return 1;
}
s=QTextCodec::locale();
if (!s)
s="de";
shortLoc=QString::fromUtf8(s);
i=shortLoc.find('_');
if (i)
shortLoc=shortLoc.left(i);
if (app.argc()>2) {
QString appHelpPath;
// application help path given, insert it into path list
appHelpPath=QString::fromUtf8(app.argv()[2]);
paths+=appHelpPath+DIRSEP+shortLoc;
paths+=appHelpPath+DIRSEP+shortLoc+DIRSEP "images";
paths+=appHelpPath+DIRSEP "C";
paths+=appHelpPath+DIRSEP "C" DIRSEP "images";
}
qs=QString::fromUtf8(Q4BANKING_HELPDIR DIRSEP)+shortLoc;
paths+=qs;
qs=QString::fromUtf8(Q4BANKING_HELPDIR DIRSEP)+shortLoc+DIRSEP "images";
paths+=qs;
qs=QString::fromUtf8(Q4BANKING_HELPDIR DIRSEP "C");
paths+=qs;
qs=QString::fromUtf8(Q4BANKING_HELPDIR DIRSEP "C" DIRSEP "images");
paths+=qs;
qs=QString::fromUtf8(app.argv()[1]);
QBHelpBrowser *hb=new QBHelpBrowser(qs, paths);
hb->resize(800, 600);
hb->show();
app.setMainWidget(hb);
return app.exec();
}
src/frontends/q4banking/bin/helpbrowser/qbhelpbrowser.cpp
/***************************************************************************
$RCSfile$
-------------------
cvs : $Id$
begin : Mon Mar 01 2004
copyright : (C) 2004 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* Please see toplevel file COPYING for license details *
***************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "qbhelpbrowser.h"
#include <qstatusbar.h>
#include <qpixmap.h>
#include <q3popupmenu.h>
#include <qmenubar.h>
#include <q3toolbar.h>
#include <qtoolbutton.h>
#include <qicon.h>
#include <qfile.h>
#include <q3textstream.h>
#include <q3stylesheet.h>
#include <qmessagebox.h>
#include <q3filedialog.h>
#include <qapplication.h>
#include <qcombobox.h>
#include <qevent.h>
#include <qlineedit.h>
#include <qobject.h>
#include <qfileinfo.h>
#include <qfile.h>
#include <qdatastream.h>
#include <qprinter.h>
#include <q3simplerichtext.h>
#include <qpainter.h>
#include <q3paintdevicemetrics.h>
#include <q3textbrowser.h>
//Added by qt3to4:
#include <Q3Frame>
#include <ctype.h>
static const char * const back_xpm[] = {
"32 32 2 1",
" c None",
". c #00FF00",
" . ",
" .. ",
" ... ",
" .... ",
" ..... ",
" ...... ",
" ....... ",
" ........ ",
" ......... ",
" .......... ",
" ........... ",
" ............ ",
" ............................",
" .............................",
" ..............................",
" ...............................",
" ...............................",
" ..............................",
" .............................",
" ............................",
" ............ ",
" ........... ",
" .......... ",
" ......... ",
" ........ ",
" ....... ",
" ...... ",
" ..... ",
" .... ",
" ... ",
" .. ",
" . "};
static const char * const forward_xpm[] = {
"32 32 2 1",
" c None",
". c #00FF00",
" . ",
" .. ",
" ... ",
" .... ",
" ..... ",
" ...... ",
" ....... ",
" ........ ",
" ......... ",
" .......... ",
" ........... ",
" ............ ",
"............................ ",
"............................. ",
".............................. ",
"............................... ",
"............................... ",
".............................. ",
"............................. ",
"............................ ",
" ............ ",
" ........... ",
" .......... ",
" ......... ",
" ........ ",
" ....... ",
" ...... ",
" ..... ",
" .... ",
" ... ",
" .. ",
" . "};
QBHelpBrowser::QBHelpBrowser(const QString& home,
const QStringList& paths,
QWidget* parent,
const char *name)
:Q3MainWindow(parent, name, Qt::WDestructiveClose)
,Ui_QBHelpBrowserUi(){
setupUi(this);
textBrowser->mimeSourceFactory()->setFilePath(paths);
textBrowser->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken);
connect(textBrowser, SIGNAL(sourceChanged(const QString&)),
this, SLOT(slotSourceChanged(const QString&)));
if (!home.isEmpty() )
textBrowser->setSource(home);
Q3PopupMenu* file = new Q3PopupMenu( this );
file->insertItem( tr("&New Window"), this, SLOT( slotNewWindow() ), Qt::CTRL+Qt::Key_N );
file->insertItem( tr("&Print"), this, SLOT( slotPrint() ), Qt::CTRL+Qt::Key_P );
file->insertSeparator();
file->insertItem( tr("&Close"), this, SLOT( close() ), Qt::CTRL+Qt::Key_Q );
// The same three icons are used twice each.
QIcon icon_back(QPixmap((const char**)back_xpm));
QIcon icon_forward(QPixmap((const char**)forward_xpm));
QIcon icon_home( QPixmap("home.xpm"));
Q3PopupMenu* go = new Q3PopupMenu( this );
_backwardId=go->insertItem(icon_back,
tr("&Backward"),
textBrowser,
SLOT(backward()),
Qt::CTRL+Qt::Key_Left);
_forwardId = go->insertItem(icon_forward,
tr("&Forward"),
textBrowser,
SLOT(forward()),
Qt::CTRL+Qt::Key_Right );
go->insertItem( icon_home, tr("&Home"), textBrowser, SLOT( home() ) );
Q3PopupMenu* help = new Q3PopupMenu( this );
help->insertItem( tr("&About"), this, SLOT( slotAbout() ) );
help->insertItem( tr("About &Qt"), this, SLOT( slotAboutQt() ) );
_hist = new Q3PopupMenu( this );
_bookm = new Q3PopupMenu( this );
_bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( slotAddBookmark() ) );
_bookm->insertSeparator();
_menuBar->insertItem(tr("&File"), file );
_menuBar->insertItem(tr("&Go"), go );
_menuBar->insertItem(tr( "History" ), _hist );
_menuBar->insertItem(tr( "Bookmarks" ), _bookm );
_menuBar->insertSeparator();
_menuBar->insertItem(tr("&Help"), help );
_menuBar->setItemEnabled( _forwardId, FALSE);
_menuBar->setItemEnabled( _backwardId, FALSE);
_backwardButton=new QToolButton( icon_back, tr("Backward"), "",
textBrowser, SLOT(backward()),
_toolBar );
_backwardButton->setEnabled(FALSE);
_forwardButton=new QToolButton(icon_forward, tr("Forward"), "",
textBrowser, SLOT(forward()),
_toolBar );
_forwardButton->setEnabled( FALSE );
QToolButton *button;
button=new QToolButton( icon_home, tr("Home"), "",
textBrowser, SLOT(home()),
_toolBar );
connect(textBrowser, SIGNAL(backwardAvailable(bool)),
this, SLOT(slotBackwardAvailable(bool)));
connect(textBrowser, SIGNAL(forwardAvailable(bool) ),
this, SLOT(slotForwardAvailable(bool)));
_toolBar->addSeparator();
textBrowser->setFocus();
}
QBHelpBrowser::~QBHelpBrowser(){
}
void QBHelpBrowser::setFilePaths(const QStringList& pathList) {
textBrowser->mimeSourceFactory()->setFilePath(pathList);
}
void QBHelpBrowser::slotBackwardAvailable(bool b){
_menuBar->setItemEnabled(_backwardId, b);
_backwardButton->setEnabled(b);
}
void QBHelpBrowser::slotForwardAvailable(bool b){
_menuBar->setItemEnabled(_forwardId, b);
_forwardButton->setEnabled(b);
}
void QBHelpBrowser::slotSourceChanged(const QString& url ){
QString fName;
int i;
i=url.find('#');
if (i)
fName=url.left(i);
else
fName=url;
if (textBrowser->mimeSourceFactory()->data(fName)==0) {
setCaption( "QBanking Helpviewer - Not found" );
textBrowser->setText(tr("<qt>"
"<font color=\"red\"><h2>Not found</h2></font>"
"Sorry - the help chapter <i>%1</i>"
" is not available."
"</qt>").arg(url));
}
else {
if (textBrowser->documentTitle().isNull() )
setCaption( "QBanking Helpviewer - " + url );
else
setCaption( "QBanking Helpviewer - " + textBrowser->documentTitle() ) ;
}
}
void QBHelpBrowser::slotAbout(){
QMessageBox::about( this, "Help Browser",
"<p>Simple Help Browser</p>"
"<p>(c) 2006 Martin Preuss</p>");
}
void QBHelpBrowser::slotAboutQt(){
QMessageBox::aboutQt( this, "QBrowser" );
}
void QBHelpBrowser::slotNewWindow(){
( new QBHelpBrowser(textBrowser->source(), QStringList(QString("qbrowser")), parentWidget()) )->show();
}
void QBHelpBrowser::slotPrint(){
QPrinter printer( QPrinter::HighResolution );
printer.setFullPage(TRUE);
if ( printer.setup( this ) ) {
QPainter p( &printer );
if( !p.isActive() ) // starting printing failed
return;
Q3PaintDeviceMetrics metrics(p.device());
int dpiy = metrics.logicalDpiY();
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
QRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
Q3SimpleRichText richText( textBrowser->text(),
QFont(),
textBrowser->context(),
textBrowser->styleSheet(),
textBrowser->mimeSourceFactory(),
body.height() );
richText.setWidth( &p, body.width() );
QRect view( body );
int page = 1;
do {
richText.draw( &p, body.left(), body.top(), view, colorGroup() );
view.moveBy( 0, body.height() );
p.translate( 0 , -body.height() );
p.drawText( view.right() - p.fontMetrics().width( QString::number(page) ),
view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page) );
if ( view.top() >= richText.height() )
break;
printer.newPage();
page++;
} while (TRUE);
}
}
void QBHelpBrowser::slotAddBookmark() {
}
#include "qbhelpbrowser.moc"
src/frontends/q4banking/bin/helpbrowser/qbhelpbrowser.h
/***************************************************************************
$RCSfile$
-------------------
cvs : $Id$
begin : Mon Mar 01 2004
copyright : (C) 2004 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* Please see toplevel file COPYING for license details *
***************************************************************************/
#ifndef QBHELPWINDOW_H
#define QBHELPWINDOW_H
#include <q3mainwindow.h>
#include <q3textbrowser.h>
#include <qstringlist.h>
#include <qmap.h>
#include <qdir.h>
#include <qstringlist.h>
#include "qbhelpbrowser.ui.h"
#include <q4banking/qbanking.h>
//Added by qt3to4:
#include <Q3PopupMenu>
class QComboBox;
class Q3PopupMenu;
class QToolButton;
/* No QBANKING_API here - this is not part of a library */
class QBHelpBrowser : public Q3MainWindow, public Ui_QBHelpBrowserUi {
Q_OBJECT
private:
QToolButton *_backwardButton;
QToolButton *_forwardButton;
public:
QBHelpBrowser(const QString& home,
const QStringList& paths,
QWidget* parent = 0,
const char *name=0);
~QBHelpBrowser();
void setFilePaths(const QStringList& pathList);
private slots:
void slotBackwardAvailable(bool );
void slotForwardAvailable(bool );
void slotSourceChanged(const QString& );
void slotAbout();
void slotAboutQt();
void slotNewWindow();
void slotPrint();
void slotAddBookmark();
private:
int _backwardId, _forwardId;
QStringList _history, _bookmarks;
QMap<int, QString> _mHistory, _mBookmarks;
Q3PopupMenu *_hist, *_bookm;
};
#endif
src/frontends/q4banking/bin/helpbrowser/qbhelpbrowser.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QBHelpBrowserUi</class>
<widget class="Q3MainWindow" name="QBHelpBrowserUi">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>480</height>
</rect>
</property>
<widget class="QWidget" name="widget">
<property name="geometry">
<rect>
<x>0</x>
<y>40</y>
<width>600</width>
<height>440</height>
</rect>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="Q3TextBrowser" name="textBrowser"/>
</item>
</layout>
</widget>
<widget class="Q3ToolBar" name="_toolBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>18</width>
<height>16</height>
</rect>
</property>
<property name="label">
<string>Tools</string>
</property>
</widget>
<widget class="QMenuBar" name="_menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>24</height>
</rect>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3ToolBar</class>
<extends>Q3Frame</extends>
<header>q3listview.h</header>
</customwidget>
<customwidget>
<class>Q3Frame</class>
<extends>QFrame</extends>
<header>Qt3Support/Q3Frame</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Q3MainWindow</class>
<extends>QWidget</extends>
<header>q3mainwindow.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Q3TextEdit</class>
<extends>Q3Frame</extends>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
<class>Q3TextBrowser</class>
<extends>Q3TextEdit</extends>
<header>Qt3Support/Q3TextBrowser</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
src/frontends/q4banking/bin/wizard/.cvsignore
qt3_wizard.xml
qt3-wizard
src/frontends/q4banking/bin/wizard/Makefile.am
INCLUDES = \
-I$(top_builddir)/headers \
-I$(srcdir)/../../gui \
-I$(srcdir)/../../lib/widgets \
-I$(srcdir)/../../lib/dialogs \
-I$(srcdir)/../../lib/views \
-I$(srcdir)/../../lib/gui \
-I$(srcdir)/../../lib \
-I../../lib/widgets -I../../lib/dialogs -I../../lib/gui -I../../lib/views -I../../lib \
$(qt4_includes) $(all_includes)
EXTRA_DIST = qt4_wizard.xml.in
plugindir = $(aqbanking_plugindir)/wizards
plugin_PROGRAMS = qt4-wizard
plugin_DATA=qt4_wizard.xml
#noinst_HEADERS=qt4_wizard.h
qt4_wizard_SOURCES = qt4_wizard.cpp
qt4_wizard_LDADD = \
$(q4banking_internal_libs) \
$(aqbanking_internal_libs) \
$(gwenhywfar_libs) $(qt4_libs)
CLEANFILES=qt4_wizard.xml
sources:
for f in $(qt4_wizard_SOURCES); do \
echo $(subdir)/$$f >>$(top_srcdir)/qtsources; \
done
for d in $(SUBDIRS); do \
$(MAKE) -C $$d sources; \
done
# For qt3 compatibility of qt4
DEFS += -DQT3_SUPPORT
built_sources:
src/frontends/q4banking/bin/wizard/qt4_wizard.cpp
/***************************************************************************
$RCSfile$
-------------------
cvs : $Id$
begin : Mon Mar 01 2004
copyright : (C) 2004 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* Please see toplevel file COPYING for license details *
***************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <qapplication.h>
#include <gwenhywfar/logger.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/gwenhywfar.h>
#include <gwenhywfar/gui_be.h>
#include <stdio.h>
#include <q4banking/qbanking.h>
#include <q4banking/qbgui.h>
int main(int argc, char **argv) {
QApplication app(argc, argv);
QBanking *ab;
QBGui *gui;
int err;
const char *s;
err=GWEN_Init();
if (err) {
DBG_ERROR_ERR(0, err);
return 2;
}
GWEN_Logger_SetLevel(0, GWEN_LoggerLevel_Info);
ab=new QBanking("qt4-wizard", 0);
gui=new QBGui(ab);
GWEN_Gui_SetGui(gui->getCInterface());
ab->setGui(gui);
GWEN_Logger_Open(0,
"qt4_wizard", 0,
GWEN_LoggerType_Console,
GWEN_LoggerFacility_User);
// set loglevels
s=getenv("LOGLEVEL");
if (s) {
GWEN_LOGGER_LEVEL ll;
ll=GWEN_Logger_Name2Level(s);
if (ll!=GWEN_LoggerLevel_Unknown) {
GWEN_Logger_SetLevel(0, ll);
DBG_WARN(0,
"Overriding loglevel for Q4Banking with \"%s\"",
s);
}
else {
DBG_ERROR(0, "Unknown loglevel \"%s\"",
s);
}
}
else {
GWEN_Logger_SetLevel(0, GWEN_LoggerLevel_Notice);
}
if (ab->init()) {
DBG_ERROR(0, "Error on QBanking::init");
return 2;
}
if (ab->onlineInit(0)) {
DBG_ERROR(0, "Error on QBanking::onlineInit");
return 2;
}
QObject::connect(&app,SIGNAL(lastWindowClosed()),
&app,SLOT(quit()));
ab->setupDialog();
if (ab->onlineFini(0)) {
DBG_ERROR(0, "Error on QBanking::onlineFini");
}
if (ab->fini()) {
DBG_ERROR(0, "Error on QBanking::fini");
}
DBG_DEBUG(0, "QBanking::fini done");
delete ab;
return 0;
}
... Dieser Diff wurde abgeschnitten, weil er die maximale Anzahl anzuzeigender Zeilen überschreitet.

Auch abrufbar als: Unified diff