Gtk::Widget *FileSystemSyncServiceAddin::create_preferences_control(EventHandler requiredPrefChanged) { Gtk::Table *table = new Gtk::Table(1, 2, false); table->set_row_spacings(5); table->set_col_spacings(10); // Read settings out of gconf std::string syncPath; if(get_config_settings(syncPath) == false) { syncPath = ""; } Gtk::Label *l = new Gtk::Label(_("_Folder Path:"), true); l->property_xalign() = 1; table->attach(*l, 0, 1, 0, 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); m_path_button = new Gtk::FileChooserButton(_("Select Synchronization Folder..."), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); m_path_button->signal_current_folder_changed().connect(requiredPrefChanged); l->set_mnemonic_widget(*m_path_button); m_path_button->set_filename(syncPath); table->attach(*m_path_button, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); table->show_all(); return table; }
Gtk::Widget *WebDavSyncServiceAddin::create_preferences_control(EventHandler requiredPrefChanged) { Gtk::Table *table = new Gtk::Table(3, 2, false); table->set_row_spacings(5); table->set_col_spacings(10); // Read settings out of gconf Glib::ustring url, username, password; get_config_settings(url, username, password); m_url_entry = new Gtk::Entry(); m_url_entry->set_text(url); m_url_entry->signal_changed().connect(requiredPrefChanged); add_row(table, m_url_entry, _("_URL:"), 0); m_username_entry = new Gtk::Entry(); m_username_entry->set_text(username); m_username_entry->signal_changed().connect(requiredPrefChanged); add_row(table, m_username_entry, _("User_name:"), 1); m_password_entry = new Gtk::Entry(); m_password_entry->set_text(password); m_password_entry->set_visibility(false); m_password_entry->signal_changed().connect(requiredPrefChanged); add_row(table, m_password_entry, _("_Password:"), 2); table->set_hexpand(true); table->set_vexpand(false); table->show_all(); return table; }
std::vector<Glib::ustring> WebDavSyncServiceAddin::get_fuse_mount_exe_args(const Glib::ustring & mountPath, bool fromStoredValues) { Glib::ustring url, username, password; if(fromStoredValues) { get_config_settings(url, username, password); } else { get_pref_widget_settings(url, username, password); } return get_fuse_mount_exe_args(mountPath, url, username, password, accept_ssl_cert()); }
gnote::sync::SyncServer::Ptr FileSystemSyncServiceAddin::create_sync_server() { gnote::sync::SyncServer::Ptr server; std::string syncPath; if(get_config_settings(syncPath)) { m_path = syncPath; if(sharp::directory_exists(m_path) == false) { sharp::directory_create(m_path); } server = gnote::sync::FileSystemSyncServer::create(m_path); } else { throw std::logic_error("FileSystemSyncServiceAddin.create_sync_server() called without being configured"); } return server; }
bool WebDavSyncServiceAddin::is_configured() { Glib::ustring url, username, password; return get_config_settings(url, username, password); }