Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

199 lines (160 sloc) 6.249 kB
#
# Copyright 2012 Tomasz Wiszkowski
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import gobject
import gtk
class XfConSettings(gobject.GObject):
__gproperties__ = {
'key-show-hide' : (gobject.TYPE_STRING,
_("Shows / hides the console."),
_("Keyboard shortcut"),
"Pause",
gobject.PARAM_READWRITE),
'key-quit' : (gobject.TYPE_STRING,
_("Quit XfCon."),
_("Keyboard shortcut"),
"<Control><Shift>q",
gobject.PARAM_READWRITE),
'key-new-tab' : (gobject.TYPE_STRING,
_("Open new tab with default view."),
_("Keyboard shortcut"),
"<Control><Shift>t",
gobject.PARAM_READWRITE),
'key-notebook-tab-close' : (gobject.TYPE_STRING,
_("Close current tab."),
_("Keyboard shortcut"),
"<Control><Shift>w",
gobject.PARAM_READWRITE),
'key-notebook-tab-rename' : (gobject.TYPE_STRING,
_("Rename current tab."),
_("Keyboard shortcut"),
"<Control><Shift>r",
gobject.PARAM_READWRITE),
'key-notebook-tab-next' : (gobject.TYPE_STRING,
_("Jump to next tab."),
_("Keyboard shortcut"),
"<Control>Page_Up",
gobject.PARAM_READWRITE),
'key-notebook-tab-previous' : (gobject.TYPE_STRING,
_("Jump to previous tab."),
_("Keyboard shortcut"),
"<Control>Page_Down",
gobject.PARAM_READWRITE),
'key-view-split-vertical' : (gobject.TYPE_STRING,
_("Split view vertically."),
_("Keyboard shortcut"),
"<Control><Alt>v",
gobject.PARAM_READWRITE),
'key-view-split-horizontal' : (gobject.TYPE_STRING,
_("Split view horizontally."),
_("Keyboard shortcut"),
"<Control><Alt>h",
gobject.PARAM_READWRITE),
'key-view-activate-next' : (gobject.TYPE_STRING,
_("Activate next view in split."),
_("Keyboard shortcut"),
"<Control><Alt>Right",
gobject.PARAM_READWRITE),
'key-view-activate-previous' : (gobject.TYPE_STRING,
_("Activate previous view in split."),
_("Keyboard shortcut"),
"<Control><Alt>Left",
gobject.PARAM_READWRITE),
'key-clipboard-copy' : (gobject.TYPE_STRING,
_("Copy selection to clipboard."),
_("Keyboard shortcut"),
"<Control><Shift>c",
gobject.PARAM_READWRITE),
'key-clipboard-paste' : (gobject.TYPE_STRING,
_("Paste clipboard contents."),
_("Keyboard shortcut"),
"<Control><Shift>v",
gobject.PARAM_READWRITE),
# Resolved
'window-follows-mouse': (gobject.TYPE_BOOLEAN,
_("Define if window should be open on same monitor as mouse."),
_("True, if window should be opened on same monitor as mouse."),
False,
gobject.PARAM_READWRITE),
'window-width': (gobject.TYPE_UINT,
_("Window width."),
_("Percentage of screen occupied by window."),
20, 100, 100,
gobject.PARAM_READWRITE),
'window-height': (gobject.TYPE_UINT,
_("Window height."),
_("Percentage of screen occupied by window."),
20, 100, 80,
gobject.PARAM_READWRITE),
'window-animations': (gobject.TYPE_BOOLEAN,
_("Window animations."),
_("Tick to enable window animations."),
False,
gobject.PARAM_READWRITE),
'window-animation-expose-direction': (gtk.DirectionType,
_("Animate position on show/hide."),
_("Direction in which the window will be animated during exposition."),
gtk.DIR_UP,
gobject.PARAM_READWRITE),
'window-animation-expose-alpha': (gobject.TYPE_BOOLEAN,
_("Animate transparency on show/hide."),
_("If set, transparency will be animated during exposition."),
True,
gobject.PARAM_READWRITE),
}
__properties__ = {}
__instance__ = None
def __init__(self):
super(XfConSettings, self).__init__()
if (XfConSettings.__instance__):
raise RuntimeError("Settings already instantiated")
XfConSettings.__instance__ = self
if (self.__properties__ == {}):
for prop in gobject.list_properties(XfConSettings):
self.__properties__[prop.name] = prop.default_value
@classmethod
def Instance(cls):
if not XfConSettings.__instance__:
XfConSettings()
return XfConSettings.__instance__
def do_get_property(self, name):
return self.__properties__[name.name]
def do_set_property(self, name, value):
self.__properties__[name.name] = value
def set_window_follows_mouse(self, status):
self.set_property("window-follows-mouse", status)
def get_window_follows_mouse(self):
return self.get_property("window-follows-mouse")
def set_window_animations(self, status):
self.set_property("window-animations", status)
def get_window_animations(self):
return self.get_property("window-animations")
def set_window_width(self, value):
self.set_property("window-width", int(value))
def get_window_width(self):
return self.get_property("window-width")
def set_window_height(self, value):
self.set_property("window-height", int(value))
def get_window_height(self):
return self.get_property("window-height")
def set_window_animation_expose_direction(self, value):
self.set_property("window-animation-expose-direction", value)
def get_window_animation_expose_direction(self):
return self.get_property("window-animation-expose-direction")
def set_window_animation_expose_alpha(self, value):
self.set_property("window-animation-expose-alpha", value)
def get_window_animation_expose_alpha(self):
return self.get_property("window-animation-expose-alpha")
gobject.type_register(XfConSettings)
Jump to Line
Something went wrong with that request. Please try again.