GTG

Merge lp:~izidor/gtg/title into lp:~gtg/gtg/old-trunk

Proposed by Izidor Matušov
Status: Merged
Merged at revision: 1192
Proposed branch: lp:~izidor/gtg/title
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 111 lines (+32/-20)
3 files modified
CHANGELOG (+1/-0)
gtg (+5/-0)
scripts/debug.sh (+26/-20)
To merge this branch: bzr merge lp:~izidor/gtg/title
Reviewer Review Type Date Requested Status
Lionel Dricot (community) Approve
Review via email: mp+109153@code.launchpad.net

Description of the change

Added option -t to set the title of windows (You can put whatever you want instead of "Getting Things GNOME!" in the titlebar). It is useful when you have opened multiple instances of GTG and want to differentiate between them.

Use case from real life. I do final debug of a new feature. I import my real life data to test and run it. In that moment I have two identical instances of GTG running. If I want to add a new task to my real GTG (oops, found a bug), it is impossible to distinguish between them.

./scripts/debug.sh sets title to "Dev GTG: <name of the dir>" or "Dev GTG: <name of dir> (<name of -s dataset> dataset)". If I am in ~/projects/gtg/new-feature and run ./scripts/debug.sh -s bryce, the title is "Dev GTG: new-feature (bryce dataset)"

I think it is a nifty feature to have.

To post a comment you must log in.
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) :
review: Approve
Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote :

Just a small comment: I totally agree it can be really useful, but
maybe another way to implement this would be to set a custom title in
the configuration file. That would allow to have development-oriented
customizations while still avoiding to make them visible to users.
That being said, I don't disapprove this particular solution, it's ok
to merge it (since it's buried in the command line options, it won't
be very visible to the user anyway). However I just wanted to point
out that if we'll need more of such kind of development-oriented
features in the future, it would probably be better to avoid adding a
dedicated flag for each one.

On Thu, Jun 7, 2012 at 4:23 PM, Lionel Dricot <email address hidden> wrote:
> Review: Approve
>
>
> --
> https://code.launchpad.net/~izidor/gtg/title/+merge/109153
> You are subscribed to branch lp:gtg.

--
Bertrand Rousseau

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGELOG'
--- CHANGELOG 2012-06-07 11:37:15 +0000
+++ CHANGELOG 2012-06-07 14:07:23 +0000
@@ -24,6 +24,7 @@
24 * New tag editor24 * New tag editor
25 * Fix bugs #1003872 and #1002067: Correct titles to Preferences and Synchronization Services Dialogs, by Alan Gomes25 * Fix bugs #1003872 and #1002067: Correct titles to Preferences and Synchronization Services Dialogs, by Alan Gomes
26 * Improved Export plugin, export to PDF works now, by Izidor Matušov26 * Improved Export plugin, export to PDF works now, by Izidor Matušov
27 * Added -t option to distinguish between multiple instances of GTG
2728
282012-02-13 Getting Things GNOME! 0.2.9292012-02-13 Getting Things GNOME! 0.2.9
29 * Big refractorization of code, now using liblarch30 * Big refractorization of code, now using liblarch
3031
=== modified file 'gtg'
--- gtg 2012-06-02 11:02:53 +0000
+++ gtg 2012-06-07 14:07:23 +0000
@@ -57,10 +57,15 @@
57 parser.add_option('-l', '--local-liblarch', action='store_true',57 parser.add_option('-l', '--local-liblarch', action='store_true',
58 dest='local_liblarch', default=False,58 dest='local_liblarch', default=False,
59 help="Use local liblarch located in ../liblarch if it is posible")59 help="Use local liblarch located in ../liblarch if it is posible")
60 parser.add_option('-t', '--title', action='store',
61 help="Use special title for windows' title")
60 parser.add_option('-v', '--version', action='store_true',62 parser.add_option('-v', '--version', action='store_true',
61 dest='print_version', help="Print GTG's version number", default=False)63 dest='print_version', help="Print GTG's version number", default=False)
62 (options, args) = parser.parse_args()64 (options, args) = parser.parse_args()
6365
66 if options.title is not None:
67 info.NAME = options.title
68
64 if options.print_version:69 if options.print_version:
65 print "GTG (Getting Things Gnome!)", info.VERSION70 print "GTG (Getting Things Gnome!)", info.VERSION
66 print71 print
6772
=== modified file 'scripts/debug.sh'
--- scripts/debug.sh 2012-04-07 15:05:21 +0000
+++ scripts/debug.sh 2012-06-07 14:07:23 +0000
@@ -7,9 +7,10 @@
7fi7fi
88
9args="--no-crash-handler"9args="--no-crash-handler"
10set="default"10dataset="default"
11norun=011norun=0
12profile=012profile=0
13title=""
1314
14# Create execution-time data directory if needed15# Create execution-time data directory if needed
15mkdir -p tmp16mkdir -p tmp
@@ -25,29 +26,34 @@
25 ;;26 ;;
26 n) norun=1;;27 n) norun=1;;
27 p) profile=1;;28 p) profile=1;;
28 s) set="$OPTARG";;29 s) dataset="$OPTARG";;
29 [?]) echo >&2 "Usage: $0 [-s dataset] [-b] [-d] [-l] [-n] [-p]"30 t) title="$OPTARG";;
31 [?]) echo >&2 "Usage: $0 [-s dataset] [-t title] [-b] [-d] [-l] [-n] [-p]"
30 exit 1;;32 exit 1;;
31 esac33 esac
32done34done
3335
34# Copy dataset36# Copy dataset
35if [ $set != "default" ]37if [ $dataset != "default" -a ! -d "./tmp/$dataset" ]
36then38then
37 if [ ! -d "./tmp/$set" ]39 echo "Copying $dataset dataset to ./tmp/"
40 cp -r test/data/$dataset tmp/
41fi
42
43echo "Setting XDG vars to use $dataset dataset."
44export XDG_DATA_HOME="./tmp/$dataset/xdg/data"
45export XDG_CACHE_HOME="./tmp/$dataset/xdg/cache"
46export XDG_CONFIG_HOME="./tmp/$dataset/xdg/config"
47
48# Title has to be passed to GTG directly, not through $args
49# title could be more word, and only the first word would be taken
50if [ "$title" = "" ]
51then
52 title="Dev GTG: $(basename `pwd`)"
53 if [ "$dataset" != "default" ]
38 then54 then
39 echo "Copying $set dataset to ./tmp/"55 title="$title ($dataset dataset)"
40 cp -r test/data/$set tmp/
41 fi56 fi
42 echo "Setting XDG vars to use $set dataset."
43 export XDG_DATA_HOME="./tmp/$set/xdg/data"
44 export XDG_CACHE_HOME="./tmp/$set/xdg/cache"
45 export XDG_CONFIG_HOME="./tmp/$set/xdg/config"
46else
47 echo "Setting XDG vars to use default dataset."
48 export XDG_DATA_HOME="./tmp/default/xdg/data"
49 export XDG_CACHE_HOME="./tmp/default/xdg/cache"
50 export XDG_CONFIG_HOME="./tmp/default/xdg/config"
51fi57fi
5258
53if [ $norun -eq 0 ]; then59if [ $norun -eq 0 ]; then
@@ -64,10 +70,10 @@
64 fi70 fi
6571
66 if [ $profile -eq 1 ]; then72 if [ $profile -eq 1 ]; then
67 python -m cProfile -o gtg.prof ./gtg $args73 python -m cProfile -o gtg.prof ./gtg $args -t "$title"
68 python ./scripts/profile_interpret.sh74 python ./scripts/profile_interpret.sh
69 else75 else
70 ./gtg $args76 ./gtg $args -t "$title"
71 fi77 fi
72fi78fi
7379

Subscribers

People subscribed via source and target branches

to status/vote changes: