After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617093 - Preview next block feature cannot be turned off
Preview next block feature cannot be turned off
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: quadrapassel
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-28 16:19 UTC by Pedro Villavicencio
Modified: 2012-01-31 23:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
[quadrapassel] Only show the preview block in the correct circumstances (4.29 KB, patch)
2010-08-19 14:37 UTC, Craig Duncan
committed Details | Review
Preview next block option fix (2.47 KB, patch)
2011-03-15 16:25 UTC, Zachary
none Details | Review

Description Pedro Villavicencio 2010-04-28 16:19:47 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/gnome-games/+bug/571300

"In Quadrapassel, there is a setting tick box called 'Preview next block'. This feature is on per default, however, when unticked, the game will continue to preview the next block."
Comment 1 Josselin Mouette 2010-05-07 21:04:16 UTC
The reverse is true as well: http://bugs.debian.org/580463

This check box is not linked at all to the signals from GConf.
Comment 2 Craig Duncan 2010-08-19 14:37:03 UTC
Created attachment 168292 [details] [review]
[quadrapassel] Only show the preview block in the correct circumstances

This patch allows 'Preview next block' to be switched off.

It also builds on the patch in bug 627209
https://bugzilla.gnome.org/show_bug.cgi?id=627209
To ensure that the block preview still shows when choosing a theme.

That patch should be applied before this one
Comment 3 Zachary 2011-03-15 16:25:36 UTC
Created attachment 183442 [details] [review]
Preview next block option fix

I have a patch here that implements this functionality, it has only been tested against the debian(testing) package of gnome-games(version 2.30.2-2) but it does apply to the current codebase I just can't build gnome-games(can't get a gtk+-3.0 package built).
Comment 4 Zachary 2011-03-16 12:45:21 UTC
Comment on attachment 183442 [details] [review]
Preview next block option fix

commit d488ce5f2d42fb22d1ab0988e3a9b0da4e352e94
Author: Zachary Richey <zr.public@gmail.com>
Date:   Tue Mar 15 12:05:12 2011 -0400

    Patch to make the 'disable preview' option work.

diff --git a/quadrapassel/preview.cpp b/quadrapassel/preview.cpp
index c758db8..e941f5d 100644
--- a/quadrapassel/preview.cpp
+++ b/quadrapassel/preview.cpp
@@ -94,11 +94,20 @@ Preview::setTheme (guint id)
 	previewBlock (blocknr, color);
 }
 
+void Preview::updateEnable()
+{
+	enabled = games_conf_get_boolean (KEY_OPTIONS_GROUP, KEY_DO_PREVIEW,
+	                                  NULL);
+}
+
 void
 Preview::previewBlock(gint bnr, gint bcol)
 {
 	ClutterActor *stage;
 	stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (w));
+	
+	if(enabled == FALSE)
+		return;
 
 	int x, y;
 
diff --git a/quadrapassel/preview.h b/quadrapassel/preview.h
index 7d553c5..f973b0f 100644
--- a/quadrapassel/preview.h
+++ b/quadrapassel/preview.h
@@ -37,6 +37,9 @@ public:
 	}
 
 	void enable (bool enable);
+	// updateEnable reads the configured KEY_DO_PREVIEW value
+	// and updates 'enabled' accordingly.
+	void updateEnable();
 	void setTheme (guint id);
 	void previewBlock (int bnr, int bcolor);
 
diff --git a/quadrapassel/tetris.cpp b/quadrapassel/tetris.cpp
index 111568c..1a4c836 100644
--- a/quadrapassel/tetris.cpp
+++ b/quadrapassel/tetris.cpp
@@ -516,6 +516,7 @@ Tetris::setRotateCounterClockWise(GtkWidget *widget, void *d)
 void
 Tetris::setSelection(GtkWidget *widget, void *data)
 {
+
 	Tetris *t;
 	t = (Tetris *)data;
 
@@ -523,6 +524,7 @@ Tetris::setSelection(GtkWidget *widget, void *data)
 	t->field->setTheme (t->themeno);
 	games_conf_set_string (KEY_OPTIONS_GROUP, KEY_THEME,
 			       ThemeTable[t->themeno].id);
+
 }
 
 void
@@ -768,9 +770,10 @@ Tetris::gameProperties(GtkAction *action, void *d)
 	gtk_box_pack_start (GTK_BOX (fvbox), omenu, FALSE, FALSE, 0);
 
 	t->theme_preview = new Preview();
+	// Make sure the block gets rendered properly
+	t->theme_preview->enable(TRUE);
 	t->theme_preview->setTheme (t->themeno);
 	gtk_box_pack_start(GTK_BOX(fvbox), t->theme_preview->getWidget(), TRUE, TRUE, 0);
-
 	t->theme_preview->previewBlock(4, 0);
 
 	gtk_widget_show_all (t->setupdialog);
@@ -1255,7 +1258,7 @@ Tetris::gameNew(GtkAction *action, void *d)
 
 	t->scoreFrame->resetScore();
 	t->paused = false;
-
+	t->preview->updateEnable(); // Set whether to show previews to the configured value.
 	t->field->generateFallingBlock();
 	t->field->putBlockInField(FALLING);
 	t->preview->previewBlock(blocknr_next, color_next);
Comment 5 Jason Clinton 2011-03-16 21:46:11 UTC
Comment on attachment 168292 [details] [review]
[quadrapassel] Only show the preview block in the correct circumstances

commit ec7d1d26aa2211e248196861be963eaa6e723d20
Author: Craig Duncan <bugzilla@duncanc.co.uk>
Date:   Thu Aug 19 15:32:06 2010 +0100

    Only show the preview block in the correct circumstances
    
    This patch is closely related to 168273 and probably depends on it
    http://bugzilla-attachments.gnome.org/attachment.cgi?id=168273
    
    It stops the preview from being generated when either the preview blocks option is off, or the difficult blocks option is on.
    However the preview still needs to be generated for the theme selection dialog.
    So I've added a force parameter to previewBlock() function for this scenario
Comment 6 Robert Ancell 2012-01-31 23:25:50 UTC
This bug is being reassigned to the "quadrapassel" component so we can close the gnometris bugzilla component.  Apologies for the mass email!