2
# -*- coding: utf-8; tab-width: 4; mode: python -*-
3
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
4
# vi: set ft=python sts=4 ts=4 sw=4 noet
6
# Copyright 2012 Shannon Black
9
# Christian Rupp <christian@r-k-r.de>
11
# This program is free software: you can redistribute it and/or modify it
12
# under the terms of either or both of the following licenses:
14
# 1) the GNU Lesser General Public License version 3, as published by the
15
# Free Software Foundation; and/or
16
# 2) the GNU Lesser General Public License version 2.1, as published by
17
# the Free Software Foundation.
19
# This program is distributed in the hope that it will be useful, but
20
# WITHOUT ANY WARRANTY; without even the implied warranties of
21
# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
22
# PURPOSE. See the applicable version of the GNU Lesser General Public
23
# License for more details.
25
# You should have received a copy of both the GNU Lesser General Public
26
# License version 3 and version 2.1 along with this program. If not, see
27
# <http://www.gnu.org/licenses/>
30
from gi.repository import Gtk, Gio
34
BASE_KEY = "apps.skype-wrapper"
35
setting = Gio.Settings.new(BASE_KEY)
37
class DialogAdvanced(Gtk.Dialog):
39
def __init__(self, parent):
40
Gtk.Dialog.__init__(self, "Remove sni-qt", parent, 0,(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,Gtk.STOCK_OK, Gtk.ResponseType.OK))
42
self.set_default_size(300, 100)
44
label = Gtk.Label("This will remove sni-qt. The Skype-Icon will not be shown in the panel any longer. This may also affects other applications. To revert the change reinstall sni-qt in the software-center")
45
label.set_line_wrap(True)
46
box = self.get_content_area()
50
class uisettings(Gtk.Window):
51
def switch(self, table, label, option):
53
gtk_label = Gtk.Label ( label )
54
gtk_label.set_alignment(0.0,0.5)
56
table.attach ( gtk_label, 0, 3, self.row, self.row+1, xpadding=10, ypadding = 2 )
57
gtk_switch = Gtk.Switch()
58
table.attach ( gtk_switch, 3, 4, self.row, self.row+1, xpadding=10, ypadding = 2 )
59
setting.bind( option, gtk_switch, "active", Gio.SettingsBindFlags.DEFAULT )
62
Gtk.Window.__init__(self, title="Skype Wrapper Options")
63
table = Gtk.Table(2, 4, True)
64
table.set_row_spacings(5)
65
table.set_col_spacings(1)
70
self.switch( table, "Notify when someone goes on or offline", "notify-on-useronlinestatuschange")
71
self.switch( table, "Notify when you recieve a message","notify-on-messagerecieve")
72
self.switch( table, "Notify about all online contacts during startup", "notify-on-initializing")
73
self.switch( table, "Display avatars next to indicator message", "display-indicator-avatars")
74
self.switch( table, "Display avatars in the notifications", "display-notification-avatars")
75
self.switch( table, "Notify on incoming File Transfer", "notify-on-incoming-filetransfer" )
76
self.switch( table, "Notify on outgoing File Transfer", "notify-on-outgoing-filetransfer" )
77
self.switch( table, "Show outgoing File Transfer progress in the Launcher", "show-outgoing-file-progress" )
78
self.switch( table, "Show incoming File Transfer progress in the Launcher", "show-incoming-file-progress" )
79
self.switch( table, "Use the global online status of the system", "use-global-status" )
80
self.switch( table, "Toggle music playback before and after a call", "control-music-player" )
81
self.switch( table, "Restore the volume to the level prior the call", "restore-volume" )
83
gtk_btn_adv = Gtk.Button("Remove the panel icon")
84
gtk_btn = Gtk.Button("Close")
85
gtk_btn.connect("clicked", Gtk.main_quit)
86
gtk_btn_adv.connect("clicked", self.on_advanced_clicked)
89
table.attach ( gtk_btn, 3, 4, self.row, self.row+1,xpadding=10, ypadding = 2 )
90
table.attach ( gtk_btn_adv, 0, 2, self.row, self.row+1,xpadding=10, ypadding = 2 )
94
def on_advanced_clicked(self, widget):
95
dialog = DialogAdvanced(self)
96
response = dialog.run()
98
if response == Gtk.ResponseType.OK:
99
subprocess.call(['gksudo','python /usr/share/skype-wrapper/uninstallsni.py'])
102
elif response == Gtk.ResponseType.CANCEL:
103
print "The Cancel button was clicked"
109
win.set_border_width(10)
110
win.connect("delete-event", Gtk.main_quit)
111
win.connect("destroy", Gtk.main_quit)