[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. 44d05812243572a0021db9dbc00bcbf63b397a77

Eugeniy Meshcheryakov eugen at debian.org
Thu Aug 23 13:08:51 UTC 2007


The branch, master has been updated
       via  44d05812243572a0021db9dbc00bcbf63b397a77 (commit)
       via  4147ce9b1b2cc897b3a2def0e84cb17f6f228b1d (commit)
      from  24fc501e24bdc3c8c80210c7b590d69ba379b6f7 (commit)


- Log -----------------------------------------------------------------
commit 44d05812243572a0021db9dbc00bcbf63b397a77
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Thu Aug 23 15:08:40 2007 +0200

    save selected outline size in config file

commit 4147ce9b1b2cc897b3a2def0e84cb17f6f228b1d
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Thu Aug 23 02:59:03 2007 +0200

    create QDataWidgetMapper with parent

-----------------------------------------------------------------------

Summary of changes:
 gui/glyphpropertieseditor.cxx |    2 +-
 gui/mainwindow.cxx            |   20 +++++++++++++++++++-
 gui/mainwindow.h              |    2 ++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/gui/glyphpropertieseditor.cxx b/gui/glyphpropertieseditor.cxx
index ee5fd32..0126dcc 100644
--- a/gui/glyphpropertieseditor.cxx
+++ b/gui/glyphpropertieseditor.cxx
@@ -79,7 +79,7 @@ GlyphPropertiesEditor::GlyphPropertiesEditor(QAbstractItemModel *model, const QM
 	connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
 			this, SLOT(buttonClicked(QAbstractButton *)));
 
-	mapper = new QDataWidgetMapper;
+	mapper = new QDataWidgetMapper(this);
 	mapper->setModel(model);
 	mapper->addMapping(nameEdit, GlyphsModel::NameColumn);
 	mapper->addMapping(colorComboBox, GlyphsModel::ColorColumn);
diff --git a/gui/mainwindow.cxx b/gui/mainwindow.cxx
index 036fbfe..3478155 100644
--- a/gui/mainwindow.cxx
+++ b/gui/mainwindow.cxx
@@ -82,7 +82,6 @@ void MainWindow::createActions()
 		cellSizeActions[i]->setCheckable(true);
 		cellSizeActions[i]->setData(size);
 	}
-	cellSizeActions[0]->setChecked(true);
 	connect(cellSizeGroup, SIGNAL(triggered(QAction *)), this, SLOT(changeCellSize(QAction *)));
 
 	editPrepAction = new QAction("Edit prep Table...", this);
@@ -357,6 +356,22 @@ void MainWindow::changeCellSize(QAction *action)
 	glyphsView->setCellSize(size);
 }
 
+void MainWindow::setCellSize(int size)
+{
+	QAction *act = 0;
+
+	for (int i = 0; i < 5; i++) {
+		if (cellSizeActions[i]->data().toInt() == size) {
+			act = cellSizeActions[i];
+			break;
+		}
+	}
+	if (!act)
+		act = cellSizeActions[0];
+	act->setChecked(true);
+	glyphsView->setCellSize(act->data().toInt());
+}
+
 void MainWindow::documentChanged()
 {
 	Q_ASSERT(m_doc);
@@ -369,6 +384,7 @@ void MainWindow::loadSettings()
 
 	settings.beginGroup("MainWindow");
 	resize(settings.value("size", QSize(640, 480)).toSize());
+	setCellSize(settings.value("outlineSize", 32).toInt());
 	settings.endGroup();
 }
 
@@ -378,5 +394,7 @@ void MainWindow::writeSettings()
 
 	settings.beginGroup("MainWindow");
 	settings.setValue("size", size());
+	Q_ASSERT(cellSizeGroup->checkedAction());
+	settings.setValue("outlineSize", cellSizeGroup->checkedAction()->data());
 	settings.endGroup();
 }
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index ca8f87d..0f6ce45 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -72,6 +72,8 @@ private:
 	void loadSettings();
 	void writeSettings();
 
+	void setCellSize(int size);
+
 	QMenu *fileMenu;
 	QMenu *editMenu;
 	QMenu *viewMenu;

-- 
Fondue Font Editor



More information about the fondue-commits mailing list