Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:vuntz:Attic_11.1
libssui
libssui-missing-options.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libssui-missing-options.patch of Package libssui
--- libssui-0.5.7/src/logout-dialog.c +++ libssui-0.5.7/src/logout-dialog.c @@ -190,7 +190,6 @@ // GdkWindow *parent; int monitor = 0; int selected_option; - gboolean haveOption = FALSE; // gsm_verbose ("display_gui: showing logout dialog\n"); @@ -257,7 +256,6 @@ if(dlg_option & SSUI_OPTION_LOGOUT) { - haveOption = TRUE; image = NULL; if(gtk_icon_theme_has_icon(iconTheme, "system-log-out")) { @@ -295,7 +293,6 @@ if(dlg_option & SSUI_OPTION_LOCK) { - haveOption = TRUE; image = NULL; if(gtk_icon_theme_has_icon(iconTheme, "system-lock-screen")) { @@ -333,150 +330,154 @@ if(dlg_option & SSUI_OPTION_SHUTDOWN) { - if(gdm_supports_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN)) + image = NULL; + if(gtk_icon_theme_has_icon(iconTheme, "system-shutdown")) { - image = NULL; - if(gtk_icon_theme_has_icon(iconTheme, "system-shutdown")) - { - themePixbuf = gtk_icon_theme_load_icon(iconTheme, - "system-shutdown", 48, 0, &error); - if(themePixbuf != NULL) - image = gtk_image_new_from_pixbuf(themePixbuf); - else - image = NULL; - } - else if(gtk_icon_theme_has_icon(iconTheme, "gnome-shutdown")) - { - themePixbuf = gtk_icon_theme_load_icon(iconTheme, - "gnome-shutdown", 48, 0, &error); - if(themePixbuf != NULL) - image = gtk_image_new_from_pixbuf(themePixbuf); - else - image = NULL; - } - if(image == NULL) - { - image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, - GTK_ICON_SIZE_DIALOG); - } - tile = ssui_get_tile(image, _("_Shutdown"), - _("Ends your session and turns off the computer.")); - g_signal_connect (G_OBJECT (tile), "clicked", - G_CALLBACK (shutdown_button_clicked), logoutDlg); + themePixbuf = gtk_icon_theme_load_icon(iconTheme, + "system-shutdown", 48, 0, &error); + if(themePixbuf != NULL) + image = gtk_image_new_from_pixbuf(themePixbuf); + else + image = NULL; + } + else if(gtk_icon_theme_has_icon(iconTheme, "gnome-shutdown")) + { + themePixbuf = gtk_icon_theme_load_icon(iconTheme, + "gnome-shutdown", 48, 0, &error); + if(themePixbuf != NULL) + image = gtk_image_new_from_pixbuf(themePixbuf); + else + image = NULL; + } + if(image == NULL) + { + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, + GTK_ICON_SIZE_DIALOG); + } + tile = ssui_get_tile(image, _("_Shutdown"), + _("Ends your session and turns off the computer.")); + g_signal_connect (G_OBJECT (tile), "clicked", + G_CALLBACK (shutdown_button_clicked), logoutDlg); - gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); - gtk_widget_show_all(tile); + if(!gdm_supports_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN)) + { + gtk_widget_set_sensitive(tile, FALSE); } + + gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); + gtk_widget_show_all(tile); } if(dlg_option & SSUI_OPTION_RESTART) { - if(gdm_supports_logout_action (GDM_LOGOUT_ACTION_REBOOT)) + image = NULL; + if(gtk_icon_theme_has_icon(iconTheme, "stock_refresh")) { - haveOption = TRUE; - image = NULL; - if(gtk_icon_theme_has_icon(iconTheme, "stock_refresh")) - { - themePixbuf = gtk_icon_theme_load_icon(iconTheme, - "stock_refresh", 48, 0, &error); - if(themePixbuf != NULL) - image = gtk_image_new_from_pixbuf(themePixbuf); - else - image = NULL; - } - else if(gtk_icon_theme_has_icon(iconTheme, "gnome-reboot")) - { - themePixbuf = gtk_icon_theme_load_icon(iconTheme, - "gnome-reboot", 48, 0, &error); - if(themePixbuf != NULL) - image = gtk_image_new_from_pixbuf(themePixbuf); - else - image = NULL; - } - if(image == NULL) - { - image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, - GTK_ICON_SIZE_DIALOG); - } - tile = ssui_get_tile(image, _("_Restart"), - _("Ends your session and restarts the computer.")); - g_signal_connect (G_OBJECT (tile), "clicked", - G_CALLBACK (restart_button_clicked), logoutDlg); + themePixbuf = gtk_icon_theme_load_icon(iconTheme, + "stock_refresh", 48, 0, &error); + if(themePixbuf != NULL) + image = gtk_image_new_from_pixbuf(themePixbuf); + else + image = NULL; + } + else if(gtk_icon_theme_has_icon(iconTheme, "gnome-reboot")) + { + themePixbuf = gtk_icon_theme_load_icon(iconTheme, + "gnome-reboot", 48, 0, &error); + if(themePixbuf != NULL) + image = gtk_image_new_from_pixbuf(themePixbuf); + else + image = NULL; + } + if(image == NULL) + { + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, + GTK_ICON_SIZE_DIALOG); + } + tile = ssui_get_tile(image, _("_Restart"), + _("Ends your session and restarts the computer.")); + g_signal_connect (G_OBJECT (tile), "clicked", + G_CALLBACK (restart_button_clicked), logoutDlg); - gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); - gtk_widget_show_all(tile); + if(!gdm_supports_logout_action (GDM_LOGOUT_ACTION_REBOOT)) + { + gtk_widget_set_sensitive(tile, FALSE); } + + gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); + gtk_widget_show_all(tile); } if(dlg_option & SSUI_OPTION_SLEEP) { - if(panel_power_manager_can_suspend(powerManager)) + image = NULL; + if(gtk_icon_theme_has_icon(iconTheme, "sleep")) { - haveOption = TRUE; - image = NULL; - if(gtk_icon_theme_has_icon(iconTheme, "sleep")) - { - themePixbuf = gtk_icon_theme_load_icon(iconTheme, - "sleep", 48, 0, &error); - if(themePixbuf != NULL) - image = gtk_image_new_from_pixbuf(themePixbuf); - else - image = NULL; - } - if(image == NULL) - { - image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, - GTK_ICON_SIZE_DIALOG); - } - tile = ssui_get_tile(image, _("Slee_p"), - _("Suspends your session quickly, using minimal power while the computer stands by.")); - g_signal_connect (G_OBJECT (tile), "clicked", - G_CALLBACK (sleep_button_clicked), logoutDlg); + themePixbuf = gtk_icon_theme_load_icon(iconTheme, + "sleep", 48, 0, &error); + if(themePixbuf != NULL) + image = gtk_image_new_from_pixbuf(themePixbuf); + else + image = NULL; + } + if(image == NULL) + { + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, + GTK_ICON_SIZE_DIALOG); + } + tile = ssui_get_tile(image, _("Slee_p"), + _("Suspends your session quickly, using minimal power while the computer stands by.")); + g_signal_connect (G_OBJECT (tile), "clicked", + G_CALLBACK (sleep_button_clicked), logoutDlg); - gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); - gtk_widget_show_all(tile); + if(!panel_power_manager_can_suspend(powerManager)) + { + gtk_widget_set_sensitive(tile, FALSE); } + + gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); + gtk_widget_show_all(tile); } if(dlg_option & SSUI_OPTION_HIBERNATE) { - if(panel_power_manager_can_hibernate(powerManager)) + image = NULL; + if(gtk_icon_theme_has_icon(iconTheme, "drive-harddisk")) { - haveOption = TRUE; - image = NULL; - if(gtk_icon_theme_has_icon(iconTheme, "drive-harddisk")) - { - themePixbuf = gtk_icon_theme_load_icon(iconTheme, - "drive-harddisk", 48, 0, &error); - if(themePixbuf != NULL) - image = gtk_image_new_from_pixbuf(themePixbuf); - else - image = NULL; - } - if(image == NULL) - { - image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, - GTK_ICON_SIZE_DIALOG); - } - tile = ssui_get_tile(image, _("Hi_bernate"), - _("Suspends your session, using no power until the computer is restarted.")); - g_signal_connect (G_OBJECT (tile), "clicked", - G_CALLBACK (hibernate_button_clicked), logoutDlg); + themePixbuf = gtk_icon_theme_load_icon(iconTheme, + "drive-harddisk", 48, 0, &error); + if(themePixbuf != NULL) + image = gtk_image_new_from_pixbuf(themePixbuf); + else + image = NULL; + } + if(image == NULL) + { + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, + GTK_ICON_SIZE_DIALOG); + } + tile = ssui_get_tile(image, _("Hi_bernate"), + _("Suspends your session, using no power until the computer is restarted.")); + g_signal_connect (G_OBJECT (tile), "clicked", + G_CALLBACK (hibernate_button_clicked), logoutDlg); - gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); - gtk_widget_show_all(tile); + if(!panel_power_manager_can_hibernate(powerManager)) + { + gtk_widget_set_sensitive(tile, FALSE); } + + gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0); + gtk_widget_show_all(tile); } if(dlg_option & SSUI_OPTION_SWITCH) { - haveOption = TRUE; image = NULL; if(gtk_icon_theme_has_icon(iconTheme, "config-users")) { @@ -551,12 +552,7 @@ do { - // if there are any options available to display above, show the - // dialog, otherwise don't show it at all - if(haveOption) - response = gtk_dialog_run (GTK_DIALOG (logoutDlg)); - else - response = GTK_RESPONSE_CANCEL; + response = gtk_dialog_run (GTK_DIALOG (logoutDlg)); showDialog = FALSE;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor