Commit fde3051f2a2bf1e44fe78439dd44479b9931914e

Authored by Perry Werneck
Committed by GitHub
2 parents 5ae53d6c c7902c68
Exists in master and in 1 other branch develop

Merge pull request #10 from PerryWerneck/develop

Adding default title bar on dialogs.
arch/PKGBUILD
... ... @@ -2,8 +2,8 @@
2 2  
3 3 pkgname=libv3270
4 4  
5   -pkgver=5.2
6   -pkgrel=2
  5 +pkgver=5.3
  6 +pkgrel=0
7 7 pkgdesc="3270 Virtual Terminal for GTK"
8 8 url="https://portal.softwarepublico.gov.br/social/pw3270/"
9 9 arch=(i686 x86_64)
... ...
debian/rules
... ... @@ -6,7 +6,7 @@
6 6 export DH_VERBOSE=1
7 7  
8 8 # This is the debhelper compatibility version to use.
9   -export DH_COMPAT=9
  9 +export DH_COMPAT=9
10 10  
11 11 # Name of the package
12 12 PACKAGE_NAME=libv3270
... ... @@ -60,8 +60,6 @@ install: build
60 60  
61 61 # Install dev
62 62 make DESTDIR=$(PWD)/debian/$(PACKAGE_NAME)-dev install-dev
63   - mkdir -p $(PWD)/debian/$(PACKAGE_NAME)-dev/usr/lib
64   - mv $(PWD)/debian/$(PACKAGE_NAME)/usr/lib/*.so $(PWD)/debian/$(PACKAGE_NAME)-dev/usr/lib
65 63  
66 64 # Install glade
67 65 make DESTDIR=$(PWD)/debian/libv3270-glade install-glade
... ...
rpm/libv3270.spec
... ... @@ -32,7 +32,7 @@ BuildRequires: gcc-c++
32 32 BuildRequires: gettext-devel
33 33 BuildRequires: m4
34 34 BuildRequires: pkgconfig(gtk+-3.0)
35   -BuildRequires: pkgconfig(lib3270) >= %{version}
  35 +BuildRequires: pkgconfig(lib3270) >= 5.3
36 36 %if 0%{?centos_version}
37 37 # CENTOS Genmarshal doesn't depend on python!
38 38 BuildRequires: python
... ... @@ -46,7 +46,7 @@ provides a TN3270 virtual terminal widget for GTK 3.
46 46 For more details, see https://softwarepublico.gov.br/social/pw3270/ .
47 47  
48 48 %define MAJOR_VERSION %(echo %{version} | cut -d. -f1)
49   -%define MINOR_VERSION %(echo %{version} | cut -d. -f2)
  49 +%define MINOR_VERSION %(echo %{version} | cut -d. -f2 | cut -d+ -f1)
50 50 %define _libvrs %{MAJOR_VERSION}_%{MINOR_VERSION}
51 51 %define _product %(pkg-config --variable=product_name lib3270)
52 52  
... ...
src/dialogs/popups.c
... ... @@ -58,7 +58,6 @@
58 58  
59 59 GtkResponseType response = 0;
60 60  
61   - debug("Emitting %s","V3270_SIGNAL_LOAD_POPUP_RESPONSE");
62 61 v3270_signal_emit(
63 62 widget,
64 63 V3270_SIGNAL_LOAD_POPUP_RESPONSE,
... ... @@ -66,8 +65,6 @@
66 65 &response
67 66 );
68 67  
69   - debug("Got response %d",(int) response);
70   -
71 68 if(response && response != GTK_RESPONSE_NONE)
72 69 return response;
73 70  
... ... @@ -129,16 +126,25 @@
129 126  
130 127 #ifdef _WIN32
131 128 gtk_container_set_border_width(GTK_CONTAINER(dialog),12);
  129 +#endif // _WIN32
  130 +
132 131 if(popup->title) {
  132 +
133 133 gtk_window_set_title(GTK_WINDOW(dialog),popup->title);
134   - } else {
135   - gtk_window_set_title(GTK_WINDOW(dialog),G_STRINGIFY(PRODUCT_NAME));
136   - }
137   -#else
138   - if(popup->title) {
139   - gtk_window_set_title(GTK_WINDOW(dialog),popup->title);
  134 +
  135 + } else if(GTK_IS_V3270(widget)) {
  136 +
  137 + const gchar *url = v3270_get_url(widget);
  138 + g_autofree gchar * title = g_strconcat(
  139 + v3270_get_session_name(widget),
  140 + " - ",
  141 + url ? url : _("No host"),
  142 + NULL
  143 + );
  144 +
  145 + gtk_window_set_title(GTK_WINDOW(dialog),title);
  146 +
140 147 }
141   -#endif // _WIN32
142 148  
143 149 if(wait) {
144 150  
... ...