mirror of
https://github.com/gryf/wicd.git
synced 2025-12-29 09:52:31 +01:00
Merged wicd-curses changes from experimental-nacl, r294
This commit is contained in:
@@ -44,8 +44,7 @@ What is wicd-curses?
|
|||||||
Why didn't you call it wicd-urwid? There is a hachoir-urwid package out there.
|
Why didn't you call it wicd-urwid? There is a hachoir-urwid package out there.
|
||||||
I first called this "urwicd". However, due to the relative obscurity of
|
I first called this "urwicd". However, due to the relative obscurity of
|
||||||
the urwid package, and the fact that many more people know what "curses"
|
the urwid package, and the fact that many more people know what "curses"
|
||||||
is, I named it wicd-curses. After all, it _does_ use curses (by default,
|
is, I named it wicd-curses.
|
||||||
anyway).
|
|
||||||
|
|
||||||
Why don't you support lower-case keybindings for most of the commands?
|
Why don't you support lower-case keybindings for most of the commands?
|
||||||
I was trying to prevent mass chaos from happening because of mashing keys.
|
I was trying to prevent mass chaos from happening because of mashing keys.
|
||||||
|
|||||||
@@ -26,11 +26,7 @@ from curses_misc import TextDialog,DynWrap,MaskingEdit,ComboBox,error
|
|||||||
import wicd.misc as misc
|
import wicd.misc as misc
|
||||||
from wicd.misc import noneToString, stringToNone, noneToBlankString, to_bool
|
from wicd.misc import noneToString, stringToNone, noneToBlankString, to_bool
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
from wicd.translations import language
|
from wicd.translations import language
|
||||||
for i in language.keys():
|
|
||||||
language[i] = language[i].decode('utf8')
|
|
||||||
|
|
||||||
daemon = None
|
daemon = None
|
||||||
wired = None
|
wired = None
|
||||||
@@ -194,11 +190,16 @@ class AdvancedSettingsDialog(urwid.WidgetWrap):
|
|||||||
self.overlay.mouse_event( dim,
|
self.overlay.mouse_event( dim,
|
||||||
event, button, col, row,
|
event, button, col, row,
|
||||||
focus=True)
|
focus=True)
|
||||||
k = self.overlay.keypress(dim, k)
|
else:
|
||||||
if k in ('up','page up'):
|
k = self.overlay.keypress(dim, k)
|
||||||
self._w.set_focus('body')
|
if k in ('up','page up'):
|
||||||
elif k in ('down','page down'):
|
self._w.set_focus('body')
|
||||||
self._w.set_focus('footer')
|
# Until I figure out a better way to do this, then this will
|
||||||
|
# have to do.
|
||||||
|
self._w.body.get_focus()[0].get_focus()._invalidate()
|
||||||
|
#self._w.body.keypress(dim,'down')
|
||||||
|
elif k in ('down','page down'):
|
||||||
|
self._w.set_focus('footer')
|
||||||
|
|
||||||
if "window resize" in keys:
|
if "window resize" in keys:
|
||||||
dim = ui.get_cols_rows()
|
dim = ui.get_cols_rows()
|
||||||
|
|||||||
2
curses/prefs_curses.py
Executable file → Normal file
2
curses/prefs_curses.py
Executable file → Normal file
@@ -29,8 +29,6 @@ wireless = None
|
|||||||
wired = None
|
wired = None
|
||||||
|
|
||||||
from wicd.translations import language
|
from wicd.translations import language
|
||||||
for i in language.keys():
|
|
||||||
language[i] = language[i].decode('utf8')
|
|
||||||
|
|
||||||
class PrefsDialog(urwid.WidgetWrap):
|
class PrefsDialog(urwid.WidgetWrap):
|
||||||
def __init__(self,body,pos,ui,dbus=None):
|
def __init__(self,body,pos,ui,dbus=None):
|
||||||
|
|||||||
11
curses/wicd-curses.py
Normal file → Executable file
11
curses/wicd-curses.py
Normal file → Executable file
@@ -866,12 +866,13 @@ def main():
|
|||||||
# Import the screen based on whatever the user picked.
|
# Import the screen based on whatever the user picked.
|
||||||
# The raw_display will have some features that may be useful to users
|
# The raw_display will have some features that may be useful to users
|
||||||
# later
|
# later
|
||||||
if options.rawscreen:
|
if options.screen == 'raw':
|
||||||
import urwid.raw_display
|
import urwid.raw_display
|
||||||
ui = urwid.raw_display.Screen()
|
ui = urwid.raw_display.Screen()
|
||||||
else:
|
elif options.screen is 'curses':
|
||||||
import urwid.curses_display
|
import urwid.curses_display
|
||||||
ui = urwid.curses_display.Screen()
|
ui = urwid.curses_display.Screen()
|
||||||
|
|
||||||
# Default Color scheme.
|
# Default Color scheme.
|
||||||
# Other potential color schemes can be found at:
|
# Other potential color schemes can be found at:
|
||||||
# http://excess.org/urwid/wiki/RecommendedPalette
|
# http://excess.org/urwid/wiki/RecommendedPalette
|
||||||
@@ -953,8 +954,10 @@ setup_dbus()
|
|||||||
########################################
|
########################################
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REVNO,daemon.Hello()))
|
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REVNO,daemon.Hello()))
|
||||||
parser.add_option("-r", "--raw-screen",action="store_true",dest='rawscreen',
|
parser.set_defaults(screen='raw')
|
||||||
help="use urwid's raw screen controller")
|
parser.add_option("-r", "--raw-screen",action="store_const",const='raw'
|
||||||
|
,dest='screen',help="use urwid's raw screen controller (default)")
|
||||||
|
parser.add_option("-c", "--curses-screen",action="store_const",const='curses',dest='screen',help="use urwid's curses screen controller")
|
||||||
(options,args) = parser.parse_args()
|
(options,args) = parser.parse_args()
|
||||||
main()
|
main()
|
||||||
# Make sure that the terminal does not try to overwrite the last line of
|
# Make sure that the terminal does not try to overwrite the last line of
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.\" First revision was r203
|
.\" First revision was r203
|
||||||
.TH WICD-CURSES "8" "January 2009" "wicd-curses-%CURSES_REVNO%"
|
.TH WICD-CURSES "8" "February 2009" "wicd-curses-%CURSES_REVNO%"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B wicd-curses
|
.B wicd-curses
|
||||||
\- curses-based wicd(8) controller
|
\- curses-based wicd(8) controller
|
||||||
@@ -12,7 +12,14 @@ This man page only documents the current status of wicd-curses. This may/may no
|
|||||||
.SH "ARGUMENTS"
|
.SH "ARGUMENTS"
|
||||||
.TP
|
.TP
|
||||||
.BR "\-r" , " \-\-raw\-screen"
|
.BR "\-r" , " \-\-raw\-screen"
|
||||||
Use Urwid's raw console display, instead of the (faster) curses-based one. This may be useful if you are experiencing unicode problems.
|
Use Urwid's raw console display. This is the default, and has several
|
||||||
|
advantages over the faster curses display, inculding fully functional unicode
|
||||||
|
and internationalization support.
|
||||||
|
.TP
|
||||||
|
.BR "\-c" , " \-\-curses\-screen"
|
||||||
|
Use Urwid's curses display. This may be faster than the default raw
|
||||||
|
display, but it lacks proper unicode support. This is fine to use if your
|
||||||
|
language of choice only uses Latin characters.
|
||||||
.SH CONTROLS
|
.SH CONTROLS
|
||||||
All of these are case sensitive.
|
All of these are case sensitive.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
@@ -10,18 +10,19 @@ fi
|
|||||||
if [ -e "%VARLIB%WHEREAREMYFILES" ] && [ ! -L "$HOME/.wicd/WHEREAREMYFILES" ]; then
|
if [ -e "%VARLIB%WHEREAREMYFILES" ] && [ ! -L "$HOME/.wicd/WHEREAREMYFILES" ]; then
|
||||||
ln -s "%VARLIB%WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES"
|
ln -s "%VARLIB%WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES"
|
||||||
fi
|
fi
|
||||||
if [ "$DISPLAY" = "" ] && [ -x "%BIN%wicd-curses" ]; then
|
if [ "$DISPLAY" = "" ]; then
|
||||||
if [ ! -f "$HOME/.wicd/CLIENT_CURSES_WARNING" ]; then
|
if [ -x "%BIN%wicd-curses" ]; then
|
||||||
printf "NOTICE: You do not have an X server active on this console, \n"
|
if [ ! -f "$HOME/.wicd/CLIENT_CURSES_WARNING" ]; then
|
||||||
printf "so ${BOLD}${BLUE}wicd-curses${NC} will be started instead. \n"
|
printf "NOTICE: You do not have an X server active on this console, \n"
|
||||||
printf "Please see the wicd-client and/or wicd-curses manual pages \n"
|
printf "so ${BOLD}${BLUE}wicd-curses${NC} will be started instead. \n"
|
||||||
printf "for more information about this error and resulting message. \n"
|
printf "Please see the wicd-client and/or wicd-curses manual pages \n"
|
||||||
printf "\n"
|
printf "for more information about this error and resulting message. \n"
|
||||||
printf "This message will not be displayed again. \n"
|
printf "\n"
|
||||||
printf "Press enter to continue... \n"
|
printf "This message will not be displayed again. \n"
|
||||||
|
printf "Press enter to continue... \n"
|
||||||
|
|
||||||
read _junk
|
read _junk
|
||||||
cat >> "$HOME/.wicd/CLIENT_CURSES_WARNING" << EOF
|
cat >> "$HOME/.wicd/CLIENT_CURSES_WARNING" << EOF
|
||||||
The wicd-client script checks for the existence of this file to determine
|
The wicd-client script checks for the existence of this file to determine
|
||||||
whether it should warn the user before launching wicd-curses instead, in
|
whether it should warn the user before launching wicd-curses instead, in
|
||||||
the event of the gui client being launched outside of the X Window environment.
|
the event of the gui client being launched outside of the X Window environment.
|
||||||
@@ -29,8 +30,16 @@ the event of the gui client being launched outside of the X Window environment.
|
|||||||
If you delete this file, then wicd-client will print the warning if it is
|
If you delete this file, then wicd-client will print the warning if it is
|
||||||
launched outside of X (and then recreate this file again).
|
launched outside of X (and then recreate this file again).
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
exec %BIN%wicd-curses
|
exec %BIN%wicd-curses
|
||||||
fi
|
|
||||||
|
|
||||||
exec python -O %LIB%wicd-client.py $@
|
else
|
||||||
|
printf "NOTICE: You do not have an X server active on this console, \n"
|
||||||
|
printf "but you do not appear to have ${BOLD}${BLUE}wicd-curses${NC}\n"
|
||||||
|
printf "installed on this system. We'd normally be running it here.\n"
|
||||||
|
printf "Please see the wicd-client manual page for more information.\n"
|
||||||
|
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
exec python -O %LIB%wicd-client.py $@
|
||||||
|
fi
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -28,7 +28,7 @@ import subprocess
|
|||||||
VERSION_NUM = '1.6.0a1'
|
VERSION_NUM = '1.6.0a1'
|
||||||
# REVISION_NUM is automatically updated
|
# REVISION_NUM is automatically updated
|
||||||
REVISION_NUM = 'unknown'
|
REVISION_NUM = 'unknown'
|
||||||
CURSES_REVNO = 'r277'
|
CURSES_REVNO = 'r279'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.exists('vcsinfo.py'):
|
if not os.path.exists('vcsinfo.py'):
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -* coding: utf-8 -*-
|
# -* coding: utf-8 -*-
|
||||||
# ^^ why do I need this?
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2009 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
|
|||||||
Reference in New Issue
Block a user