[gnome-tweak-tool] Remove dead code
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Remove dead code
- Date: Wed, 21 Aug 2013 12:40:56 +0000 (UTC)
commit 19d71a2571b00b3b3f70161afce58777d7371063
Author: John Stowers <john stowers gmail com>
Date: Wed Aug 21 14:35:37 2013 +0200
Remove dead code
gtweak/tweakmodel.py | 6 ------
gtweak/tweaks/tweak_group_interface.py | 4 +---
gtweak/tweaks/tweak_group_legacy.py | 2 +-
gtweak/tweakview.py | 15 ---------------
4 files changed, 2 insertions(+), 25 deletions(-)
---
diff --git a/gtweak/tweakmodel.py b/gtweak/tweakmodel.py
index af63be7..78d746b 100644
--- a/gtweak/tweakmodel.py
+++ b/gtweak/tweakmodel.py
@@ -26,7 +26,6 @@ from gi.repository import Gtk
def N_(x): return x
TWEAK_GROUP_APPEARANCE = _("Appearance")
-TWEAK_GROUP_DESKTOP = _("Desktop")
TWEAK_GROUP_EXTENSION = _("Extensions")
TWEAK_GROUP_FONTS = _("Fonts")
TWEAK_GROUP_POWER = _("Power")
@@ -39,9 +38,6 @@ TWEAK_GROUP_MOUSE = _("Mouse")
TWEAK_GROUP_TYPING = _("Typing")
TWEAK_GROUP_FILES = _("Files")
-TWEAK_SORT_FIRST = -1e3
-TWEAK_SORT_LAST = 1e3
-
LOG = logging.getLogger(__name__)
class Tweak(object):
@@ -58,8 +54,6 @@ class Tweak(object):
self.widget_sort_hint = None
self._search_cache = None
- if options.get("sort"):
- self.widget_sort_hint = options.get("sort")
def search_matches(self, txt):
if self._search_cache == None:
diff --git a/gtweak/tweaks/tweak_group_interface.py b/gtweak/tweaks/tweak_group_interface.py
index 6bc1810..375e449 100644
--- a/gtweak/tweaks/tweak_group_interface.py
+++ b/gtweak/tweaks/tweak_group_interface.py
@@ -27,7 +27,7 @@ from gi.repository import GLib
import gtweak
from gtweak.utils import walk_directories, make_combo_list_with_default, extract_zip_file
-from gtweak.tweakmodel import Tweak, TWEAK_GROUP_APPEARANCE, TWEAK_SORT_LAST
+from gtweak.tweakmodel import Tweak, TWEAK_GROUP_APPEARANCE
from gtweak.gshellwrapper import GnomeShellFactory
from gtweak.gsettings import GSettingsSetting
from gtweak.widgets import ListBoxTweakGroup, GSettingsSwitchTweak, GSettingsComboTweak, DarkThemeSwitcher,
Title, build_combo_box_text,build_label_beside_widget, FileChooserButton
@@ -196,8 +196,6 @@ class ShellThemeTweak(Gtk.Box, Tweak):
build_label_beside_widget(self.name, chooser, cb, hbox=self)
self.widget_for_size_group = cb
-
- self.widget_sort_hint = TWEAK_SORT_LAST
def _on_file_set(self, chooser):
f = chooser.get_filename()
diff --git a/gtweak/tweaks/tweak_group_legacy.py b/gtweak/tweaks/tweak_group_legacy.py
index 34186ae..f259a7f 100644
--- a/gtweak/tweaks/tweak_group_legacy.py
+++ b/gtweak/tweaks/tweak_group_legacy.py
@@ -21,7 +21,7 @@ import logging
from gi.repository import Pango, Gtk, GnomeDesktop
from gtweak.gshellwrapper import GnomeShellFactory
-from gtweak.tweakmodel import Tweak, TweakGroup, TWEAK_GROUP_WINDOWS, TWEAK_GROUP_TYPING, TWEAK_GROUP_MOUSE,
TWEAK_GROUP_FILES, TWEAK_GROUP_DESKTOP, TWEAK_GROUP_FONTS, TWEAK_GROUP_POWER, TWEAK_GROUP_WORKSPACES,
TWEAK_SORT_FIRST
+from gtweak.tweakmodel import Tweak, TweakGroup, TWEAK_GROUP_TYPING
from gtweak.widgets import GSettingsSwitchTweak, build_label_beside_widget, GSettingsComboEnumTweak,
GSettingsComboTweak, build_horizontal_sizegroup, ListBoxTweakGroup, Title
from gtweak.gsettings import GSettingsSetting, GSettingsMissingError, GSettingsFakeSetting
diff --git a/gtweak/tweakview.py b/gtweak/tweakview.py
index a766987..b1897fd 100644
--- a/gtweak/tweakview.py
+++ b/gtweak/tweakview.py
@@ -25,21 +25,6 @@ import gtweak.tweakmodel
from gtweak.tweakmodel import TweakModel
from gtweak.widgets import Title
-DEFAULT_TWEAKGROUP = gtweak.tweakmodel.TWEAK_GROUP_APPEARANCE
-WIDGET_SORT_ORDER = (Gtk.Switch, Gtk.SpinButton, Gtk.ComboBox, Gtk.Box, Gtk.VBox, Gtk.HBox)
-
-def _sort_tweak_widgets_by_widget_type(tweak):
- #for appearance tries to make small widgets be packed first, followed by larger widgets,
- #followed by widgets of the same type
- if not tweak.widget_for_size_group:
- return -1
- if tweak.widget_sort_hint != None:
- return tweak.widget_sort_hint
- try:
- return WIDGET_SORT_ORDER.index(type(tweak.widget_for_size_group))
- except ValueError:
- return len(WIDGET_SORT_ORDER) #last
-
class Window(Gtk.ApplicationWindow):
def __init__(self, app, model):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]