[fix] update download path inside teleport when gsettings changes #5
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@@ -62,6 +62,16 @@ change_download_directory_cb (GtkWidget *widget,
|
|||||||
g_free(newDownloadDir);
|
g_free(newDownloadDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
update_download_directory (GSettings *settings,
|
||||||
|
gchar *key,
|
||||||
|
gpointer *data) {
|
||||||
|
if (g_strcmp0 (key, "download-dir") == 0) {
|
||||||
|
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (data),
|
||||||
|
g_settings_get_string(settings, key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_click_this_device_settings_button (GtkWidget *widget,
|
on_click_this_device_settings_button (GtkWidget *widget,
|
||||||
gpointer user_data) {
|
gpointer user_data) {
|
||||||
@@ -114,22 +124,13 @@ teleport_window_init (TeleportWindow *win)
|
|||||||
priv->this_device_name_label, "label",
|
priv->this_device_name_label, "label",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
/*gtk_label_set_text (GTK_LABEL (priv->this_device_name_label),
|
|
||||||
g_settings_get_string (priv->settings, "device-name"));
|
|
||||||
*/
|
|
||||||
|
|
||||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (downloadDir),
|
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (downloadDir),
|
||||||
g_settings_get_string(priv->settings,
|
g_settings_get_string(priv->settings,
|
||||||
"download-dir"));
|
"download-dir"));
|
||||||
|
|
||||||
g_signal_connect (downloadDir, "file-set", G_CALLBACK (change_download_directory_cb), priv->settings);
|
g_signal_connect (downloadDir, "file-set", G_CALLBACK (change_download_directory_cb), priv->settings);
|
||||||
/*g_settings_bind (priv->settings, "download-dir",
|
g_signal_connect (priv->settings, "changed", G_CALLBACK (update_download_directory), downloadDir);
|
||||||
GTK_FILE_CHOOSER (downloadDir), "current-folder",
|
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
|
||||||
*/
|
|
||||||
|
|
||||||
//g_object_unref (menu);
|
|
||||||
//g_object_unref (label);
|
|
||||||
g_object_unref (builder);
|
g_object_unref (builder);
|
||||||
|
|
||||||
/* Add popover for device settings */
|
/* Add popover for device settings */
|
||||||
|
|||||||
Reference in New Issue
Block a user