summaryrefslogtreecommitdiffstats
path: root/xserver.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-06-15 16:17:53 +0000
committerMatt Wilson <msw@redhat.com>2000-06-15 16:17:53 +0000
commitd272a1574c8809e19de12121d2597bef9b8c17f9 (patch)
tree069f553b4aaf1302f928dfb27b34489791611228 /xserver.py
parentc2e0852d427b8553349e77f5f1e2f9e7602c0e1b (diff)
downloadanaconda-d272a1574c8809e19de12121d2597bef9b8c17f9.tar.gz
anaconda-d272a1574c8809e19de12121d2597bef9b8c17f9.tar.xz
anaconda-d272a1574c8809e19de12121d2597bef9b8c17f9.zip
ask for mouse info when probe fails
Diffstat (limited to 'xserver.py')
-rw-r--r--xserver.py54
1 files changed, 51 insertions, 3 deletions
diff --git a/xserver.py b/xserver.py
index 65bc00b42..e5362b3da 100644
--- a/xserver.py
+++ b/xserver.py
@@ -8,7 +8,56 @@ from xf86config import *
from kbd import Keyboard
from mouse import Mouse
import time
+from snack import *
+from translate import _
+from constants_text import *
+from mouse_text import MouseWindow, MouseDeviceWindow
+def mouseWindow(mouse):
+ screen = SnackScreen()
+
+ STEP_MESSAGE = 0
+ STEP_TYPE = 1
+ STEP_DEVICE = 2
+ STEP_DONE = 3
+ step = 0
+ while step < STEP_DONE:
+ if step == STEP_MESSAGE:
+ button = ButtonChoiceWindow(screen, _("Mouse Not Detected"),
+ _("Your mouse was not automatically "
+ "detected. To proceed in the graphical "
+ "installation mode, please proceed to "
+ "the next screen and provide your mouse "
+ "information. You may also use text mode "
+ "installation which does not require a mouse."),
+ buttons = [ _("OK"), _("Use text mode") ])
+ if button == string.lower (_("Use text mode")):
+ screen.finish ()
+ return 0
+ else:
+ step = STEP_TYPE
+ continue
+
+ if step == STEP_TYPE:
+ rc = MouseWindow()(screen, mouse)
+ if rc == INSTALL_BACK:
+ step = STEP_MESSAGE
+ continue
+ else:
+ step = STEP_DEVICE
+ continue
+
+ if step == STEP_DEVICE:
+ rc = MouseDeviceWindow()(screen, mouse)
+ if rc == INSTALL_BACK:
+ step = STEP_TYPE
+ continue
+ else:
+ step = STEP_DONE
+ continue
+ screen.finish()
+ return 1
+
def startX():
global serverPath
global mode
@@ -20,9 +69,8 @@ def startX():
mouse = Mouse()
if not mouse.probe ():
- print "No mouse detected, GUI startup can not continue."
- time.sleep (1)
- print "Falling back to Text mode"
+ if not mouseWindow(mouse):
+ raise RuntimeError, "failed to get a mouse for X startup"
x = XF86Config (mouse)
x.probe ()