GNOME Bugzilla – Bug 617093
Preview next block feature cannot be turned off
Last modified: 2012-01-31 23:25:50 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."
The reverse is true as well: http://bugs.debian.org/580463 This check box is not linked at all to the signals from GConf.
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
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 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 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
This bug is being reassigned to the "quadrapassel" component so we can close the gnometris bugzilla component. Apologies for the mass email!