Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
c61bd656
by Philipp Hörist at 2018-11-20T14:32:01Z
-
b74468b9
by Philipp Hörist at 2018-11-20T14:32:01Z
-
15c3de2b
by Philipp Hörist at 2018-11-20T14:32:01Z
-
8f9c596a
by Philipp Hörist at 2018-11-20T15:10:11Z
18 changed files:
- gajim/chat_control.py
- gajim/common/config.py
- gajim/common/modules/atom.py
- gajim/common/modules/pep.py
- gajim/common/modules/user_activity.py
- gajim/common/modules/user_avatar.py
- gajim/common/modules/user_location.py
- gajim/common/modules/user_mood.py
- gajim/common/modules/user_nickname.py
- gajim/common/modules/user_tune.py
- gajim/data/gui/preferences_window.ui
- gajim/data/style/default-dark.css
- gajim/data/style/default.css
- gajim/data/style/gajim.css
- gajim/gtk/preferences.py
- gajim/message_window.py
- gajim/roster_window.py
- win/_base.sh
Changes:
| ... | ... | @@ -669,19 +669,14 @@ class ChatControl(ChatControlBase): |
| 669 | 669 |
status_reduced = ''
|
| 670 | 670 |
status_escaped = GLib.markup_escape_text(status_reduced)
|
| 671 | 671 |
|
| 672 |
- st = app.config.get('displayed_chat_state_notifications')
|
|
| 673 | 672 |
if self.TYPE_ID == 'pm':
|
| 674 | 673 |
cs = self.gc_contact.chatstate
|
| 675 | 674 |
else:
|
| 676 | 675 |
cs = app.contacts.get_combined_chatstate(
|
| 677 | 676 |
self.account, self.contact.jid)
|
| 678 |
- if cs and st in ('composing_only', 'all'):
|
|
| 679 |
- if contact.show == 'offline':
|
|
| 680 |
- chatstate = ''
|
|
| 681 |
- elif st == 'all' or cs == 'composing':
|
|
| 682 |
- chatstate = helpers.get_uf_chatstate(cs)
|
|
| 683 |
- else:
|
|
| 684 |
- chatstate = ''
|
|
| 677 |
+ |
|
| 678 |
+ if app.config.get('show_chatstate_in_banner'):
|
|
| 679 |
+ chatstate = helpers.get_uf_chatstate(cs)
|
|
| 685 | 680 |
|
| 686 | 681 |
label_text = '<span>%s</span><span size="x-small" weight="light">%s %s</span>' \
|
| 687 | 682 |
% (name, acct_info, chatstate)
|
| ... | ... | @@ -187,7 +187,6 @@ class Config: |
| 187 | 187 |
'always_english_wiktionary': [opt_bool, True],
|
| 188 | 188 |
'remote_control': [opt_bool, False, _('If checked, Gajim can be controlled remotely using gajim-remote.'), True],
|
| 189 | 189 |
'outgoing_chat_state_notifications': [opt_str, 'all', _('Sent chat state notifications. Can be one of all, composing_only, disabled.')],
|
| 190 |
- 'displayed_chat_state_notifications': [opt_str, 'all', _('Displayed chat state notifications in chat windows. Can be one of all, composing_only, disabled.')],
|
|
| 191 | 190 |
'autodetect_browser_mailer': [opt_bool, True, '', True],
|
| 192 | 191 |
'print_ichat_every_foo_minutes': [opt_int, 5, _('When not printing time for every message (print_time==sometimes), print it every x minutes.')],
|
| 193 | 192 |
'confirm_close_muc': [opt_bool, True, _('Ask before closing a group chat tab/window.')],
|
| ... | ... | @@ -296,6 +295,9 @@ class Config: |
| 296 | 295 |
'public_room_sync_threshold': [opt_int, 1, _('Maximum history in days we request from a public room archive. 0: As much as possible')],
|
| 297 | 296 |
'private_room_sync_threshold': [opt_int, 0, _('Maximum history in days we request from a private room archive. 0: As much as possible')],
|
| 298 | 297 |
'show_subject_on_join': [opt_bool, True, _('If the room subject is shown in chat on join')],
|
| 298 |
+ 'show_chatstate_in_roster': [opt_bool, True, _('If the contact row is colored according to the current chatstate of the contact')],
|
|
| 299 |
+ 'show_chatstate_in_tabs': [opt_bool, True, _('If the tab is colored according to the current chatstate of the contact')],
|
|
| 300 |
+ 'show_chatstate_in_banner': [opt_bool, True, _('Shows a text in the banner that describes the current chatstate of the contact')],
|
|
| 299 | 301 |
}, {}) # type: Tuple[Dict[str, List[Any]], Dict[Any, Any]]
|
| 300 | 302 |
|
| 301 | 303 |
__options_per_key = {
|
| ... | ... | @@ -58,11 +58,6 @@ class Atom(AbstractPEPModule): |
| 58 | 58 |
store_publish = False
|
| 59 | 59 |
_log = log
|
| 60 | 60 |
|
| 61 |
- def __init__(self, con):
|
|
| 62 |
- AbstractPEPModule.__init__(self, con, con.name)
|
|
| 63 |
- |
|
| 64 |
- self.handlers = []
|
|
| 65 |
- |
|
| 66 | 61 |
def _extract_info(self, item):
|
| 67 | 62 |
entry = item.getTag('entry', namespace=nbxmpp.NS_ATOM)
|
| 68 | 63 |
if entry is None:
|
| ... | ... | @@ -153,11 +153,11 @@ class AbstractPEPModule: |
| 153 | 153 |
store_publish = True
|
| 154 | 154 |
_log = log
|
| 155 | 155 |
|
| 156 |
- def __init__(self,
|
|
| 157 |
- con: ConnectionT,
|
|
| 158 |
- account: str) -> None:
|
|
| 159 |
- self._account = account
|
|
| 156 |
+ def __init__(self, con: ConnectionT) -> None:
|
|
| 160 | 157 |
self._con = con
|
| 158 |
+ self._account = con.name
|
|
| 159 |
+ |
|
| 160 |
+ self.handlers = [] # type: List[Tuple[Any, ...]]
|
|
| 161 | 161 |
|
| 162 | 162 |
self._stored_publish = None
|
| 163 | 163 |
|
| ... | ... | @@ -30,9 +30,6 @@ class UserActivityData(AbstractPEPData): |
| 30 | 30 |
|
| 31 | 31 |
type_ = PEPEventType.ACTIVITY
|
| 32 | 32 |
|
| 33 |
- def __init__(self, activity):
|
|
| 34 |
- self.data = activity
|
|
| 35 |
- |
|
| 36 | 33 |
def as_markup_text(self):
|
| 37 | 34 |
pep = self.data
|
| 38 | 35 |
activity = pep['activity']
|
| ... | ... | @@ -62,11 +59,6 @@ class UserActivity(AbstractPEPModule): |
| 62 | 59 |
store_publish = True
|
| 63 | 60 |
_log = log
|
| 64 | 61 |
|
| 65 |
- def __init__(self, con):
|
|
| 66 |
- AbstractPEPModule.__init__(self, con, con.name)
|
|
| 67 |
- |
|
| 68 |
- self.handlers = []
|
|
| 69 |
- |
|
| 70 | 62 |
def _extract_info(self, item):
|
| 71 | 63 |
activity_dict = {}
|
| 72 | 64 |
activity_tag = item.getTag('activity', namespace=self.namespace)
|
| ... | ... | @@ -32,9 +32,6 @@ class UserAvatarData(AbstractPEPData): |
| 32 | 32 |
|
| 33 | 33 |
type_ = PEPEventType.AVATAR
|
| 34 | 34 |
|
| 35 |
- def __init__(self, avatar):
|
|
| 36 |
- self.data = avatar
|
|
| 37 |
- |
|
| 38 | 35 |
|
| 39 | 36 |
class UserAvatar(AbstractPEPModule):
|
| 40 | 37 |
|
| ... | ... | @@ -44,11 +41,6 @@ class UserAvatar(AbstractPEPModule): |
| 44 | 41 |
store_publish = False
|
| 45 | 42 |
_log = log
|
| 46 | 43 |
|
| 47 |
- def __init__(self, con):
|
|
| 48 |
- AbstractPEPModule.__init__(self, con, con.name)
|
|
| 49 |
- |
|
| 50 |
- self.handlers = []
|
|
| 51 |
- |
|
| 52 | 44 |
def get_pubsub_avatar(self, jid, item_id):
|
| 53 | 45 |
log.info('Request: %s %s', jid, item_id)
|
| 54 | 46 |
self._con.get_module('PubSub').send_pb_retrieve(
|
| ... | ... | @@ -30,11 +30,6 @@ class UserLocationData(AbstractPEPData): |
| 30 | 30 |
|
| 31 | 31 |
type_ = PEPEventType.LOCATION
|
| 32 | 32 |
|
| 33 |
- def __init__(self, location):
|
|
| 34 |
- # set_location plugin uses self._pep_specific_data
|
|
| 35 |
- self._pep_specific_data = location
|
|
| 36 |
- self.data = location
|
|
| 37 |
- |
|
| 38 | 33 |
def as_markup_text(self):
|
| 39 | 34 |
location = self.data
|
| 40 | 35 |
location_string = ''
|
| ... | ... | @@ -58,11 +53,6 @@ class UserLocation(AbstractPEPModule): |
| 58 | 53 |
store_publish = True
|
| 59 | 54 |
_log = log
|
| 60 | 55 |
|
| 61 |
- def __init__(self, con):
|
|
| 62 |
- AbstractPEPModule.__init__(self, con, con.name)
|
|
| 63 |
- |
|
| 64 |
- self.handlers = []
|
|
| 65 |
- |
|
| 66 | 56 |
def _extract_info(self, item):
|
| 67 | 57 |
location_dict = {}
|
| 68 | 58 |
location_tag = item.getTag('geoloc', namespace=nbxmpp.NS_LOCATION)
|
| ... | ... | @@ -37,9 +37,6 @@ class UserMoodData(AbstractPEPData): |
| 37 | 37 |
|
| 38 | 38 |
type_ = PEPEventType.MOOD
|
| 39 | 39 |
|
| 40 |
- def __init__(self, mood: Optional[Dict[str, str]]) -> None:
|
|
| 41 |
- self.data = mood
|
|
| 42 |
- |
|
| 43 | 40 |
def as_markup_text(self) -> str:
|
| 44 | 41 |
if self.data is None:
|
| 45 | 42 |
return ''
|
| ... | ... | @@ -65,11 +62,6 @@ class UserMood(AbstractPEPModule): |
| 65 | 62 |
store_publish = True
|
| 66 | 63 |
_log = log
|
| 67 | 64 |
|
| 68 |
- def __init__(self, con: ConnectionT) -> None:
|
|
| 69 |
- AbstractPEPModule.__init__(self, con, con.name)
|
|
| 70 |
- |
|
| 71 |
- self.handlers = [] # type: List[Tuple[Any, ...]]
|
|
| 72 |
- |
|
| 73 | 65 |
def _extract_info(self, item: nbxmpp.Node) -> Optional[Dict[str, str]]:
|
| 74 | 66 |
mood_dict = {}
|
| 75 | 67 |
mood_tag = item.getTag('mood', namespace=nbxmpp.NS_MOOD)
|
| ... | ... | @@ -36,9 +36,6 @@ class UserNicknameData(AbstractPEPData): |
| 36 | 36 |
|
| 37 | 37 |
type_ = PEPEventType.NICKNAME
|
| 38 | 38 |
|
| 39 |
- def __init__(self, nickname: Optional[str]) -> None:
|
|
| 40 |
- self.data = nickname
|
|
| 41 |
- |
|
| 42 | 39 |
def get_nick(self) -> str:
|
| 43 | 40 |
return self.data or ''
|
| 44 | 41 |
|
| ... | ... | @@ -51,11 +48,6 @@ class UserNickname(AbstractPEPModule): |
| 51 | 48 |
store_publish = True
|
| 52 | 49 |
_log = log
|
| 53 | 50 |
|
| 54 |
- def __init__(self, con: ConnectionT) -> None:
|
|
| 55 |
- AbstractPEPModule.__init__(self, con, con.name)
|
|
| 56 |
- |
|
| 57 |
- self.handlers = [] # type: List[Tuple[Any, ...]]
|
|
| 58 |
- |
|
| 59 | 51 |
def _extract_info(self, item: nbxmpp.Node) -> Optional[str]:
|
| 60 | 52 |
nick = ''
|
| 61 | 53 |
child = item.getTag('nick', namespace=nbxmpp.NS_NICK)
|
| ... | ... | @@ -39,9 +39,6 @@ class UserTuneData(AbstractPEPData): |
| 39 | 39 |
|
| 40 | 40 |
type_ = PEPEventType.TUNE
|
| 41 | 41 |
|
| 42 |
- def __init__(self, tune: Optional[Dict[str, str]]) -> None:
|
|
| 43 |
- self.data = tune
|
|
| 44 |
- |
|
| 45 | 42 |
def as_markup_text(self) -> str:
|
| 46 | 43 |
if self.data is None:
|
| 47 | 44 |
return ''
|
| ... | ... | @@ -72,11 +69,6 @@ class UserTune(AbstractPEPModule): |
| 72 | 69 |
store_publish = True
|
| 73 | 70 |
_log = log
|
| 74 | 71 |
|
| 75 |
- def __init__(self, con: ConnectionT) -> None:
|
|
| 76 |
- AbstractPEPModule.__init__(self, con, con.name)
|
|
| 77 |
- |
|
| 78 |
- self.handlers = [] # type: List[Tuple[Any, ...]]
|
|
| 79 |
- |
|
| 80 | 72 |
def _extract_info(self, item: nbxmpp.Node) -> Optional[Dict[str, str]]:
|
| 81 | 73 |
tune_dict = {}
|
| 82 | 74 |
tune_tag = item.getTag('tune', namespace=self.namespace)
|
| ... | ... | @@ -737,49 +737,107 @@ |
| 737 | 737 |
<property name="top_attach">0</property>
|
| 738 | 738 |
</packing>
|
| 739 | 739 |
</child>
|
| 740 |
+ </object>
|
|
| 741 |
+ <packing>
|
|
| 742 |
+ <property name="expand">False</property>
|
|
| 743 |
+ <property name="fill">True</property>
|
|
| 744 |
+ <property name="position">5</property>
|
|
| 745 |
+ </packing>
|
|
| 746 |
+ </child>
|
|
| 747 |
+ </object>
|
|
| 748 |
+ </child>
|
|
| 749 |
+ <child type="label">
|
|
| 750 |
+ <object class="GtkLabel">
|
|
| 751 |
+ <property name="visible">True</property>
|
|
| 752 |
+ <property name="can_focus">False</property>
|
|
| 753 |
+ <property name="label" translatable="yes">Chat Settings</property>
|
|
| 754 |
+ <property name="use_markup">True</property>
|
|
| 755 |
+ <style>
|
|
| 756 |
+ <class name="bold"/>
|
|
| 757 |
+ <class name="margin-top6"/>
|
|
| 758 |
+ </style>
|
|
| 759 |
+ </object>
|
|
| 760 |
+ </child>
|
|
| 761 |
+ </object>
|
|
| 762 |
+ <packing>
|
|
| 763 |
+ <property name="expand">False</property>
|
|
| 764 |
+ <property name="fill">True</property>
|
|
| 765 |
+ <property name="position">0</property>
|
|
| 766 |
+ </packing>
|
|
| 767 |
+ </child>
|
|
| 768 |
+ <child>
|
|
| 769 |
+ <object class="GtkFrame">
|
|
| 770 |
+ <property name="visible">True</property>
|
|
| 771 |
+ <property name="can_focus">False</property>
|
|
| 772 |
+ <property name="label_xalign">0</property>
|
|
| 773 |
+ <property name="shadow_type">none</property>
|
|
| 774 |
+ <child>
|
|
| 775 |
+ <object class="GtkAlignment">
|
|
| 776 |
+ <property name="visible">True</property>
|
|
| 777 |
+ <property name="can_focus">False</property>
|
|
| 778 |
+ <property name="xalign">0</property>
|
|
| 779 |
+ <child>
|
|
| 780 |
+ <object class="GtkBox">
|
|
| 781 |
+ <property name="visible">True</property>
|
|
| 782 |
+ <property name="can_focus">False</property>
|
|
| 783 |
+ <property name="margin_top">6</property>
|
|
| 784 |
+ <property name="orientation">vertical</property>
|
|
| 785 |
+ <property name="spacing">6</property>
|
|
| 740 | 786 |
<child>
|
| 741 |
- <object class="GtkLabel">
|
|
| 787 |
+ <object class="GtkCheckButton" id="show_chatstate_in_tabs">
|
|
| 788 |
+ <property name="label" translatable="yes">Show chatstate in tabs</property>
|
|
| 742 | 789 |
<property name="visible">True</property>
|
| 743 |
- <property name="can_focus">False</property>
|
|
| 744 |
- <property name="tooltip_text" translatable="yes">Gajim can send and receive meta-information related to a conversation you may have with a contact. Here you can specify which chatstates you want to display in chat windows.</property>
|
|
| 745 |
- <property name="halign">end</property>
|
|
| 746 |
- <property name="label" translatable="yes">_Display chat state notifications</property>
|
|
| 790 |
+ <property name="can_focus">True</property>
|
|
| 791 |
+ <property name="receives_default">False</property>
|
|
| 792 |
+ <property name="tooltip_text" translatable="yes">If checked, the tab will be colored according to the current chatstate of the contact</property>
|
|
| 793 |
+ <property name="halign">start</property>
|
|
| 747 | 794 |
<property name="use_underline">True</property>
|
| 748 |
- <property name="justify">right</property>
|
|
| 749 |
- <property name="mnemonic_widget">displayed_chat_states_combobox</property>
|
|
| 750 |
- <style>
|
|
| 751 |
- <class name="dim-label"/>
|
|
| 752 |
- </style>
|
|
| 795 |
+ <property name="draw_indicator">True</property>
|
|
| 796 |
+ <signal name="toggled" handler="on_show_chatstate_in_tabs_toggled" swapped="no"/>
|
|
| 753 | 797 |
</object>
|
| 754 | 798 |
<packing>
|
| 755 |
- <property name="left_attach">0</property>
|
|
| 756 |
- <property name="top_attach">1</property>
|
|
| 799 |
+ <property name="expand">False</property>
|
|
| 800 |
+ <property name="fill">True</property>
|
|
| 801 |
+ <property name="position">0</property>
|
|
| 757 | 802 |
</packing>
|
| 758 | 803 |
</child>
|
| 759 | 804 |
<child>
|
| 760 |
- <object class="GtkComboBox" id="displayed_chat_states_combobox">
|
|
| 805 |
+ <object class="GtkCheckButton" id="show_chatstate_in_roster">
|
|
| 806 |
+ <property name="label" translatable="yes">Show chatstate in roster</property>
|
|
| 761 | 807 |
<property name="visible">True</property>
|
| 762 |
- <property name="can_focus">False</property>
|
|
| 763 |
- <property name="model">display_chat_state_notifications_liststore</property>
|
|
| 764 |
- <signal name="changed" handler="on_displayed_chat_states_combobox_changed" swapped="no"/>
|
|
| 765 |
- <child>
|
|
| 766 |
- <object class="GtkCellRendererText"/>
|
|
| 767 |
- <attributes>
|
|
| 768 |
- <attribute name="text">0</attribute>
|
|
| 769 |
- </attributes>
|
|
| 770 |
- </child>
|
|
| 808 |
+ <property name="can_focus">True</property>
|
|
| 809 |
+ <property name="receives_default">False</property>
|
|
| 810 |
+ <property name="tooltip_text" translatable="yes">If checked, the contact row will be colored according to the current chatstate of the contact</property>
|
|
| 811 |
+ <property name="halign">start</property>
|
|
| 812 |
+ <property name="use_underline">True</property>
|
|
| 813 |
+ <property name="draw_indicator">True</property>
|
|
| 814 |
+ <signal name="toggled" handler="on_show_chatstate_in_roster_toggled" swapped="no"/>
|
|
| 771 | 815 |
</object>
|
| 772 | 816 |
<packing>
|
| 773 |
- <property name="left_attach">1</property>
|
|
| 774 |
- <property name="top_attach">1</property>
|
|
| 817 |
+ <property name="expand">False</property>
|
|
| 818 |
+ <property name="fill">True</property>
|
|
| 819 |
+ <property name="position">1</property>
|
|
| 820 |
+ </packing>
|
|
| 821 |
+ </child>
|
|
| 822 |
+ <child>
|
|
| 823 |
+ <object class="GtkCheckButton" id="show_chatstate_in_banner">
|
|
| 824 |
+ <property name="label" translatable="yes">Show chatstate in banner</property>
|
|
| 825 |
+ <property name="visible">True</property>
|
|
| 826 |
+ <property name="can_focus">True</property>
|
|
| 827 |
+ <property name="receives_default">False</property>
|
|
| 828 |
+ <property name="tooltip_text" translatable="yes">If checked, a desciption of the contacts current chatstate is shown in the banner</property>
|
|
| 829 |
+ <property name="halign">start</property>
|
|
| 830 |
+ <property name="use_underline">True</property>
|
|
| 831 |
+ <property name="draw_indicator">True</property>
|
|
| 832 |
+ <signal name="toggled" handler="on_show_chatstate_in_banner_toggled" swapped="no"/>
|
|
| 833 |
+ </object>
|
|
| 834 |
+ <packing>
|
|
| 835 |
+ <property name="expand">False</property>
|
|
| 836 |
+ <property name="fill">True</property>
|
|
| 837 |
+ <property name="position">2</property>
|
|
| 775 | 838 |
</packing>
|
| 776 | 839 |
</child>
|
| 777 | 840 |
</object>
|
| 778 |
- <packing>
|
|
| 779 |
- <property name="expand">False</property>
|
|
| 780 |
- <property name="fill">True</property>
|
|
| 781 |
- <property name="position">5</property>
|
|
| 782 |
- </packing>
|
|
| 783 | 841 |
</child>
|
| 784 | 842 |
</object>
|
| 785 | 843 |
</child>
|
| ... | ... | @@ -787,8 +845,7 @@ |
| 787 | 845 |
<object class="GtkLabel">
|
| 788 | 846 |
<property name="visible">True</property>
|
| 789 | 847 |
<property name="can_focus">False</property>
|
| 790 |
- <property name="label" translatable="yes">Chat Settings</property>
|
|
| 791 |
- <property name="use_markup">True</property>
|
|
| 848 |
+ <property name="label" translatable="yes">Chatstate</property>
|
|
| 792 | 849 |
<style>
|
| 793 | 850 |
<class name="bold"/>
|
| 794 | 851 |
<class name="margin-top6"/>
|
| ... | ... | @@ -799,7 +856,7 @@ |
| 799 | 856 |
<packing>
|
| 800 | 857 |
<property name="expand">False</property>
|
| 801 | 858 |
<property name="fill">True</property>
|
| 802 |
- <property name="position">0</property>
|
|
| 859 |
+ <property name="position">1</property>
|
|
| 803 | 860 |
</packing>
|
| 804 | 861 |
</child>
|
| 805 | 862 |
</object>
|
| ... | ... | @@ -15,4 +15,16 @@ |
| 15 | 15 |
}
|
| 16 | 16 |
.gajim-status-message {
|
| 17 | 17 |
color: rgb(115, 210, 22)
|
| 18 |
+ }
|
|
| 19 |
+.gajim-state-composing {
|
|
| 20 |
+ color: rgb(0, 139, 0)
|
|
| 21 |
+ }
|
|
| 22 |
+.gajim-state-inactive {
|
|
| 23 |
+ color: rgb(158, 158, 158)
|
|
| 24 |
+ }
|
|
| 25 |
+.gajim-state-gone {
|
|
| 26 |
+ color: rgb(128, 128, 128)
|
|
| 27 |
+ }
|
|
| 28 |
+.gajim-state-paused {
|
|
| 29 |
+ color: rgb(0, 0, 205)
|
|
| 18 | 30 |
}
|
| \ No newline at end of file |
| 1 |
-.gajim-incoming-nickname {
color: rgb(164, 0, 0)
}.gajim-outgoing-nickname {
color: rgb(52, 101, 164)
}.gajim-outgoing-message-text {
color: rgb(85, 87, 83)
}.gajim-status-message {
color: rgb(78, 154, 6)
}.gajim-url {
color: rgb(32, 74, 135)
}.gajim-highlight-message {
color: rgb(255, 128, 128)
}.gajim-restored-message {
color: rgb(85, 87, 83)
}.gajim-roster-disconnected {
background: rgb(171 ,97 ,97)
}.gajim-roster-connected {
background: rgb(173, 195, 198)
}
|
|
| \ No newline at end of file | ||
| 1 |
+.gajim-incoming-nickname {
color: rgb(164, 0, 0)
}.gajim-outgoing-nickname {
color: rgb(52, 101, 164)
}.gajim-outgoing-message-text {
color: rgb(85, 87, 83)
}.gajim-status-message {
color: rgb(78, 154, 6)
}.gajim-url {
color: rgb(32, 74, 135)
}.gajim-highlight-message {
color: rgb(255, 128, 128)
}.gajim-restored-message {
color: rgb(85, 87, 83)
}.gajim-roster-disconnected {
background: rgb(171 ,97 ,97)
}.gajim-roster-connected {
background: rgb(173, 195, 198)
}.gajim-state-composing {
color: rgb(0, 139, 0)
}.gajim-state-inactive {
color: rgb(158, 158, 158)
}.gajim-state-gone {
color: rgb(128, 128, 128)
}.gajim-state-paused {
color: rgb(0, 0, 205)
}
|
|
| \ No newline at end of file |
| 1 | 1 |
/* Gajim Application CSS File */
|
| 2 | 2 |
|
| 3 |
-.gajim-state-composing {
|
|
| 4 |
- color: rgb(0, 139, 0)
|
|
| 5 |
- }
|
|
| 6 |
-.gajim-state-inactive {
|
|
| 7 |
- color: rgb(158, 158, 158)
|
|
| 8 |
- }
|
|
| 9 |
-.gajim-state-gone {
|
|
| 10 |
- color: rgb(128, 128, 128)
|
|
| 11 |
- }
|
|
| 12 |
-.gajim-state-paused {
|
|
| 13 |
- color: rgb(0, 0, 205)
|
|
| 14 |
- }
|
|
| 15 | 3 |
.gajim-msg-correcting text {
|
| 16 | 4 |
background: rgb(238, 232, 170)
|
| 17 | 5 |
}
|
| ... | ... | @@ -157,13 +157,14 @@ class Preferences(Gtk.ApplicationWindow): |
| 157 | 157 |
self._ui.print_status_in_muc_combobox.set_active(2)
|
| 158 | 158 |
|
| 159 | 159 |
# Displayed chat state notifications
|
| 160 |
- st = app.config.get('displayed_chat_state_notifications')
|
|
| 161 |
- if st == 'all':
|
|
| 162 |
- self._ui.displayed_chat_states_combobox.set_active(0)
|
|
| 163 |
- elif st == 'composing_only':
|
|
| 164 |
- self._ui.displayed_chat_states_combobox.set_active(1)
|
|
| 165 |
- else: # disabled
|
|
| 166 |
- self._ui.displayed_chat_states_combobox.set_active(2)
|
|
| 160 |
+ st = app.config.get('show_chatstate_in_tabs')
|
|
| 161 |
+ self._ui.show_chatstate_in_tabs.set_active(st)
|
|
| 162 |
+ |
|
| 163 |
+ st = app.config.get('show_chatstate_in_roster')
|
|
| 164 |
+ self._ui.show_chatstate_in_roster.set_active(st)
|
|
| 165 |
+ |
|
| 166 |
+ st = app.config.get('show_chatstate_in_banner')
|
|
| 167 |
+ self._ui.show_chatstate_in_banner.set_active(st)
|
|
| 167 | 168 |
|
| 168 | 169 |
### Notifications tab ###
|
| 169 | 170 |
## Visual Notifications
|
| ... | ... | @@ -612,15 +613,14 @@ class Preferences(Gtk.ApplicationWindow): |
| 612 | 613 |
else: # in_and_out
|
| 613 | 614 |
app.config.set('print_status_in_muc', 'in_and_out')
|
| 614 | 615 |
|
| 615 |
- def on_displayed_chat_states_combobox_changed(self, widget):
|
|
| 616 |
- active = widget.get_active()
|
|
| 617 |
- if active == 0: # all
|
|
| 618 |
- app.config.set('displayed_chat_state_notifications', 'all')
|
|
| 619 |
- elif active == 1: # only composing
|
|
| 620 |
- app.config.set('displayed_chat_state_notifications',
|
|
| 621 |
- 'composing_only')
|
|
| 622 |
- else: # disabled
|
|
| 623 |
- app.config.set('displayed_chat_state_notifications', 'disabled')
|
|
| 616 |
+ def on_show_chatstate_in_tabs_toggled(self, widget):
|
|
| 617 |
+ self.on_checkbutton_toggled(widget, 'show_chatstate_in_tabs')
|
|
| 618 |
+ |
|
| 619 |
+ def on_show_chatstate_in_roster_toggled(self, widget):
|
|
| 620 |
+ self.on_checkbutton_toggled(widget, 'show_chatstate_in_roster')
|
|
| 621 |
+ |
|
| 622 |
+ def on_show_chatstate_in_banner_toggled(self, widget):
|
|
| 623 |
+ self.on_checkbutton_toggled(widget, 'show_chatstate_in_banner')
|
|
| 624 | 624 |
|
| 625 | 625 |
### Notifications tab ###
|
| 626 | 626 |
def on_systray_combobox_changed(self, widget):
|
| ... | ... | @@ -652,7 +652,9 @@ class MessageWindow: |
| 652 | 652 |
if isinstance(ctrl, ChatControl):
|
| 653 | 653 |
tab_label_str = ctrl.get_tab_label()
|
| 654 | 654 |
# Set Label Color
|
| 655 |
- gtkgui_helpers.add_css_class(nick_label, chatstate, 'gajim-state-')
|
|
| 655 |
+ if app.config.get('show_chatstate_in_tabs'):
|
|
| 656 |
+ gtkgui_helpers.add_css_class(
|
|
| 657 |
+ nick_label, chatstate, 'gajim-state-')
|
|
| 656 | 658 |
else:
|
| 657 | 659 |
tab_label_str, color = ctrl.get_tab_label(chatstate)
|
| 658 | 660 |
# Set Label Color
|
| ... | ... | @@ -4639,6 +4639,11 @@ class RosterWindow: |
| 4639 | 4639 |
|
| 4640 | 4640 |
gtkgui_helpers.set_unset_urgency_hint(self.window, nb_unread)
|
| 4641 | 4641 |
|
| 4642 |
+ def _nec_chatstate_received(self, event):
|
|
| 4643 |
+ if event.contact.is_gc_contact or event.contact.is_pm_contact:
|
|
| 4644 |
+ return
|
|
| 4645 |
+ self.draw_contact(event.contact.jid, event.account)
|
|
| 4646 |
+ |
|
| 4642 | 4647 |
def _style_changed(self, *args):
|
| 4643 | 4648 |
self.change_roster_style(None)
|
| 4644 | 4649 |
|
| ... | ... | @@ -4741,17 +4746,22 @@ class RosterWindow: |
| 4741 | 4746 |
return
|
| 4742 | 4747 |
jid = model[titer][Column.JID]
|
| 4743 | 4748 |
account = model[titer][Column.ACCOUNT]
|
| 4749 |
+ |
|
| 4744 | 4750 |
color = None
|
| 4745 | 4751 |
if type_ == 'groupchat':
|
| 4746 |
- ctrl = app.interface.minimized_controls[account].get(jid,
|
|
| 4747 |
- None)
|
|
| 4752 |
+ ctrl = app.interface.minimized_controls[account].get(jid, None)
|
|
| 4748 | 4753 |
if ctrl and ctrl.attention_flag:
|
| 4749 | 4754 |
color = app.css_config.get_value(
|
| 4750 | 4755 |
'.state_muc_directed_msg_color', StyleAttr.COLOR)
|
| 4751 |
- renderer.set_property('foreground', color)
|
|
| 4752 |
- if not color:
|
|
| 4753 |
- color = app.css_config.get_value('.gajim-contact-row', StyleAttr.COLOR)
|
|
| 4754 |
- renderer.set_property('foreground', color)
|
|
| 4756 |
+ elif app.config.get('show_chatstate_in_roster'):
|
|
| 4757 |
+ chatstate = app.contacts.get_combined_chatstate(account, jid)
|
|
| 4758 |
+ if chatstate not in (None, 'active'):
|
|
| 4759 |
+ color = app.css_config.get_value(
|
|
| 4760 |
+ '.gajim-state-%s' % chatstate, StyleAttr.COLOR)
|
|
| 4761 |
+ else:
|
|
| 4762 |
+ color = app.css_config.get_value(
|
|
| 4763 |
+ '.gajim-contact-row', StyleAttr.COLOR)
|
|
| 4764 |
+ renderer.set_property('foreground', color)
|
|
| 4755 | 4765 |
|
| 4756 | 4766 |
self._set_contact_row_background_color(renderer, jid, account)
|
| 4757 | 4767 |
desc = app.css_config.get_font('.gajim-contact-row')
|
| ... | ... | @@ -5886,3 +5896,5 @@ class RosterWindow: |
| 5886 | 5896 |
self._nec_blocking)
|
| 5887 | 5897 |
app.ged.register_event_handler('style-changed', ged.GUI1,
|
| 5888 | 5898 |
self._style_changed)
|
| 5899 |
+ app.ged.register_event_handler('chatstate-received', ged.GUI1,
|
|
| 5900 |
+ self._nec_chatstate_received)
|
| ... | ... | @@ -75,11 +75,6 @@ function install_deps { |
| 75 | 75 |
https://gajim.org/downloads/snap/win/build/mingw-w64-"${ARCH}"-glib2-2.56.2-1-any.pkg.tar.xz
|
| 76 | 76 |
build_pacman --noconfirm -U "${BUILD_ROOT}"/mingw-w64-"${ARCH}"-glib2-2.56.2-1-any.pkg.tar.xz
|
| 77 | 77 |
|
| 78 |
- # Fix broken cryptography package
|
|
| 79 |
- curl -o "${BUILD_ROOT}"/mingw-w64-"${ARCH}"-python3-cryptography-2.3.1-1-any.pkg.tar.xz \
|
|
| 80 |
- https://gajim.org/downloads/snap/win/build/mingw-w64-"${ARCH}"-python3-cryptography-2.3.1-1-any.pkg.tar.xz
|
|
| 81 |
- build_pacman --noconfirm -U "${BUILD_ROOT}"/mingw-w64-"${ARCH}"-python3-cryptography-2.3.1-1-any.pkg.tar.xz
|
|
| 82 |
- |
|
| 83 | 78 |
build_pacman --noconfirm -S mingw-w64-"${ARCH}"-gtk3 mingw-w64-"${ARCH}"-"${PYTHON_ID}" \
|
| 84 | 79 |
mingw-w64-"${ARCH}"-"${PYTHON_ID}"-gobject \
|
| 85 | 80 |
mingw-w64-"${ARCH}"-"${PYTHON_ID}"-pip \
|