summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSorokin Alexei <[email protected]>2016-06-07 18:53:50 +0300
committerraveit65 <[email protected]>2016-06-07 20:08:42 +0200
commit7703c9e3e480629a7eeab8b4310f313b9b1784df (patch)
tree9738116d2b4ee8b3bd317cca3ac5039aaa08f086 /src
parentb8f642a86d8d18747a0b970b4420435603ee5a5f (diff)
downloadmate-power-manager-7703c9e3e480629a7eeab8b4310f313b9b1784df.tar.bz2
mate-power-manager-7703c9e3e480629a7eeab8b4310f313b9b1784df.tar.xz
rely less on GtkStock
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/gpm-backlight.c2
-rw-r--r--src/gpm-engine.c4
-rw-r--r--src/gpm-icon-names.h (renamed from src/gpm-stock-icons.h)24
-rw-r--r--src/gpm-main.c2
-rw-r--r--src/gpm-manager.c13
-rw-r--r--src/gpm-prefs-core.c4
-rw-r--r--src/gpm-statistics.c4
-rw-r--r--src/gpm-tray-icon.c19
-rw-r--r--src/gpm-tray-icon.h2
10 files changed, 38 insertions, 38 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b7469ea..680384f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -172,7 +172,7 @@ mate_power_manager_SOURCES = \
gpm-session.c \
gpm-networkmanager.h \
gpm-networkmanager.c \
- gpm-stock-icons.h \
+ gpm-icon-names.h \
gsd-media-keys-window.h \
gsd-media-keys-window.c \
msd-osd-window.h \
diff --git a/src/gpm-backlight.c b/src/gpm-backlight.c
index a4629ad..48a33c7 100644
--- a/src/gpm-backlight.c
+++ b/src/gpm-backlight.c
@@ -52,7 +52,7 @@
#include "gpm-dpms.h"
#include "gpm-idle.h"
#include "gpm-marshal.h"
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "egg-console-kit.h"
#if !GTK_CHECK_VERSION(3,0,0)
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index f1ae198..61cdba4 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -32,7 +32,7 @@
#include "gpm-upower.h"
#include "gpm-marshal.h"
#include "gpm-engine.h"
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "gpm-phone.h"
static void gpm_engine_finalize (GObject *object);
@@ -443,7 +443,7 @@ gpm_engine_get_icon (GpmEngine *engine)
/* we fallback to the ac_adapter icon */
egg_debug ("Using fallback");
- return g_strdup (GPM_STOCK_AC_ADAPTER);
+ return g_strdup (GPM_ICON_AC_ADAPTER);
}
/**
diff --git a/src/gpm-stock-icons.h b/src/gpm-icon-names.h
index 395d612..004e70e 100644
--- a/src/gpm-stock-icons.h
+++ b/src/gpm-icon-names.h
@@ -21,21 +21,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GPM_STOCK_ICONS_H
-#define __GPM_STOCK_ICONS_H
+#ifndef __GPM_ICON_NAMES_H
+#define __GPM_ICON_NAMES_H
G_BEGIN_DECLS
-#define GPM_STOCK_APP_ICON "mate-power-manager"
-#define GPM_STOCK_AC_ADAPTER "gpm-ac-adapter"
-#define GPM_STOCK_BATTERY_CHARGED "gpm-primary-charged"
-#define GPM_STOCK_HIBERNATE "gpm-hibernate"
-#define GPM_STOCK_SUSPEND "gpm-suspend"
-#define GPM_STOCK_STATISTICS "mate-power-statistics"
-#define GPM_STOCK_BRIGHTNESS_LCD "gpm-brightness-lcd"
-#define GPM_STOCK_BRIGHTNESS_KBD "gpm-brightness-kbd"
-#define GPM_STOCK_INHIBIT "gpm-inhibit"
+#define GPM_ICON_APP_ICON "mate-power-manager"
+#define GPM_ICON_AC_ADAPTER "gpm-ac-adapter"
+#define GPM_ICON_BATTERY_CHARGED "gpm-primary-charged"
+#define GPM_ICON_SUSPEND "gpm-suspend"
+#define GPM_ICON_HIBERNATE "gpm-hibernate"
+#define GPM_ICON_STATISTICS "mate-power-statistics"
+#define GPM_ICON_BRIGHTNESS_LCD "gpm-brightness-lcd"
+#define GPM_ICON_BRIGHTNESS_KBD "gpm-brightness-kbd"
+#define GPM_ICON_INHIBIT "gpm-inhibit"
G_END_DECLS
-#endif /* __GPM_STOCK_ICONS_H */
+#endif /* __GPM_ICON_NAMES_H */
diff --git a/src/gpm-main.c b/src/gpm-main.c
index 30cf481..6186d6e 100644
--- a/src/gpm-main.c
+++ b/src/gpm-main.c
@@ -36,7 +36,7 @@
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "gpm-common.h"
#include "gpm-manager.h"
#include "gpm-session.h"
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 050d3ec..d07cae8 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -56,7 +56,7 @@
#include "gpm-backlight.h"
#include "gpm-kbd-backlight.h"
#include "gpm-session.h"
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "gpm-tray-icon.h"
#include "gpm-engine.h"
#include "gpm-upower.h"
@@ -579,13 +579,13 @@ gpm_manager_sleep_failure (GpmManager *manager, gboolean is_suspend, const gchar
g_string_append (string, _("Computer failed to suspend."));
/* TRANSLATORS: title text */
title = _("Failed to suspend");
- icon = GPM_STOCK_SUSPEND;
+ icon = GPM_ICON_SUSPEND;
} else {
/* TRANSLATORS: message text */
g_string_append (string, _("Computer failed to hibernate."));
/* TRANSLATORS: title text */
title = _("Failed to hibernate");
- icon = GPM_STOCK_HIBERNATE;
+ icon = GPM_ICON_HIBERNATE;
}
/* TRANSLATORS: message text */
@@ -926,7 +926,7 @@ gpm_manager_button_pressed_cb (GpmButton *button, const gchar *type, GpmManager
_("Power Information"),
message,
GPM_MANAGER_NOTIFY_TIMEOUT_LONG,
- GTK_STOCK_DIALOG_INFO,
+ "dialog-information",
NOTIFY_URGENCY_NORMAL);
g_free (message);
}
@@ -1116,7 +1116,7 @@ gpm_manager_engine_low_capacity_cb (GpmEngine *engine, UpDevice *device, GpmMana
message = g_strdup_printf (_("Battery has a very low capacity (%1.1f%%), "
"which means that it may be old or broken."), capacity);
gpm_manager_notify (manager, &manager->priv->notification_general, title, message, GPM_MANAGER_NOTIFY_TIMEOUT_SHORT,
- GTK_STOCK_DIALOG_INFO, NOTIFY_URGENCY_LOW);
+ "dialog-information", NOTIFY_URGENCY_LOW);
out:
g_free (message);
}
@@ -1165,7 +1165,7 @@ gpm_manager_engine_fully_charged_cb (GpmEngine *engine, UpDevice *device, GpmMan
title = ngettext ("Battery Charged", "Batteries Charged", plural);
gpm_manager_notify (manager, &manager->priv->notification_fully_charged,
title, NULL, GPM_MANAGER_NOTIFY_TIMEOUT_SHORT,
- GTK_STOCK_DIALOG_INFO, NOTIFY_URGENCY_LOW);
+ "dialog-information", NOTIFY_URGENCY_LOW);
}
out:
g_free (native_path);
@@ -1790,7 +1790,6 @@ static void
gpm_manager_init (GpmManager *manager)
{
gboolean check_type_cpu;
- gint timeout;
DBusGConnection *connection;
GDBusConnection *g_connection;
GError *error = NULL;
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index ef7edad..4bef861 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -39,7 +39,7 @@
#include "gpm-tray-icon.h"
#include "gpm-common.h"
#include "gpm-prefs-core.h"
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "gpm-brightness.h"
static void gpm_prefs_finalize (GObject *object);
@@ -842,7 +842,7 @@ gpm_prefs_init (GpmPrefs *prefs)
/* Hide window first so that the dialogue resizes itself without redrawing */
gtk_widget_hide (main_window);
- gtk_window_set_default_icon_name (GPM_STOCK_APP_ICON);
+ gtk_window_set_default_icon_name (GPM_ICON_APP_ICON);
/* Get the main window quit */
g_signal_connect (main_window, "delete_event",
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index f800cef..9fab6bc 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -36,7 +36,7 @@
#include "egg-unique.h"
#include "gpm-common.h"
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "gpm-upower.h"
#include "gpm-graph-widget.h"
@@ -1642,7 +1642,7 @@ main (int argc, char *argv[])
widget = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_stats"));
gtk_window_set_default_size (GTK_WINDOW(widget), 800, 500);
- gtk_window_set_default_icon_name (GPM_STOCK_APP_ICON);
+ gtk_window_set_default_icon_name (GPM_ICON_APP_ICON);
/* Get the main window quit */
g_signal_connect_swapped (widget, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c
index 28e30c5..6d4b2f9 100644
--- a/src/gpm-tray-icon.c
+++ b/src/gpm-tray-icon.c
@@ -46,7 +46,7 @@
#include "gpm-upower.h"
#include "gpm-engine.h"
#include "gpm-common.h"
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "gpm-tray-icon.h"
static void gpm_tray_icon_finalize (GObject *object);
@@ -111,20 +111,21 @@ gpm_tray_icon_get_status_icon (GpmTrayIcon *icon)
}
/**
- * gpm_tray_icon_set_image_from_stock:
- * @filename: The icon name, e.g. GPM_STOCK_APP_ICON, or NULL to remove.
+ * gpm_tray_icon_set_icon:
+ * @icon_name: The icon name, e.g. GPM_ICON_APP_ICON, or NULL to remove.
*
- * Loads a pixmap from disk, and sets as the tooltip icon
+ * Loads a pixmap from disk, and sets as the tooltip icon.
**/
gboolean
-gpm_tray_icon_set_icon (GpmTrayIcon *icon, const gchar *filename)
+gpm_tray_icon_set_icon (GpmTrayIcon *icon, const gchar *icon_name)
{
g_return_val_if_fail (icon != NULL, FALSE);
g_return_val_if_fail (GPM_IS_TRAY_ICON (icon), FALSE);
- if (filename != NULL) {
- egg_debug ("Setting icon to %s", filename);
- gtk_status_icon_set_from_icon_name (icon->priv->status_icon, filename);
+ if (icon_name != NULL) {
+ egg_debug ("Setting icon to %s", icon_name);
+ gtk_status_icon_set_from_icon_name (icon->priv->status_icon,
+ icon_name);
/* make sure that we are visible */
gpm_tray_icon_show (icon, TRUE);
@@ -328,7 +329,7 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon, guint32 timestamp)
/* preferences */
item = gtk_image_menu_item_new_with_mnemonic (_("_Preferences"));
- image = gtk_image_new_from_icon_name (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_icon_name ("preferences-system", GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (gpm_tray_icon_show_preferences_cb), icon);
diff --git a/src/gpm-tray-icon.h b/src/gpm-tray-icon.h
index 5ff828f..03bc943 100644
--- a/src/gpm-tray-icon.h
+++ b/src/gpm-tray-icon.h
@@ -55,7 +55,7 @@ GpmTrayIcon *gpm_tray_icon_new (void);
gboolean gpm_tray_icon_set_tooltip (GpmTrayIcon *icon,
const gchar *tooltip);
gboolean gpm_tray_icon_set_icon (GpmTrayIcon *icon,
- const gchar *filename);
+ const gchar *icon_name);
GtkStatusIcon *gpm_tray_icon_get_status_icon (GpmTrayIcon *icon);
G_END_DECLS