From 5877db7f1c24c900c7b05e384389e34bc44631c3 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 23 Feb 2009 14:26:33 -0600 Subject: [PATCH] Fix for Bug #333180 Add a toggle for turning on/off of the screen profiles configuration screen --- debian/changelog | 13 +++-- po/screen-profiles.pot | 113 ++++++++++++++++++++++++----------------- screen-profiles | 45 ++++++++++++++-- 3 files changed, 115 insertions(+), 56 deletions(-) diff --git a/debian/changelog b/debian/changelog index a192d749..85bdb606 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,14 @@ screen-profiles (1.27) UNRELEASED; urgency=low - Fix for LP: #333189: - * keybindings/common: add profile reload shortcut, "ctrl-a ~" - * screen-profiles: updated messages to point to ^a ~ - * po/*: updated for the new message + * Fix for LP: #333189: + - keybindings/common: add profile reload shortcut, "ctrl-a ~" + - screen-profiles: updated messages to point to ^a ~ + - 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 Mon, 23 Feb 2009 10:04:43 -0600 + -- Dustin Kirkland Mon, 23 Feb 2009 14:25:02 -0600 screen-profiles (1.26-0ubuntu1) jaunty; urgency=low diff --git a/po/screen-profiles.pot b/po/screen-profiles.pot index e791c75a..754f3d00 100644 --- a/po/screen-profiles.pot +++ b/po/screen-profiles.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,140 +16,157 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: screen-profiles:70 +#: screen-profiles:71 msgid "Remove screen by default at login" msgstr "" -#: screen-profiles:72 +#: screen-profiles:73 msgid "Install screen by default at login" msgstr "" -#: screen-profiles:76 -msgid "Help" +#: screen-profiles:75 +msgid "Launch Screen Profiles Configuration on startup" msgstr "" #: screen-profiles:77 -msgid "Change screen profile" -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)" +msgid "Do not launch Screen Profiles Configuration on startup" msgstr "" #: 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" msgstr "" -#: screen-profiles:83 screen-profiles:96 screen-profiles:144 -#: screen-profiles:161 screen-profiles:305 screen-profiles:316 -#: screen-profiles:391 +#: screen-profiles:89 screen-profiles:102 screen-profiles:150 +#: screen-profiles:167 screen-profiles:322 screen-profiles:340 +#: screen-profiles:351 screen-profiles:426 msgid "Okay" msgstr "" -#: screen-profiles:83 screen-profiles:144 screen-profiles:161 -#: screen-profiles:305 screen-profiles:316 screen-profiles:391 +#: screen-profiles:89 screen-profiles:150 screen-profiles:167 +#: screen-profiles:322 screen-profiles:340 screen-profiles:351 +#: screen-profiles:426 msgid "Exit" msgstr "" -#: screen-profiles:85 screen-profiles:402 +#: screen-profiles:91 screen-profiles:437 msgid " Screen Profiles Configuration" msgstr "" -#: screen-profiles:96 screen-profiles:135 screen-profiles:154 -#: screen-profiles:191 screen-profiles:280 screen-profiles:364 +#: screen-profiles:102 screen-profiles:141 screen-profiles:160 +#: screen-profiles:197 screen-profiles:286 screen-profiles:399 msgid "Cancel" msgstr "" -#: screen-profiles:114 +#: screen-profiles:120 msgid "Back" msgstr "" -#: screen-profiles:115 +#: screen-profiles:121 msgid "Screen Profiles Help" msgstr "" -#: screen-profiles:135 screen-profiles:154 +#: screen-profiles:141 screen-profiles:160 msgid "Apply" msgstr "" -#: screen-profiles:137 +#: screen-profiles:143 msgid "Which profile would you like to use?" msgstr "" -#: screen-profiles:143 screen-profiles:160 screen-profiles:315 -#: screen-profiles:389 +#: screen-profiles:149 screen-profiles:166 screen-profiles:350 +#: screen-profiles:424 msgid "Message" msgstr "" -#: screen-profiles:143 screen-profiles:160 screen-profiles:390 +#: screen-profiles:149 screen-profiles:166 screen-profiles:425 msgid "Use ' ~ ' to enable your changes." msgstr "" -#: screen-profiles:155 +#: screen-profiles:161 msgid "Which set of keybindings would you like to use?" msgstr "" -#: screen-profiles:171 +#: screen-profiles:177 msgid "Title: " msgstr "" -#: screen-profiles:173 +#: screen-profiles:179 msgid "Command: " msgstr "" -#: screen-profiles:175 +#: screen-profiles:181 msgid "Presets: " msgstr "" -#: screen-profiles:189 +#: screen-profiles:195 msgid "Add to default windows" msgstr "" -#: screen-profiles:191 +#: screen-profiles:197 msgid "Create" msgstr "" -#: screen-profiles:192 +#: screen-profiles:198 msgid "Create new window(s):" msgstr "" -#: screen-profiles:272 +#: screen-profiles:278 msgid "Windows:" msgstr "" -#: screen-profiles:280 screen-profiles:364 +#: screen-profiles:286 screen-profiles:399 msgid "Save" msgstr "" -#: screen-profiles:282 +#: screen-profiles:288 msgid "Select window(s) to create by default:" 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." msgstr "" -#: screen-profiles:313 +#: screen-profiles:348 msgid "Screen will not be used next time you login." msgstr "" -#: screen-profiles:363 +#: screen-profiles:398 msgid "Escape key: ctrl-" msgstr "" -#: screen-profiles:365 +#: screen-profiles:400 msgid "Change escape sequence:" msgstr "" -#: screen-profiles:403 +#: screen-profiles:438 msgid "/ between elements | Validates" msgstr "" diff --git a/screen-profiles b/screen-profiles index 4f5082b0..60a1ed24 100755 --- a/screen-profiles +++ b/screen-profiles @@ -30,6 +30,7 @@ HOME=os.getenv("HOME") SHARE='/usr/share/screen-profiles' DOC='/usr/share/doc/screen-profiles' DEF_ESC="A" +WELCOME = "screen -t welcome 1 screen-profiles" gettext.bindtextdomain('screen-profiles', SHARE+'/po') gettext.textdomain('screen-profiles') @@ -65,14 +66,18 @@ def terminal_size(): ### decide on *some* terminal size cr = (25, 80) 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: installtext=_("Remove screen by default at login") else: 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(_("Change screen profile"), 2) li.append(_("Change keybinding set"), 3) @@ -80,6 +85,7 @@ def menu(screen, size, isInstalled): li.append(_("Create new window(s)"), 5) li.append(_("Manage default windows"), 6) li.append(installtext, 7) + li.append(welcometext, 8) bb = ButtonBar(screen, ((_("Okay"), "okay"), (_("Exit"), "exit")), compact = 1) g = GridForm(screen, _(" Screen Profiles Configuration"), 1, 2) @@ -295,6 +301,35 @@ def defaultwindows(screen, size): 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): if not isInstalled: out = commands.getoutput("bash /usr/share/screen-profiles/screen-launcher-install") @@ -405,11 +440,12 @@ def main(): config = SafeConfigParser() isInstalled = (commands.getoutput('grep screen-launcher '+(HOME+'/.profile')) != "") + welcome = welcomeOn() tag = 100 while tag > 0 : - tag = menu(screen, size, isInstalled) + tag = menu(screen, size, isInstalled, welcome) if tag == 1: tag = help(screen, size, config) elif tag == 2: @@ -425,6 +461,9 @@ def main(): elif tag == 7: tag = install(screen, size, isInstalled) isInstalled=(tag == 100) + elif tag == 8: + tag = togglewelcome(screen, size, welcome) + welcome=(tag == 100) screen.finish() sys.exit(0)