From d9e8e65328406f10de9f272572d4bee0732a7b3c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Oct 2011 03:13:45 +0000 Subject: Remove remote patch stuff (doesn't work anyway). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3585 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/LoadRemotePatchWindow.cpp | 151 ---------------- src/gui/LoadRemotePatchWindow.hpp | 93 ---------- src/gui/PatchWindow.cpp | 22 --- src/gui/PatchWindow.hpp | 4 - src/gui/UploadPatchWindow.cpp | 269 ---------------------------- src/gui/UploadPatchWindow.hpp | 109 ------------ src/gui/WindowFactory.cpp | 37 ---- src/gui/WindowFactory.hpp | 5 - src/gui/ingen_gui.ui | 356 -------------------------------------- src/gui/wscript | 5 - 10 files changed, 1051 deletions(-) delete mode 100644 src/gui/LoadRemotePatchWindow.cpp delete mode 100644 src/gui/LoadRemotePatchWindow.hpp delete mode 100644 src/gui/UploadPatchWindow.cpp delete mode 100644 src/gui/UploadPatchWindow.hpp (limited to 'src/gui') diff --git a/src/gui/LoadRemotePatchWindow.cpp b/src/gui/LoadRemotePatchWindow.cpp deleted file mode 100644 index 55ceccc0..00000000 --- a/src/gui/LoadRemotePatchWindow.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include "ingen/client/PatchModel.hpp" -#include "ingen/ServerInterface.hpp" -#include "ingen/shared/World.hpp" -#include "App.hpp" -#include "Configuration.hpp" -#include "LoadRemotePatchWindow.hpp" -#include "ThreadedLoader.hpp" - -using boost::optional; -using namespace Raul; -using namespace std; - -namespace Ingen { -namespace GUI { - -LoadRemotePatchWindow::LoadRemotePatchWindow(BaseObjectType* cobject, - const Glib::RefPtr& xml) - : Dialog(cobject) -{ - xml->get_widget("load_remote_patch_treeview", _treeview); - xml->get_widget("load_remote_patch_uri_entry", _uri_entry); - xml->get_widget("load_remote_patch_cancel_button", _cancel_button); - xml->get_widget("load_remote_patch_open_button", _open_button); - - _liststore = Gtk::ListStore::create(_columns); - _treeview->set_model(_liststore); - _treeview->append_column("Name", _columns._col_name); - _treeview->append_column("URI", _columns._col_uri); - - _selection = _treeview->get_selection(); - _selection->signal_changed().connect(sigc::mem_fun(this, &LoadRemotePatchWindow::patch_selected)); - _treeview->signal_row_activated().connect(sigc::mem_fun(this, &LoadRemotePatchWindow::patch_activated)); - - _open_button->signal_clicked().connect(sigc::mem_fun(this, &LoadRemotePatchWindow::open_clicked)); - _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &LoadRemotePatchWindow::cancel_clicked)); - _uri_entry->signal_changed().connect(sigc::mem_fun(this, &LoadRemotePatchWindow::uri_changed)); -} - -void -LoadRemotePatchWindow::present(SharedPtr patch, - GraphObject::Properties data) -{ - _liststore->clear(); - - set_patch(patch); - _initial_data = data; - - cerr << "FIXME: load remote patch" << endl; -#if 0 - Sord::Model model(*_app->world()->rdf_world(), - "http://rdf.drobilla.net/ingen_patches/index.ttl", - "http://rdf.drobilla.net/ingen_patches/"); - - Sord::Query query(*_app->world()->rdf_world(), Glib::ustring( - "SELECT DISTINCT ?name ?uri WHERE {" - " ?uri a ingen:Patch ;" - " doap:name ?name ." - "}")); - - SharedPtr results(query.run(*_app->world()->rdf_world(), model)); - for (; !results->finished(); results->next()) { - Gtk::TreeModel::iterator iter = _liststore->append(); - (*iter)[_columns._col_name] = results->get("name").to_string(); - (*iter)[_columns._col_uri] = results->get("uri").to_string(); - } - - _treeview->columns_autosize(); - - Gtk::Window::present(); -#endif -} - -/** Sets the patch controller for this window and initializes everything. - * - * This function MUST be called before using the window in any way! - */ -void -LoadRemotePatchWindow::set_patch(SharedPtr patch) -{ - _patch = patch; -} - -void -LoadRemotePatchWindow::uri_changed() -{ - _open_button->property_sensitive() = (_uri_entry->get_text().length() > 0); -} - -void -LoadRemotePatchWindow::patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col) -{ - open_clicked(); -} - -void -LoadRemotePatchWindow::patch_selected() -{ - Gtk::TreeModel::iterator selected_i = _selection->get_selected(); - - if (selected_i) { // If anything is selected - const Glib::ustring uri = selected_i->get_value(_columns._col_uri); - _uri_entry->set_text(uri); - } -} - -void -LoadRemotePatchWindow::open_clicked() -{ - Glib::ustring uri = _uri_entry->get_text(); - - // If unset load_patch will load values - optional parent; - optional symbol; - - if (!_patch->path().is_root()) - parent = _patch->path().parent(); - - _app->loader()->load_patch(true, uri, - parent, symbol, _initial_data); - - hide(); -} - -void -LoadRemotePatchWindow::cancel_clicked() -{ - hide(); -} - -} // namespace GUI -} // namespace Ingen diff --git a/src/gui/LoadRemotePatchWindow.hpp b/src/gui/LoadRemotePatchWindow.hpp deleted file mode 100644 index b6f86892..00000000 --- a/src/gui/LoadRemotePatchWindow.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_GUI_LOADREMOTEPATCHWINDOW_HPP -#define INGEN_GUI_LOADREMOTEPATCHWINDOW_HPP - -#include - -#include "raul/SharedPtr.hpp" - -#include "ingen/GraphObject.hpp" - -#include "Window.hpp" - -using namespace Ingen::Shared; - -namespace Ingen { - -namespace Client { class PatchModel; } -using Ingen::Client::PatchModel; - -namespace GUI { - -/** Columns for the remote patch list. - * - * \ingroup GUI - */ -class PatchColumns : public Gtk::TreeModel::ColumnRecord -{ -public: - PatchColumns() { - add(_col_name); - add(_col_uri); - } - - Gtk::TreeModelColumn _col_name; - Gtk::TreeModelColumn _col_uri; -}; - -/* Load remote patch ("import location") dialog. - * - * \ingroup GUI - */ -class LoadRemotePatchWindow : public Dialog -{ -public: - LoadRemotePatchWindow(BaseObjectType* cobject, - const Glib::RefPtr& xml); - - void set_patch(SharedPtr patch); - - void present(SharedPtr patch, - GraphObject::Properties data); - -private: - void patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col); - void patch_selected(); - void uri_changed(); - void open_clicked(); - void cancel_clicked(); - - GraphObject::Properties _initial_data; - - SharedPtr _patch; - - Glib::RefPtr _selection; - Glib::RefPtr _liststore; - PatchColumns _columns; - - Gtk::TreeView* _treeview; - Gtk::Entry* _uri_entry; - Gtk::Button* _open_button; - Gtk::Button* _cancel_button; -}; - -} // namespace GUI -} // namespace Ingen - -#endif // INGEN_GUI_LOADREMOTEPATCHWINDOW_HPP diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index c95f4fea..aa4c3330 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -77,11 +77,9 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, //xml->get_widget("patch_win_status_bar", _status_bar); //xml->get_widget("patch_open_menuitem", _menu_open); xml->get_widget("patch_import_menuitem", _menu_import); - xml->get_widget("patch_import_location_menuitem", _menu_import_location); //xml->get_widget("patch_open_into_menuitem", _menu_open_into); xml->get_widget("patch_save_menuitem", _menu_save); xml->get_widget("patch_save_as_menuitem", _menu_save_as); - xml->get_widget("patch_upload_menuitem", _menu_upload); xml->get_widget("patch_draw_menuitem", _menu_draw); xml->get_widget("patch_edit_controls_menuitem", _menu_edit_controls); xml->get_widget("patch_cut_menuitem", _menu_cut); @@ -111,14 +109,10 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, _menu_view_control_window->property_sensitive() = false; _menu_import->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_import)); - _menu_import_location->signal_activate().connect( - sigc::mem_fun(this, &PatchWindow::event_import_location)); _menu_save->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_save)); _menu_save_as->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_save_as)); - _menu_upload->signal_activate().connect( - sigc::mem_fun(this, &PatchWindow::event_upload)); _menu_draw->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_draw)); _menu_edit_controls->signal_activate().connect( @@ -160,10 +154,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, _menu_view_patch_properties->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_show_properties)); -#ifndef HAVE_CURL - _menu_upload->hide(); -#endif - Glib::RefPtr clipboard = Gtk::Clipboard::get(); clipboard->signal_owner_change().connect( sigc::mem_fun(this, &PatchWindow::event_clipboard_changed)); @@ -442,12 +432,6 @@ PatchWindow::event_import() _app->window_factory()->present_load_patch(_patch); } -void -PatchWindow::event_import_location() -{ - _app->window_factory()->present_load_remote_patch(_patch); -} - void PatchWindow::event_save() { @@ -561,12 +545,6 @@ more files and/or directories, recursively. Existing files will be overwritten. } } -void -PatchWindow::event_upload() -{ - _app->window_factory()->present_upload_patch(_patch); -} - void PatchWindow::event_draw() { diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp index 63f70cd7..b3f7ad55 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/PatchWindow.hpp @@ -84,10 +84,8 @@ private: void editable_changed(bool editable); void event_import(); - void event_import_location(); void event_save(); void event_save_as(); - void event_upload(); void event_draw(); void event_edit_controls(); void event_copy(); @@ -122,10 +120,8 @@ private: int _y; Gtk::MenuItem* _menu_import; - Gtk::MenuItem* _menu_import_location; Gtk::MenuItem* _menu_save; Gtk::MenuItem* _menu_save_as; - Gtk::MenuItem* _menu_upload; Gtk::MenuItem* _menu_draw; Gtk::CheckMenuItem* _menu_edit_controls; Gtk::MenuItem* _menu_cut; diff --git a/src/gui/UploadPatchWindow.cpp b/src/gui/UploadPatchWindow.cpp deleted file mode 100644 index 5e47bef9..00000000 --- a/src/gui/UploadPatchWindow.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include "ingen/shared/World.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/client/ClientStore.hpp" -#include "ingen/ServerInterface.hpp" -#include "ingen/serialisation/Serialiser.hpp" -#include "ingen/client/PatchModel.hpp" -#include "UploadPatchWindow.hpp" -#include "App.hpp" -#include "Configuration.hpp" -#include "ThreadedLoader.hpp" - -using boost::optional; -using namespace Raul; -using namespace std; - -namespace Ingen { -namespace GUI { - -UploadPatchWindow::UploadPatchWindow(BaseObjectType* cobject, - const Glib::RefPtr& xml) - : Dialog(cobject) - , _thread(NULL) - , _progress_pct(0) - , _response(0) -{ - xml->get_widget("upload_patch_symbol_entry", _symbol_entry); - xml->get_widget("upload_patch_short_name_entry", _short_name_entry); - xml->get_widget("upload_patch_progress", _upload_progress); - xml->get_widget("upload_patch_cancel_button", _cancel_button); - xml->get_widget("upload_patch_upload_button", _upload_button); - - _symbol_entry->signal_changed().connect(sigc::mem_fun(this, &UploadPatchWindow::symbol_changed)); - _short_name_entry->signal_changed().connect(sigc::mem_fun(this, &UploadPatchWindow::short_name_changed)); - _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &UploadPatchWindow::cancel_clicked)); - _upload_button->signal_clicked().connect(sigc::mem_fun(this, &UploadPatchWindow::upload_clicked)); -} - -void -UploadPatchWindow::present(SharedPtr patch) -{ - _patch = patch; - - Gtk::Window::present(); -} - -void -UploadPatchWindow::on_show() -{ - const Shared::URIs& uris = _app->uris(); - Gtk::Dialog::on_show(); - - Raul::Atom atom = _patch->get_property(uris.lv2_symbol); - if (atom.is_valid()) - _symbol_entry->set_text(atom.get_string()); - - atom = _patch->get_property(uris.doap_name); - if (atom.is_valid()) - _short_name_entry->set_text(atom.get_string()); -} - -void -UploadPatchWindow::on_hide() -{ - Gtk::Dialog::on_hide(); - - delete _thread; - _thread = NULL; -} - -bool -UploadPatchWindow::is_symbol(const Glib::ustring& s) -{ - if (s.length() == 0) - return false; - - for (unsigned i=0; i < s.length(); ++i) - if ( !( (s[i] >= 'a' && s[i] <= 'z') - || (s[i] >= 'A' && s[i] <= 'Z') - || (s[i] == '_') - || (i > 0 && s[i] >= '0' && s[i] <= '9') ) ) - return false; - - return true; -} - -void -UploadPatchWindow::symbol_changed() -{ - _upload_button->property_sensitive() = ( - is_symbol(_symbol_entry->get_text()) - && _short_name_entry->get_text().length() > 0); -} - -void -UploadPatchWindow::short_name_changed() -{ - _upload_button->property_sensitive() = ( - is_symbol(_symbol_entry->get_text()) - && _short_name_entry->get_text().length() > 0); -} - -size_t -UploadThread::curl_read_cb(void *ptr, size_t size, size_t nmemb, void *data) -{ - assert(size == 1); - - istringstream* ss = (istringstream*)data; - - return ss->readsome((char*)ptr, nmemb); -} - -int -UploadThread::curl_progress_cb(void *thread, - double dltotal, - double dlnow, - double ultotal, - double ulnow) -{ - UploadThread* me = (UploadThread*)thread; - me->_win->set_progress(min( - (int)(min(ulnow, (double)me->_length) / me->_length * 100.0), - 99)); - return 0; -} - -UploadThread::UploadThread(UploadPatchWindow* win, const string& str, const string& url) - : Thread("Upload") - , _curl(NULL) - , _headers(NULL) - , _win(win) - , _length(str.length()) - , _stream(str) - , _url(url) -{ - _curl = curl_easy_init(); - _headers = curl_slist_append(NULL, "Content-type: application/x-turtle"); - - curl_easy_setopt(_curl, CURLOPT_URL, url.c_str()); - curl_easy_setopt(_curl, CURLOPT_HTTPHEADER, _headers); - curl_easy_setopt(_curl, CURLOPT_UPLOAD, 1); - curl_easy_setopt(_curl, CURLOPT_READDATA, &_stream); - curl_easy_setopt(_curl, CURLOPT_READFUNCTION, &UploadThread::curl_read_cb); - curl_easy_setopt(_curl, CURLOPT_INFILESIZE, sizeof(char) * str.length()); - curl_easy_setopt(_curl, CURLOPT_NOPROGRESS, FALSE); - curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, &UploadThread::curl_progress_cb); - curl_easy_setopt(_curl, CURLOPT_PROGRESSDATA, this); -} - -void -UploadThread::_run() -{ - curl_easy_perform(_curl); - - long response; - curl_easy_getinfo(_curl, CURLINFO_RESPONSE_CODE, &response); - - printf("Server returned %ld\n", response); - - _win->set_response(response); - _win->set_progress(100); - - curl_slist_free_all(_headers); - curl_easy_cleanup(_curl); - - _headers = NULL; - _curl = NULL; -} - -bool -UploadPatchWindow::progress_callback() -{ - const int progress = _progress_pct.get(); - const int response = _response.get(); - - _upload_progress->set_fraction(progress / 100.0); - - if (progress == 100) { - if (response == 200) { - _upload_progress->set_text("Transfer completed"); - } else { - _upload_progress->set_fraction(0.0); - char status[4]; - snprintf(status, 4, "%d", (unsigned)response); - string msg = "Transfer failed: Server returned "; - msg.append(status); - _upload_progress->set_text(msg); - } - delete _thread; - _thread = NULL; - _upload_button->set_sensitive(true); - return false; - } else { - return true; - } -} - -void -UploadPatchWindow::upload_clicked() -{ - assert(!_thread); - - const Shared::URIs& uris = _app->uris(); - - Glib::ustring symbol = _symbol_entry->get_text(); - Glib::ustring short_name = _short_name_entry->get_text(); - - GraphObject::Properties extra_rdf; - extra_rdf.insert(make_pair(uris.lv2_symbol, symbol)); - extra_rdf.insert(make_pair(uris.doap_name, short_name)); - - _response = 0; - _progress_pct = 0; - - _upload_progress->set_fraction(0.0); - _upload_progress->set_text(""); - - Serialiser s(*_app->world(), _app->store()); - - const string uri = string("http://rdf.drobilla.net/ingen_patches/") - .append(symbol).append(INGEN_PATCH_FILE_EXT); - - const string str = s.to_string(_patch, uri, extra_rdf); - - _thread = new UploadThread(this, str, uri); - - _thread->start(); - - _upload_button->set_sensitive(false); - - Glib::signal_timeout().connect( - sigc::mem_fun(this, &UploadPatchWindow::progress_callback), 100); -} - -void -UploadPatchWindow::cancel_clicked() -{ - if (_thread) { - delete _thread; - _thread = NULL; - } - - hide(); -} - -} // namespace GUI -} // namespace Ingen diff --git a/src/gui/UploadPatchWindow.hpp b/src/gui/UploadPatchWindow.hpp deleted file mode 100644 index 98d1b6c1..00000000 --- a/src/gui/UploadPatchWindow.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_GUI_UPLOADPATCHWINDOW_HPP -#define INGEN_GUI_UPLOADPATCHWINDOW_HPP - -#include - -#include - -#include - -#include "raul/SharedPtr.hpp" -#include "raul/Thread.hpp" -#include "raul/AtomicInt.hpp" - -#include "ingen/client/PluginModel.hpp" - -#include "Window.hpp" - -namespace Ingen { - -namespace Client { class PatchModel; } -using Ingen::Client::PatchModel; - -namespace GUI { - -class UploadPatchWindow; - -class UploadThread : public Raul::Thread { -public: - UploadThread(UploadPatchWindow* win, - const std::string& str, - const std::string& url); - -private: - static size_t curl_read_cb(void* ptr, size_t size, size_t nmemb, void *stream); - static int curl_progress_cb(void* thread, double dltotal, double dlnow, double ultotal, double ulnow); - - void _run(); - - CURL* _curl; - curl_slist* _headers; - UploadPatchWindow* _win; - size_t _length; - std::istringstream _stream; - std::string _url; -}; - -/* Upload patch dialog. - * - * \ingroup GUI - */ -class UploadPatchWindow : public Dialog -{ -public: - UploadPatchWindow(BaseObjectType* cobject, - const Glib::RefPtr& xml); - - void present(SharedPtr patch); - - Gtk::ProgressBar* progress_bar() { return _upload_progress; } - - void set_response(int response) { _response = response; } - void set_progress(int pct) { _progress_pct = pct; } - -private: - bool is_symbol(const Glib::ustring& str); - void symbol_changed(); - void short_name_changed(); - void cancel_clicked(); - void upload_clicked(); - void on_show(); - void on_hide(); - bool progress_callback(); - - UploadThread* _thread; - - SharedPtr _patch; - - Raul::AtomicInt _progress_pct; - Raul::AtomicInt _response; - - Gtk::Entry* _symbol_entry; - Gtk::Entry* _short_name_entry; - Gtk::ProgressBar* _upload_progress; - Gtk::Button* _cancel_button; - Gtk::Button* _upload_button; - -}; - -} // namespace GUI -} // namespace Ingen - -#endif // INGEN_GUI_UPLOADPATCHWINDOW_HPP diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index 6ea87f84..9f433ded 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -22,7 +22,6 @@ #include "WidgetFactory.hpp" #include "LoadPatchWindow.hpp" #include "LoadPluginWindow.hpp" -#include "LoadRemotePatchWindow.hpp" #include "NewSubpatchWindow.hpp" #include "NodeControlWindow.hpp" #include "PropertiesWindow.hpp" @@ -30,9 +29,6 @@ #include "PatchWindow.hpp" #include "RenameWindow.hpp" #include "WindowFactory.hpp" -#ifdef HAVE_CURL -#include "UploadPatchWindow.hpp" -#endif using namespace std; @@ -43,26 +39,18 @@ WindowFactory::WindowFactory(App& app) : _app(app) , _load_plugin_win(NULL) , _load_patch_win(NULL) - , _load_remote_patch_win(NULL) - , _upload_patch_win(NULL) , _new_subpatch_win(NULL) , _properties_win(NULL) { WidgetFactory::get_widget_derived("load_plugin_win", _load_plugin_win); WidgetFactory::get_widget_derived("load_patch_win", _load_patch_win); - WidgetFactory::get_widget_derived("load_remote_patch_win", _load_remote_patch_win); WidgetFactory::get_widget_derived("new_subpatch_win", _new_subpatch_win); WidgetFactory::get_widget_derived("properties_win", _properties_win); WidgetFactory::get_widget_derived("rename_win", _rename_win); -#ifdef HAVE_CURL - WidgetFactory::get_widget_derived("upload_patch_win", _upload_patch_win); - _upload_patch_win->init_dialog(app); -#endif _load_plugin_win->init_window(app); _load_patch_win->init(app); - //_load_remote_patch_win->init(app); _new_subpatch_win->init_window(app); _properties_win->init_window(app); _rename_win->init_window(app); @@ -291,31 +279,6 @@ WindowFactory::present_load_subpatch(SharedPtr patch, _load_patch_win->present(patch, false, data); } -void -WindowFactory::present_load_remote_patch(SharedPtr patch, - GraphObject::Properties data) -{ - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); - - if (w != _patch_windows.end()) - _load_remote_patch_win->set_transient_for(*w->second); - - _load_remote_patch_win->present(patch, data); -} - -void -WindowFactory::present_upload_patch(SharedPtr patch) -{ -#ifdef HAVE_CURL - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); - - if (w != _patch_windows.end()) - _upload_patch_win->set_transient_for(*w->second); - - _upload_patch_win->present(patch); -#endif -} - void WindowFactory::present_new_subpatch(SharedPtr patch, GraphObject::Properties data) diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 952c3db7..d520740f 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -41,7 +41,6 @@ namespace GUI { class App; class LoadPatchWindow; class LoadPluginWindow; -class LoadRemotePatchWindow; class NewSubpatchWindow; class NodeControlWindow; class PropertiesWindow; @@ -78,8 +77,6 @@ public: void present_load_plugin(SharedPtr patch, Properties data=Properties()); void present_load_patch(SharedPtr patch, Properties data=Properties()); void present_load_subpatch(SharedPtr patch, Properties data=Properties()); - void present_load_remote_patch(SharedPtr patch, Properties data=Properties()); - void present_upload_patch(SharedPtr patch); void present_new_subpatch(SharedPtr patch, Properties data=Properties()); void present_rename(SharedPtr object); void present_properties(SharedPtr object); @@ -104,8 +101,6 @@ private: ControlWindowMap _control_windows; LoadPluginWindow* _load_plugin_win; LoadPatchWindow* _load_patch_win; - LoadRemotePatchWindow* _load_remote_patch_win; - UploadPatchWindow* _upload_patch_win; NewSubpatchWindow* _new_subpatch_win; PropertiesWindow* _properties_win; RenameWindow* _rename_win; diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui index 5ba80d7a..f5c88bde 100644 --- a/src/gui/ingen_gui.ui +++ b/src/gui/ingen_gui.ui @@ -1154,139 +1154,6 @@ Contributors: - - False - 8 - Download Patch - Ingen - dialog - - - True - False - 8 - - - True - False - end - - - gtk-cancel - True - True - True - False - False - True - - - False - False - 0 - - - - - gtk-open - True - False - True - True - True - False - False - True - - - False - False - 1 - - - - - False - True - end - 0 - - - - - True - False - 8 - - - True - True - True - in - - - True - True - - - - - - - - True - True - 0 - - - - - True - False - - - True - False - URI: - - - False - False - 0 - - - - - True - True - 78 - - - True - True - 1 - - - - - False - True - 1 - - - - - False - True - 2 - - - - - - load_remote_patch_cancel_button - load_remote_patch_open_button - - 400 180 @@ -1712,18 +1579,6 @@ Contributors: - - - Import _Location... - True - False - False - True - False - - - - True @@ -1754,18 +1609,6 @@ Contributors: - - - _Upload... - True - False - False - True - False - - - - _Draw... @@ -2617,205 +2460,6 @@ Contributors: - - False - 8 - Upload Patch - Ingen - False - dialog - - - True - False - 9 - - - True - False - end - - - gtk-close - True - True - True - False - False - True - - - False - False - 0 - - - - - True - False - True - True - True - False - False - - - True - False - 0 - 0 - - - True - False - 2 - - - True - False - gtk-ok - - - False - False - 0 - - - - - True - False - Upload - True - - - False - False - 1 - - - - - - - - - False - False - 1 - - - - - False - True - end - 0 - - - - - True - False - 2 - 2 - 8 - - - True - True - True - - - 1 - 2 - - - - - - True - True - True - - - 1 - 2 - 1 - 2 - - - - - - True - False - 0 - Symbol: - - - GTK_FILL - - - - - - True - False - 0 - Short Name: - - - 1 - 2 - GTK_FILL - - - - - - False - True - 2 - - - - - True - False - 4 - Succesfully uploaded patches will be available immediately in the remote patch browser. - -By uploading patches, you agree to license them under the Creative Commons Attribution-Share Alike 3.0 License. - -Thank you for contributing. - True - - - False - False - 3 - - - - - True - False - 0.10000000149 - - - False - False - 4 - - - - - - upload_patch_cancel_button - upload_patch_upload_button - - False Warehouse - Ingen diff --git a/src/gui/wscript b/src/gui/wscript index a44b0b66..642148b1 100644 --- a/src/gui/wscript +++ b/src/gui/wscript @@ -11,7 +11,6 @@ def build(bld): install_path = '${LIBDIR}', use = 'libingen_shared libingen_client libingen_serialisation') autowaf.use_lib(bld, obj, ''' - CURL FLOWCANVAS GLADEMM GLIBMM @@ -37,7 +36,6 @@ def build(bld): Controls.cpp LoadPatchWindow.cpp LoadPluginWindow.cpp - LoadRemotePatchWindow.cpp MessagesWindow.cpp NewSubpatchWindow.cpp NodeControlWindow.cpp @@ -62,9 +60,6 @@ def build(bld): ingen_gui.cpp ''' - if bld.is_defined('HAVE_CURL'): - obj.source += 'UploadPatchWindow.cpp' - # XML UI definition bld(features = 'subst', source = 'ingen_gui.ui', -- cgit v1.2.1