Commit db2b826b authored by Lukasz Zalewski's avatar Lukasz Zalewski Committed by Brian Cameron

More changes related to bug #352924. Made warnings more self-explanatory

2006-11-08  Lukasz Zalewski  <lukas@dcs.qmul.ac.uk>

        More changes related to bug #352924.
        * gui/gdmsetup.c: Made warnings more self-explanatory when no themes
          are selected in "Random from selected" mode. Enabled back the delete
          button on the "Random from selected" view for the currently selected
          theme in the single theme view with a slight modification - users can
          click on it but get told that they need to first deselect it from
          "Single theme" mode first in order to delete it. Also upon closure if
          users have activeted "Random form selected" but have not selected any
          themes for it, they will be informed that the greeter will default to
          single theme mode.
parent ff79b299
2006-11-08 Lukasz Zalewski <lukas@dcs.qmul.ac.uk>
More changes related to bug #352924.
* gui/gdmsetup.c: Made warnings more self-explanatory when no themes
are selected in "Random from selected" mode. Enabled back the delete
button on the "Random from selected" view for the currently selected
theme in the single theme view with a slight modification - users can
click on it but get told that they need to first deselect it from
"Single theme" mode first in order to delete it. Also upon closure if
users have activeted "Random form selected" but have not selected any
themes for it, they will be informed that the greeter will default to
single theme mode.
2006-11-02 Brian Cameron <brian.cameron@sun.com>
* gui/gdmlanguages.c, config/locale.alias: Add
......@@ -28,7 +41,7 @@
Fixes bug #352924.
* gui/gdmsetup.c: Added warnings when no themes are selected in
Random from sleceted mode. Random from selected option can only be
Random from selected mode. Random from selected option can only be
enabled only and only if one or more themes are selected. Also
disabled the delete button on the Random from selected view for
the currently selected theme in the single theme view mode.
......
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY legal SYSTEM "legal.xml">
<!ENTITY version "2.17.1">
<!ENTITY version "2.17.2">
<!ENTITY date "05/12/2006">
]>
<article id="index" lang="uk">
......@@ -72,7 +72,7 @@
<releaseinfo>
This manual describes version 2.17.1 of the GNOME Display Manager.
This manual describes version 2.17.2 of the GNOME Display Manager.
It was last updated on 05/12/2006.
</releaseinfo>
</articleinfo>
......@@ -81,7 +81,7 @@
<title>Терміни та домовленості використані у цьому посібнику</title>
<para>
This manual describes version 2.17.1 of the GNOME Display Manager.
This manual describes version 2.17.2 of the GNOME Display Manager.
It was last updated on 05/12/2006.
</para>
......
......@@ -59,6 +59,7 @@ static gboolean GdmIncludeAll;
static gboolean GdmAllowRoot;
static gboolean GdmAllowRemoteRoot;
static gboolean GdmUserChangesUnsaved;
static gboolean GdmRandomFromSelectedChangesWarn;
/* set the DOING_GDM_DEVELOPMENT env variable if you want to
* search for the glade file in the current dir and not the system
......@@ -1271,16 +1272,21 @@ combobox_changed (GtkWidget *combobox)
This is a bit of a HACK as combo_box handler is
called multiple times and we want this warning
to be displayed only once */
if (selected == RANDOM_THEME && ve_string_empty (selected_themes)) {
GtkWidget *warn_dlg = ve_hig_dialog_new (NULL /* parent */,
GTK_DIALOG_MODAL /* flags */,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
_("No themes selected!"),
"You need one or more themes selected for the Random from selected option to be valid.");
"You need one or more themes selected for the \"Random from selected\" option to be valid. Failure to do so will force \"Selected only\" mode.");
gtk_dialog_run (GTK_DIALOG (warn_dlg));
gtk_widget_destroy (warn_dlg);
GdmRandomFromSelectedChangesWarn = TRUE;
}
else if (selected == ONE_THEME)
GdmRandomFromSelectedChangesWarn = FALSE;
}
}
else {
......@@ -1352,6 +1358,15 @@ combobox_changed (GtkWidget *combobox)
} else {
gtk_tree_model_get_value (model, &iter,
THEME_COLUMN_SELECTED, &value);
/* We might have "Random from selected" option selected, but no
active themes there hence defaulting to "Selected only"
Lets make this theme delete-able from "Random from selected"
mode in this case */
if (g_value_get_boolean (&value) && selected == RANDOM_THEME) {
g_value_unset (&value);
g_value_set_boolean (&value, FALSE);
}
}
if (g_value_get_boolean (&value)) {
......@@ -1363,6 +1378,8 @@ combobox_changed (GtkWidget *combobox)
gtk_widget_set_sensitive (delete_button, TRUE);
gtk_widget_set_sensitive (delete_button_remote, TRUE);
}
g_value_unset (&value);
}
}
else if (strcmp (ve_sure_string (key), GDM_KEY_SERVER_PREFIX) == 0 ) {
......@@ -3201,6 +3218,7 @@ gg_selection_changed (GtkTreeSelection *selection, gpointer data)
GValue value = {0, };
gboolean GdmGraphicalThemeRand;
gchar *str;
gint selected = -1;
delete_button = glade_helper_get (xml, "gg_delete_theme",
GTK_TYPE_BUTTON);
......@@ -3217,6 +3235,7 @@ gg_selection_changed (GtkTreeSelection *selection, gpointer data)
if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
GtkWidget *theme_list;
GtkWidget *local_combobox;
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreePath *path;
......@@ -3226,6 +3245,10 @@ gg_selection_changed (GtkTreeSelection *selection, gpointer data)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (theme_list));
local_combobox = glade_helper_get (xml, "gg_mode_combobox",
GTK_TYPE_COMBO_BOX);
selected = gtk_combo_box_get_active (GTK_COMBO_BOX (local_combobox));
if (model != NULL) {
path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
if (path != NULL) {
......@@ -3267,15 +3290,17 @@ gg_selection_changed (GtkTreeSelection *selection, gpointer data)
GdmGraphicalThemeRand = gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND);
if (GdmGraphicalThemeRand) {
gtk_tree_model_get_value (model, &iter, THEME_COLUMN_SELECTED_LIST, &value);
} else {
gtk_tree_model_get_value (model, &iter, THEME_COLUMN_SELECTED, &value);
/* Make sure that the theme is not selected in the
single theme mode */
if (!g_value_get_boolean (&value)) {
/* We might have "Random form selected" option selected, but no
active themes there hence defaulting to "Selected only"
Lets make this theme delete-able from "Random from selected"
mode in this case */
if (g_value_get_boolean (&value) && selected == RANDOM_THEME) {
g_value_unset (&value);
gtk_tree_model_get_value (model, &iter, THEME_COLUMN_SELECTED, &value);
g_value_set_boolean (&value, FALSE);
}
} else {
gtk_tree_model_get_value (model, &iter, THEME_COLUMN_SELECTED, &value);
}
/* Do not allow deleting of active themes */
......@@ -3538,12 +3563,15 @@ greeter_theme_timeout (GtkWidget *toggle)
If there is at least one random theme selected and the random
theme option was false we force it to be true */
if (ve_string_empty (selected_themes) &&
gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND))
gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND)) {
gdm_setup_config_set_bool (GDM_KEY_GRAPHICAL_THEME_RAND, FALSE);
GdmRandomFromSelectedChangesWarn = TRUE;
else if (!ve_string_empty (selected_themes) &&
!gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND))
} else if (!ve_string_empty (selected_themes) &&
!gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND)) {
gdm_setup_config_set_bool (GDM_KEY_GRAPHICAL_THEME_RAND, TRUE);
GdmRandomFromSelectedChangesWarn = FALSE;
}
update_greeters ();
}
......@@ -3608,22 +3636,20 @@ selected_toggled (GtkCellRendererToggle *cell,
/* Loop through all checkboxes */
while (gtk_tree_model_get_iter (model, &iter, path)) {
gboolean selected = FALSE;
gboolean other_selected = FALSE;
/* If this checkbox was just toggled */
if (gtk_tree_path_compare (path, sel_path) == 0) {
gtk_tree_model_get (model, &selected_iter,
THEME_COLUMN_DIR, &theme_name,
THEME_COLUMN_SELECTED, &other_selected, -1);
THEME_COLUMN_DIR, &theme_name, -1);
if (gtk_cell_renderer_toggle_get_active (cell)) {
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
THEME_COLUMN_SELECTED_LIST,
FALSE, -1); /* Toggle OFF */
/* We will only make a theme delete-able if its not the
selected theme from single the theme mode */
gtk_widget_set_sensitive (del_button, !other_selected);
gtk_widget_set_sensitive (del_button_remote, !other_selected);
gtk_widget_set_sensitive (del_button, TRUE);
gtk_widget_set_sensitive (del_button_remote, TRUE);
} else {
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
THEME_COLUMN_SELECTED_LIST,
......@@ -3656,7 +3682,7 @@ selected_toggled (GtkCellRendererToggle *cell,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
_("No themes selected!"),
"You need one or more themes selected for the Random from selected option to be valid.");
"You need one or more themes selected for the \"Random from selected\" option to be valid. Failure to do so will force \"Selected only\" mode.");
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
}
......@@ -4230,6 +4256,7 @@ delete_theme (GtkWidget *button, gpointer data)
GtkWidget *setup_dialog;
GtkWidget *del_button;
GtkWidget *del_button_remote;
GtkWidget *local_combobox;
GtkTreeSelection *selection;
char *dir, *name;
GtkTreeModel *model;
......@@ -4238,6 +4265,8 @@ delete_theme (GtkWidget *button, gpointer data)
GtkWidget *dlg;
char *s;
gboolean GdmGraphicalThemeRand;
gboolean selected_warning = FALSE;
gint selected = -1;
setup_dialog = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
theme_list = glade_helper_get (xml, "gg_theme_list",
......@@ -4248,6 +4277,8 @@ delete_theme (GtkWidget *button, gpointer data)
GTK_TYPE_BUTTON);
del_button_remote = glade_helper_get (xml, "gg_delete_theme_remote",
GTK_TYPE_BUTTON);
local_combobox = glade_helper_get (xml, "gg_mode_combobox",
GTK_TYPE_COMBO_BOX);
if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
......@@ -4274,12 +4305,38 @@ delete_theme (GtkWidget *button, gpointer data)
g_value_unset (&value);
gtk_tree_model_get_value (model, &iter,
THEME_COLUMN_SELECTED, &value);
if (g_value_get_boolean (&value))
selected_warning = TRUE;
}
}
else {
gtk_tree_model_get_value (model, &iter,
THEME_COLUMN_SELECTED,
&value);
/* We might have "Random form selected" option selected, but no
active themes there hence defaulting to "Selected only"
Lets make this theme delete-able from "Random from selected"
mode in this case */
selected = gtk_combo_box_get_active (GTK_COMBO_BOX (local_combobox));
if (g_value_get_boolean (&value) && selected == RANDOM_THEME)
selected_warning = TRUE;
}
/* The theme we trying to delete in "Random from selected"
mode is currently in use in the "Selected only" mode
so lets warn the user about it */
if (selected_warning == TRUE) {
dlg = ve_hig_dialog_new (NULL /* parent */,
GTK_DIALOG_MODAL /* flags */,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
_("Theme active in \"Selected only\" mode"),
_("This theme cannot be deleted at this point. If you wish to delete this theme switch to \"Selected only\" mode, and deselect it by choosing a different theme."));
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
}
/* Do not allow deleting of selected theme */
......@@ -6490,6 +6547,30 @@ apply_user_changes (GObject *object, gint arg1, gpointer user_data)
{
GtkWidget *dialog = user_data;
/* This is pretty ugly but it is probable
that both events can occur simultaneously.
Then we display two dialogs - one after the other.
Lets hope that although probable this scenario
does not araise very often */
if (GdmRandomFromSelectedChangesWarn == TRUE) {
GtkWidget *prompt;
gint response;
prompt = ve_hig_dialog_new (NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
_("Random theme mode change"),
_("Since no themes were selected in random theme mode"
" switching back to single theme mode."));
gtk_dialog_run (GTK_DIALOG (prompt));
gtk_widget_destroy (prompt);
}
if (GdmUserChangesUnsaved == TRUE) {
GtkWidget *prompt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment