Add a toggle for turning on/off of the screen profiles configuration screen
This commit is contained in:
Dustin Kirkland 2009-02-23 14:26:33 -06:00
commit 5877db7f1c
3 changed files with 115 additions and 56 deletions

13
debian/changelog vendored
View file

@ -1,11 +1,14 @@
screen-profiles (1.27) UNRELEASED; urgency=low screen-profiles (1.27) UNRELEASED; urgency=low
Fix for LP: #333189: * Fix for LP: #333189:
* keybindings/common: add profile reload shortcut, "ctrl-a ~" - keybindings/common: add profile reload shortcut, "ctrl-a ~"
* screen-profiles: updated messages to point to ^a ~ - screen-profiles: updated messages to point to ^a ~
* po/*: updated for the new message - po/*: updated for the new messages
* Fix for LP: #333180
- screen-profiles: add toggle for auto launch of welcome
- po/*: updated for the new messages
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 23 Feb 2009 10:04:43 -0600 -- Dustin Kirkland <kirkland@ubuntu.com> Mon, 23 Feb 2009 14:25:02 -0600
screen-profiles (1.26-0ubuntu1) jaunty; urgency=low screen-profiles (1.26-0ubuntu1) jaunty; urgency=low

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-02-23 11:22-0600\n" "POT-Creation-Date: 2009-02-23 14:26-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -16,140 +16,157 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: screen-profiles:70 #: screen-profiles:71
msgid "Remove screen by default at login" msgid "Remove screen by default at login"
msgstr "" msgstr ""
#: screen-profiles:72 #: screen-profiles:73
msgid "Install screen by default at login" msgid "Install screen by default at login"
msgstr "" msgstr ""
#: screen-profiles:76 #: screen-profiles:75
msgid "Help" msgid "Launch Screen Profiles Configuration on startup"
msgstr "" msgstr ""
#: screen-profiles:77 #: screen-profiles:77
msgid "Change screen profile" msgid "Do not launch Screen Profiles Configuration on startup"
msgstr ""
#: screen-profiles:78
msgid "Change keybinding set"
msgstr ""
#: screen-profiles:79
msgid "Change escape sequence"
msgstr ""
#: screen-profiles:80
msgid "Create new window(s)"
msgstr "" msgstr ""
#: screen-profiles:81 #: screen-profiles:81
msgid "Help"
msgstr ""
#: screen-profiles:82
msgid "Change screen profile"
msgstr ""
#: screen-profiles:83
msgid "Change keybinding set"
msgstr ""
#: screen-profiles:84
msgid "Change escape sequence"
msgstr ""
#: screen-profiles:85
msgid "Create new window(s)"
msgstr ""
#: screen-profiles:86
msgid "Manage default windows" msgid "Manage default windows"
msgstr "" msgstr ""
#: screen-profiles:83 screen-profiles:96 screen-profiles:144 #: screen-profiles:89 screen-profiles:102 screen-profiles:150
#: screen-profiles:161 screen-profiles:305 screen-profiles:316 #: screen-profiles:167 screen-profiles:322 screen-profiles:340
#: screen-profiles:391 #: screen-profiles:351 screen-profiles:426
msgid "Okay" msgid "Okay"
msgstr "" msgstr ""
#: screen-profiles:83 screen-profiles:144 screen-profiles:161 #: screen-profiles:89 screen-profiles:150 screen-profiles:167
#: screen-profiles:305 screen-profiles:316 screen-profiles:391 #: screen-profiles:322 screen-profiles:340 screen-profiles:351
#: screen-profiles:426
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
#: screen-profiles:85 screen-profiles:402 #: screen-profiles:91 screen-profiles:437
msgid " Screen Profiles Configuration" msgid " Screen Profiles Configuration"
msgstr "" msgstr ""
#: screen-profiles:96 screen-profiles:135 screen-profiles:154 #: screen-profiles:102 screen-profiles:141 screen-profiles:160
#: screen-profiles:191 screen-profiles:280 screen-profiles:364 #: screen-profiles:197 screen-profiles:286 screen-profiles:399
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: screen-profiles:114 #: screen-profiles:120
msgid "Back" msgid "Back"
msgstr "" msgstr ""
#: screen-profiles:115 #: screen-profiles:121
msgid "Screen Profiles Help" msgid "Screen Profiles Help"
msgstr "" msgstr ""
#: screen-profiles:135 screen-profiles:154 #: screen-profiles:141 screen-profiles:160
msgid "Apply" msgid "Apply"
msgstr "" msgstr ""
#: screen-profiles:137 #: screen-profiles:143
msgid "Which profile would you like to use?" msgid "Which profile would you like to use?"
msgstr "" msgstr ""
#: screen-profiles:143 screen-profiles:160 screen-profiles:315 #: screen-profiles:149 screen-profiles:166 screen-profiles:350
#: screen-profiles:389 #: screen-profiles:424
msgid "Message" msgid "Message"
msgstr "" msgstr ""
#: screen-profiles:143 screen-profiles:160 screen-profiles:390 #: screen-profiles:149 screen-profiles:166 screen-profiles:425
msgid "Use '<ctrl-a> ~ <enter>' to enable your changes." msgid "Use '<ctrl-a> ~ <enter>' to enable your changes."
msgstr "" msgstr ""
#: screen-profiles:155 #: screen-profiles:161
msgid "Which set of keybindings would you like to use?" msgid "Which set of keybindings would you like to use?"
msgstr "" msgstr ""
#: screen-profiles:171 #: screen-profiles:177
msgid "Title: " msgid "Title: "
msgstr "" msgstr ""
#: screen-profiles:173 #: screen-profiles:179
msgid "Command: " msgid "Command: "
msgstr "" msgstr ""
#: screen-profiles:175 #: screen-profiles:181
msgid "Presets: " msgid "Presets: "
msgstr "" msgstr ""
#: screen-profiles:189 #: screen-profiles:195
msgid "Add to default windows" msgid "Add to default windows"
msgstr "" msgstr ""
#: screen-profiles:191 #: screen-profiles:197
msgid "Create" msgid "Create"
msgstr "" msgstr ""
#: screen-profiles:192 #: screen-profiles:198
msgid "Create new window(s):" msgid "Create new window(s):"
msgstr "" msgstr ""
#: screen-profiles:272 #: screen-profiles:278
msgid "Windows:" msgid "Windows:"
msgstr "" msgstr ""
#: screen-profiles:280 screen-profiles:364 #: screen-profiles:286 screen-profiles:399
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: screen-profiles:282 #: screen-profiles:288
msgid "Select window(s) to create by default:" msgid "Select window(s) to create by default:"
msgstr "" msgstr ""
#: screen-profiles:302 #: screen-profiles:315
msgid "Screen Profiles Configuration will be launched automatically."
msgstr ""
#: screen-profiles:319
msgid "Screen Profiles Configuration will be not launched automatically."
msgstr ""
#: screen-profiles:337
msgid "Screen will be launched automatically next time you login." msgid "Screen will be launched automatically next time you login."
msgstr "" msgstr ""
#: screen-profiles:313 #: screen-profiles:348
msgid "Screen will not be used next time you login." msgid "Screen will not be used next time you login."
msgstr "" msgstr ""
#: screen-profiles:363 #: screen-profiles:398
msgid "Escape key: ctrl-" msgid "Escape key: ctrl-"
msgstr "" msgstr ""
#: screen-profiles:365 #: screen-profiles:400
msgid "Change escape sequence:" msgid "Change escape sequence:"
msgstr "" msgstr ""
#: screen-profiles:403 #: screen-profiles:438
msgid "<Tab>/<Alt-Tab> between elements | <Return> Validates" msgid "<Tab>/<Alt-Tab> between elements | <Return> Validates"
msgstr "" msgstr ""

View file

@ -30,6 +30,7 @@ HOME=os.getenv("HOME")
SHARE='/usr/share/screen-profiles' SHARE='/usr/share/screen-profiles'
DOC='/usr/share/doc/screen-profiles' DOC='/usr/share/doc/screen-profiles'
DEF_ESC="A" DEF_ESC="A"
WELCOME = "screen -t welcome 1 screen-profiles"
gettext.bindtextdomain('screen-profiles', SHARE+'/po') gettext.bindtextdomain('screen-profiles', SHARE+'/po')
gettext.textdomain('screen-profiles') gettext.textdomain('screen-profiles')
@ -65,14 +66,18 @@ def terminal_size(): ### decide on *some* terminal size
cr = (25, 80) cr = (25, 80)
return int(cr[1]-5), int(cr[0]-5) # reverse rows, cols return int(cr[1]-5), int(cr[0]-5) # reverse rows, cols
def menu(screen, size, isInstalled): def menu(screen, size, isInstalled, welcome):
if isInstalled: if isInstalled:
installtext=_("Remove screen by default at login") installtext=_("Remove screen by default at login")
else: else:
installtext=_("Install screen by default at login") installtext=_("Install screen by default at login")
if welcome:
welcometext=_("Launch Screen Profiles Configuration on startup")
else:
welcometext=_("Do not launch Screen Profiles Configuration on startup")
li = Listbox(height = 7, width = 60, returnExit = 1) li = Listbox(height = 8, width = 60, returnExit = 1)
li.append(_("Help"), 1) li.append(_("Help"), 1)
li.append(_("Change screen profile"), 2) li.append(_("Change screen profile"), 2)
li.append(_("Change keybinding set"), 3) li.append(_("Change keybinding set"), 3)
@ -80,6 +85,7 @@ def menu(screen, size, isInstalled):
li.append(_("Create new window(s)"), 5) li.append(_("Create new window(s)"), 5)
li.append(_("Manage default windows"), 6) li.append(_("Manage default windows"), 6)
li.append(installtext, 7) li.append(installtext, 7)
li.append(welcometext, 8)
bb = ButtonBar(screen, ((_("Okay"), "okay"), (_("Exit"), "exit")), compact = 1) bb = ButtonBar(screen, ((_("Okay"), "okay"), (_("Exit"), "exit")), compact = 1)
g = GridForm(screen, _(" Screen Profiles Configuration"), 1, 2) g = GridForm(screen, _(" Screen Profiles Configuration"), 1, 2)
@ -295,6 +301,35 @@ def defaultwindows(screen, size):
return 100 return 100
def welcomeOn():
path=HOME+'/.screenrc-windows'
line = commands.getoutput("grep '^"+WELCOME+"' "+path)
if line == "":
return 1
else:
return 0
def togglewelcome(screen, size, welcome):
if welcome:
togglewelcomeon()
out = _("Screen Profiles Configuration will be launched automatically.")
rc = 101
else:
togglewelcomeoff()
out = _("Screen Profiles Configuration will be not launched automatically.")
rc = 100
button = messagebox(screen, 70, 2, "Message", out, \
buttons=((_("Okay"),"okay"), (_("Exit"), "exit")) )
if button == "exit":
return 0
return rc
def togglewelcomeon():
commands.getoutput("sed -i -e 's/^#"+WELCOME+"/"+WELCOME+"/' "+HOME+'/.screenrc-windows')
def togglewelcomeoff():
commands.getoutput("sed -i -e 's/^"+WELCOME+"/#"+WELCOME+"/' "+HOME+'/.screenrc-windows')
def install(screen, size, isInstalled): def install(screen, size, isInstalled):
if not isInstalled: if not isInstalled:
out = commands.getoutput("bash /usr/share/screen-profiles/screen-launcher-install") out = commands.getoutput("bash /usr/share/screen-profiles/screen-launcher-install")
@ -405,11 +440,12 @@ def main():
config = SafeConfigParser() config = SafeConfigParser()
isInstalled = (commands.getoutput('grep screen-launcher '+(HOME+'/.profile')) != "") isInstalled = (commands.getoutput('grep screen-launcher '+(HOME+'/.profile')) != "")
welcome = welcomeOn()
tag = 100 tag = 100
while tag > 0 : while tag > 0 :
tag = menu(screen, size, isInstalled) tag = menu(screen, size, isInstalled, welcome)
if tag == 1: if tag == 1:
tag = help(screen, size, config) tag = help(screen, size, config)
elif tag == 2: elif tag == 2:
@ -425,6 +461,9 @@ def main():
elif tag == 7: elif tag == 7:
tag = install(screen, size, isInstalled) tag = install(screen, size, isInstalled)
isInstalled=(tag == 100) isInstalled=(tag == 100)
elif tag == 8:
tag = togglewelcome(screen, size, welcome)
welcome=(tag == 100)
screen.finish() screen.finish()
sys.exit(0) sys.exit(0)