Commit 654f208215fe5066b730a545ed4190d2dbf4fb64

Authored by Perry Werneck
1 parent 9e287cd2

Playing with gschemas.

@@ -128,6 +128,13 @@ $(OBJDBG)/%.o: \ @@ -128,6 +128,13 @@ $(OBJDBG)/%.o: \
128 @$(MKDIR) $(@D) 128 @$(MKDIR) $(@D)
129 @$(WINDRES) $< -O coff -o $@ 129 @$(WINDRES) $< -O coff -o $@
130 130
  131 +gschemas.compiled: \
  132 + schemas/*.gschema.xml
  133 +
  134 + @glib-compile-schemas \
  135 + --targetdir=$(@D) \
  136 + $(BASEDIR)/schemas
  137 +
131 #---[ Release Rules ]-------------------------------------------------------------------- 138 #---[ Release Rules ]--------------------------------------------------------------------
132 139
133 $(OBJRLS)/%.o: \ 140 $(OBJRLS)/%.o: \
@@ -219,7 +226,8 @@ Debug: \ @@ -219,7 +226,8 @@ Debug: \
219 $(BINDBG)/$(PACKAGE_NAME)@EXEEXT@ 226 $(BINDBG)/$(PACKAGE_NAME)@EXEEXT@
220 227
221 $(BINDBG)/$(PACKAGE_NAME)@EXEEXT@: \ 228 $(BINDBG)/$(PACKAGE_NAME)@EXEEXT@: \
222 - $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC).o) 229 + $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC).o) \
  230 + gschemas.compiled
223 231
224 @$(MKDIR) $(@D) 232 @$(MKDIR) $(@D)
225 @echo $< ... 233 @echo $< ...
@@ -267,6 +275,7 @@ cleanDebug: @@ -267,6 +275,7 @@ cleanDebug:
267 275
268 @rm -fr $(OBJDBG) 276 @rm -fr $(OBJDBG)
269 @rm -fr $(BINDBG) 277 @rm -fr $(BINDBG)
  278 + @rm -f gschemas.compiled
270 279
271 cleanRelease: 280 cleanRelease:
272 281
schemas/application.gschema.xml 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +<schemalist>
  2 +
  3 + <schema id="br.com.bb.pw3270" gettext-domain="pw3270">
  4 +
  5 + <key type="b" name="enable-something">
  6 + <default>false</default>
  7 + <summary>Enable something</summary>
  8 + <description>Enables something important in the application</description>
  9 + </key>
  10 +
  11 + </schema>
  12 +
  13 +</schemalist>
  14 +
src/main/main.c
@@ -35,19 +35,33 @@ @@ -35,19 +35,33 @@
35 35
36 #include "private.h" 36 #include "private.h"
37 #include <pw3270/application.h> 37 #include <pw3270/application.h>
  38 + #include <lib3270.h>
  39 + #include <lib3270/log.h>
38 40
39 /*---[ Implement ]----------------------------------------------------------------------------------*/ 41 /*---[ Implement ]----------------------------------------------------------------------------------*/
40 42
41 int main (int argc, char **argv) { 43 int main (int argc, char **argv) {
42 44
43 - GtkApplication *app;  
44 - int status; 45 + GtkApplication *app;
  46 + int status;
45 47
46 - app = pw3270_application_new("br.com.bb." G_STRINGIFY(PRODUCT_NAME),G_APPLICATION_HANDLES_OPEN);  
47 - status = g_application_run(G_APPLICATION (app), argc, argv);  
48 - g_object_unref (app); 48 +#ifdef DEBUG
  49 + {
  50 + GError * error = NULL;
  51 + GSettingsSchemaSource * source = g_settings_schema_source_new_from_directory(".",NULL,TRUE,&error);
49 52
50 - return status; 53 + if(!source && error) {
  54 + g_error(error->message);
  55 + }
  56 +
  57 + }
  58 +#endif // DEBUG
  59 +
  60 + app = pw3270_application_new("br.com.bb." G_STRINGIFY(PRODUCT_NAME),G_APPLICATION_HANDLES_OPEN);
  61 + status = g_application_run(G_APPLICATION (app), argc, argv);
  62 + g_object_unref (app);
  63 +
  64 + return status;
51 65
52 } 66 }
53 67