From 09c6e0cb5c94037f8dfd3bdd6811cebee01bcb11 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 19 Sep 2014 13:20:09 +0100 Subject: [PATCH] Remove gtkui specific func from path_chooser_common --- deluge/path_chooser_common.py | 5 ----- deluge/ui/gtkui/path_combo_chooser.py | 7 +++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/deluge/path_chooser_common.py b/deluge/path_chooser_common.py index 357824bba..8c0f0d54f 100644 --- a/deluge/path_chooser_common.py +++ b/deluge/path_chooser_common.py @@ -11,11 +11,6 @@ import os -def get_resource(filename): - import deluge - return deluge.common.resource_filename("deluge.ui.gtkui", os.path.join("glade", filename)) - - def is_hidden(filepath): def has_hidden_attribute(filepath): import win32api diff --git a/deluge/ui/gtkui/path_combo_chooser.py b/deluge/ui/gtkui/path_combo_chooser.py index 68ef6a1e8..e48f4796d 100755 --- a/deluge/ui/gtkui/path_combo_chooser.py +++ b/deluge/ui/gtkui/path_combo_chooser.py @@ -16,7 +16,8 @@ import gobject import gtk from gtk import gdk, keysyms -from deluge.path_chooser_common import get_completion_paths, get_resource +from deluge.common import resource_filename +from deluge.path_chooser_common import get_completion_paths def is_ascii_value(keyval, ascii_key): @@ -1036,7 +1037,9 @@ class PathChooserComboBox(gtk.HBox, StoredValuesPopup, gobject.GObject): self.setting_accelerator_key = False self.builder = gtk.Builder() self.popup_buttonbox = self.builder.get_object("buttonbox") - self.builder.add_from_file(get_resource("path_combo_chooser.ui")) + self.builder.add_from_file(resource_filename( + "deluge.ui.gtkui", os.path.join("glade", "path_combo_chooser.ui") + )) self.button_toggle = self.builder.get_object("button_toggle_dropdown") self.text_entry = self.builder.get_object("entry_text") self.open_filechooser_dialog_button = self.builder.get_object("button_open_dialog")