[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegames/kolf
From:       Stefan Majewsky <majewsky () gmx ! net>
Date:       2010-10-31 22:15:31
Message-ID: 20101031221531.B0531AC89C () svn ! kde ! org
[Download RAW message or body]

SVN commit 1191682 by majewsky:

Remove printing code, which was already broken since KDE 4.0.

 M  +0 -1      CMakeLists.txt  
 M  +0 -32     game.cpp  
 M  +0 -1      game.h  
 M  +0 -26     kolf.cpp  
 M  +0 -2      kolf.h  
 D             printdialogpage.cpp  
 D             printdialogpage.h  


--- trunk/KDE/kdegames/kolf/CMakeLists.txt #1191681:1191682
@@ -20,7 +20,6 @@
    config.cpp 
    scoreboard.cpp 
    editor.cpp 
-   printdialogpage.cpp 
    kcomboboxdialog.cpp 
    floater.cpp 
    slope.cpp
--- trunk/KDE/kdegames/kolf/game.cpp #1191681:1191682
@@ -29,7 +29,6 @@
 #include <QCheckBox>
 #include <QLabel>
 #include <QMouseEvent>
-#include <QPrinter>
 #include <QSlider>
 #include <QStyleOptionGraphicsItem>
 #include <QTimer>
@@ -4386,37 +4385,6 @@
 	game->setBorderWalls(yes);
 }
 
-void KolfGame::print(QPrinter &pr, bool printTitle) //note: this is currently \
                broken, see comment below
-{
-	kDebug(12007) << "Printing Currently broken";
-	QPainter p(&pr);
-
-	// translate to center
-	// TODO: This is broken since the port to Tagaro::Board.
-	p.translate(pr.width() / 2 - course->sceneRect().width() / 2, pr.height() / 2 - \
                course->sceneRect().height() / 2);
-
-	QPixmap pix(width, height);
-	QPainter pixp(&pix);
-	//course->drawArea(course->sceneRect(), &pixp); //not sure how to fix this line to \
                work with QGV, so just commenting for now. This will break printing
-	p.drawPixmap(0, 0, pix);
-
-	p.setPen(QPen(Qt::black, 2));
-	p.drawRect(course->sceneRect());
-
-	p.resetMatrix();
-
-	if (printTitle)
-	{
-		QString text = i18n("%1 - Hole %2; by %3", holeInfo.name(), curHole, \
                holeInfo.author());
-		QFont font(QApplication::font());
-		font.setPointSize(18);
-		QRect rect = QFontMetrics(font).boundingRect(text);
-		p.setFont(font);
-
-		p.drawText(QPointF(pr.width() / 2 - rect.width() / 2, pr.height() / 2 - \
                course->sceneRect().height() / 2 -20 - rect.height()), text);
-	}
-}
-
 bool KolfGame::allPlayersDone()
 {
 	for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it)
--- trunk/KDE/kdegames/kolf/game.h #1191681:1191682
@@ -910,7 +910,6 @@
 	void showInfoDlg(bool = false);
 	void resetHole();
 	void clearHole();
-	void print(QPrinter &, bool printTitle);
 	void setShowInfo(bool yes);
 	void toggleShowInfo();
 	void updateShowInfo();
--- trunk/KDE/kdegames/kolf/kolf.cpp #1191681:1191682
@@ -21,7 +21,6 @@
 #include "editor.h"
 #include "floater.h"
 #include "newgame.h"
-#include "printdialogpage.h"
 #include "scoreboard.h"
 #include "slope.h"
 
@@ -37,11 +36,8 @@
 #include <KStandardGameAction>
 #include <KStandardGuiItem>
 #include <KToggleAction>
-#include <kdeprintdialog.h>
 
 #include <QGridLayout>
-#include <QPrintDialog>
-#include <QPrinter>
 #include <QTimer>
 
 KolfWindow::KolfWindow()
@@ -87,7 +83,6 @@
 	// Game
 	newAction = KStandardGameAction::gameNew(this, SLOT(newGame()), \
actionCollection());  endAction = KStandardGameAction::end(this, SLOT(closeGame()), \
                actionCollection());
-	//printAction = KStandardGameAction::print(this, SLOT(print()), \
actionCollection());  KStandardGameAction::quit(this, SLOT(close()), \
actionCollection());  
 	saveAction = actionCollection()->addAction(KStandardAction::Save, "game_save", \
this, SLOT(save())); @@ -326,7 +321,6 @@
 	setHoleOtherEnabled(true);
 	aboutAction->setEnabled(true);
 	highScoreAction->setEnabled(true);
-	//printAction->setEnabled(true);
 	saveAction->setEnabled(true);
 	saveAsAction->setEnabled(true);
 	saveGameAction->setEnabled(true);
@@ -389,7 +383,6 @@
 	endAction->setEnabled(false);
 	aboutAction->setEnabled(false);
 	highScoreAction->setEnabled(false);
-	//printAction->setEnabled(false);
 	saveAction->setEnabled(false);
 	saveAsAction->setEnabled(false);
 	saveGameAction->setEnabled(false);
@@ -748,25 +741,6 @@
 	editingAction->setChecked(true);
 }
 
-void KolfWindow::print()
-{
-	if (!game)
-		return;
-
-	QPrinter pr;
-	PrintDialogPage prPage;
-
-	QPrintDialog *printDialog = KdePrint::createPrintDialog(&pr, QList<QWidget*>() << \
                &prPage, this);
-	printDialog->setWindowTitle(i18n("Print %1 - Hole %2", game->courseName(), \
                game->currentHole()));
-
-	if (printDialog->exec())
-	{
-		pr.newPage();
-		game->print(pr, prPage.printTitle());
-	}
-	delete printDialog;
-}
-
 void KolfWindow::updateModified(bool mod)
 {
 	courseModified = mod;
--- trunk/KDE/kdegames/kolf/kolf.h #1191681:1191682
@@ -60,7 +60,6 @@
 	void saveAs();
 	void saveGame();
 	void saveGameAs();
-	void print();
 	void newPlayersTurn(Player *);
 	void gameOver();
 	void editingStarted();
@@ -106,7 +105,6 @@
 	QAction *tutorialAction;
 	QAction *newAction;
 	QAction *endAction;
-	//QAction *printAction;
 	QAction *saveAction;
 	QAction *saveAsAction;
 	QAction *saveGameAction;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic