Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Open Virtual Carcassonne Clone
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Colomban Wendling
Open Virtual Carcassonne Clone
Commits
ae065329
Commit
ae065329
authored
Mar 10, 2014
by
Colomban Wendling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OVCCGtk: start using GTK 3.10 widget templates
parent
9ab55947
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
263 additions
and
220 deletions
+263
-220
clients/ovcc-gtk/configure.ac
clients/ovcc-gtk/configure.ac
+2
-2
clients/ovcc-gtk/data/ovccgtk-connection-dialog.ui
clients/ovcc-gtk/data/ovccgtk-connection-dialog.ui
+230
-162
clients/ovcc-gtk/src/ovccgtk-connection-dialog.c
clients/ovcc-gtk/src/ovccgtk-connection-dialog.c
+31
-56
No files found.
clients/ovcc-gtk/configure.ac
View file @
ae065329
...
...
@@ -28,9 +28,9 @@ AC_CHECK_PROGS([GLIB_MKENUMS], [glib-mkenums], [NONE])
#GTK_DOC_CHECK(1.11)
# Checks for libraries.
GLIB_REQUIRE=2.3
2
GLIB_REQUIRE=2.3
8
GMODULE_REQUIRE=2.0
GTK_REQUIRE=3.0
GTK_REQUIRE=3.
1
0
OVCC_REQUIRE=0.0
PKG_CHECK_MODULES([OVCCGTK], [glib-2.0 >= ${GLIB_REQUIRE}
...
...
clients/ovcc-gtk/data/ovccgtk-connection-dialog.ui
View file @
ae065329
This diff is collapsed.
Click to expand it.
clients/ovcc-gtk/src/ovccgtk-connection-dialog.c
View file @
ae065329
...
...
@@ -34,7 +34,7 @@
struct
_OVCCGtkConnectionDialogPrivate
{
GtkWidget
*
message
;
GtkWidget
*
message
info
;
GtkWidget
*
spinner
;
GtkWidget
*
host
;
...
...
@@ -69,9 +69,9 @@ static void ovccgtk_connection_dialog_response (GtkDialog *dialog,
static
gboolean
ovccgtk_connection_dialog_real_validate
(
OVCCGtkConnectionDialog
*
self
);
G_DEFINE_TYPE
(
OVCCGtkConnectionDialog
,
ovccgtk_connection_dialog
,
GTK_TYPE_DIALOG
)
G_DEFINE_TYPE
_WITH_PRIVATE
(
OVCCGtkConnectionDialog
,
ovccgtk_connection_dialog
,
GTK_TYPE_DIALOG
)
enum
...
...
@@ -184,65 +184,40 @@ ovccgtk_connection_dialog_class_init (OVCCGtkConnectionDialogClass *klass)
G_TYPE_BOOLEAN
,
0
);
g_type_class_add_private
(
klass
,
sizeof
(
OVCCGtkConnectionDialogPrivate
));
}
static
GtkBuilder
*
builder_new_from_resource
(
const
gchar
*
resource
)
{
GtkBuilder
*
builder
;
GError
*
err
=
NULL
;
builder
=
gtk_builder_new
();
if
(
!
gtk_builder_add_from_resource
(
builder
,
resource
,
&
err
))
{
/* aborts */
g_error
(
"Failed to load UI resource: %s"
,
err
->
message
);
g_error_free
(
err
);
}
return
builder
;
gtk_widget_class_set_template_from_resource
(
widget_class
,
"/org/ovccgtk/widgets/ovccgtk-connection-dialog.ui"
);
gtk_widget_class_bind_template_child_private
(
widget_class
,
OVCCGtkConnectionDialog
,
messageinfo
);
gtk_widget_class_bind_template_child_private
(
widget_class
,
OVCCGtkConnectionDialog
,
host
);
gtk_widget_class_bind_template_child_private
(
widget_class
,
OVCCGtkConnectionDialog
,
port
);
gtk_widget_class_bind_template_child_private
(
widget_class
,
OVCCGtkConnectionDialog
,
username
);
gtk_widget_class_bind_template_child_private
(
widget_class
,
OVCCGtkConnectionDialog
,
password
);
gtk_widget_class_bind_template_callback
(
widget_class
,
host_notify_handler
);
gtk_widget_class_bind_template_callback
(
widget_class
,
port_notify_handler
);
gtk_widget_class_bind_template_callback
(
widget_class
,
username_notify_handler
);
}
static
void
ovccgtk_connection_dialog_init
(
OVCCGtkConnectionDialog
*
self
)
{
GtkWidget
*
content_area
;
GtkBuilder
*
builder
;
self
->
priv
=
G_TYPE_INSTANCE_GET_PRIVATE
(
self
,
OVCCGTK_TYPE_CONNECTION_DIALOG
,
OVCCGtkConnectionDialogPrivate
);
self
->
priv
=
ovccgtk_connection_dialog_get_instance_private
(
self
);
builder
=
builder_new_from_resource
(
"/org/ovccgtk/widgets/ovccgtk-connection-dialog.ui"
);
gtk_widget_init_template
(
GTK_WIDGET
(
self
)
);
gtk_dialog_add_buttons
(
GTK_DIALOG
(
self
),
GTK_STOCK_CANCEL
,
GTK_RESPONSE_CANCEL
,
GTK_STOCK_CONNECT
,
GTK_RESPONSE_OK
,
NULL
);
gtk_dialog_set_default_response
(
GTK_DIALOG
(
self
),
GTK_RESPONSE_OK
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
self
),
6
);
content_area
=
gtk_dialog_get_content_area
(
GTK_DIALOG
(
self
));
self
->
priv
->
message
=
(
GtkWidget
*
)
gtk_builder_get_object
(
builder
,
"messageinfo"
);
self
->
priv
->
host
=
(
GtkWidget
*
)
gtk_builder_get_object
(
builder
,
"host-entry"
);
self
->
priv
->
port
=
(
GtkWidget
*
)
gtk_builder_get_object
(
builder
,
"port-entry"
);
self
->
priv
->
username
=
(
GtkWidget
*
)
gtk_builder_get_object
(
builder
,
"username-entry"
);
self
->
priv
->
password
=
(
GtkWidget
*
)
gtk_builder_get_object
(
builder
,
"password-entry"
);
gtk_box_pack_start
(
GTK_BOX
(
content_area
),
(
GtkWidget
*
)
gtk_builder_get_object
(
builder
,
"box1"
),
TRUE
,
TRUE
,
0
);
g_signal_connect
(
self
->
priv
->
host
,
"notify::text"
,
G_CALLBACK
(
host_notify_handler
),
self
);
g_signal_connect
(
self
->
priv
->
port
,
"notify::value"
,
G_CALLBACK
(
port_notify_handler
),
self
);
g_signal_connect
(
self
->
priv
->
username
,
"notify::text"
,
G_CALLBACK
(
username_notify_handler
),
self
);
gtk_widget_show_all
(
content_area
);
g_object_unref
(
builder
);
}
static
void
...
...
@@ -564,7 +539,7 @@ ovccgtk_connection_dialog_set_message (OVCCGtkConnectionDialog *self,
g_return_if_fail
(
OVCCGTK_IS_CONNECTION_DIALOG
(
self
));
g_return_if_fail
(
primary
!=
NULL
);
g_object_set
(
self
->
priv
->
message
,
g_object_set
(
self
->
priv
->
message
info
,
"message-type"
,
message_type
,
"text"
,
primary
,
"secondary-text"
,
secondary
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment