[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. 6a65065ee0b35eaa5fbef22b9b5691e18755f3c4
Eugeniy Meshcheryakov
eugen at debian.org
Thu Aug 16 09:11:54 UTC 2007
The branch, master has been updated
via 6a65065ee0b35eaa5fbef22b9b5691e18755f3c4 (commit)
via 997d8a4835eb615287d40d089717ffd6d5018e60 (commit)
via ab73308e7eb51976ff27665e795ca9348c0a61ae (commit)
from be2770d89b13cd0f95b63da08ee13609948141ae (commit)
- Log -----------------------------------------------------------------
commit 6a65065ee0b35eaa5fbef22b9b5691e18755f3c4
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date: Thu Aug 16 11:11:31 2007 +0200
make it possible to compile without ruby
commit 997d8a4835eb615287d40d089717ffd6d5018e60
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date: Thu Aug 16 01:27:52 2007 +0200
Save and restore main window size
commit ab73308e7eb51976ff27665e795ca9348c0a61ae
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date: Thu Aug 16 01:27:17 2007 +0200
Set settings parameters and remove window resize
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 57 +++++++++++++++++++++++++++++++--------------------
gui/mainwindow.cxx | 22 ++++++++++++++++++++
gui/mainwindow.h | 3 ++
ruby/ruby.rules | 2 +
src/main.cxx | 6 +++-
src/src.rules | 6 ++++-
6 files changed, 71 insertions(+), 25 deletions(-)
diff --git a/configure.ac b/configure.ac
index dc08384..61c4c81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,16 @@ AC_PROG_CXX
AC_PROG_RANLIB
AC_LANG([C++])
+AC_ARG_ENABLE([ruby],
+ AS_HELP_STRING([--enable-ruby], [compile with ruby support (default is YES)]),
+ [case "${enableval}" in
+ yes) enable_ruby=true ;;
+ no) enable_ruby=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-ruby]);;
+ esac], [enable_ruby=true])
+
+AM_CONDITIONAL([RUBY_SUPPORT], [test x$enable_ruby = xtrue])
+
PKG_CHECK_MODULES([QtCore], [QtCore >= 4.3])
PKG_CHECK_MODULES([QtGui], [QtGui >= 4.3])
PKG_CHECK_MODULES([QtXml], [QtXml >= 4.3])
@@ -21,29 +31,31 @@ then
fi
AC_ARG_VAR([RUBY], [Ruby interpreter command])
-AC_PATH_PROGS([RUBY], [ruby])
-if test -z "$RUBY"
+if test x$enable_ruby = xtrue
then
- AC_MSG_ERROR([ruby required but not found])
-fi
+ AC_PATH_PROGS([RUBY], [ruby])
+ if test -z "$RUBY"
+ then
+ AC_MSG_ERROR([ruby required but not found])
+ fi
-AC_MSG_CHECKING([for ruby compile flags])
-ruby_archdir=[`${RUBY} -e "require 'rbconfig'; print RbConfig::CONFIG['archdir'].to_s"`]
-ruby_CFLAGS="-I${ruby_archdir}"
-AC_MSG_RESULT([$ruby_CFLAGS])
-AC_SUBST([ruby_CFLAGS])
+ AC_MSG_CHECKING([for ruby compile flags])
+ ruby_archdir=[`${RUBY} -e "require 'rbconfig'; print RbConfig::CONFIG['archdir'].to_s"`]
+ ruby_CFLAGS="-I${ruby_archdir}"
+ AC_MSG_RESULT([$ruby_CFLAGS])
+ AC_SUBST([ruby_CFLAGS])
-AC_MSG_CHECKING([for ruby link flags])
-ruby_libpath=[`${RUBY} -e "require 'rbconfig'; print RbConfig::CONFIG['libpath'].to_s"`]
-ruby_libarg=[`${RUBY} -e "require 'rbconfig'; print RbConfig::CONFIG['LIBRUBYARG'].to_s"`]
-ruby_LIBS="${ruby_libpath:+-L$ruby_libpath} ${ruby_libarg}"
-AC_MSG_RESULT([$ruby_LIBS])
-AC_SUBST([ruby_LIBS])
+ AC_MSG_CHECKING([for ruby link flags])
+ ruby_libpath=[`${RUBY} -e "require 'rbconfig'; print RbConfig::CONFIG['libpath'].to_s"`]
+ ruby_libarg=[`${RUBY} -e "require 'rbconfig'; print RbConfig::CONFIG['LIBRUBYARG'].to_s"`]
+ ruby_LIBS="${ruby_libpath:+-L$ruby_libpath} ${ruby_libarg}"
+ AC_MSG_RESULT([$ruby_LIBS])
+ AC_SUBST([ruby_LIBS])
-saved_CPPFLAGS=${CPPFLAGS}
-CPPFLAGS=${ruby_CFLAGS}
-AC_MSG_CHECKING([if ruby.h has RSTRING_PTR and RSTRING_LEN])
-AC_COMPILE_IFELSE([#include <ruby.h>
+ saved_CPPFLAGS=${CPPFLAGS}
+ CPPFLAGS=${ruby_CFLAGS}
+ AC_MSG_CHECKING([if ruby.h has RSTRING_PTR and RSTRING_LEN])
+ AC_COMPILE_IFELSE([#include <ruby.h>
int main(int argc, char **argv)
{
VALUE data;
@@ -52,10 +64,11 @@ int main(int argc, char **argv)
return 0;
}
],
-[AC_MSG_RESULT([yes])],
-[AC_MSG_ERROR([no
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_ERROR([no
please make sure that you have recent version of ruby installed (>= 1.8.6).])])
-CPPFLAGS=${saved_CPPFLAGS}
+ CPPFLAGS=${saved_CPPFLAGS}
+fi
AC_ARG_VAR([XSLTPROC], [XSLT processor command (xsltproc-compatible)])
AC_PATH_PROGS([XSLTPROC], [xsltproc])
diff --git a/gui/mainwindow.cxx b/gui/mainwindow.cxx
index 6991b18..92b7998 100644
--- a/gui/mainwindow.cxx
+++ b/gui/mainwindow.cxx
@@ -30,6 +30,7 @@
#include "ttieditor.h"
#include "glyphsgridwidget.h"
#include "glyphsmodel.h"
+#include <QSettings>
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
@@ -49,6 +50,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
// click, this is not very good... But this does not happen on Linux
connect(glyphsView, SIGNAL(activated(const QModelIndex &)), this, SLOT(editGlyph(const QModelIndex &)));
+ loadSettings();
+
setCurrentFile(0);
changeDocumentName(0);
}
@@ -318,6 +321,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
}
emit documentClosed();
+ writeSettings();
event->accept();
}
@@ -349,3 +353,21 @@ void MainWindow::documentChanged()
Q_ASSERT(m_doc);
setWindowModified(m_doc->changed());
}
+
+void MainWindow::loadSettings()
+{
+ QSettings settings;
+
+ settings.beginGroup("MainWindow");
+ resize(settings.value("size", QSize(640, 480)).toSize());
+ settings.endGroup();
+}
+
+void MainWindow::writeSettings()
+{
+ QSettings settings;
+
+ settings.beginGroup("MainWindow");
+ settings.setValue("size", size());
+ settings.endGroup();
+}
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 3e1bf8d..3bcf765 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -68,6 +68,9 @@ private:
void changeDocumentName(const QString &name);
bool askSave();
+ void loadSettings();
+ void writeSettings();
+
QMenu *fileMenu;
QMenu *editMenu;
QMenu *viewMenu;
diff --git a/ruby/ruby.rules b/ruby/ruby.rules
index bf511a2..0497fc7 100644
--- a/ruby/ruby.rules
+++ b/ruby/ruby.rules
@@ -1,3 +1,4 @@
+if RUBY_SUPPORT
noinst_LIBRARIES += libfondueruby.a
libfondueruby_a_SOURCES = \
@@ -5,6 +6,7 @@ libfondueruby_a_SOURCES = \
ruby/ascii85.cxx
libfondueruby_a_CPPFLAGS = $(ruby_CFLAGS) $(QtCore_CFLAGS)
+endif
noinst_HEADERS += \
ruby/ruby_bindings.h \
diff --git a/src/main.cxx b/src/main.cxx
index cb42564..dde2311 100644
--- a/src/main.cxx
+++ b/src/main.cxx
@@ -28,6 +28,10 @@ int main(int argc, char **argv)
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
+ QCoreApplication::setOrganizationName("Fondue");
+ QCoreApplication::setOrganizationDomain("fondue.alioth.debian.org");
+ QCoreApplication::setApplicationName("Fondue");
+
if (argc > 1) {
// TODO other options
bool open = false;
@@ -46,8 +50,6 @@ int main(int argc, char **argv)
}
else {
MainWindow *mainWindow = new MainWindow();
- mainWindow->resize(640, 400); // TODO this should be adjustable
-
mainWindow->show();
}
diff --git a/src/src.rules b/src/src.rules
index 9f25303..37b4901 100644
--- a/src/src.rules
+++ b/src/src.rules
@@ -1,8 +1,12 @@
-bin_PROGRAMS += src/ufondue src/fondue
+if RUBY_SUPPORT
+bin_PROGRAMS += src/ufondue
src_ufondue_SOURCES = src/ufondue.cxx
src_ufondue_CPPFLAGS = $(ruby_CFLAGS) $(QtCore_CFLAGS)
src_ufondue_LDADD = libfondueruby.a libfonduenongui.a $(ruby_LIBS) $(QtCore_LIBS)
+endif
+
+bin_PROGRAMS += src/fondue
src_fondue_SOURCES = src/main.cxx
src_fondue_CPPFLAGS = $(QtCore_CFLAGS) $(QtGui_CFLAGS) $(QtXml_CFLAGS)
--
Fondue Font Editor
More information about the fondue-commits
mailing list