diff options
Diffstat (limited to 'capplets/time-admin/src/main.c')
-rw-r--r-- | capplets/time-admin/src/main.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/capplets/time-admin/src/main.c b/capplets/time-admin/src/main.c index 8ae4986c..fb9e87a2 100644 --- a/capplets/time-admin/src/main.c +++ b/capplets/time-admin/src/main.c @@ -17,14 +17,13 @@ #include <glib/gi18n.h> #include <polkit/polkit.h> +#include "capplet-util.h" #include "time-tool.h" #include "time-zone.h" #include "time-map.h" #define LOCKFILE "/tmp/time-admin.pid" #define TIME_ADMIN_PERMISSION "org.freedesktop.timedate1.set-time" -#define APPICON "mate-times-admin.png" -#define ICONFILE DATADIR APPICON static gboolean CheckClockHealth(gpointer data) { @@ -53,20 +52,7 @@ static void ChangeTimeValue(GtkSpinButton *spin_button, update_apply_timeout(ta); } } -static GdkPixbuf * GetAppIcon(void) -{ - GdkPixbuf *Pixbuf; - GError *Error = NULL; - Pixbuf = gdk_pixbuf_new_from_file(ICONFILE,&Error); - if(!Pixbuf) - { - MessageReport(("Get Icon Fail"),Error->message,ERROR); - g_error_free(Error); - } - - return Pixbuf; -} static gboolean on_window_quit (GtkWidget *widget, GdkEvent *event, gpointer user_data) @@ -108,7 +94,6 @@ static void on_permission_changed (GPermission *permission, static void InitMainWindow(TimeAdmin *ta) { GtkWidget *Window; - GdkPixbuf *AppIcon; GError *error = NULL; Window = gtk_window_new(GTK_WINDOW_TOPLEVEL); @@ -124,14 +109,8 @@ static void InitMainWindow(TimeAdmin *ta) "delete-event", G_CALLBACK(on_window_quit), ta); - - AppIcon = GetAppIcon(); - if(AppIcon) - { - gtk_window_set_icon(GTK_WINDOW(Window),AppIcon); - g_object_unref(AppIcon); - } - ta->Permission = polkit_permission_new_sync (TIME_ADMIN_PERMISSION, + gtk_window_set_icon_name (GTK_WINDOW(Window), "preferences-system-time"); + ta->Permission = polkit_permission_new_sync (TIME_ADMIN_PERMISSION, NULL, NULL, &error); @@ -442,16 +421,12 @@ EXIT: g_error_free(error); return FALSE; } + int main(int argc, char **argv) { TimeAdmin ta; - setlocale (LC_ALL, ""); - bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - gtk_init(&argc, &argv); + capplet_init (NULL, &argc, &argv); /* Create the main window */ InitMainWindow(&ta); |