aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-04-24 11:51:26 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-04-24 11:51:26 +0800
commit5868173118fc790b7371a4bac8511358db7438bd (patch)
tree091de4f174f044812ce04913c8852c8673fd26a2 /embed
parent8c83ceb4776c927353d7a235290c1fc2f9f34b1f (diff)
downloadgsoc2013-epiphany-5868173118fc790b7371a4bac8511358db7438bd.tar
gsoc2013-epiphany-5868173118fc790b7371a4bac8511358db7438bd.tar.gz
gsoc2013-epiphany-5868173118fc790b7371a4bac8511358db7438bd.tar.bz2
gsoc2013-epiphany-5868173118fc790b7371a4bac8511358db7438bd.tar.lz
gsoc2013-epiphany-5868173118fc790b7371a4bac8511358db7438bd.tar.xz
gsoc2013-epiphany-5868173118fc790b7371a4bac8511358db7438bd.tar.zst
gsoc2013-epiphany-5868173118fc790b7371a4bac8511358db7438bd.zip
Always save a page's content if there i content to be saved. Remove the
2003-04-23 David Bordoley <bordoley@msu.edu> * embed/ephy-embed-single.c: (ephy_embed_single_show_file_picker): * embed/ephy-embed-single.h: * embed/ephy-embed-utils.c: (ephy_embed_utils_save): * embed/ephy-embed-utils.h: * embed/mozilla/FilePicker.cpp: (GFilePicker::GFilePicker), (GFilePicker::Show), (GFilePicker::HandleFilePickerR): * embed/mozilla/FilePicker.h: * embed/mozilla/mozilla-embed-persist.cpp: (impl_save): * embed/mozilla/mozilla-embed-single.cpp: (impl_show_file_picker): * src/window-commands.c: (window_cmd_file_open): Always save a page's content if there i content to be saved. Remove the checkbox from the save as dialog. Patch from Christian Persch <chpe+gnomebugz@stud.uni-saarland.de>
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-single.c3
-rw-r--r--embed/ephy-embed-single.h2
-rw-r--r--embed/ephy-embed-utils.c13
-rw-r--r--embed/ephy-embed-utils.h2
-rw-r--r--embed/mozilla/FilePicker.cpp28
-rw-r--r--embed/mozilla/FilePicker.h9
-rw-r--r--embed/mozilla/mozilla-embed-persist.cpp2
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp20
8 files changed, 13 insertions, 66 deletions
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c
index 071ed1b48..dfeaf4c44 100644
--- a/embed/ephy-embed-single.c
+++ b/embed/ephy-embed-single.c
@@ -255,14 +255,13 @@ ephy_embed_single_show_file_picker (EphyEmbedSingle *shell,
const char *file,
FilePickerMode mode,
char **ret_fullpath,
- gboolean *ret_save_content,
FileFormat *file_formats,
int *ret_file_format)
{
EphyEmbedSingleClass *klass = EPHY_EMBED_SINGLE_GET_CLASS (shell);
return klass->show_file_picker (shell, parentWidget, title,
directory, file, mode,
- ret_fullpath, ret_save_content,
+ ret_fullpath,
file_formats, ret_file_format);
}
diff --git a/embed/ephy-embed-single.h b/embed/ephy-embed-single.h
index 174158db7..ebd065a92 100644
--- a/embed/ephy-embed-single.h
+++ b/embed/ephy-embed-single.h
@@ -161,7 +161,6 @@ struct EphyEmbedSingleClass
const char* file,
FilePickerMode mode,
char **ret_fullpath,
- gboolean *ret_save_content,
FileFormat *file_formats,
gint *ret_file_format);
};
@@ -222,7 +221,6 @@ gresult ephy_embed_single_show_file_picker (EphyEmbedSingle *shell,
const char *file,
FilePickerMode mode,
char **ret_fullpath,
- gboolean *ret_save_content,
FileFormat *file_formats,
int *ret_file_format);
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 33a8935ad..e564bb084 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -44,7 +44,8 @@
void
ephy_embed_utils_save (GtkWidget *window,
const char *default_dir_pref,
- gboolean ask_dest, gboolean ask_content,
+ gboolean ask_dest,
+ gboolean with_content,
EphyEmbedPersist *persist)
{
GnomeVFSURI *uri;
@@ -57,7 +58,6 @@ ephy_embed_utils_save (GtkWidget *window,
gresult ret;
EphyEmbed *embed;
EmbedPersistFlags flags;
- gboolean content;
EphyEmbedSingle *single;
single = ephy_embed_shell_get_embed_single
@@ -132,7 +132,6 @@ ephy_embed_utils_save (GtkWidget *window,
(single, window,
_("Select the destination filename"),
dirName, fileName, modeSave, &retPath,
- ask_content ? &content : NULL,
NULL, NULL);
}
@@ -143,12 +142,8 @@ ephy_embed_utils_save (GtkWidget *window,
retDir = gnome_vfs_uri_extract_dirname (uri);
- if (ask_content && content)
- {
- flags |= EMBED_PERSIST_SAVE_CONTENT;
- ephy_embed_persist_set_flags (persist,
- flags);
- }
+ if (with_content) flags |= EMBED_PERSIST_SAVE_CONTENT;
+ ephy_embed_persist_set_flags (persist, flags);
ephy_embed_persist_set_dest (persist, retPath);
diff --git a/embed/ephy-embed-utils.h b/embed/ephy-embed-utils.h
index 19f7b72f1..c24119828 100644
--- a/embed/ephy-embed-utils.h
+++ b/embed/ephy-embed-utils.h
@@ -35,7 +35,7 @@ typedef struct
void ephy_embed_utils_save (GtkWidget *window,
const char *default_dir_pref,
gboolean ask_dest,
- gboolean ask_content,
+ gboolean with_content,
EphyEmbedPersist *persist);
void ephy_embed_utils_build_charsets_submenu (BonoboUIComponent *ui_component,
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp
index 8ae5429f7..fb8a82313 100644
--- a/embed/mozilla/FilePicker.cpp
+++ b/embed/mozilla/FilePicker.cpp
@@ -76,9 +76,7 @@
/* Implementation file */
NS_IMPL_ISUPPORTS1(GFilePicker, nsIFilePicker)
-GFilePicker::GFilePicker(PRBool aShowContentCheck, FileFormat *aFileFormats) :
- mShowContentCheck(aShowContentCheck),
- mSaveContentCheck(NULL),
+GFilePicker::GFilePicker(FileFormat *aFileFormats) :
mFileFormats(aFileFormats)
{
NS_INIT_ISUPPORTS();
@@ -246,24 +244,6 @@ NS_IMETHODIMP GFilePicker::Show(PRInt16 *_retval)
gtk_window_set_transient_for(GTK_WINDOW(mFileSelector),
GTK_WINDOW(mParentWidget));
- if (mShowContentCheck)
- {
- GtkWidget *bbox = gtk_hbutton_box_new ();
- gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox),
- GTK_BUTTONBOX_END);
- gtk_box_set_spacing(GTK_BOX(bbox), 0);
- gtk_box_pack_end(GTK_BOX(GTK_FILE_SELECTION(mFileSelector)->action_area),
- bbox, TRUE, TRUE, 0);
-
- mSaveContentCheck =
- gtk_check_button_new_with_label(_("Save with content"));
-
- gtk_box_pack_start(GTK_BOX(bbox), mSaveContentCheck,
- FALSE, FALSE, 0);
-
- gtk_widget_show_all(bbox);
- }
-
if (mFileFormats)
{
mFormatChooser = gtk_option_menu_new();
@@ -482,11 +462,7 @@ NS_METHOD GFilePicker::HandleFilePickerResult(PRInt16 *retval)
}
}
- if (GTK_IS_TOGGLE_BUTTON(mSaveContentCheck))
- *retval = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mSaveContentCheck)) ?
- returnOKSaveContent : returnOK;
- else
- *retval = returnOK;
+ *retval = returnOK;
return NS_OK;
}
diff --git a/embed/mozilla/FilePicker.h b/embed/mozilla/FilePicker.h
index 8f8fdf571..c478ce7a1 100644
--- a/embed/mozilla/FilePicker.h
+++ b/embed/mozilla/FilePicker.h
@@ -52,11 +52,9 @@ class GFilePicker : public nsIFilePicker
NS_DECL_NSIFILEPICKER
enum { returnOK = nsIFilePicker::returnOK,
returnCancel = nsIFilePicker::returnCancel,
- returnReplace = nsIFilePicker::returnReplace,
- returnOKSaveContent = 256 };
+ returnReplace = nsIFilePicker::returnReplace };
- GFilePicker(PRBool aShowContentCheck = PR_FALSE,
- FileFormat *aFileFormats = nsnull);
+ GFilePicker(FileFormat *aFileFormats = nsnull);
virtual ~GFilePicker();
/* additional members */
@@ -80,12 +78,9 @@ class GFilePicker : public nsIFilePicker
PRInt16 mMode;
- PRBool mShowContentCheck;
-
GtkWidget *mParentWidget;
GtkWidget *mFileSelector;
GtkWidget *mFormatChooser;
- GtkWidget *mSaveContentCheck;
FileFormat *mFileFormats;
};
diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp
index 2b19bcc69..5668e14fb 100644
--- a/embed/mozilla/mozilla-embed-persist.cpp
+++ b/embed/mozilla/mozilla-embed-persist.cpp
@@ -190,7 +190,7 @@ impl_save (EphyEmbedPersist *persist)
if (flags & EMBED_PERSIST_SAVE_CONTENT)
{
char *datapath;
- datapath = g_strconcat (filename, "content", NULL);
+ datapath = g_strconcat (filename, ".content", NULL);
NS_NewLocalFile(NS_ConvertUTF8toUCS2(datapath), PR_TRUE, getter_AddRefs(path));
g_free (datapath);
}
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 20ccdfdca..355e33583 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -108,7 +108,6 @@ impl_show_file_picker (EphyEmbedSingle *shell,
const char *file,
FilePickerMode mode,
char **ret_fullpath,
- gboolean *ret_save_content,
FileFormat *file_formats,
int *ret_file_format);
@@ -887,20 +886,12 @@ impl_show_file_picker (EphyEmbedSingle *shell,
const char *file,
FilePickerMode mode,
char **ret_fullpath,
- gboolean *ret_save_content,
FileFormat *file_formats,
int *ret_file_format)
{
- PRBool showContentCheck;
- gchar *expanded_directory;
+ gchar *expanded_directory;
- if (ret_save_content == NULL)
- showContentCheck = PR_FALSE;
- else
- showContentCheck = PR_TRUE;
-
- GFilePicker *filePicker = new GFilePicker (showContentCheck,
- file_formats);
+ GFilePicker *filePicker = new GFilePicker (file_formats);
/* FIXME sane path: expand tilde ... */
expanded_directory = g_strdup (directory);
@@ -926,13 +917,6 @@ impl_show_file_picker (EphyEmbedSingle *shell,
PRInt16 retval;
filePicker->Show (&retval);
- if (ret_save_content != NULL)
- {
- if (retval == GFilePicker::returnOKSaveContent)
- *ret_save_content = TRUE;
- else
- *ret_save_content = FALSE;
- }
if (ret_file_format != NULL)
{
*ret_file_format = filePicker->mSelectedFileFormat;