View | Details | Raw Unified | Return to bug 50908
Collapse All | Expand All

(-)thefish/Makefile (-3 / +2 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	thefish
8
PORTNAME=	thefish
9
PORTVERSION=	0.3
9
PORTVERSION=	0.3.1
10
PORTREVISION=	1
11
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
12
MASTER_SITES=	http://energyhq.homeip.net/files/
11
MASTER_SITES=	http://energyhq.homeip.net/files/
13
12
Lines 18-24 Link Here
18
NO_GUI=		yes
17
NO_GUI=		yes
19
MAKE_ENV+=	NO_GUI=yes
18
MAKE_ENV+=	NO_GUI=yes
20
.else
19
.else
21
LIB_DEPENDS=	gtk-x11-2.0:${PORTSDIR}/x11-toolkits/gtk20
20
USE_GNOME=	gtk20
22
USE_X_PREFIX=	yes
21
USE_X_PREFIX=	yes
23
.endif
22
.endif
24
23
(-)thefish/distinfo (-1 / +1 lines)
Line 1 Link Here
1
MD5 (thefish-0.3.tar.gz) = f51b20b4a3c4714f0902138e23765adf
1
MD5 (thefish-0.3.1.tar.gz) = 40ec4c7a47929032eca9d633c8ace891
(-)thefish/files/patch-gui_ui.c (-138 lines)
Lines 1-138 Link Here
1
--- gtk_ui.c.orig	Tue Feb  4 17:51:19 2003
2
+++ gtk_ui.c	Tue Feb  4 17:51:37 2003
3
@@ -24,7 +24,7 @@
4
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6
 
7
-$Id: //depot/fish/gtk_ui.c#28 $
8
+$Id: //depot/fish/gtk_ui.c#29 $
9
 
10
 */
11
 
12
@@ -33,6 +33,10 @@
13
 #include <string.h>
14
 #include <fcntl.h>
15
 
16
+#include <sys/types.h>
17
+#include <sys/uio.h>
18
+#include <unistd.h>
19
+
20
 #include <time.h>
21
 extern char *tzname[2];
22
 
23
@@ -66,6 +70,8 @@
24
 void add_yes_pressed(GtkWidget *, gpointer);
25
 void add_no_pressed(GtkWidget *, gpointer);
26
 
27
+void save_geometry(void);
28
+
29
 /* Some defines here */
30
 #define IS_DIRTY 1
31
 #define NOT_DIRTY 0
32
@@ -139,7 +145,10 @@
33
 	GtkWidget *window;
34
 	GtkWidget *myviewport1;
35
 	GtkWidget *myviewport2;
36
-	
37
+
38
+	/* Window geometry */
39
+	int oldsize[2];
40
+		
41
 /* I know this code looks chaotic at first sight, but it seems to work :-) */
42
 int
43
 create_gtk_ui(RC_NODE *rc_knobs,int num_knobs,RC_NODE *rc_strings,int num_str)
44
@@ -202,6 +211,10 @@
45
 		
46
 	int i;
47
 
48
+	char *homedir;
49
+	char temp[255];
50
+	int fd;
51
+	
52
 	commit_win_up=FALSE;
53
 	add_win_up=FALSE;
54
 	about_win_up=FALSE;
55
@@ -218,6 +231,27 @@
56
 	gtk_window_set_title(GTK_WINDOW(window),"The Fish");
57
 
58
 
59
+	/* Set the size */
60
+	
61
+	homedir=getenv("HOME");
62
+	if(homedir!=NULL) {
63
+	
64
+		snprintf(temp,255,"%s/%s",homedir,".thefishrc");
65
+		fd=open(temp,O_RDONLY,0);
66
+		if(fd!=-1) {
67
+		read(fd,&oldsize[0],sizeof(oldsize));
68
+		close(fd);
69
+		} else  {
70
+		
71
+		oldsize[0]=400;
72
+		oldsize[1]=480;
73
+		
74
+		}
75
+		
76
+	}	
77
+
78
+	gtk_window_set_default_size(GTK_WINDOW(window),oldsize[0],oldsize[1]);
79
+	 
80
 	/* Set the icon */
81
 	icon16_pixbuf=gdk_pixbuf_new_from_xpm_data((const char **)icon16);
82
 	icon32_pixbuf=gdk_pixbuf_new_from_xpm_data((const char **)icon32);
83
@@ -561,6 +595,7 @@
84
 void 
85
 destroy( GtkWidget *widget, gpointer data)
86
 {
87
+	save_geometry();
88
     gtk_main_quit();
89
 }
90
 
91
@@ -583,10 +618,15 @@
92
 		result=gtk_dialog_run (GTK_DIALOG (dialog));
93
 		gtk_widget_destroy (dialog);	
94
 
95
-		if(result==GTK_RESPONSE_YES) gtk_main_quit();
96
+		if(result==GTK_RESPONSE_YES) {
97
+		
98
+			save_geometry();
99
+			gtk_main_quit();
100
+		}
101
 	
102
-		} else {
103
+	} else {
104
 	
105
+		save_geometry();
106
     	gtk_main_quit();
107
 	
108
 	}
109
@@ -1167,4 +1207,29 @@
110
 	gtk_widget_destroy(add_window);
111
 
112
 	add_win_up=FALSE;
113
+}
114
+
115
+void
116
+save_geometry(void)
117
+{
118
+
119
+	int newsize[2];
120
+	char *homedir;
121
+	char temp[255];
122
+	int fd;
123
+	
124
+	gtk_window_get_size(GTK_WINDOW(window),&newsize[0],&newsize[1]);
125
+	
126
+	if(oldsize[0]!=newsize[0] || oldsize[1]!=newsize[1]) {
127
+	
128
+		homedir=getenv("HOME");
129
+		if(homedir==NULL) return;
130
+		snprintf(temp,255,"%s/%s",homedir,".thefishrc");
131
+		fd=open(temp,O_WRONLY|O_CREAT|O_TRUNC,0666);
132
+		if(fd==-1) return;
133
+		write(fd,&newsize[0],sizeof(newsize));
134
+		close(fd);
135
+		return;
136
+		
137
+	}
138
 }

Return to bug 50908