diff options
author | Roman Bogorodskiy <novel@FreeBSD.org> | 2005-03-14 14:01:52 +0000 |
---|---|---|
committer | Roman Bogorodskiy <novel@FreeBSD.org> | 2005-03-14 14:01:52 +0000 |
commit | 3fe3468035906097522e192c9febd39e83245beb (patch) | |
tree | 1d69c9be2c55491bd4b617fe1d53527065f12ae7 /editors/leafpad | |
parent | 7cf8cdf2cdc73153e87d7de50d11c98071b6af7e (diff) | |
download | ports-3fe3468035906097522e192c9febd39e83245beb.tar.gz ports-3fe3468035906097522e192c9febd39e83245beb.zip |
Notes
Diffstat (limited to 'editors/leafpad')
-rw-r--r-- | editors/leafpad/Makefile | 20 | ||||
-rw-r--r-- | editors/leafpad/files/extra-new-selector.patch | 130 | ||||
-rw-r--r-- | editors/leafpad/pkg-plist | 1 |
3 files changed, 149 insertions, 2 deletions
diff --git a/editors/leafpad/Makefile b/editors/leafpad/Makefile index 5a2c5a8da6f3..df25990a21a8 100644 --- a/editors/leafpad/Makefile +++ b/editors/leafpad/Makefile @@ -19,11 +19,27 @@ USE_GNOME= gtk20 gnomehier desktopfileutils USE_REINPLACE= yes USE_X_PREFIX= yes GNU_CONFIGURE= yes -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib" +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include ${PTHREAD_CFLAGS}" \ + LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib ${PTHREAD_LIBS}" \ + PTHREAD_LIB="${PTHREAD_LIBS}" PORTDOCS= AUTHORS COPYING ChangeLog INSTALL README +.if defined (WITH_NEW_SELECTOR) +EXTRA_PATCHES= ${FILESDIR}/extra-new-selector.patch +.endif + +pre-everything:: +.if !defined(WITH_NEW_SELECTOR) + @${ECHO_MSG} "" + @${ECHO_MSG} "You may choose to compile with unsupported patch" + @${ECHO_MSG} "that lets leafpad use the new GTK file selector." + @${ECHO_MSG} "Define:" + @${ECHO_MSG} "" + @${ECHO_MSG} " WITH_NEW_SELECTOR=yes" + @${ECHO_MSG} "" +.endif + post-patch: @${REINPLACE_CMD} -e 's|/pixmaps|/gnome/pixmaps|; \ s|/applications|/gnome/applications|' \ diff --git a/editors/leafpad/files/extra-new-selector.patch b/editors/leafpad/files/extra-new-selector.patch new file mode 100644 index 000000000000..f0c86d93cfdb --- /dev/null +++ b/editors/leafpad/files/extra-new-selector.patch @@ -0,0 +1,130 @@ +--- src/callback.c.orig Mon Dec 20 12:58:26 2004 ++++ src/callback.c Thu Feb 3 20:08:07 2005 +@@ -93,7 +93,7 @@ + + if (!check_text_modification(sd)) { + // fi = get_file_info_by_selector(OPEN, sd->fi); +- fi = get_fileinfo_from_selector(sd->mainwin->window, sd->fi, OPEN); ++ fi = get_fileinfo_from_chooser(sd->mainwin->window, sd->fi, OPEN); + if (fi) { + if (file_open_real(sd->mainwin->textview, fi)) { + g_free(fi); +@@ -123,7 +123,7 @@ + { + FileInfo *fi; + +- fi = get_fileinfo_from_selector(sd->mainwin->window, sd->fi, SAVE); ++ fi = get_fileinfo_from_chooser(sd->mainwin->window, sd->fi, SAVE); + if (fi) { + if (file_save_real(sd->mainwin->textview, fi)) + g_free(fi); +--- src/selector.c.orig Fri Dec 24 10:35:12 2004 ++++ src/selector.c Thu Feb 3 21:02:00 2005 +@@ -310,7 +310,7 @@ + return option_menu; + } + +-static GtkWidget *create_file_selector(FileInfo *selected_fi) ++static GtkWidget *create_file_chooser(FileInfo *selected_fi, GtkWidget *window) + { + GtkWidget *filesel; + GtkWidget *align; +@@ -322,12 +322,19 @@ + + title = mode ? _("Open") : _("Save As"); + +- filesel = gtk_file_selection_new(title); +-// gtk_window_set_transient_for(GTK_WINDOW(filesel), GTK_WINDOW(window)); ++ if(mode == OPEN) ++ filesel = gtk_file_chooser_dialog_new(title, GTK_WINDOW(window), ++ GTK_FILE_CHOOSER_ACTION_OPEN, ++ GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL, ++ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,NULL); ++ else ++ filesel = gtk_file_chooser_dialog_new(title, GTK_WINDOW(window), ++ GTK_FILE_CHOOSER_ACTION_SAVE, ++ GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL, ++ GTK_STOCK_SAVE,GTK_RESPONSE_ACCEPT,NULL); + + align = gtk_alignment_new(1, 0, 0, 0); +- gtk_box_pack_end(GTK_BOX(GTK_FILE_SELECTION(filesel)->main_vbox), +- align, FALSE, FALSE, 0); ++ gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(filesel),align); + table = gtk_table_new(2, 2, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), 5); + gtk_container_add(GTK_CONTAINER(align), table); +@@ -340,15 +347,15 @@ + option_menu_lineend = create_lineend_menu(selected_fi); + gtk_table_attach_defaults(GTK_TABLE(table), option_menu_lineend, 1, 2, 0, 1); + } +- gtk_widget_show_all(GTK_FILE_SELECTION(filesel)->main_vbox); ++ gtk_widget_show_all(GTK_FILE_CHOOSER(filesel)); + + if (selected_fi->filename) +- gtk_file_selection_set_filename(GTK_FILE_SELECTION(filesel), selected_fi->filename); ++ gtk_file_chooser_select_filename(GTK_FILE_CHOOSER(filesel), selected_fi->filename); + + return filesel; + } + +-FileInfo *get_fileinfo_from_selector(GtkWidget *window, FileInfo *fi, gint requested_mode) ++FileInfo *get_fileinfo_from_chooser(GtkWidget *window, FileInfo *fi, gint requested_mode) + { + FileInfo *selected_fi; + GtkWidget *filesel; +@@ -366,24 +373,24 @@ + selected_fi->manual_charset = + fi->manual_charset ? g_strdup(fi->manual_charset) : NULL; + +- filesel = create_file_selector(selected_fi); ++ filesel = create_file_chooser(selected_fi,window); + + gtk_window_set_transient_for(GTK_WINDOW(filesel), GTK_WINDOW(window)); + + do { + res = gtk_dialog_run(GTK_DIALOG(filesel)); +- if (res == GTK_RESPONSE_OK) { ++ if (res == GTK_RESPONSE_ACCEPT) { + if (selected_fi->filename) + g_free(selected_fi->filename); + selected_fi->filename = g_strdup( +- gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel))); ++ gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel))); + if (g_file_test(selected_fi->filename, G_FILE_TEST_IS_DIR)) { + len = strlen(selected_fi->filename); + if (len < 1 || selected_fi->filename[len - 1] != G_DIR_SEPARATOR) + str = g_strconcat(selected_fi->filename, G_DIR_SEPARATOR_S, NULL); + else + str = g_strdup(selected_fi->filename); +- gtk_file_selection_set_filename(GTK_FILE_SELECTION(filesel), str); ++ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(filesel), str); + g_free(str); + continue; + } +@@ -397,14 +404,14 @@ + case GTK_RESPONSE_NO: + continue; + case GTK_RESPONSE_YES: +- res = GTK_RESPONSE_OK; ++ res = GTK_RESPONSE_ACCEPT; + } + } + } + gtk_widget_hide(filesel); + } while (GTK_WIDGET_VISIBLE(filesel)); + +- if (res != GTK_RESPONSE_OK) { ++ if (res != GTK_RESPONSE_ACCEPT) { + if (selected_fi->charset) + g_free(selected_fi->charset); + if (selected_fi->manual_charset) +--- src/selector.h.orig Thu Feb 3 20:17:09 2005 ++++ src/selector.h Thu Feb 3 20:17:27 2005 +@@ -30,6 +30,6 @@ + OPEN + }; + +-FileInfo *get_fileinfo_from_selector(GtkWidget *window, FileInfo *fi, gint requested_mode); ++FileInfo *get_fileinfo_from_chooser(GtkWidget *window, FileInfo *fi, gint requested_mode); + + #endif /* _SELECTOR_H */ diff --git a/editors/leafpad/pkg-plist b/editors/leafpad/pkg-plist index a60d34ce4531..1caf7634eeb6 100644 --- a/editors/leafpad/pkg-plist +++ b/editors/leafpad/pkg-plist @@ -16,5 +16,6 @@ share/locale/sv/LC_MESSAGES/leafpad.mo share/locale/ta/LC_MESSAGES/leafpad.mo share/locale/zh_CN/LC_MESSAGES/leafpad.mo share/locale/zh_TW/LC_MESSAGES/leafpad.mo +%%PORTDOCS%%@dirrm %%DOCSDIR%% @exec update-desktop-database > /dev/null || /usr/bin/true @unexec update-desktop-database > /dev/null || /usr/bin/true |