Commit cce80668b0c21c021e950d45beb6b0cd577907fa

Authored by perry.werneck@gmail.com
1 parent 69f76c9c

Implementando cores para relatorios

@@ -40,3 +40,31 @@ BaseAttributes=green,green,green,green @@ -40,3 +40,31 @@ BaseAttributes=green,green,green,green
40 SelectedText=dimGrey,green,dimGrey 40 SelectedText=dimGrey,green,dimGrey
41 Cursor=green,green 41 Cursor=green,green
42 OIA=black,green,green,green,green 42 OIA=black,green,green,green,green
  43 +
  44 +[BW]
  45 +Label=Black & White
  46 +Label[pt_BR]=Branco e preto
  47 +Terminal=black,white,white,white,white,white,white,white,white,white,white,white,white,white,white,white
  48 +BaseAttributes=white,white,white,white
  49 +SelectedText=dimGrey,white,dimGrey
  50 +Cursor=white,white
  51 +OIA=black,green,white,white
  52 +
  53 +[WB]
  54 +Label=White on Black
  55 +Label[pt_BR]=Branco com fundo preto
  56 +Terminal=black,white,white,white,white,white,white,white,white,white,white,white,white,white,white,white
  57 +BaseAttributes=white,white,white,white
  58 +SelectedText=white,black,white
  59 +Cursor=white,white
  60 +OIA=black,white,white,white,white
  61 +
  62 +[BW]
  63 +Label=Black on White
  64 +Label[pt_BR]=Preto com fundo branco
  65 +Terminal=white,black,black,black,black,black,black,black,black,black,black,black,black,black,black,black
  66 +BaseAttributes=black,black,black,black
  67 +SelectedText=black,white,black
  68 +Cursor=black,black
  69 +OIA=white,black,black,black,black
  70 +
src/gtk/Makefile.in
@@ -50,7 +50,7 @@ include uiparser/sources.mak @@ -50,7 +50,7 @@ include uiparser/sources.mak
50 50
51 #---[ Targets ]---------------------------------------------------------------- 51 #---[ Targets ]----------------------------------------------------------------
52 52
53 -SOURCES=main.c mainwindow.c actions.c fonts.c dialog.c print.c \ 53 +SOURCES=main.c mainwindow.c actions.c fonts.c dialog.c print.c colors.c \
54 $(foreach SRC, $(V3270_SRC), v3270/$(SRC)) \ 54 $(foreach SRC, $(V3270_SRC), v3270/$(SRC)) \
55 $(foreach SRC, $(COMMON_SRC), common/$(SRC)) \ 55 $(foreach SRC, $(COMMON_SRC), common/$(SRC)) \
56 $(foreach SRC, $(UI_PARSER_SRC), uiparser/$(SRC)) 56 $(foreach SRC, $(UI_PARSER_SRC), uiparser/$(SRC))
src/gtk/colors.c
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 32
33 /*--[ Implement ]------------------------------------------------------------------------------------*/ 33 /*--[ Implement ]------------------------------------------------------------------------------------*/
34 34
35 - void load_color_schemes(GtkWidget *widget, gchar **target) 35 + void load_color_schemes(GtkWidget *widget, gchar *active)
36 { 36 {
37 gchar *filename = build_data_filename("colors.conf",NULL); 37 gchar *filename = build_data_filename("colors.conf",NULL);
38 38
@@ -88,7 +88,7 @@ @@ -88,7 +88,7 @@
88 1, str, 88 1, str,
89 -1); 89 -1);
90 90
91 - if(*target && !g_strcasecmp(*target,str)) 91 + if(active && !g_strcasecmp(active,str))
92 { 92 {
93 found = TRUE; 93 found = TRUE;
94 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(widget),&iter); 94 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(widget),&iter);
@@ -102,13 +102,13 @@ @@ -102,13 +102,13 @@
102 g_strfreev(group); 102 g_strfreev(group);
103 g_key_file_free(conf); 103 g_key_file_free(conf);
104 104
105 - if(!found) 105 + if(active && !found)
106 { 106 {
107 #if GTK_CHECK_VERSION(3,0,0) 107 #if GTK_CHECK_VERSION(3,0,0)
108 108
109 gtk_combo_box_text_insert( GTK_COMBO_BOX_TEXT(widget), 109 gtk_combo_box_text_insert( GTK_COMBO_BOX_TEXT(widget),
110 0, 110 0,
111 - *target, 111 + active,
112 _( "Custom colors") ); 112 _( "Custom colors") );
113 113
114 #else 114 #else
@@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@
116 gtk_list_store_append((GtkListStore *) model,&iter); 116 gtk_list_store_append((GtkListStore *) model,&iter);
117 gtk_list_store_set((GtkListStore *) model, &iter, 117 gtk_list_store_set((GtkListStore *) model, &iter,
118 0, _( "Custom colors" ), 118 0, _( "Custom colors" ),
119 - 1, *target, 119 + 1, active,
120 -1); 120 -1);
121 121
122 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(widget),&iter); 122 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(widget),&iter);
src/gtk/globals.h
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 55
56 GtkWidget * create_main_window(void); 56 GtkWidget * create_main_window(void);
57 void setup_font_list(GtkWidget *widget, GtkWidget *obj); 57 void setup_font_list(GtkWidget *widget, GtkWidget *obj);
58 - void load_color_schemes(GtkWidget *widget, gchar **target); 58 + void load_color_schemes(GtkWidget *widget, gchar *active);
59 59
60 // actions 60 // actions
61 void paste_file_action(GtkAction *action, GtkWidget *widget); 61 void paste_file_action(GtkAction *action, GtkWidget *widget);
src/gtk/print.c
@@ -147,7 +147,7 @@ @@ -147,7 +147,7 @@
147 widget = gtk_combo_box_new(); 147 widget = gtk_combo_box_new();
148 #endif // GTK(3,0,0) 148 #endif // GTK(3,0,0)
149 149
150 - load_color_schemes(widget,&info->colorname); 150 + load_color_schemes(widget,info->colorname);
151 gtk_table_attach(GTK_TABLE(container),widget,1,2,1,2,GTK_EXPAND|GTK_FILL,GTK_FILL,5,0); 151 gtk_table_attach(GTK_TABLE(container),widget,1,2,1,2,GTK_EXPAND|GTK_FILL,GTK_FILL,5,0);
152 152
153 // Show and return 153 // Show and return
src/gtk/pw3270-GTK.cbp
@@ -41,6 +41,9 @@ @@ -41,6 +41,9 @@
41 <Unit filename="actions.c"> 41 <Unit filename="actions.c">
42 <Option compilerVar="CC" /> 42 <Option compilerVar="CC" />
43 </Unit> 43 </Unit>
  44 + <Unit filename="colors.c">
  45 + <Option compilerVar="CC" />
  46 + </Unit>
44 <Unit filename="common/common.h" /> 47 <Unit filename="common/common.h" />
45 <Unit filename="common/config.c"> 48 <Unit filename="common/config.c">
46 <Option compilerVar="CC" /> 49 <Option compilerVar="CC" />