-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove deprecated TreeView instead of GTK4 ColumnView
- Loading branch information
Showing
29 changed files
with
857 additions
and
816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from lib.logger import logger | ||
|
||
|
||
class Component(ABC): | ||
@staticmethod | ||
def to_str(bind, from_value): | ||
return str(from_value) | ||
|
||
@abstractmethod | ||
def handle_model_changed(self, source, data_obj, data_changed): | ||
logger.debug( | ||
"Component Model changed", | ||
extra={"class_name": self.__class__.__name__}, | ||
) | ||
|
||
@abstractmethod | ||
def handle_attribute_changed(self, source, key, value): | ||
logger.debug( | ||
"Component Attribute changed", | ||
extra={"class_name": self.__class__.__name__}, | ||
) | ||
|
||
@abstractmethod | ||
def handle_settings_changed(self, source, data_obj, data_changed): | ||
logger.debug( | ||
"Component settings changed", | ||
extra={"class_name": self.__class__.__name__}, | ||
) | ||
|
||
@abstractmethod | ||
def update_view(self, model, torrent, attribute): | ||
logger.debug( | ||
"Component update view", | ||
extra={"class_name": self.__class__.__name__}, | ||
) | ||
|
||
def set_model(self, model): | ||
self.model = model | ||
# subscribe to model changes | ||
self.model.connect("data-changed", self.handle_model_changed) | ||
|
||
def model_selection_changed(self, source, model, torrent): | ||
logger.debug( | ||
"Model selection changed", | ||
extra={"class_name": self.__class__.__name__}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.