]> Pileus Git - ~andy/gtk/commitdiff
Extract reasons and reasons_desc arrays to file level
authorJohn Ralls <jralls@ceridwen.us>
Sun, 19 Feb 2012 21:14:36 +0000 (13:14 -0800)
committerJohn Ralls <jralls@ceridwen.us>
Mon, 23 Apr 2012 19:44:06 +0000 (12:44 -0700)
So that they can be used from more than one function. Rename them to avoid naming conflicts.

modules/printbackends/cups/gtkprintbackendcups.c

index 928ad96a6b0ddc3805e184500bf759cb768cd106..f26214af6a17c5cc6abf5dc2cbf62140e47b85fc 100644 (file)
@@ -1652,6 +1652,42 @@ find_printer (GtkPrinter  *printer,
   printer_name = gtk_printer_get_name (printer);
   return g_ascii_strcasecmp (printer_name, find_name);
 }
+/* Printer messages we're interested in */
+static const char * const printer_messages[] =
+  {
+    "toner-low",
+    "toner-empty",
+    "developer-low",
+    "developer-empty",
+    "marker-supply-low",
+    "marker-supply-empty",
+    "cover-open",
+    "door-open",
+    "media-low",
+    "media-empty",
+    "offline",
+    "other"
+  };
+/* Our translatable versions of the printer messages */
+static const char * printer_strings[] =
+  {
+    N_("Printer '%s' is low on toner."),
+    N_("Printer '%s' has no toner left."),
+    /* Translators: "Developer" like on photo development context */
+    N_("Printer '%s' is low on developer."),
+    /* Translators: "Developer" like on photo development context */
+    N_("Printer '%s' is out of developer."),
+    /* Translators: "marker" is one color bin of the printer */
+    N_("Printer '%s' is low on at least one marker supply."),
+    /* Translators: "marker" is one color bin of the printer */
+    N_("Printer '%s' is out of at least one marker supply."),
+    N_("The cover is open on printer '%s'."),
+    N_("The door is open on printer '%s'."),
+    N_("Printer '%s' is low on paper."),
+    N_("Printer '%s' is out of paper."),
+    N_("Printer '%s' is currently offline."),
+    N_("There is a problem on printer '%s'.")
+  };
 
 static void
 cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
@@ -1723,40 +1759,6 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
       gint printer_state_reason_level = 0; /* 0 - none, 1 - report, 2 - warning, 3 - error */
       gboolean interested_in = FALSE;
       gboolean found = FALSE;
-      static const char * const reasons[] =    /* Reasons we're interested in */
-        {
-          "toner-low",
-          "toner-empty",
-          "developer-low",
-          "developer-empty",
-          "marker-supply-low",
-          "marker-supply-empty",
-          "cover-open",
-          "door-open",
-          "media-low",
-          "media-empty",
-          "offline",
-          "other"
-        };
-      static const char * reasons_descs[] =
-        {
-          N_("Printer '%s' is low on toner."),
-          N_("Printer '%s' has no toner left."),
-          /* Translators: "Developer" like on photo development context */
-          N_("Printer '%s' is low on developer."),
-          /* Translators: "Developer" like on photo development context */
-          N_("Printer '%s' is out of developer."),
-          /* Translators: "marker" is one color bin of the printer */
-          N_("Printer '%s' is low on at least one marker supply."),
-          /* Translators: "marker" is one color bin of the printer */
-          N_("Printer '%s' is out of at least one marker supply."),
-          N_("The cover is open on printer '%s'."),
-          N_("The door is open on printer '%s'."),
-          N_("Printer '%s' is low on paper."),
-          N_("Printer '%s' is out of paper."),
-          N_("Printer '%s' is currently offline."),
-          N_("There is a problem on printer '%s'.")
-        };
       gboolean is_paused = FALSE;
       gboolean is_accepting_jobs = TRUE;
       gboolean default_printer = FALSE;