Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evert Mouw
gajim-plugins
Commits
c97e45f2
Commit
c97e45f2
authored
14 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
ftp manager plugin added to the main repository
parent
714ba627
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ftp_manager/ftp_manager.py
+19
-1
19 additions, 1 deletion
ftp_manager/ftp_manager.py
ubuntu_integration/plugin.py
+22
-21
22 additions, 21 deletions
ubuntu_integration/plugin.py
with
41 additions
and
22 deletions
ftp_manager/ftp_manager.py
+
19
−
1
View file @
c97e45f2
# -*- coding: utf-8 -*-
#
## plugins/ftp_manager/ftp_manager.py
##
## Copyright (C) 2010 Denis Fomin <fominde AT gmail.com>
##
## This file is part of Gajim.
##
## Gajim is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; version 3 only.
##
## Gajim is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
import
gtk
import
pango
import
gobject
...
...
This diff is collapsed.
Click to expand it.
ubuntu_integration/plugin.py
+
22
−
21
View file @
c97e45f2
...
...
@@ -44,24 +44,28 @@ class UbuntuIntegrationPlugin(GajimPlugin):
"""
Class for Messaging Menu and Me Menu.
"""
@log_calls
(
"
UbuntuIntegrationPlugin
"
)
def
init
(
self
):
"""
Does nothing.
"""
self
.
config_dialog
=
None
@log_calls
(
"
UbuntuIntegrationPlugin
"
)
def
activate
(
self
):
"""
Displays gajim in the Messaging Menu.
"""
# {(account, jid): (indicator, [event, ...]), ...}
self
.
events
=
{}
self
.
server
=
None
if
not
HAS_INDICATE
:
raise
GajimPluginException
(
"
python-indicate is missing!
"
)
if
not
HAS_PYXDG
:
raise
GajimPluginException
(
"
python-xdg is missing!
"
)
self
.
server
=
indicate
.
indicate_server_ref_default
()
self
.
server
.
set_type
(
"
message.im
"
)
dfile
=
""
...
...
@@ -72,13 +76,10 @@ class UbuntuIntegrationPlugin(GajimPlugin):
raise
GajimPluginException
(
"
Can
'
t locate gajim.desktop!
"
)
self
.
server
.
set_desktop_file
(
dfile
)
self
.
server
.
show
()
# {(account, jid): (indicator, [event, ...]), ...}
self
.
events
=
{}
gajim
.
events
.
event_added_subscribe
(
self
.
on_event_added
)
gajim
.
events
.
event_removed_subscribe
(
self
.
on_event_removed
)
@log_calls
(
"
UbuntuIntegrationPlugin
"
)
def
deactivate
(
self
):
"""
...
...
@@ -86,14 +87,14 @@ class UbuntuIntegrationPlugin(GajimPlugin):
"""
gajim
.
events
.
event_added_unsubscribe
(
self
.
on_event_added
)
gajim
.
events
.
event_removed_unsubscribe
(
self
.
on_event_removed
)
for
(
_
,
event
)
in
self
.
events
:
event
[
0
].
hide
()
self
.
server
.
hide
()
del
self
.
server
del
self
.
events
def
on_indicator_activate
(
self
,
indicator
,
_
):
"""
Forwards the action to gajims event handler.
...
...
@@ -101,20 +102,20 @@ class UbuntuIntegrationPlugin(GajimPlugin):
key
=
indicator
.
key
event
=
self
.
events
[
key
][
1
][
0
]
gajim
.
interface
.
handle_event
(
event
.
account
,
event
.
jid
,
event
.
type_
)
def
on_event_added
(
self
,
event
):
"""
Adds
"
Nickname Time
"
to the Messaging menu.
"""
print
"
----
"
,
event
.
type_
# Basic variables
account
=
event
.
account
jid
=
event
.
jid
when
=
time
.
time
()
contact
=
""
key
=
(
account
,
jid
)
# Check if the event is valid and modify the variables
if
event
.
type_
==
"
chat
"
or
\
event
.
type_
==
"
printed_chat
"
or
\
...
...
@@ -135,9 +136,9 @@ class UbuntuIntegrationPlugin(GajimPlugin):
else
:
print
"
ignored
"
;
return
print
account
,
jid
,
when
,
contact
# Add a new indicator if necessary
if
not
self
.
events
.
has_key
(
key
):
indicator
=
indicate
.
Indicator
()
...
...
@@ -152,11 +153,11 @@ class UbuntuIntegrationPlugin(GajimPlugin):
indicator
.
show
()
indicator
.
key
=
key
self
.
events
[
key
]
=
(
indicator
,
[])
# Prepare the event and save it
event
.
time
=
when
self
.
events
[
key
][
1
].
append
(
event
);
def
on_event_removed
(
self
,
events
):
"""
Goes through the events and removes them from the array and
...
...
@@ -164,13 +165,13 @@ class UbuntuIntegrationPlugin(GajimPlugin):
"""
for
event
in
events
:
print
"
====
"
,
event
.
type_
key
=
(
event
.
account
,
event
.
jid
)
if
self
.
events
.
has_key
(
key
)
and
\
event
in
self
.
events
[
key
][
1
]:
self
.
events
[
key
][
1
].
remove
(
event
)
if
len
(
self
.
events
[
key
][
1
])
==
0
:
# remove indicator
self
.
events
[
key
][
0
].
hide
()
del
self
.
events
[
key
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment