summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f5aa15)
raw | patch | inline | side by side (parent: 0f5aa15)
author | bdilly <bdilly@users.sourceforge.net> | |
Sun, 19 Aug 2007 09:43:12 +0000 (09:43 +0000) | ||
committer | bdilly <bdilly@users.sourceforge.net> | |
Sun, 19 Aug 2007 09:43:12 +0000 (09:43 +0000) |
src/ui/dialog/inkscape-preferences.cpp | patch | blob | history | |
src/ui/dialog/ocaldialogs.cpp | patch | blob | history | |
src/ui/dialog/ocaldialogs.h | patch | blob | history |
index a32dcb3c6a1f13e64d0ae6c78bf1ba9d440f6290..506d9bb4a6a85f612162c05e19f014272ba42650 100644 (file)
_misc_overs_bitmap.init("options.bitmapoversample", "value", labels, values, num_items, 1);
_page_misc.add_line( false, _("Oversample bitmaps:"), _misc_overs_bitmap, "", "", false);
_misc_ocal_url.init("options.ocalurl", "str", true);
- _page_misc.add_line( false, _("Open Clip Art Library URL:"), _misc_ocal_url, "", _("The url of the Open Clip Art Library webdav server. It's used by the Export to OCAL function."), true);
+ _page_misc.add_line( false, _("Open Clip Art Library Server Name:"), _misc_ocal_url, "", _("The server name of the Open Clip Art Library webdav server. It's used by the Import and Export to OCAL function."), true);
_misc_ocal_username.init("options.ocalusername", "str", true);
_page_misc.add_line( false, _("Open Clip Art Library Username:"), _misc_ocal_username, "", _("The username used to log into Open Clip Art Library."), true);
_misc_ocal_password.init("options.ocalpassword", "str", false);
index bb4661706fce105c1db9384921114f2760a02197..b99a48fa92b1c7a0618825272a20c07632b6aab0 100644 (file)
//### F I L E I M P O R T F R O M O C A L
//#########################################################################
+
/*
* Callback for row activated
*/
@@ -515,7 +516,7 @@ void FileListViewText::on_row_activated(const Gtk::TreeModel::Path& path, Gtk::T
//Glib::ustring fileUrl = "dav://"; //dav url
//fileUrl.append(prefs_get_string_attribute("options.ocalurl", "str"));
- //fileUrl.append("/dav/");
+ //fileUrl.append("/dav.php/");
//fileUrl.append(get_text(posArray[0], 3)); //author dir
//fileUrl.append("/");
//fileUrl.append(get_text(posArray[0], 2)); //filename
@@ -568,6 +569,7 @@ void FileListViewText::on_row_activated(const Gtk::TreeModel::Path& path, Gtk::T
gnome_vfs_close(to_handle);
}
myPreview->showImage(myFilename);
+ myLabel->set_text(get_text(posArray[0], 4));
#endif
}
return;
notFoundLabel->hide();
+ descriptionLabel->set_text("");
Glib::ustring searchTag = searchTagEntry->get_text();
// create the ocal uri to get rss feed
- Glib::ustring uri = "http://www.";
+ Glib::ustring uri = "http://";
uri.append(prefs_get_string_attribute("options.ocalurl", "str"));
uri.append("/media/feed/rss/");
uri.append(searchTag);
// open the rss feed
result = gnome_vfs_open (&from_handle, uri.c_str(), GNOME_VFS_OPEN_READ);
if (result != GNOME_VFS_OK) {
- sp_ui_error_dialog(_("Failed to receive the Open Clip Art Library RSS feed. Verify if the URL is correct in Configuration->Misc (e.g.: openclipart.org)"));
- //g_warning("Could not find the Open Clip Art Library rss feed. Verify if the OCAL url is correct in Configuration");
+ sp_ui_error_dialog(_("Failed to receive the Open Clip Art Library RSS feed. Verify if the server name is correct in Configuration->Misc (e.g.: openclipart.org)"));
return;
}
@@ -731,6 +733,10 @@ void FileImportFromOCALDialogImplGtk::print_xml_element_names(xmlNode * a_node)
{
filesList->set_text(row_num, 3, (const char*)xmlNodeGetContent(cur_node));
}
+ else if (!strcmp((const char*)cur_node->name, "description"))
+ {
+ filesList->set_text(row_num, 4, (const char*)xmlNodeGetContent(cur_node));
+ }
#endif
}
print_xml_element_names(cur_node->children);
@@ -746,7 +752,6 @@ FileImportFromOCALDialogImplGtk::FileImportFromOCALDialogImplGtk(Gtk::Window& pa
const Glib::ustring &title) :
FileDialogOCALBase(title)
{
-
// Initalize to Autodetect
extension = NULL;
// No filename to start out with
@@ -756,30 +761,36 @@ FileImportFromOCALDialogImplGtk::FileImportFromOCALDialogImplGtk(Gtk::Window& pa
Gtk::VBox *vbox = get_vbox();
Gtk::Label *tagLabel = new Gtk::Label(_("Search Tag"));
notFoundLabel = new Gtk::Label(_("No files matched your search"));
+ descriptionLabel = new Gtk::Label();
messageBox.pack_start(*notFoundLabel);
+ descriptionBox.pack_start(*descriptionLabel);
searchTagEntry = new Gtk::Entry();
searchTagEntry->set_text(searchTag);
- searchTagEntry->set_max_length(252); // I am giving the extension approach.
+ searchTagEntry->set_max_length(255);
+ searchButton = new Gtk::Button(_("Search"));
tagBox.pack_start(*tagLabel);
tagBox.pack_start(*searchTagEntry, Gtk::PACK_EXPAND_WIDGET, 3);
+ tagBox.pack_start(*searchButton);
filesPreview = new SVGPreview();
filesPreview->showNoPreview();
- filesList = new FileListViewText(4, *filesPreview);
+ filesList = new FileListViewText(5, *filesPreview, *descriptionLabel);
filesList->set_sensitive(false);
// add the listview inside a ScrolledWindow
listScrolledWindow.add(*filesList);
// only show the scrollbars when they are necessary:
listScrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
filesList->set_column_title(0, _("Files Found"));
- listScrolledWindow.set_size_request(200, 180);
+ listScrolledWindow.set_size_request(400, 180);
filesList->get_column(1)->set_visible(false); // file url
filesList->get_column(2)->set_visible(false); // tmp file path
filesList->get_column(3)->set_visible(false); // author dir
+ filesList->get_column(4)->set_visible(false); // file description
filesBox.pack_start(listScrolledWindow);
filesBox.pack_start(*filesPreview);
vbox->pack_start(tagBox);
vbox->pack_start(messageBox);
vbox->pack_start(filesBox);
+ vbox->pack_start(descriptionBox);
//Let's do some customization
searchTagEntry = NULL;
@@ -794,6 +805,9 @@ FileImportFromOCALDialogImplGtk::FileImportFromOCALDialogImplGtk(Gtk::Window& pa
sigc::mem_fun(*this, &FileImportFromOCALDialogImplGtk::searchTagEntryChangedCallback));
}
+ searchButton->signal_clicked().connect(
+ sigc::mem_fun(*this, &FileImportFromOCALDialogImplGtk::searchTagEntryChangedCallback));
+
add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
set_default(*add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK));
index 5a06ba4f534e744361b287989644582e6d8fd7d5..4af282ee3ac2b048ad6161e317a932901d36f64e 100644 (file)
class FileListViewText : public Gtk::ListViewText
{
public:
- FileListViewText(guint columns_count, SVGPreview& filesPreview):ListViewText(columns_count)
+ FileListViewText(guint columns_count, SVGPreview& filesPreview, Gtk::Label& description):ListViewText(columns_count)
{
myPreview = &filesPreview;
+ myLabel = &description;
}
Glib::ustring getFilename();
protected:
private:
Glib::ustring myFilename;
SVGPreview *myPreview;
+ Gtk::Label *myLabel;
};
/**
FileListViewText *filesList;
SVGPreview *filesPreview;
Gtk::Label *notFoundLabel;
+ Gtk::Label *descriptionLabel;
+ Gtk::Button *searchButton;
// Child widgets
Gtk::HBox tagBox;
Gtk::HBox filesBox;
Gtk::HBox messageBox;
+ Gtk::HBox descriptionBox;
Gtk::ScrolledWindow listScrolledWindow;
Glib::RefPtr<Gtk::TreeSelection> selection;