Commit ce614b92 authored by Kai Willadsen's avatar Kai Willadsen

Remove preferences creation and passing

parent ec0705d4
......@@ -302,8 +302,8 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
tree.STATE_MODIFIED: ("modified", "ShowModified"),
}
def __init__(self, prefs, num_panes):
melddoc.MeldDoc.__init__(self, prefs)
def __init__(self, num_panes):
melddoc.MeldDoc.__init__(self)
gnomeglade.Component.__init__(self, "dirdiff.ui", "dirdiff",
["DirdiffActions"])
......
......@@ -164,10 +164,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
'action-mode-changed': (GObject.SignalFlags.RUN_FIRST, None, (int,)),
}
def __init__(self, prefs, num_panes):
def __init__(self, num_panes):
"""Start up an filediff with num_panes empty contents.
"""
melddoc.MeldDoc.__init__(self, prefs)
melddoc.MeldDoc.__init__(self)
gnomeglade.Component.__init__(self, "filediff.ui", "filediff")
self.map_widgets_into_lists(["textview", "fileentry", "diffmap",
"scrolledwindow", "linkmap",
......
......@@ -43,7 +43,6 @@ class MeldApp(Gtk.Application):
self.set_application_id("org.gnome.meld")
GObject.set_application_name("Meld")
Gtk.Window.set_default_icon_name("meld")
self.prefs = meld.preferences.MeldPreferences()
self.recent_comparisons = meld.recent.RecentFiles(sys.argv[0])
self.window = None
......
......@@ -70,11 +70,9 @@ class MeldDoc(GObject.GObject):
(bool, bool)),
}
def __init__(self, prefs):
def __init__(self):
GObject.GObject.__init__(self)
self.scheduler = task.FifoScheduler()
self.prefs = prefs
self.prefs.notify_add(self.on_preference_changed)
self.num_panes = 0
self.label_text = _("untitled")
self.tooltip_text = _("untitled")
......@@ -162,9 +160,6 @@ class MeldDoc(GObject.GObject):
def on_replace_activate(self, *extra):
pass
def on_preference_changed(self, key, value):
pass
def on_file_changed(self, filename):
pass
......
......@@ -625,7 +625,7 @@ class MeldWindow(gnomeglade.Component):
def append_dirdiff(self, dirs, auto_compare=False):
assert len(dirs) in (1, 2, 3)
doc = dirdiff.DirDiff(app.prefs, len(dirs))
doc = dirdiff.DirDiff(len(dirs))
self._append_page(doc, "folder")
doc.set_locations(dirs)
# FIXME: This doesn't work, as dirdiff behaves differently to vcview
......@@ -635,7 +635,7 @@ class MeldWindow(gnomeglade.Component):
def append_filediff(self, files, merge_output=None):
assert len(files) in (1, 2, 3)
doc = filediff.FileDiff(app.prefs, len(files))
doc = filediff.FileDiff(len(files))
self._append_page(doc, "text-x-generic")
doc.set_files(files)
if merge_output is not None:
......@@ -644,7 +644,7 @@ class MeldWindow(gnomeglade.Component):
def append_filemerge(self, files, merge_output=None):
assert len(files) == 3
doc = filemerge.FileMerge(app.prefs, len(files))
doc = filemerge.FileMerge(len(files))
self._append_page(doc, "text-x-generic")
doc.set_files(files)
if merge_output is not None:
......@@ -666,7 +666,7 @@ class MeldWindow(gnomeglade.Component):
return self.append_filediff(paths, merge_output=merge_output)
def append_vcview(self, location, auto_compare=False):
doc = vcview.VcView(app.prefs)
doc = vcview.VcView()
# FIXME: need a good themed VC icon
self._append_page(doc, "vc-icon")
location = location[0] if isinstance(location, list) else location
......@@ -691,7 +691,7 @@ class MeldWindow(gnomeglade.Component):
return tab
def _single_file_open(self, path):
doc = vcview.VcView(app.prefs)
doc = vcview.VcView()
def cleanup():
self.scheduler.remove_scheduler(doc.scheduler)
......
......@@ -25,11 +25,9 @@ from gi.repository import Gtk
from gi.repository import GtkSource
from meld.filters import FilterEntry
from meld.settings import settings
from meld.ui.gnomeglade import Component
from meld.ui.listwidget import ListWidget
from .util import prefs
from meld.settings import settings
class FilterList(ListWidget):
......@@ -243,13 +241,3 @@ class PreferencesDialog(Component):
def on_response(self, dialog, response_id):
self.widget.destroy()
class MeldPreferences(prefs.Preferences):
defaults = {
"window_size_x": prefs.Value(prefs.INT, 600),
"window_size_y": prefs.Value(prefs.INT, 600),
}
def __init__(self):
super(MeldPreferences, self).__init__("/apps/meld", self.defaults)
......@@ -162,8 +162,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
"ignored": ("VcShowIgnored", entry_ignored),
}
def __init__(self, prefs):
melddoc.MeldDoc.__init__(self, prefs)
def __init__(self):
melddoc.MeldDoc.__init__(self)
gnomeglade.Component.__init__(self, "vcview.ui", "vcview",
["VcviewActions", 'liststore_vcs'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment