[eog-plugins] maximize-windows: New plugin that opens windows maximized



commit afd89b4eb4d3acb0e3ab6e54c51cc70b88f6f253
Author: Felix Riemann <friemann gnome org>
Date:   Sun Feb 8 18:39:33 2015 +0100

    maximize-windows: New plugin that opens windows maximized
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744083

 configure.ac                                       |    7 ++--
 plugins/maximize-windows/Makefile.am               |   24 +++++++++++++
 .../eog-maximize-windows.metainfo.xml.in           |   12 ++++++
 .../maximize-windows.plugin.desktop.in             |    9 +++++
 plugins/maximize-windows/maximize-windows.py       |   36 ++++++++++++++++++++
 po/POTFILES.in                                     |    2 +
 6 files changed, 87 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 21e5e8f..0bc8c41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,9 +65,9 @@ ALL_PLUGINS="postr map fit-to-width exif-display send-by-mail postasa hide-title
 USEFUL_PLUGINS="postr map fit-to-width exif-display send-by-mail postasa hide-titlebar light-theme"
 DEFAULT_PLUGINS="postr map fit-to-width exif-display send-by-mail postasa hide-titlebar light-theme"
 
-PYTHON_ALL_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder"
-PYTHON_USEFUL_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder"
-PYTHON_DEFAULT_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder"
+PYTHON_ALL_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder maximize-windows"
+PYTHON_USEFUL_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder maximize-windows"
+PYTHON_DEFAULT_PLUGINS="slideshowshuffle pythonconsole fullscreenbg export-to-folder maximize-windows"
 
 DIST_PLUGINS="$ALL_PLUGINS $PYTHON_ALL_PLUGINS"
 
@@ -345,6 +345,7 @@ plugins/fullscreenbg/Makefile
 plugins/fullscreenbg/org.gnome.eog.plugins.fullscreenbg.gschema.xml
 plugins/hide-titlebar/Makefile
 plugins/light-theme/Makefile
+plugins/maximize-windows/Makefile
 plugins/send-by-mail/Makefile
 plugins/slideshowshuffle/Makefile
 plugins/postr/Makefile
diff --git a/plugins/maximize-windows/Makefile.am b/plugins/maximize-windows/Makefile.am
new file mode 100644
index 0000000..7c1721b
--- /dev/null
+++ b/plugins/maximize-windows/Makefile.am
@@ -0,0 +1,24 @@
+# Fullscreen Background plugin
+plugindir = $(EOG_PLUGINS_LIBS_DIR)
+appstreamdir = $(datadir)/appdata
+plugin_in_files = maximize-windows.plugin.desktop.in
+appstream_in_files = eog-maximize-windows.metainfo.xml.in
+
+plugin_PYTHON = \
+       maximize-windows.py
+
+%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; 
$(AM_V_GEN)$(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
+
+plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin)
+
+appstream_DATA = $(appstream_in_files:.xml.in=.xml)
+
+ INTLTOOL_XML_RULE@
+
+EXTRA_DIST = $(plugin_in_files)\
+            $(appstream_in_files)
+
+CLEANFILES = $(plugin_DATA) $(appstream_DATA)
+DISTCLEANFILES = $(plugin_DATA) $(appstream_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/plugins/maximize-windows/eog-maximize-windows.metainfo.xml.in 
b/plugins/maximize-windows/eog-maximize-windows.metainfo.xml.in
new file mode 100644
index 0000000..2c0dc51
--- /dev/null
+++ b/plugins/maximize-windows/eog-maximize-windows.metainfo.xml.in
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="addon">
+  <id>eog-maximize-windows</id>
+  <extends>eog.desktop</extends>
+  <_name>Maximize Windows</_name>
+  <_summary>New windows will open maximized</_summary>
+  <url type="homepage">https://wiki.gnome.org/Apps/EyeOfGnome/Plugins</url>
+  <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=eog&amp;component=plugins</url>
+  <metadata_license>CC0-1.0</metadata_license>
+  <project_license>GPL-2.0+</project_license>
+  <updatecontact>friemann gnome org</updatecontact>
+</component>
diff --git a/plugins/maximize-windows/maximize-windows.plugin.desktop.in 
b/plugins/maximize-windows/maximize-windows.plugin.desktop.in
new file mode 100644
index 0000000..b2f4ec0
--- /dev/null
+++ b/plugins/maximize-windows/maximize-windows.plugin.desktop.in
@@ -0,0 +1,9 @@
+[Plugin]
+Loader=python3
+Module=maximize-windows
+IAge=3
+_Name=Maximize Windows
+_Description=Maximize new windows
+Authors=Felix Riemann <friemann gnome org>
+Copyright=Copyright © 2015 Felix Riemann <friemann gnome org>
+Website=http://projects.gnome.org/eog
diff --git a/plugins/maximize-windows/maximize-windows.py b/plugins/maximize-windows/maximize-windows.py
new file mode 100644
index 0000000..f0321aa
--- /dev/null
+++ b/plugins/maximize-windows/maximize-windows.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+# Maximize Windows Plugin for Eye of GNOME
+# Copyright (C) 2015 Felix Riemann <friemann gnome org>
+#
+# This program 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; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+from gi.repository import GObject, Eog
+
+
+class MaximizeWindows(GObject.Object, Eog.WindowActivatable):
+    """Plugin causing new EogWindows to open maximized"""
+
+    window = GObject.property(type=Eog.Window)
+
+    def __init__(self):
+        super(MaximizeWindows, self).__init__()
+
+    def do_activate(self):
+        """Maximize each window this plugin is activated for"""
+        self.window.maximize()
+
+    def do_deactivate(self):
+        """Does nothing on deactivation"""
+        pass
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0867a53..154d3d3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -22,6 +22,8 @@ plugins/light-theme/light-theme.plugin.desktop.in
 plugins/map/eog-map.metainfo.xml.in
 plugins/map/eog-map-plugin.c
 plugins/map/map.plugin.desktop.in
+plugins/maximize-windows/eog-maximize-windows.metainfo.xml.in
+plugins/maximize-windows/maximize-windows.plugin.desktop.in
 plugins/postasa/eog-postasa.metainfo.xml.in
 plugins/postasa/eog-postasa-plugin.c
 [type: gettext/glade]plugins/postasa/postasa-config.xml


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]