~ubuntu-branches/debian/sid/groundcontrol/sid

« back to all changes in this revision

Viewing changes to GroundControl/helper.py

  • Committer: Bazaar Package Importer
  • Author(s): Luke Faraone
  • Date: 2010-02-07 18:26:54 UTC
  • Revision ID: james.westby@ubuntu.com-20100207182654-u0n26lkazgfog4et
Tags: upstream-1.5
ImportĀ upstreamĀ versionĀ 1.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Copyright 2009 Martin Owens
 
3
#
 
4
# This program is free software: you can redistribute it and/or modify
 
5
#  it under the terms of the GNU General Public License as published by
 
6
#  the Free Software Foundation, either version 3 of the License, or
 
7
#  (at your option) any later version.
 
8
#
 
9
#  This program is distributed in the hope that it will be useful,
 
10
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
#  GNU General Public License for more details.
 
13
#
 
14
#  You should have received a copy of the GNU General Public License
 
15
#  along with this program.  If not, see <http://www.gnu.org/licenses/>
 
16
#
 
17
"""App for showing some help."""
 
18
 
 
19
# Various required variables and locations
 
20
from GroundControl.gtkviews  import GtkApp, Window
 
21
from GroundControl import __version__, __appname__, __stage__
 
22
 
 
23
VERSION = "<i>%s Version: %s (%s)</i>" % (
 
24
    __appname__, __version__, __stage__)
 
25
 
 
26
class HelpWindow(Window):
 
27
    """Show a help file."""
 
28
    name = 'help'
 
29
 
 
30
    def load(self, page, **kwargs):
 
31
        """Load the requesting merge gui."""
 
32
        if HelpApp.is_help(page):
 
33
            content = HelpApp.help_message[page]
 
34
            self.widget('content').set_markup(content)
 
35
        self.widget('version').set_markup(VERSION)
 
36
        super(HelpWindow, self).load(**kwargs)
 
37
 
 
38
    def is_valid(self):
 
39
        """return true if the dialog has everything required."""
 
40
        return True
 
41
 
 
42
 
 
43
class HelpApp(GtkApp):
 
44
    """An application to show some help to the user."""
 
45
    gtkfile = 'help.glade'
 
46
    windows = [ HelpWindow ]
 
47
    
 
48
    @staticmethod
 
49
    def is_help(page):
 
50
        return page in HelpApp.help_message
 
51
 
 
52
    help_message = {
 
53
        'code-commited': 
 
54
            _("""Ground Control has committed the changes you have made to your local branch (the current directory).\n\nIf you would like to share your changes with others you will need to upload your branch to Launchpad.\n\nYou will not be able to upload until all changes have been committed to your local branch."""),
 
55
 
 
56
        'code-mergereq':
 
57
            _("""Ground Control has created a merge request to alert the upstream developers that you wish to incorporate your changes into their branch.\n\nAny subsequent changes you make to this branch will be added to this merge request once you have committed locally and uploaded to Launchpad."""),
 
58
 
 
59
        'code-modified': 
 
60
            _("""Ground Control has determined that there are new and/or modified files within your local branch.\n\nWhen you commit your changes, you will have the opportunity to describe the changes you have made. The description you enter should be accurate and succinct, as it serves as a history of your branch changes."""),
 
61
 
 
62
        'code-uploaded':
 
63
            _("""Ground Control has uploaded your changes to a personal branch within your Launchpad account.\n\nYou can now submit a merge request which will inform the project developers of your new hosted branch."""),
 
64
 
 
65
        'configure':
 
66
            _("""Ground Control needs to access and download information from your Launchpad account to this machine.\n\nYou will have the opportunity to create a Launchpad account if you do not currently have one."""),
 
67
 
 
68
        'project':
 
69
            _("""You are currently within the project view where you can create local branches of projects hosted on Launchpad.\n\nLocal branches can be uploaded to your Launchpad account and proposed for merging with the project's main development branch."""),
 
70
 
 
71
        'projects':
 
72
            _("""You are currently within the projects directory. Here you can create local projects (and related branches) based upon those hosted on Launchpad.\n\nIf you wish to delete the project, simply remove the project directory - this will also remove any local branches related to the project."""),
 
73
}
 
74
 
 
75