Ticket #1522: patch.txt

File patch.txt, 2.7 KB (added by bo, 13 years ago)

One solution

Line 
1### Eclipse Workspace Patch 1.0
2#P Transmission2
3Index: gtk/tr-window.c
4===================================================================
5--- gtk/tr-window.c     (revision 8019)
6+++ gtk/tr-window.c     (working copy)
7@@ -83,6 +83,7 @@
8     GtkWidget *           dl_lb;
9     GtkWidget *           stats_lb;
10     GtkWidget *           gutter_lb;
11+    GtkWindow *                          win;
12     GtkTreeSelection *    selection;
13     GtkCellRenderer *     renderer;
14     GtkTreeViewColumn *   column;
15@@ -239,6 +240,25 @@
16     g_free( p );
17 }
18 
19+static void onDlUlLimitsClicked(GtkWidget *w UNUSED, GdkEventButton *button UNUSED, gpointer vprivate)
20+{
21+       
22+       PrivateData * p;
23+       GtkDialog *myWidget;
24+       GList *list;
25+       GtkNotebook *noteBook;
26+       GtkVBox *contentArea;
27+       
28+       
29+       p = vprivate;
30+       myWidget = GTK_DIALOG(tr_prefs_dialog_new(p->core,p->win)); /*change NULL to PARENT_WINDOW */
31+       contentArea = GTK_VBOX(gtk_dialog_get_content_area(myWidget));
32+       list = gtk_container_get_children(GTK_CONTAINER(contentArea));
33+       noteBook = list->data; 
34+       gtk_notebook_set_current_page(noteBook, (gint) 4);
35+       gtk_widget_show(GTK_WIDGET(myWidget));
36+}
37+
38 static void
39 onYinYangReleased( GtkWidget * w           UNUSED,
40                    GdkEventButton * button UNUSED,
41@@ -542,6 +562,7 @@
42     g_object_set_data_full( G_OBJECT(
43                                 self ), PRIVATE_DATA_KEY, p, privateFree );
44     win = GTK_WINDOW( self );
45+    p->win=win;
46     gtk_window_set_title( win, g_get_application_name( ) );
47     gtk_window_set_role( win, "tr-main" );
48     gtk_window_set_default_size( win,
49@@ -625,14 +646,20 @@
50     w = p->ul_lb = gtk_label_new( NULL );
51     gtk_box_pack_end( GTK_BOX( h ), w, FALSE, FALSE, 0 );
52     w = gtk_image_new_from_stock( GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU );
53-    gtk_box_pack_end( GTK_BOX( h ), w, FALSE, FALSE, 0 );
54+    c = gtk_event_box_new();
55+    gtk_container_add(GTK_CONTAINER(c),w);
56+    gtk_box_pack_end( GTK_BOX( h ), c, FALSE, FALSE, 0 );
57+    g_signal_connect(c,"button-release-event",G_CALLBACK(onDlUlLimitsClicked),p);
58     w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
59     gtk_widget_set_size_request( w, GUI_PAD, 0u );
60     gtk_box_pack_end( GTK_BOX( h ), w, FALSE, FALSE, 0 );
61     w = p->dl_lb = gtk_label_new( NULL );
62     gtk_box_pack_end( GTK_BOX( h ), w, FALSE, FALSE, 0 );
63     w = gtk_image_new_from_stock( GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU );
64-    gtk_box_pack_end( GTK_BOX( h ), w, FALSE, FALSE, 0 );
65+    c = gtk_event_box_new();
66+    gtk_container_add(GTK_CONTAINER(c),w);
67+    gtk_box_pack_end( GTK_BOX( h ), c, FALSE, FALSE, 0 );
68+    g_signal_connect(c,"button-release-event",G_CALLBACK(onDlUlLimitsClicked),p);
69     w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
70     gtk_widget_set_size_request( w, GUI_PAD, 0u );
71     gtk_box_pack_end( GTK_BOX( h ), w, FALSE, FALSE, 0 );