aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authori026e <klev.paul@gmail.com>2017-01-26 11:16:38 +0300
committeri026e <klev.paul@gmail.com>2017-01-26 11:16:38 +0300
commit097eb5b6f1f82fa9bf53930715b74b6fe92bda21 (patch)
treea8a4f158dd4abb45802d6642827e6fc675038e28
parentCategory mode bug fix (diff)
downloadmime_types_editor-097eb5b6f1f82fa9bf53930715b74b6fe92bda21.tar.gz
mime_types_editor-097eb5b6f1f82fa9bf53930715b74b6fe92bda21.tar.bz2
mime_types_editor-097eb5b6f1f82fa9bf53930715b74b6fe92bda21.zip
Background
-rw-r--r--src/common/mime_view.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/common/mime_view.py b/src/common/mime_view.py
index 85d5880..6a1eb7c 100644
--- a/src/common/mime_view.py
+++ b/src/common/mime_view.py
@@ -5,17 +5,17 @@ Created on Thu Dec 1 08:15:56 2016
@author: pavel
"""
+import mime_operations, mime_categories
+import data_filter
-from gi.repository import Gtk, Gdk, Gio
+from gi.repository import Gtk, Gdk, Gio, GObject
from gi.repository import GdkPixbuf
from gtk_common import ImageTextColumn, FlagColumn, TextColumn
from gtk_common import ICON_SIZE
-import mime_operations, mime_categories
-import data_filter
-
from locale import gettext as _
+from threading import Thread
@@ -94,9 +94,13 @@ class MimeView:
def set_data(self, *args, **kwargs):
+ def background_job():
+ mtypes = self._get_initial_data(*args, **kwargs)
+ GObject.idle_add(self._add_mtypes, mtypes)
+
self.list_store.clear()
- mtypes = self._get_initial_data(*args, **kwargs)
- self._add_mtypes(mtypes)
+ self.thread = Thread(target = background_job)
+ self.thread.start()
def set_filter_params(self, filter_name, **kwargs):
if filter_name in self.data_filters:
bgstack15