def __init__(self): parser = argparse.ArgumentParser(description='Cinnamon Screensaver') parser.add_argument('--debug', dest='debug', action='store_true', help='Print out some extra debugging info') parser.add_argument('--disable-locking', dest='lock_disabled', action='store_true', help='Disable the lock screen') parser.add_argument('--version', dest='version', action='store_true', help='Display the current version') parser.add_argument('--no-daemon', dest='no_daemon', action='store_true', help="Deprecated: left for compatibility only - we never become a daemon") args = parser.parse_args() if args.version: print("cinnamon-screensaver %s" % (config.VERSION)) quit() status.LockEnabled = not args.lock_disabled if args.lock_disabled: print("Locking disabled") Gtk.icon_size_register("audio-button", 20, 20) Gtk.Settings.get_default().connect("notify::gtk-theme-name", self.on_theme_changed) self.do_style_overrides() ScreensaverService() Gtk.main()
def __init__(self): parser = argparse.ArgumentParser(description='Cinnamon Screensaver') parser.add_argument('--debug', dest='debug', action='store_true', help='Print out some extra debugging info') parser.add_argument( '--interactive-debug', dest='interactive', action='store_true', help= 'If multiple monitors are in use, only cover one monitor, and launch GtkInspector' ) parser.add_argument('--disable-locking', dest='lock_disabled', action='store_true', help='Disable the lock screen') parser.add_argument('--version', dest='version', action='store_true', help='Display the current version') parser.add_argument( '--no-daemon', dest='no_daemon', action='store_true', help= "Deprecated: left for compatibility only - we never become a daemon" ) args = parser.parse_args() if settings.get_custom_screensaver() != '': print("custom screensaver selected, exiting cinnamon-screensaver.") quit() if args.version: print("cinnamon-screensaver %s" % (config.VERSION)) quit() status.LockEnabled = not args.lock_disabled status.Debug = args.debug status.InteractiveDebug = args.interactive if status.Debug: print("Debug mode active") if args.lock_disabled: print("Locking disabled") from service import ScreensaverService # This is here mainly to allow the notification watcher to have a valid status.Debug value import singletons Gtk.icon_size_register("audio-button", 20, 20) Gtk.Settings.get_default().connect("notify::gtk-theme-name", self.on_theme_changed) self.do_style_overrides() ScreensaverService() Gtk.main()
def init_style_overrides(self): path = os.path.join(config.pkgdatadir, "application.css") prov = Gtk.CssProvider() Gtk.icon_size_register("audio-button", 20, 20) if prov.load_from_path(path): Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default(), prov, 600)
def __init__(self): parser = argparse.ArgumentParser(description='Cinnamon Screensaver') parser.add_argument('--version', dest='version', action='store_true', help='Display the current version') parser.add_argument('--no-daemon', dest='no_daemon', action='store_true', help="Deprecated: left for compatibility only - we never become a daemon") args = parser.parse_args() if args.version: print("cinnamon-screensaver %s" % (config.VERSION)) quit() Gtk.icon_size_register("audio-button", 20, 20) Gtk.Settings.get_default().connect("notify::gtk-theme-name", self.on_theme_changed) self.do_style_overrides() ScreensaverService() Gtk.main()
def __init__(self): parser = argparse.ArgumentParser(description="Cinnamon Screensaver") parser.add_argument("--debug", dest="debug", action="store_true", help="Print out some extra debugging info") parser.add_argument( "--interactive-debug", dest="interactive", action="store_true", help="If multiple monitors are in use, only cover one monitor, and launch GtkInspector", ) parser.add_argument( "--disable-locking", dest="lock_disabled", action="store_true", help="Disable the lock screen" ) parser.add_argument("--version", dest="version", action="store_true", help="Display the current version") parser.add_argument( "--no-daemon", dest="no_daemon", action="store_true", help="Deprecated: left for compatibility only - we never become a daemon", ) args = parser.parse_args() if args.version: print("cinnamon-screensaver %s" % (config.VERSION)) quit() status.LockEnabled = not args.lock_disabled status.Debug = args.debug status.InteractiveDebug = args.interactive if args.lock_disabled: print("Locking disabled") Gtk.icon_size_register("audio-button", 20, 20) Gtk.Settings.get_default().connect("notify::gtk-theme-name", self.on_theme_changed) self.do_style_overrides() ScreensaverService() Gtk.main()
def __init__(self): parser = argparse.ArgumentParser(description='Cinnamon Screensaver') parser.add_argument('--debug', dest='debug', action='store_true', help='Print out some extra debugging info') parser.add_argument('--interactive-debug', dest='interactive', action='store_true', help='If multiple monitors are in use, only cover one monitor, and launch GtkInspector') parser.add_argument('--disable-locking', dest='lock_disabled', action='store_true', help='Disable the lock screen') parser.add_argument('--version', dest='version', action='store_true', help='Display the current version') parser.add_argument('--no-daemon', dest='no_daemon', action='store_true', help="Deprecated: left for compatibility only - we never become a daemon") args = parser.parse_args() if args.version: print("cinnamon-screensaver %s" % (config.VERSION)) quit() status.LockEnabled = not args.lock_disabled status.Debug = args.debug status.InteractiveDebug = args.interactive if status.Debug: print("Debug mode active") if args.lock_disabled: print("Locking disabled") from service import ScreensaverService # This is here mainly to allow the notification watcher to have a valid status.Debug value import singletons Gtk.icon_size_register("audio-button", 20, 20) Gtk.Settings.get_default().connect("notify::gtk-theme-name", self.on_theme_changed) self.do_style_overrides() ScreensaverService() Gtk.main()
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from __future__ import absolute_import, division, print_function, unicode_literals from logging import getLogger, DEBUG as _DEBUG _log = getLogger(__name__) del getLogger from gi.repository import Gtk # # # _LARGE_SIZE = 64 Gtk.IconSize.LARGE = Gtk.icon_size_register('large', _LARGE_SIZE, _LARGE_SIZE) # Gtk.IconSize.XLARGE = Gtk.icon_size_register('x-large', _LARGE_SIZE * 2, _LARGE_SIZE * 2) # print ("menu", int(Gtk.IconSize.MENU), Gtk.icon_size_lookup(Gtk.IconSize.MENU)) # print ("small toolbar", int(Gtk.IconSize.SMALL_TOOLBAR), Gtk.icon_size_lookup(Gtk.IconSize.SMALL_TOOLBAR)) # print ("button", int(Gtk.IconSize.BUTTON), Gtk.icon_size_lookup(Gtk.IconSize.BUTTON)) # print ("large toolbar", int(Gtk.IconSize.LARGE_TOOLBAR), Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR)) # print ("dnd", int(Gtk.IconSize.DND), Gtk.icon_size_lookup(Gtk.IconSize.DND)) # print ("dialog", int(Gtk.IconSize.DIALOG), Gtk.icon_size_lookup(Gtk.IconSize.DIALOG)) TRAY_INIT = 'solaar-init' TRAY_OKAY = 'solaar' TRAY_ATTENTION = 'solaar-attention' def _look_for_application_icons(): import os.path as _path
from panucci.services import ObservableService from panucci.gtk3ui import gtkwidgets as widgets from panucci.gtk3ui import gtkplaylist from panucci.gtk3ui import gtkutil try: import pynotify pynotify.init('Panucci') have_pynotify = True except: have_pynotify = False gtk.icon_size_register('panucci-button', 32, 32) ################################################## # PanucciGUI ################################################## class PanucciGUI(object): """ The object that holds the entire panucci gui """ def __init__(self, settings, filename=None): self.__log = logging.getLogger('panucci.panucci.PanucciGUI') interface.register_gui(self) self.config = settings.config self.playlist = playlist.Playlist(self.config) window = gtk.Window(gtk.WindowType.TOPLEVEL) self.main_window = window
CONFIGMC = os.path.join(CONFIG, "magiccollection") CACHEMC = os.path.join(CACHE, "magiccollection") CACHEMCPIC = os.path.join(CACHEMC, "downloadedPics") CACHEMCPR = os.path.join(CACHEMC, "prices") # we add our folders to paths where GTK is looking for icons Gtk.IconTheme.append_search_path(Gtk.IconTheme.get_default(), os.path.join(PATH_MC, "images", "math")) Gtk.IconTheme.append_search_path( Gtk.IconTheme.get_default(), os.path.join(PATH_MC, "images", "symbolic-mana")) Gtk.IconTheme.append_search_path(Gtk.IconTheme.get_default(), os.path.join(PATH_MC, "images", "icons")) # we add a custom size for gicons Gtk.icon_size_register("150_mana_symbol", 150, 150) Gtk.icon_size_register("100_mana_symbol", 100, 100) Gtk.icon_size_register("12_config_warning", 12, 12) # MC website SITEMC = "http://mirandir.pagesperso-orange.fr/" ### Config var and default values # default values, for english language ext_fr_name = "0" fr_language = "de" as_columns = "name;type;edition;colors" coll_columns = "name;type;edition;colors;nb" decks_columns = "name;type;edition;colors;nb" # default values for specific language
import gettext from gettext import gettext as _ gettext.textdomain('fogger') from gi.repository import GLib, Gtk, Gdk, GdkPixbuf, GObject, Gio # pylint: disable=E0611 import logging logger = logging.getLogger('fogger') from fogger_lib import Window, IconChooserDialog, ConfirmDialog from fogger_lib import FogAppManager from fogger_lib.exceptions import BaseFogAppException from fogger_lib.helpers import get_network_proxies from fogger_lib.consts import DEFAULT_APP_ICON from fogger_lib.BackgroundLoader import get_chameleonic_pixbuf_from_svg from fogger.AboutFoggerDialog import AboutFoggerDialog ICON_SIZE = Gtk.icon_size_register('FoggerIconSize', 80, 80) GLib.threads_init() # See fogger_lib.Window.py for more details about how this class works class FoggerWindow(Window): __gtype_name__ = "FoggerWindow" def finish_initializing(self, builder): # pylint: disable=E1002 """Set up the main window""" super(FoggerWindow, self).finish_initializing(builder) self.AboutDialog = AboutFoggerDialog self.url = self.builder.get_object('url_entry')
def test_return_misc(self): self.assertTrue( isinstance(Gtk.icon_size_register("foo", 1, 2), _compat.integer_types)) self.assertEqual(Gtk.icon_size_get_name(Gtk.IconSize.MENU), "gtk-menu")
# # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranties of # MERCHANTABILITY, SATISFACTORY QUALITY, 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 this program. If not, see <http://www.gnu.org/licenses/>. ### END LICENSE import gettext from gettext import gettext as _ gettext.textdomain('fogger') from gi.repository import Gtk, GdkPixbuf ICON_SIZE = Gtk.icon_size_register('FoggerDialogIconSize', 80, 80) class ConfirmDialog(Gtk.MessageDialog): def __init__(self, appname, title, message, icon=None, parent=None, ok='gtk-ok', cancel='gtk-cancel'): Gtk.MessageDialog.__init__(self, parent, Gtk.DialogFlags.MODAL & Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, title) if icon: image = self.get_content_area().get_children()[0].get_children()[0] if icon.startswith('/'): pixbuf = GdkPixbuf.Pixbuf.new_from_file(icon) image.props.pixbuf = pixbuf.scale_simple(80, 80, GdkPixbuf.InterpType.BILINEAR) else: image.set_from_icon_name(icon, ICON_SIZE)