+2003-06-02 Dani Carbonell <bocata@panete.net>
+
+ * src/fields.c (fields_page_new): create here the cursors that
+ will be used later to hide/restore the main cursor.
+ (fields_expose_event, fields_nextpiece_expose)
+ (fields_specials_expose): hide the cursor if the user is in a
+ game, show it otherwise.
+
+ * src/dialogs.c (connectingdialog_new): set a parent for this
+ window, set it modal, and don't show it in the windows list.
+
+
2003-05-28 Danilo Ĺ egan <dsegan@gmx.net>
* configure.in: Added "sr" and "sr@Latn" to ALL_LINGUAS.
/*****************************************************/
/* connecting dialog - a dialog with a cancel button */
/*****************************************************/
-static GtkWidget *connectingdialog = 0;
+static GtkWidget *connectingdialog = 0, *connectdialog;
static GtkWidget *progressbar;
static gint timeouttag = 0;
return;
}
connectingdialog = gtk_dialog_new_with_buttons (_("Connect to server"),
- NULL,
- 0,
+ GTK_WINDOW (connectdialog),
+ GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
+ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (connectingdialog), TRUE);
progressbar = gtk_progress_bar_new ();
gtk_widget_show (progressbar);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(connectingdialog)->vbox),
GTK_STOCK_CANCEL, GTK_RESPONSE_CLOSE,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
+ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (team_dialog), TRUE);
gtk_dialog_set_default_response (GTK_DIALOG (team_dialog), GTK_RESPONSE_OK);
gtk_window_set_position (GTK_WINDOW (team_dialog), GTK_WIN_POS_MOUSE);
gtk_window_set_resizable (GTK_WINDOW (team_dialog), FALSE);
/**********************/
static int connecting;
static GtkWidget *serveraddressentry, *nicknameentry, *teamnameentry, *spectatorcheck, *passwordentry;
-static GtkWidget *connectdialog, *passwordlabel, *teamnamelabel;
+static GtkWidget *passwordlabel, *teamnamelabel;
static GtkWidget *originalradio, *tetrifastradio;
static GSList *gametypegroup;
static int oldgamemode;
gconf_client_set_string (gconf_client, "/apps/gtetrinet/player/server", server1, NULL);
gconf_client_set_string (gconf_client, "/apps/gtetrinet/player/nickname", nick, NULL);
gconf_client_set_string (gconf_client, "/apps/gtetrinet/player/team",
- gtk_entry_get_text (GTK_ENTRY(gnome_entry_gtk_entry(GNOME_ENTRY(teamnameentry)))), NULL);
+ gtk_entry_get_text (GTK_ENTRY(gnome_entry_gtk_entry(GNOME_ENTRY(teamnameentry)))),
+ NULL);
g_free (team_utf8);
g_free (nick);
break;
static GtkWidget *fields_page_contents (void);
static gint fields_expose_event (GtkWidget *widget, GdkEventExpose *event, int field);
-static gint fields_nextpiece_expose (void);
-static gint fields_specials_expose (void);
+static gint fields_nextpiece_expose (GtkWidget *widget);
+static gint fields_specials_expose (GtkWidget *widget);
static void fields_refreshfield (int field);
static void fields_drawblock (int field, int x, int y, char block);
static GdkPixmap *blockpix;
+static GdkColor black = {0, 0, 0, 0};
+static GdkBitmap *bitmap;
+static GdkCursor *invisible_cursor, *arrow_cursor;
+
static FIELD displayfields[6]; /* what is actually displayed */
static TETRISBLOCK displayblock;
+/*
+ GdkColor black = {0,0,0};
+ GdkBitmap *bitmap;
+ GdkCursor *invisible_cursor, *current_cursor;
+
+ bitmap = gdk_bitmap_create_from_data (widget->window, "\0", 1, 1);
+ invisible_cursor = gdk_cursor_new_from_pixmap (bitmap, bitmap, &black, &black, 0, 0);
+
+ gdk_window_set_cursor (window, cursor);
+*/
+
void fields_init (void)
{
GtkWidget *mb;
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
_("Error loading theme: cannot load graphics file\n"
- "Falling back to default"));
+ "Falling back to default"));
gtk_dialog_run (GTK_DIALOG (mb));
gtk_widget_destroy (mb);
g_string_assign(currenttheme, DEFAULTTHEME);
}
gtk_container_add (GTK_CONTAINER(fieldspage), pagecontents);
+ /* create the cursors */
+ bitmap = gdk_bitmap_create_from_data (GTK_WIDGET (fieldspage)->window, "\0", 1, 1);
+ invisible_cursor = gdk_cursor_new_from_pixmap (bitmap, bitmap, &black, &black, 0, 0);
+ arrow_cursor = gdk_cursor_new (GDK_ARROW);
+
return fieldspage;
}
gtk_box_pack_start (GTK_BOX(box), widget, TRUE, TRUE, 0);
/* the field */
fieldwidgets[i] = gtk_drawing_area_new ();
+
/* attach the signals */
g_signal_connect (G_OBJECT(fieldwidgets[i]), "expose_event",
GTK_SIGNAL_FUNC(fields_expose_event), (gpointer)i);
widget = widget;
event = event;
fields_refreshfield (field);
+ /* hide the cursor */
+ if (ingame)
+ gdk_window_set_cursor (widget->window, invisible_cursor);
+ else
+ gdk_window_set_cursor (widget->window, arrow_cursor);
return FALSE;
}
}
}
-gint fields_nextpiece_expose (void)
+gint fields_nextpiece_expose (GtkWidget *widget)
{
fields_drawnextblock (NULL);
+ if (ingame)
+ gdk_window_set_cursor (widget->window, invisible_cursor);
+ else
+ gdk_window_set_cursor (widget->window, arrow_cursor);
return FALSE;
}
-gint fields_specials_expose (void)
+gint fields_specials_expose (GtkWidget *widget)
{
fields_drawspecials ();
+ if (ingame)
+ gdk_window_set_cursor (widget->window, invisible_cursor);
+ else
+ gdk_window_set_cursor (widget->window, arrow_cursor);
return FALSE;
}