diff options
author | David Robillard <d@drobilla.net> | 2011-10-22 03:13:45 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-10-22 03:13:45 +0000 |
commit | d9e8e65328406f10de9f272572d4bee0732a7b3c (patch) | |
tree | dbd4e8d0bbff0bceb8316aef0d140b3e730ec705 /src/gui | |
parent | ac1d6d135bda8d739fdb8bf564f89c38b664c097 (diff) | |
download | ingen-d9e8e65328406f10de9f272572d4bee0732a7b3c.tar.gz ingen-d9e8e65328406f10de9f272572d4bee0732a7b3c.tar.bz2 ingen-d9e8e65328406f10de9f272572d4bee0732a7b3c.zip |
Remove remote patch stuff (doesn't work anyway).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3585 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/LoadRemotePatchWindow.cpp | 151 | ||||
-rw-r--r-- | src/gui/LoadRemotePatchWindow.hpp | 93 | ||||
-rw-r--r-- | src/gui/PatchWindow.cpp | 22 | ||||
-rw-r--r-- | src/gui/PatchWindow.hpp | 4 | ||||
-rw-r--r-- | src/gui/UploadPatchWindow.cpp | 269 | ||||
-rw-r--r-- | src/gui/UploadPatchWindow.hpp | 109 | ||||
-rw-r--r-- | src/gui/WindowFactory.cpp | 37 | ||||
-rw-r--r-- | src/gui/WindowFactory.hpp | 5 | ||||
-rw-r--r-- | src/gui/ingen_gui.ui | 356 | ||||
-rw-r--r-- | src/gui/wscript | 5 |
10 files changed, 0 insertions, 1051 deletions
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 <http://drobilla.net> - * - * 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 <sys/types.h> -#include <dirent.h> -#include <boost/optional/optional.hpp> -#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<Gtk::Builder>& 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<const PatchModel> 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<Sord::QueryResults> 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<const PatchModel> 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<Path> parent; - optional<Symbol> 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 <http://drobilla.net> - * - * 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 <gtkmm.h> - -#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<Glib::ustring> _col_name; - Gtk::TreeModelColumn<Glib::ustring> _col_uri; -}; - -/* Load remote patch ("import location") dialog. - * - * \ingroup GUI - */ -class LoadRemotePatchWindow : public Dialog -{ -public: - LoadRemotePatchWindow(BaseObjectType* cobject, - const Glib::RefPtr<Gtk::Builder>& xml); - - void set_patch(SharedPtr<const PatchModel> patch); - - void present(SharedPtr<const PatchModel> 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<const PatchModel> _patch; - - Glib::RefPtr<Gtk::TreeSelection> _selection; - Glib::RefPtr<Gtk::ListStore> _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<Gtk::Clipboard> clipboard = Gtk::Clipboard::get(); clipboard->signal_owner_change().connect( sigc::mem_fun(this, &PatchWindow::event_clipboard_changed)); @@ -443,12 +433,6 @@ PatchWindow::event_import() } void -PatchWindow::event_import_location() -{ - _app->window_factory()->present_load_remote_patch(_patch); -} - -void PatchWindow::event_save() { const Raul::Atom& document = _patch->get_property(_app->uris().ingen_document); @@ -562,12 +546,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() { Gtk::FileChooserDialog dialog(*this, "Draw to DOT", Gtk::FILE_CHOOSER_ACTION_SAVE); 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 <http://drobilla.net> - * - * 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 <sstream> -#include <algorithm> -#include <sys/types.h> -#include <dirent.h> -#include <boost/optional/optional.hpp> -#include <curl/curl.h> -#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<Gtk::Builder>& 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<PatchModel> 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 <http://drobilla.net> - * - * 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 <sstream> - -#include <curl/curl.h> - -#include <gtkmm.h> - -#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<Gtk::Builder>& xml); - - void present(SharedPtr<PatchModel> 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<PatchModel> _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); @@ -292,31 +280,6 @@ WindowFactory::present_load_subpatch(SharedPtr<const PatchModel> patch, } void -WindowFactory::present_load_remote_patch(SharedPtr<const PatchModel> 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<const PatchModel> 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<const PatchModel> 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<const PatchModel> patch, Properties data=Properties()); void present_load_patch(SharedPtr<const PatchModel> patch, Properties data=Properties()); void present_load_subpatch(SharedPtr<const PatchModel> patch, Properties data=Properties()); - void present_load_remote_patch(SharedPtr<const PatchModel> patch, Properties data=Properties()); - void present_upload_patch(SharedPtr<const PatchModel> patch); void present_new_subpatch(SharedPtr<const PatchModel> patch, Properties data=Properties()); void present_rename(SharedPtr<const ObjectModel> object); void present_properties(SharedPtr<const ObjectModel> 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: </object> </child> </object> - <object class="GtkDialog" id="load_remote_patch_win"> - <property name="can_focus">False</property> - <property name="border_width">8</property> - <property name="title" translatable="yes">Download Patch - Ingen</property> - <property name="type_hint">dialog</property> - <child internal-child="vbox"> - <object class="GtkBox" id="dialog-vbox5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">8</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="load_remote_patch_cancel_button"> - <property name="label">gtk-cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="load_remote_patch_open_button"> - <property name="label">gtk-open</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkVBox" id="vbox21"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">8</property> - <child> - <object class="GtkScrolledWindow" id="load_remote_patch_treeview_sw"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="shadow_type">in</property> - <child> - <object class="GtkTreeView" id="load_remote_patch_treeview"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection3"/> - </child> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox71"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkLabel" id="label133"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">URI: </property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="load_remote_patch_uri_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="width_chars">78</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - </object> - </child> - <action-widgets> - <action-widget response="-6">load_remote_patch_cancel_button</action-widget> - <action-widget response="-5">load_remote_patch_open_button</action-widget> - </action-widgets> - </object> <object class="GtkWindow" id="messages_win"> <property name="width_request">400</property> <property name="height_request">180</property> @@ -1713,18 +1580,6 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_import_location_menuitem"> - <property name="label">Import _Location...</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> - <property name="use_underline">True</property> - <property name="use_stock">False</property> - <accelerator key="L" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_import_location1_activate" swapped="no"/> - </object> - </child> - <child> <object class="GtkSeparatorMenuItem" id="separator9"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1755,18 +1610,6 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_upload_menuitem"> - <property name="label">_Upload...</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> - <property name="use_underline">True</property> - <property name="use_stock">False</property> - <accelerator key="U" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_upload_menuitem_activate" swapped="no"/> - </object> - </child> - <child> <object class="GtkImageMenuItem" id="patch_draw_menuitem"> <property name="label">_Draw...</property> <property name="visible">True</property> @@ -2617,205 +2460,6 @@ Contributors: </object> </child> </object> - <object class="GtkDialog" id="upload_patch_win"> - <property name="can_focus">False</property> - <property name="border_width">8</property> - <property name="title" translatable="yes">Upload Patch - Ingen</property> - <property name="resizable">False</property> - <property name="type_hint">dialog</property> - <child internal-child="vbox"> - <object class="GtkBox" id="dialog-vbox6"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">9</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area6"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="upload_patch_cancel_button"> - <property name="label">gtk-close</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="upload_patch_upload_button"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> - <child> - <object class="GtkAlignment" id="alignment5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <child> - <object class="GtkHBox" id="hbox72"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">2</property> - <child> - <object class="GtkImage" id="image2136"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="stock">gtk-ok</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label134"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Upload</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkTable" id="table19"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="row_spacing">8</property> - <child> - <object class="GtkEntry" id="upload_patch_symbol_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="activates_default">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkEntry" id="upload_patch_short_name_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="activates_default">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label135"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Symbol: </property> - </object> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label136"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Short Name: </property> - </object> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label137"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="ypad">4</property> - <property name="label" translatable="yes">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.</property> - <property name="wrap">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkProgressBar" id="upload_patch_progress"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pulse_step">0.10000000149</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">4</property> - </packing> - </child> - </object> - </child> - <action-widgets> - <action-widget response="-7">upload_patch_cancel_button</action-widget> - <action-widget response="-5">upload_patch_upload_button</action-widget> - </action-widgets> - </object> <object class="GtkWindow" id="warehouse_win"> <property name="can_focus">False</property> <property name="title" translatable="yes">Warehouse - Ingen</property> 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', |