From 3043157a1d9106bb27e8cc0c115c471da6df893b Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Sat, 11 Jul 2009 21:29:47 +0200 Subject: [PATCH] bugfix and nicer decklist font --- cockatrice/src/decklistmodel.cpp | 4 ++-- cockatrice/src/window_deckeditor.cpp | 10 +++++++++- cockatrice/src/window_deckeditor.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/decklistmodel.cpp b/cockatrice/src/decklistmodel.cpp index 983b36d2..4473033c 100644 --- a/cockatrice/src/decklistmodel.cpp +++ b/cockatrice/src/decklistmodel.cpp @@ -353,10 +353,10 @@ void DeckListModel::printDeckList(QPrinter *printer) { QTextDocument doc; -/* QFont font("Times"); + QFont font("Serif"); font.setStyleHint(QFont::Serif); doc.setDefaultFont(font); -*/ + QTextCursor cursor(&doc); QTextBlockFormat headerBlockFormat; diff --git a/cockatrice/src/window_deckeditor.cpp b/cockatrice/src/window_deckeditor.cpp index 2b0f304d..93859a2f 100644 --- a/cockatrice/src/window_deckeditor.cpp +++ b/cockatrice/src/window_deckeditor.cpp @@ -56,7 +56,7 @@ WndDeckEditor::WndDeckEditor(CardDatabase *_db, QWidget *parent) QLabel *nameLabel = new QLabel(tr("Deck &name:")); nameEdit = new QLineEdit; nameLabel->setBuddy(nameEdit); - connect(nameEdit, SIGNAL(textChanged(const QString &)), deckModel->getDeckList(), SLOT(setName(const QString &))); + connect(nameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateName(const QString &))); QLabel *commentsLabel = new QLabel(tr("&Comments:")); commentsEdit = new QTextEdit; commentsEdit->setMaximumHeight(70); @@ -146,9 +146,16 @@ WndDeckEditor::~WndDeckEditor() } +void WndDeckEditor::updateName(const QString &name) +{ + deckModel->getDeckList()->setName(name); + setWindowModified(true); +} + void WndDeckEditor::updateComments() { deckModel->getDeckList()->setComments(commentsEdit->toPlainText()); + setWindowModified(true); } void WndDeckEditor::updateCardInfoLeft(const QModelIndex ¤t, const QModelIndex &/*previous*/) @@ -219,6 +226,7 @@ void WndDeckEditor::actLoadDeck() deckModel->sort(1); deckView->expandAll(); deckView->resizeColumnToContents(0); + setWindowModified(false); } } diff --git a/cockatrice/src/window_deckeditor.h b/cockatrice/src/window_deckeditor.h index 6390608a..91572ba0 100644 --- a/cockatrice/src/window_deckeditor.h +++ b/cockatrice/src/window_deckeditor.h @@ -17,6 +17,7 @@ class QTextEdit; class WndDeckEditor : public QMainWindow { Q_OBJECT private slots: + void updateName(const QString &name); void updateComments(); void updateCardInfoLeft(const QModelIndex ¤t, const QModelIndex &previous); void updateCardInfoRight(const QModelIndex ¤t, const QModelIndex &previous);