[planner: 24/32] Handle GTK 3.2 deprecations
- From: Mart Raudsepp <mraudsepp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner: 24/32] Handle GTK 3.2 deprecations
- Date: Sun, 20 Jun 2021 18:13:51 +0000 (UTC)
commit cffbd2aa744b888160094db1b479828946a42cb7
Author: Mart Raudsepp <leio gentoo org>
Date: Sun Jun 13 14:27:10 2021 +0300
Handle GTK 3.2 deprecations
src/planner-cell-renderer-date.c | 10 +++++-----
src/planner-gantt-chart.c | 10 ++++++----
src/planner-gantt-chart.h | 4 ++--
src/planner-gantt-view.c | 2 +-
src/planner-popup-entry.c | 2 +-
src/planner-print-dialog.c | 6 +++---
src/planner-project-properties.c | 4 ++--
src/planner-sidebar.c | 4 ++--
src/planner-task-date-widget.c | 2 +-
src/planner-usage-chart.c | 8 +++++---
src/planner-usage-chart.h | 4 ++--
src/planner-usage-view.c | 2 +-
src/planner-window.c | 6 +++---
13 files changed, 34 insertions(+), 30 deletions(-)
---
diff --git a/src/planner-cell-renderer-date.c b/src/planner-cell-renderer-date.c
index 1f2b3103..9715a05d 100644
--- a/src/planner-cell-renderer-date.c
+++ b/src/planner-cell-renderer-date.c
@@ -119,7 +119,7 @@ mcrd_init (PlannerCellRendererDate *date)
gtk_container_add (GTK_CONTAINER (popup->popup_window), frame);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
@@ -127,10 +127,10 @@ mcrd_init (PlannerCellRendererDate *date)
popup->focus_window = date->calendar;
gtk_box_pack_start (GTK_BOX (vbox), date->calendar, TRUE, TRUE, 0);
- date->constraint_vbox = gtk_vbox_new (FALSE, 0);
+ date->constraint_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), date->constraint_vbox, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
/* I18n: the verb "schedule" here. */
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("Schedule:")),
FALSE, FALSE, 0);
@@ -150,10 +150,10 @@ mcrd_init (PlannerCellRendererDate *date)
gtk_box_pack_start (GTK_BOX (date->constraint_vbox), hbox, TRUE, TRUE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (date->constraint_vbox), hbox, FALSE, FALSE, 0);
- bbox = gtk_hbutton_box_new ();
+ bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_set_spacing (GTK_BOX (bbox), 6);
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0);
diff --git a/src/planner-gantt-chart.c b/src/planner-gantt-chart.c
index 2d69d9b0..55257382 100644
--- a/src/planner-gantt-chart.c
+++ b/src/planner-gantt-chart.c
@@ -223,8 +223,8 @@ static void gantt_chart_tree_traverse (TreeNode *nod
TreeFunc func,
gpointer data);
-static guint signals[LAST_SIGNAL];
-static GtkVBoxClass *parent_class = NULL;
+static guint signals[LAST_SIGNAL];
+static GtkBoxClass *parent_class = NULL;
GType
@@ -251,7 +251,7 @@ planner_gantt_chart_get_type (void)
NULL
};
- type = g_type_register_static (GTK_TYPE_VBOX, "PlannerGanttChart",
+ type = g_type_register_static (GTK_TYPE_BOX, "PlannerGanttChart",
&info, 0);
g_type_add_interface_static (type, GTK_TYPE_SCROLLABLE, &scrollable_info);
@@ -1190,7 +1190,9 @@ planner_gantt_chart_new_with_model (GtkTreeModel *model)
{
PlannerGanttChart *chart;
- chart = PLANNER_GANTT_CHART (g_object_new (PLANNER_TYPE_GANTT_CHART, NULL));
+ chart = PLANNER_GANTT_CHART (g_object_new (PLANNER_TYPE_GANTT_CHART,
+ "orientation", GTK_ORIENTATION_VERTICAL,
+ NULL));
if (model) {
planner_gantt_chart_set_model (chart, model);
diff --git a/src/planner-gantt-chart.h b/src/planner-gantt-chart.h
index dd142063..9c89bbe0 100644
--- a/src/planner-gantt-chart.h
+++ b/src/planner-gantt-chart.h
@@ -40,13 +40,13 @@ typedef struct _PlannerGanttChartPriv PlannerGanttChartPriv;
struct _PlannerGanttChart
{
- GtkVBox parent;
+ GtkBox parent;
PlannerGanttChartPriv *priv;
};
struct _PlannerGanttChartClass
{
- GtkVBoxClass parent_class;
+ GtkBoxClass parent_class;
void (* set_scroll_adjustments) (PlannerGanttChart *chart,
GtkAdjustment *hadjustment,
diff --git a/src/planner-gantt-view.c b/src/planner-gantt-view.c
index ed18710c..182faad6 100644
--- a/src/planner-gantt-view.c
+++ b/src/planner-gantt-view.c
@@ -665,7 +665,7 @@ gantt_view_create_widget (PlannerGanttView *view)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (sw), tree);
- hpaned = gtk_hpaned_new ();
+ hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_add1 (GTK_PANED (hpaned), sw);
/* TODO: Exclude the scrollbar from the gantt header, like the GtkTreeView does */
diff --git a/src/planner-popup-entry.c b/src/planner-popup-entry.c
index da5b0baf..05395e0d 100644
--- a/src/planner-popup-entry.c
+++ b/src/planner-popup-entry.c
@@ -82,7 +82,7 @@ planner_popup_entry_init (PlannerPopupEntry *widget)
{
GtkWidget *arrow;
- widget->hbox = gtk_hbox_new (FALSE, 0);
+ widget->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (widget->hbox);
widget->entry = g_object_new (GTK_TYPE_ENTRY, "has_frame", FALSE, NULL);
diff --git a/src/planner-print-dialog.c b/src/planner-print-dialog.c
index 767cd326..1f10d233 100644
--- a/src/planner-print-dialog.c
+++ b/src/planner-print-dialog.c
@@ -241,7 +241,7 @@ print_dialog_create_page (PlannerWindow *window,
gchar *str;
gboolean state;
- outer_vbox = gtk_vbox_new (FALSE, 4);
+ outer_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_container_set_border_width (GTK_CONTAINER (outer_vbox), 8);
str = g_strconcat ("<b>", _("Select the views to print:"), "</b>", NULL);
@@ -251,14 +251,14 @@ print_dialog_create_page (PlannerWindow *window,
gtk_label_set_use_markup (GTK_LABEL (w), TRUE);
gtk_misc_set_alignment (GTK_MISC (w), 0, 0.5);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (outer_vbox), hbox, TRUE, TRUE, 0);
w = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* w = gtk_check_button_new_with_mnemonic (_("Project summary"));
diff --git a/src/planner-project-properties.c b/src/planner-project-properties.c
index a4a4952e..d063bdc0 100644
--- a/src/planner-project-properties.c
+++ b/src/planner-project-properties.c
@@ -721,7 +721,7 @@ mpp_start_button_popup_cb (PlannerPopupButton *popup_button,
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
@@ -731,7 +731,7 @@ mpp_start_button_popup_cb (PlannerPopupButton *popup_button,
start = mrp_project_get_project_start (data->project);
mpp_start_set_date (GTK_CALENDAR (data->calendar), start);
- bbox = gtk_hbutton_box_new ();
+ bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_set_spacing (GTK_BOX (bbox), 6);
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0);
diff --git a/src/planner-sidebar.c b/src/planner-sidebar.c
index b9a1dddb..600c2756 100644
--- a/src/planner-sidebar.c
+++ b/src/planner-sidebar.c
@@ -121,7 +121,7 @@ sidebar_init (PlannerSidebar *bar)
G_CALLBACK (sidebar_event_box_realize_cb),
bar);
- bar->priv->vbox = gtk_vbox_new (FALSE, 0);
+ bar->priv->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (bar->priv->vbox);
gtk_container_add (GTK_CONTAINER (bar), bar->priv->event_box);
@@ -456,7 +456,7 @@ planner_sidebar_append (PlannerSidebar *sidebar,
entry = g_new0 (ButtonEntry, 1);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
image = gtk_image_new_from_file (icon_filename);
diff --git a/src/planner-task-date-widget.c b/src/planner-task-date-widget.c
index e4863cdb..eb6f7469 100644
--- a/src/planner-task-date-widget.c
+++ b/src/planner-task-date-widget.c
@@ -144,7 +144,7 @@ task_date_widget_setup (PlannerTaskDateWidget *widget)
priv = planner_task_date_widget_get_instance_private (widget);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (widget), vbox);
builder = planner_util_new_builder ("/org/gnome/Planner/ui/task-date-widget.ui");
diff --git a/src/planner-usage-chart.c b/src/planner-usage-chart.c
index d88e549c..9df6097f 100644
--- a/src/planner-usage-chart.c
+++ b/src/planner-usage-chart.c
@@ -206,7 +206,7 @@ static void usage_chart_row_deleted (GtkTreeModel *mod
static guint signals[LAST_SIGNAL];
-static GtkVBoxClass *parent_class = NULL;
+static GtkBoxClass *parent_class = NULL;
GType
planner_usage_chart_get_type (void)
@@ -232,7 +232,7 @@ planner_usage_chart_get_type (void)
NULL
};
- type = g_type_register_static (GTK_TYPE_VBOX,
+ type = g_type_register_static (GTK_TYPE_BOX,
"PlannerUsageChart", &info,
0);
@@ -1019,7 +1019,9 @@ planner_usage_chart_new_with_model (GtkTreeModel *model)
{
PlannerUsageChart *chart;
- chart = g_object_new (PLANNER_TYPE_USAGE_CHART, NULL);
+ chart = g_object_new (PLANNER_TYPE_USAGE_CHART,
+ "orientation", GTK_ORIENTATION_VERTICAL,
+ NULL);
if (model) {
planner_usage_chart_set_model (chart, model);
diff --git a/src/planner-usage-chart.h b/src/planner-usage-chart.h
index e53d2f40..f30f3b31 100644
--- a/src/planner-usage-chart.h
+++ b/src/planner-usage-chart.h
@@ -39,12 +39,12 @@ typedef struct _PlannerUsageChartClass PlannerUsageChartClass;
typedef struct _PlannerUsageChartPriv PlannerUsageChartPriv;
struct _PlannerUsageChart {
- GtkVBox parent_class;
+ GtkBox parent_class;
PlannerUsageChartPriv *priv;
};
struct _PlannerUsageChartClass {
- GtkVBoxClass parent_class;
+ GtkBoxClass parent_class;
void (*set_scroll_adjustments) (PlannerUsageChart *chart,
GtkAdjustment *hadj,
diff --git a/src/planner-usage-view.c b/src/planner-usage-view.c
index 899ac2f4..80fde53a 100644
--- a/src/planner-usage-view.c
+++ b/src/planner-usage-view.c
@@ -429,7 +429,7 @@ usage_view_create_widget (PlannerView *view)
model = planner_usage_model_new (project);
tree = planner_usage_tree_new (view->main_window, model);
priv->tree = tree;
- hpaned = gtk_hpaned_new ();
+ hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
sw = gtk_scrolled_window_new (NULL, NULL);
/* TODO: Consider changing vertical policy to GTK_POLICY_EXTERNAL once we depend on gtk 3.16 */
diff --git a/src/planner-window.c b/src/planner-window.c
index cf23b406..4990b57c 100644
--- a/src/planner-window.c
+++ b/src/planner-window.c
@@ -567,7 +567,7 @@ window_populate (PlannerWindow *window)
window_add_stock_icons ();
- priv->ui_box = gtk_vbox_new (FALSE, 0);
+ priv->ui_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), priv->ui_box);
priv->actions = gtk_action_group_new ("Planner");
@@ -638,7 +638,7 @@ window_populate (PlannerWindow *window)
open_recent = gtk_ui_manager_get_widget (priv->ui_manager, "/MenuBar/File/FileOpenRecent");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (open_recent), recent_view);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
priv->sidebar = planner_sidebar_new ();
gtk_box_pack_start (GTK_BOX (hbox), priv->sidebar, FALSE, TRUE, 0);
@@ -1578,7 +1578,7 @@ window_create_dialog_button (const gchar *icon_name, const gchar *text)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
- hbox = gtk_hbox_new (FALSE, 2);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]