1126 GtkWidget *
editor, *table, *sw, *bbox;
1127 GtkWidget *src_view, *dst_view, *label, *button;
1128 GtkWidget *aux_menu;
1130 GtkWidget *table2, *arrow, *check;
1131 GtkSizeGroup *sgroup;
1132 GtkListStore *src_store, *dst_store;
1135 GtkEventController *controller;
1136 GtkGesture *gesture;
1137 GtkDropTarget *dnd_tgt;
1141 src_store = gtk_list_store_new(2, G_TYPE_INT, G_TYPE_STRING);
1142 dst_store = gtk_list_store_new(2, G_TYPE_INT, G_TYPE_STRING);
1146 ptr->
src = src_store;
1147 ptr->
dst = dst_store;
1152 gtk_grid_set_row_spacing(GTK_GRID(
editor), 6);
1153 gtk_orientable_set_orientation(GTK_ORIENTABLE(
editor),
1154 GTK_ORIENTATION_VERTICAL);
1156 g_object_set_data(G_OBJECT(
editor),
"data", ptr);
1161 table = gtk_grid_new();
1162 gtk_grid_attach(GTK_GRID(
editor), table, 0, editor_row++, 1, 1);
1164 sgroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1166 sw = gtk_scrolled_window_new();
1167 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
1168 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1169 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1170 gtk_grid_attach(GTK_GRID(table), sw, 3, 1, 2, 1);
1172 src_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(src_store));
1175 g_object_unref(src_store);
1176 gtk_size_group_add_widget(sgroup,
src_view);
1177 gtk_widget_set_name(
src_view,
"small_font");
1178 gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(
src_view), 1);
1180 gesture = gtk_gesture_click_new();
1181 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
1182 controller = GTK_EVENT_CONTROLLER(gesture);
1183 g_signal_connect(controller,
"pressed",
1185 gtk_widget_add_controller(
src_view, controller);
1188 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
src_view);
1190 label = g_object_new(GTK_TYPE_LABEL,
1191 "use-underline",
TRUE,
1193 "label",
_(
"Source _Tasks:"),
1194 "xalign", 0.0,
"yalign", 0.5, NULL);
1195 gtk_grid_attach(GTK_GRID(table), label, 3, 0, 1, 1);
1197 check = gtk_check_button_new_with_mnemonic(
_(
"Show _Future Targets"));
1198 gtk_grid_attach(GTK_GRID(table), check, 4, 0, 1, 1);
1201 table2 = gtk_grid_new();
1202 gtk_grid_attach(GTK_GRID(table), table2, 2, 1, 1, 1);
1204 button = gtk_button_new();
1205 gtk_widget_set_margin_top(button, 24);
1206 gtk_widget_set_margin_bottom(button, 24);
1208 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
1209 gtk_grid_attach(GTK_GRID(table2), button, 0, 0, 1, 1);
1211 arrow = gtk_image_new_from_icon_name(
"pan-start-symbolic");
1212 gtk_button_set_child(GTK_BUTTON(button), arrow);
1213 g_signal_connect_swapped(button,
"clicked",
1217 button = gtk_button_new();
1219 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
1220 gtk_grid_attach(GTK_GRID(table2), button, 0, 1, 1, 1);
1222 arrow = gtk_image_new_from_icon_name(
"pan-up-symbolic");
1223 gtk_button_set_child(GTK_BUTTON(button), arrow);
1224 g_signal_connect_swapped(button,
"clicked",
1228 button = gtk_button_new();
1230 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
1231 gtk_grid_attach(GTK_GRID(table2), button, 0, 2, 1, 1);
1233 arrow = gtk_image_new_from_icon_name(
"pan-down-symbolic");
1234 gtk_button_set_child(GTK_BUTTON(button), arrow);
1235 g_signal_connect_swapped(button,
"clicked",
1239 button = gtk_button_new();
1240 gtk_widget_set_margin_top(button, 24);
1241 gtk_widget_set_margin_bottom(button, 24);
1243 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
1244 gtk_grid_attach(GTK_GRID(table2), button, 0, 3, 1, 1);
1246 arrow = gtk_image_new_from_icon_name(
"pan-start-symbolic");
1247 gtk_button_set_child(GTK_BUTTON(button), arrow);
1248 g_signal_connect_swapped(button,
"clicked",
1252 button = gtk_button_new();
1253 gtk_widget_set_margin_top(button, 24);
1254 gtk_widget_set_margin_bottom(button, 24);
1256 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
1257 gtk_grid_attach(GTK_GRID(table2), button, 0, 4, 1, 1);
1259 arrow = gtk_image_new_from_icon_name(
"pan-end-symbolic");
1260 gtk_button_set_child(GTK_BUTTON(button), arrow);
1261 g_signal_connect_swapped(button,
"clicked",
1265 sw = gtk_scrolled_window_new();
1266 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
1267 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1268 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1269 gtk_grid_attach(GTK_GRID(table), sw, 0, 1, 2, 1);
1271 dst_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dst_store));
1274 g_object_unref(dst_store);
1275 gtk_size_group_add_widget(sgroup,
dst_view);
1276 gtk_widget_set_name(
dst_view,
"small_font");
1277 gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(
dst_view), 1);
1279 gesture = gtk_gesture_click_new();
1280 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
1281 controller = GTK_EVENT_CONTROLLER(gesture);
1282 g_signal_connect(controller,
"pressed",
1284 gtk_widget_add_controller(
dst_view, controller);
1287 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
dst_view);
1289 label = g_object_new(GTK_TYPE_LABEL,
1290 "use-underline",
TRUE,
1292 "label",
_(
"Target _Worklist:"),
1293 "xalign", 0.0,
"yalign", 0.5, NULL);
1294 gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
1297 bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
1298 gtk_box_set_spacing(GTK_BOX(bbox), 10);
1299 gtk_grid_attach(GTK_GRID(
editor), bbox, 0, editor_row++, 1, 1);
1303 ptr->
group = G_ACTION_GROUP(g_simple_action_group_new());
1305 gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(aux_menu), G_MENU_MODEL(
menu));
1307 gtk_box_append(GTK_BOX(bbox), aux_menu);
1308 gtk_widget_insert_action_group(aux_menu,
"win", ptr->
group);
1311 gtk_box_append(GTK_BOX(bbox), button);
1312 g_signal_connect(button,
"clicked",
1317 button = gtk_button_new_with_mnemonic(
_(
"Change Prod_uction"));
1318 gtk_box_append(GTK_BOX(bbox), button);
1319 g_signal_connect(button,
"clicked",
1328 gtk_tree_selection_set_mode(ptr->
dst_selection, GTK_SELECTION_MULTIPLE);
1331 gtk_tree_view_set_reorderable(GTK_TREE_VIEW(
dst_view),
TRUE);
1333 dnd_tgt = gtk_drop_target_new(G_TYPE_INT, GDK_ACTION_COPY);
1335 g_signal_connect(dnd_tgt,
"drop", G_CALLBACK(
drag_drop), ptr);
1336 gtk_widget_add_controller(GTK_WIDGET(
dst_view), GTK_EVENT_CONTROLLER(dnd_tgt));
1338 controller = gtk_event_controller_key_new();
1339 g_signal_connect(controller,
"key-pressed",
1341 gtk_widget_add_controller(
src_view, controller);
1343 controller = gtk_event_controller_key_new();
1344 g_signal_connect(controller,
"key-pressed",
1346 gtk_widget_add_controller(
dst_view, controller);
1348 g_signal_connect(
src_view,
"row_activated",
1351 g_signal_connect(
dst_view,
"row_activated",
1360 gtk_widget_show(table);
1361 gtk_widget_show(bbox);