[Xfce4-commits] [apps/gigolo] 02/26: Replace GtkStock usage
noreply at xfce.org
noreply at xfce.org
Thu Oct 25 08:03:54 CEST 2018
This is an automated email from the git hooks/post-receive script.
l a n d r y p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/gigolo.
commit 0118f913eb8717dd9d13b168fa8280cd6c7b24cf
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Tue Oct 16 19:18:41 2018 -0400
Replace GtkStock usage
---
TODO | 22 +---------------------
src/bookmarkdialog.c | 12 +++++++++---
src/browsenetworkpanel.c | 2 +-
src/menubuttonaction.c | 2 +-
src/window.c | 24 ++++++++++++------------
5 files changed, 24 insertions(+), 38 deletions(-)
diff --git a/TODO b/TODO
index 150536c..5cc5d79 100644
--- a/TODO
+++ b/TODO
@@ -35,26 +35,6 @@ bookmarkdialog.c:77:2: warning: ‘g_type_class_add_private’ is deprecated
bookmarkeditdialog.c:328:2: warning: ‘g_type_class_add_private’ is deprecated
browsenetworkpanel.c:102:2: warning: ‘g_type_class_add_private’ is deprecated
-=== GtkStock deprecations ===
-menubuttonaction.c:156:3: warning: ‘gtk_tool_button_set_stock_id’ is deprecated: Use 'gtk_tool_button_set_icon_name' instead
-bookmarkdialog.c:423:2: warning: ‘gtk_button_new_from_stock’ is deprecated: Use 'gtk_button_new_with_label' instead
-bookmarkdialog.c:426:2: warning: ‘gtk_button_new_from_stock’ is deprecated: Use 'gtk_button_new_with_label' instead
-bookmarkdialog.c:429:2: warning: ‘gtk_button_new_from_stock’ is deprecated: Use 'gtk_button_new_with_label' instead
-window.c:1276:3: warning: ‘GtkStock’ is deprecated
-window.c:1278:3: warning: ‘GtkStock’ is deprecated
-window.c:1280:3: warning: ‘GtkStock’ is deprecated
-window.c:1284:3: warning: ‘GtkStock’ is deprecated
-window.c:1285:3: warning: ‘GtkStock’ is deprecated
-window.c:1287:3: warning: ‘GtkStock’ is deprecated
-window.c:1291:3: warning: ‘GtkStock’ is deprecated
-window.c:1292:3: warning: ‘GtkStock’ is deprecated
-window.c:1293:3: warning: ‘GtkStock’ is deprecated
-window.c:1295:3: warning: ‘GtkStock’ is deprecated
-window.c:1321:3: warning: ‘GtkStock’ is deprecated
-window.c:1342:3: warning: ‘GtkStock’ is deprecated
-menubuttonaction.c:156:3: warning: ‘GtkStock’ is deprecated
-browsenetworkpanel.c:445:2: warning: ‘GtkStock’ is deprecated
-
=== GtkStatusIcon deprecations ===
window.c:1041:2: warning: ‘gtk_status_icon_set_visible’ is deprecated
window.c:1623:2: warning: ‘gtk_status_icon_new_from_icon_name’ is deprecated
@@ -98,7 +78,7 @@ window.c:727:3: warning: ‘gtk_action_set_sensitive’ is deprecated
window.c:728:3: warning: ‘gtk_action_set_sensitive’ is deprecated
window.c:729:3: warning: ‘gtk_action_set_sensitive’ is deprecated
window.c:1340:3: warning: ‘gtk_action_set_icon_name’ is deprecated
-window.c:1342:3: warning: ‘gtk_action_set_stock_id’ is deprecated
+window.c:1342:3: warning: ‘gtk_action_set_icon_name’ is deprecated
menubuttonaction.c:49:1: warning: ‘gtk_action_get_type’ is deprecated
menubuttonaction.c:112:2: warning: ‘gtk_action_get_proxies’ is deprecated
menubuttonaction.c:112:2: warning: ‘gtk_action_get_type’ is deprecated
diff --git a/src/bookmarkdialog.c b/src/bookmarkdialog.c
index 7f7c22f..7e69edb 100644
--- a/src/bookmarkdialog.c
+++ b/src/bookmarkdialog.c
@@ -420,13 +420,19 @@ static void gigolo_bookmark_dialog_init(GigoloBookmarkDialog *dialog)
gtk_window_set_default_size(GTK_WINDOW(dialog), 550, 350);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CLOSE);
- button_add = gtk_button_new_from_stock("gtk-add");
+ button_add = gtk_button_new_from_icon_name ("list-add", GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_label (GTK_BUTTON (button_add), _("_Add"));
+ gtk_button_set_use_underline (GTK_BUTTON (button_add), TRUE);
g_signal_connect(button_add, "clicked", G_CALLBACK(add_button_click_cb), dialog);
- priv->button_edit = gtk_button_new_from_stock("gtk-edit");
+ priv->button_edit = gtk_button_new_from_icon_name ("gtk-edit", GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_label (GTK_BUTTON (priv->button_edit), _("_Edit"));
+ gtk_button_set_use_underline (GTK_BUTTON (priv->button_edit), TRUE);
g_signal_connect(priv->button_edit, "clicked", G_CALLBACK(edit_button_click_cb), dialog);
- priv->button_delete = gtk_button_new_from_stock("gtk-delete");
+ priv->button_delete = gtk_button_new_from_icon_name ("edit-delete", GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_label (GTK_BUTTON (priv->button_delete), _("_Delete"));
+ gtk_button_set_use_underline (GTK_BUTTON (priv->button_delete), TRUE);
g_signal_connect(priv->button_delete, "clicked", G_CALLBACK(delete_button_click_cb), dialog);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
diff --git a/src/browsenetworkpanel.c b/src/browsenetworkpanel.c
index 6f6a5ed..c8882bc 100644
--- a/src/browsenetworkpanel.c
+++ b/src/browsenetworkpanel.c
@@ -442,7 +442,7 @@ static void tree_prepare(GigoloBrowseNetworkPanel *panel)
/* popup menu */
menu = gtk_menu_new();
- priv->item_connect = item = gtk_image_menu_item_new_from_stock(GTK_STOCK_CONNECT, NULL);
+ priv->item_connect = item = gtk_image_menu_item_new_from_stock("gtk-connect", NULL);
g_object_set_data(G_OBJECT(item), "panel", panel);
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
diff --git a/src/menubuttonaction.c b/src/menubuttonaction.c
index 6ffb097..afd9439 100644
--- a/src/menubuttonaction.c
+++ b/src/menubuttonaction.c
@@ -153,7 +153,7 @@ static void gigolo_menu_button_action_connect_proxy(GtkAction *action, GtkWidget
/* Overwrite the icon and label of the toolbar button */
if (GTK_IS_TOOL_BUTTON(widget))
{
- gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(widget), GTK_STOCK_CONNECT);
+ gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON(widget), "gtk-connect");
gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Connect"));
}
}
diff --git a/src/window.c b/src/window.c
index e9bd5da..d28cf73 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1273,26 +1273,26 @@ static void create_ui_elements(GigoloWindow *window, GtkUIManager *ui_manager)
{ "Actions", NULL, N_("_Actions"), NULL, NULL, NULL },
{ "View", NULL, N_("_View"), NULL, NULL, NULL },
{ "Help", NULL, N_("_Help"), NULL, NULL, NULL },
- { "Preferences", GTK_STOCK_PREFERENCES,
+ { "Preferences", "preferences-system",
NULL, "<Ctrl>p", NULL, G_CALLBACK(action_preferences_cb) },
- { "CreateBookmark", GTK_STOCK_ADD,
+ { "CreateBookmark", "list-add",
N_("Create _Bookmark"), "<Ctrl>n", NULL, G_CALLBACK(action_create_bookmark_cb) },
- { "EditBookmarks", GTK_STOCK_EDIT,
+ { "EditBookmarks", "gtk-edit",
N_("_Edit Bookmarks"), "<Ctrl>b",
N_("Open the bookmark manager to add, edit or delete bookmarks"),
G_CALLBACK(action_bookmark_edit_cb) },
- { "Connect", GTK_STOCK_CONNECT, NULL, NULL, NULL, G_CALLBACK(action_mount_cb) },
- { "Disconnect", GTK_STOCK_DISCONNECT, NULL, NULL,
+ { "Connect", "gtk-connect", NULL, NULL, NULL, G_CALLBACK(action_mount_cb) },
+ { "Disconnect", "gtk-disconnect", NULL, NULL,
N_("Disconnect the selected resource"), G_CALLBACK(action_unmount_cb) },
- { "Open", GTK_STOCK_OPEN, NULL, "<Ctrl>o",
+ { "Open", "document-open", NULL, "<Ctrl>o",
N_("Open the selected resource with a file manager"), G_CALLBACK(action_open_cb) },
{ "OpenTerminal", NULL, _("Open in _Terminal"), "<Ctrl>t",
N_("Start a terminal from here"), G_CALLBACK(action_open_terminal_cb) },
- { "CopyURI", GTK_STOCK_COPY, N_("Copy _URI"), "<Ctrl>c", NULL, G_CALLBACK(action_copy_uri_cb) },
- { "Quit", GTK_STOCK_QUIT, NULL, "<Ctrl>q", N_("Quit Gigolo"), G_CALLBACK(action_quit_cb) },
- { "OnlineHelp", GTK_STOCK_HELP, _("Online Help"), NULL, NULL, G_CALLBACK(action_help_cb) },
+ { "CopyURI", "edit-copy", N_("Copy _URI"), "<Ctrl>c", NULL, G_CALLBACK(action_copy_uri_cb) },
+ { "Quit", "application-exit", NULL, "<Ctrl>q", N_("Quit Gigolo"), G_CALLBACK(action_quit_cb) },
+ { "OnlineHelp", "go-home", _("Online Help"), NULL, NULL, G_CALLBACK(action_help_cb) },
{ "SupportedSchemes", NULL, _("Supported Protocols"), NULL, NULL, G_CALLBACK(action_supported_schemes_cb) },
- { "About", GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK(action_about_cb) }
+ { "About", "help-abount", NULL, NULL, NULL, G_CALLBACK(action_about_cb) }
};
const guint entries_n = G_N_ELEMENTS(entries);
@@ -1318,7 +1318,7 @@ static void create_ui_elements(GigoloWindow *window, GtkUIManager *ui_manager)
priv->action_bookmarks = gigolo_menu_button_action_new(
"Bookmarks", _("_Bookmarks"), _("Choose a bookmark to connect to"),
- gigolo_find_icon_name("bookmark-new", GTK_STOCK_EDIT));
+ gigolo_find_icon_name("bookmark-new", "gtk-edit"));
g_signal_connect(priv->action_bookmarks, "item-clicked",
G_CALLBACK(action_bookmark_activate_cb), window);
g_signal_connect(priv->action_bookmarks, "button-clicked", G_CALLBACK(action_mount_cb), window);
@@ -1339,7 +1339,7 @@ static void create_ui_elements(GigoloWindow *window, GtkUIManager *ui_manager)
if (gtk_icon_theme_has_icon(icon_theme, "utilities-terminal"))
gtk_action_set_icon_name(open_terminal, "utilities-terminal");
else
- gtk_action_set_stock_id(open_terminal, GTK_STOCK_OPEN);
+ gtk_action_set_icon_name(open_terminal, "document-open");
if (! gtk_ui_manager_add_ui_from_string(ui_manager, ui_markup, -1, &error))
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list