From 4180f889fbcf008957545f2d00de1655c4c2d919 Mon Sep 17 00:00:00 2001
From: Nathan_SR <cquickcal@gmail.com>
Date: Tue, 8 May 2018 01:31:14 +0530
Subject: [PATCH] On branch master 	modified:   CHANGELOG.md 
 modified:   helpman 	new file:   helpman.css 	deleted:   
 helpman.desktop 	new file:   org.gnome.helpman.appdata.xml 
 modified:   setup.py

---
 CHANGELOG.md                  | 19 +++++++++++++
 helpman                       | 35 +++++++++++++++++-------
 helpman.css                   | 28 +++++++++++++++++++
 helpman.desktop               | 10 -------
 org.gnome.helpman.appdata.xml | 51 +++++++++++++++++++++++++++++++++++
 setup.py                      |  8 +++---
 6 files changed, 129 insertions(+), 22 deletions(-)
 create mode 100644 helpman.css
 delete mode 100644 helpman.desktop
 create mode 100644 org.gnome.helpman.appdata.xml

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9ce974f..67382dd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,25 @@
 All notable changes to this project will be documented in this file.
 
 
+2.4 (06-May-2018)
+
+Features:
+
+  * Comment field updated in the helpman.desktop file
+  * helpman.appdata.xml file introduced for software manager description
+  * helpman.appdata.xml includes screenshots for the application
+  * setup.py updated for version numbers and included above file
+  * helpman.css introduced for theming
+  * Files appdata and desktop are renamed to specification
+
+
+2.3 (06-May-2018)
+
+Features:
+
+  * helpman script updated to load a css file for theming
+
+
 2.2 (25-Apr-2018)
 
 Features:
diff --git a/helpman b/helpman
index 7504696..6744129 100755
--- a/helpman
+++ b/helpman
@@ -139,10 +139,10 @@ builder.connect_signals(Handler())
 window = builder.get_object("window1") 
 textview = builder.get_object("textview1")
 textbuffer = textview.get_buffer()
-textview.modify_font(Pango.FontDescription('Verdana 14'))
+# textview.modify_font(Pango.FontDescription('Verdana 14'))
 
-bgcolor = Gdk.RGBA()
-bgcolor.parse('#edd2a4')
+# bgcolor = Gdk.RGBA()
+# bgcolor.parse('#edd2a4')
 
 # fgcolor = Gdk.RGBA()
 # fgcolor.parse('#AACCFF')
@@ -150,21 +150,21 @@ bgcolor.parse('#edd2a4')
 # crcolor = Gdk.RGBA()
 # crcolor.parse('#FFFFFF')
 
-textview.override_background_color(Gtk.StateFlags.NORMAL, bgcolor)
+# textview.override_background_color(Gtk.StateFlags.NORMAL, bgcolor)
 
 # textview.override_color(Gtk.StateFlags.NORMAL, fgcolor)
 
 # textview.override_cursor(crcolor, fgcolor)
 
 manual_type_cbtext_I = builder.get_object("manual_type_cbtext_1")
-manual_type_cbtext_I.modify_font(Pango.FontDescription('Verdana 14'))
+# manual_type_cbtext_I.modify_font(Pango.FontDescription('Verdana 14'))
 manual_type_cbtext_I.grab_focus()
 
 starting_with_cbtext_II = builder.get_object("starting_with_cbtext_2")
-starting_with_cbtext_II.modify_font(Pango.FontDescription('Verdana 14'))
+# starting_with_cbtext_II.modify_font(Pango.FontDescription('Verdana 14'))
 
 select_manual_cbtext_III = builder.get_object("select_manual_cbtext_3")
-select_manual_cbtext_III.modify_font(Pango.FontDescription('Verdana 14'))
+# select_manual_cbtext_III.modify_font(Pango.FontDescription('Verdana 14'))
 
 # Following specifies the combo box text values and populates the same
 
@@ -180,10 +180,27 @@ for y in default_textII:
     starting_with_cbtext_II.append_text(y)
 
 result = builder.get_object("result1")
-result.modify_font(Pango.FontDescription('Verdana 14'))
+# result.modify_font(Pango.FontDescription('Verdana 14'))
 
 smentry = builder.get_object("smentry1")
-smentry.modify_font(Pango.FontDescription('Verdana 14'))
+# smentry.modify_font(Pango.FontDescription('Verdana 14'))
+
+# Following sets the theme for the widgets
+
+# load CSS
+style_provider = Gtk.CssProvider()
+css = open('/usr/lib/helpman/helpman.css')
+css_data = css.read()
+css.close()
+style_provider.load_from_data(bytes(css_data.encode()))
+Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),style_provider,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
+
+textview.get_style_context().add_class("textview_theme")
+result.get_style_context().add_class("result_theme")
+manual_type_cbtext_I.get_style_context().add_class("font_theme")
+starting_with_cbtext_II.get_style_context().add_class("font_theme")
+select_manual_cbtext_III.get_style_context().add_class("font_theme")
+smentry.get_style_context().add_class("font_theme")
 
 ouraboutwindow = builder.get_object("aboutdialog1")
 window.connect("delete-event", Gtk.main_quit) 
diff --git a/helpman.css b/helpman.css
new file mode 100644
index 0000000..208cac4
--- /dev/null
+++ b/helpman.css
@@ -0,0 +1,28 @@
+.textview_theme {
+    background-color: #EDD2A4;
+    background: #EDD2A4;
+    color: black;
+    font-weight: normal;
+    font-size: 12pt;
+    font-family: Verdana;
+}
+
+.result_theme {
+    background-color: #BAE9FF;
+    background: #BAE9FF;
+    color: black;
+    font-weight: normal;
+    font-size: 12pt;
+    font-family: Verdana;
+}
+
+.font_theme {
+    font-weight: normal;
+    font-size: 12pt;
+    font-family: Verdana;
+}
+
+.textview_theme:selected {
+    color: white;
+    background-color: orange;
+    }
diff --git a/helpman.desktop b/helpman.desktop
deleted file mode 100644
index fa37d67..0000000
--- a/helpman.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Name=Helpman Manuals / Guides / Tutorials
-Comment=quick & easy access to 4000+ manuals / guides / tutorials
-Keywords=manuals;guides;tutorials
-Exec=helpman
-Icon=helpman
-Terminal=false
-Type=Application
-StartupNotify=true
-Categories=GNOME;GTK;Utility;
diff --git a/org.gnome.helpman.appdata.xml b/org.gnome.helpman.appdata.xml
new file mode 100644
index 0000000..306a3ed
--- /dev/null
+++ b/org.gnome.helpman.appdata.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component type="desktop">
+  <id>org.gnome.helpman.desktop</id>
+  <metadata_license>CC0-1.0</metadata_license>
+  <project_license>GPL-3.0+</project_license>
+  <name>Helpman</name>
+  <summary>Quick and Easy access to 4000+ manuals / guides / tutorials</summary>
+  <description>
+    <p>
+      Helpman provides a classified access to the manuals, installed by user/system 
+      programs, automatically. It also supports typing a program / manual name, in 
+      the Select Manual: text / combo box directly, to display it quickly. Error
+      Messages will be shown below, if a manual is not found. 
+    </p>
+    <p>
+      The Manual Type list box, shows sections 1 to 8, useful for specific display
+      of  a version of the manual. Say for example, if you see, CRON(8) in a manual,
+      it means the CRON manual in the 8th section. So users should choose
+      appropriately.
+    </p>
+    <p>
+      Please click the info button for more details.
+    </p>
+    <p>Features:</p>
+    <ul>
+      <li>Classified and Automatic Updation of New Manuals</li>
+      <li>GUI Display of Manuals makes back and forth navigation easier</li>
+      <li>It also makes copying text easier</li>
+      <li>Direct Searching of Manuals is possible too</li>
+    </ul>
+  </description>
+  <url type="homepage">https://git.fosscommunity.in/SRNathan/Helpman</url>
+  <screenshots>
+    <screenshot type="default">
+      <image>http://screenshots.debian.net/screenshots/000/016/177/large.png</image>
+    </screenshot>
+    <screenshot>
+      <image>http://screenshots.debian.net/screenshots/000/016/176/large.png</image>
+    </screenshot>
+    <screenshot>
+      <image>http://screenshots.debian.net/screenshots/000/016/175/large.png</image>
+    </screenshot>
+    <screenshot>
+      <image>http://screenshots.debian.net/screenshots/000/016/174/large.png</image>
+    </screenshot>
+  </screenshots>
+  <project_group>Nathan</project_group>
+  <provides>
+    <binary>helpman</binary>
+  </provides>
+</component>
diff --git a/setup.py b/setup.py
index 257d844..15fa8cf 100644
--- a/setup.py
+++ b/setup.py
@@ -1,15 +1,17 @@
 from setuptools import setup
 setup(name = "helpman", 
-version = "2.2", 
+version = "2.4", 
 description = "quick & easy access to 4000+ manuals / guides / tutorials", 
 author = "Nathan SR", 
 author_email = "cquickcal@gmail.com",
 url = "https://git.fosscommunity.in/SRNathan/Helpman", 
 license='GPLv3', 
 scripts=['helpman'], 
-data_files = [ ("lib/helpman", ["helpman.glade"]), 
+data_files = [ ("lib/helpman", ["helpman.glade"]),
+("lib/helpman", ["helpman.css"]), 
 ("share/pixmaps", ["helpman.png"]),
 ("share/pixmaps", ["helpman_small.png"]),
 ("share/pixmaps", ["info_24x24.png"]),
 ("share/man/man1", ["helpman.1.gz"]),
-("share/applications", ["helpman.desktop"]) ] ) 
+("share/metainfo", ["org.gnome.helpman.appdata.xml"]),
+("share/applications", ["org.gnome.helpman.desktop"]) ] ) 
-- 
GitLab