Skip to content

Commit

Permalink
Refresh panes when toggling dark mode
Browse files Browse the repository at this point in the history
ref #150
  • Loading branch information
diegogangl committed Sep 11, 2020
1 parent ed81e4d commit 8e61052
Show file tree
Hide file tree
Showing 29 changed files with 751 additions and 0 deletions.
7 changes: 7 additions & 0 deletions GTG/gtk/general_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,10 @@ def on_dark_mode_toggled(self, widget, state):

self.config.set("dark_mode", state)
self.app.toggle_darkmode(state)

# Refresh panes
func = self.app.browser.tv_factory.get_task_bg_color

for pane in self.app.browser.vtree_panes.values():
pane.set_bg_color(func, 'bg_color')
pane.basetree.get_basetree().refresh_all()
Binary file added builddir/.ninja_deps
Binary file not shown.
7 changes: 7 additions & 0 deletions builddir/.ninja_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ninja log v5
0 894 1599653406657193937 build.ninja 5952a0d27814c18b
0 533 0 reconfigure 5952a0d27814c18b
0 812 1599693167708532095 build.ninja 5952a0d27814c18b
0 820 0 reconfigure 5952a0d27814c18b
0 531 1599697170785692046 build.ninja 5952a0d27814c18b
0 590 0 reconfigure 5952a0d27814c18b
122 changes: 122 additions & 0 deletions builddir/GTG/gtg
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2015 - Lionel Dricot & Bertrand Rousseau
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
#==============================================================================
#
# Getting things GNOME!: a gtd-inspired organizer for GNOME
#
# @author : B. Rousseau, L. Dricot
# @date : November 2008
#
# main.py contains the configuration and data structures loader
# taskbrowser.py contains the main GTK interface for the tasklist
# task.py contains the implementation of a task and a project
# taskeditor contains the GTK interface for task editing
# (it's the window you see when writing a task)
# backends/xml_backend.py is the way to store tasks and project in XML
#
# tid stand for "Task ID"
# pid stand for "Project ID"
# uid stand for "Universal ID" which is generally the tuple [pid,tid]
#
# Each id are *strings*
# tid are the form "X@Y" where Y is the pid.
# For example : 21@2 is the 21st task of the 2nd project
# This way, we are sure that a tid is unique accross multiple projects
#
#==============================================================================

"""This is the top-level exec script for running GTG"""

#=== IMPORT ===================================================================
import sys
import argparse
import gettext
import locale
import signal

import gi
gi.require_version('Gdk', '3.0')
gi.require_version('Gtk', '3.0')

_LOCAL = False

if _LOCAL:
sys.path.insert(1, '/usr/lib/python3.8/site-packages')

from GTG.core import info
from GTG.gtk.application import Application


def parse_args():
"""Parse arguments from the command line."""

parser = argparse.ArgumentParser()

parser.add_argument('-v', '--version', help='Show program version',
action="store_true")

parser.add_argument('-d', '--debug', help='Enable debug output',
action='store_true')

parser.add_argument('-t', '--title',
help='Use special title for windows\' title')

parser.add_argument('task_uri', default='', nargs='*', type=str,
help='Open a specific task via URI')

return parser.parse_args()


if __name__ == "__main__":
if _LOCAL:
print("Running from source tree")
try:
args = parse_args()

if args.version:
print("GTG (Getting Things GNOME!)", info.VERSION)
print()
print("For more information:", info.URL)
sys.exit(0)

if args.title is not None:
info.NAME = args.title

# Set up UI i18n
LOCALE_DIR = '/usr/local/share/locale'

try:
locale.bindtextdomain('gtg', LOCALE_DIR)
locale.textdomain('gtg')
except AttributeError as e:
# Python built without gettext support doesn't have bindtextdomain() and textdomain()
print("Couldn't bind the gettext translation domain. Some translations won't work.\n{}".format(e))

gettext.bindtextdomain('gtg', LOCALE_DIR)
gettext.textdomain('gtg')

# Run the application
application = Application('org.gnome.GTG', args.debug)
application.uri_list = args.task_uri

signal.signal(signal.SIGTERM, lambda s, f: application.quit())
application.run()

except KeyboardInterrupt:
sys.exit(1)
122 changes: 122 additions & 0 deletions builddir/GTG/local-gtg
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2015 - Lionel Dricot & Bertrand Rousseau
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
#==============================================================================
#
# Getting things GNOME!: a gtd-inspired organizer for GNOME
#
# @author : B. Rousseau, L. Dricot
# @date : November 2008
#
# main.py contains the configuration and data structures loader
# taskbrowser.py contains the main GTK interface for the tasklist
# task.py contains the implementation of a task and a project
# taskeditor contains the GTK interface for task editing
# (it's the window you see when writing a task)
# backends/xml_backend.py is the way to store tasks and project in XML
#
# tid stand for "Task ID"
# pid stand for "Project ID"
# uid stand for "Universal ID" which is generally the tuple [pid,tid]
#
# Each id are *strings*
# tid are the form "X@Y" where Y is the pid.
# For example : 21@2 is the 21st task of the 2nd project
# This way, we are sure that a tid is unique accross multiple projects
#
#==============================================================================

"""This is the top-level exec script for running GTG"""

#=== IMPORT ===================================================================
import sys
import argparse
import gettext
import locale
import signal

import gi
gi.require_version('Gdk', '3.0')
gi.require_version('Gtk', '3.0')

_LOCAL = True

if _LOCAL:
sys.path.insert(1, '/home/januz/code/gtg')

from GTG.core import info
from GTG.gtk.application import Application


def parse_args():
"""Parse arguments from the command line."""

parser = argparse.ArgumentParser()

parser.add_argument('-v', '--version', help='Show program version',
action="store_true")

parser.add_argument('-d', '--debug', help='Enable debug output',
action='store_true')

parser.add_argument('-t', '--title',
help='Use special title for windows\' title')

parser.add_argument('task_uri', default='', nargs='*', type=str,
help='Open a specific task via URI')

return parser.parse_args()


if __name__ == "__main__":
if _LOCAL:
print("Running from source tree")
try:
args = parse_args()

if args.version:
print("GTG (Getting Things GNOME!)", info.VERSION)
print()
print("For more information:", info.URL)
sys.exit(0)

if args.title is not None:
info.NAME = args.title

# Set up UI i18n
LOCALE_DIR = '/home/januz/code/gtg/po'

try:
locale.bindtextdomain('gtg', LOCALE_DIR)
locale.textdomain('gtg')
except AttributeError as e:
# Python built without gettext support doesn't have bindtextdomain() and textdomain()
print("Couldn't bind the gettext translation domain. Some translations won't work.\n{}".format(e))

gettext.bindtextdomain('gtg', LOCALE_DIR)
gettext.textdomain('gtg')

# Run the application
application = Application('org.gnome.GTG', args.debug)
application.uri_list = args.task_uri

signal.signal(signal.SIGTERM, lambda s, f: application.quit())
application.run()

except KeyboardInterrupt:
sys.exit(1)
Loading

0 comments on commit 8e61052

Please sign in to comment.