Quote |
I haven't looked at your (robert's) code yet, but I plan to make a slight modification to exit.lua. Its current behavior, if you uncheck "backup" and then select "reboot" (or "shutdown" if reboot is already selected), is to automatically re-check "backup". This doesn't seem like a logical behavior, and I assume it will be a minor thing to change. |
Code Sample |
[code]w = fltk:Fl_Double_Window(205, 175, "DSL Exit Options") --[[ -- I don't think this is needed? w:callback( function(w) os.exit(0) end) ]] shutdownGroup = fltk:Fl_Group(40, 15, 135, 75) shutdownBtn = fltk:Fl_Round_Button(55, 15, 95, 25, "Shutdown") shutdownBtn:type(fltk.FL_RADIO_BUTTON) shutdownBtn:value(1) shutdownBtn:callback( function(shutdownBtn) -- backupBtn:value(1) backupBtn:show() end) rebootBtn = fltk:Fl_Round_Button(55, 35, 100, 25, "Reboot") rebootBtn:type(fltk.FL_RADIO_BUTTON) rebootBtn:value(0) rebootBtn:callback( function(rebootBtn) -- backupBtn:value(1) backupBtn:show() end) promptBtn = fltk:Fl_Round_Button(55, 55, 115, 25, "Exit to Prompt"); promptBtn:type(fltk.FL_RADIO_BUTTON) promptBtn:value(0) promptBtn:callback( function(promptBtn) -- backupBtn:value(0) backupBtn:hide() end) fltk:Fl_End() -- End of shutdown group backupBtn = fltk:Fl_Check_Button(70, 85, 80, 30, "Backup") backupBtn:tooltip("Uncheck to skip backup") backupBtn:value(1) --[[ -- I know this isn't needed. The value of backupBtn will normally -- change itself automatically. Setting the button type to a -- boxtype causes the problem that this callback fixes. backupBtn:type(fltk.FL_DOWN_BOX) backupBtn:callback( function(backupBtn) if backupBtn:value() == 0 then backupBtn:value(1) else backupBtn:value(0) end end) ]] --[[ the backup and reboot checks are now nested inside the prompt check. If the prompt is true, the others are not checked, and there is no need to check backup ]] okBtn = fltk:Fl_Return_Button(25, 130, 60, 25, "OK") okBtn:callback( function(okBtn) if promptBtn:value() == 1 then os.execute("pidof jwm >/dev/null && pkill jwm") os.execute("pidof fluxbox && pkill fluxbox") os.execute("pidof swm && pkill swm") os.exit(0) else if backupBtn:value() == 0 then os.execute("> /opt/.backup_device") backupReq = "" else backupReq = "yes" end if rebootBtn:value() == 1 then os.execute("/usr/local/bin/exitcheck.sh reboot " .. backupReq) else os.execute("/usr/local/bin/exitcheck.sh shutdown " .. backupReq) end end os.exit(0) end) cancelBtn = fltk:Fl_Button(115, 130, 60, 25, "Cancel") cancelBtn:callback( function(cancelBtn) os.exit(1) end) w:show() Fl:run() |
Code Sample |
modprobe sb io=0x220 irq=5 dma=1 |
Quote (roberts @ Oct. 16 2007,07:48) |
Neverless, I have script updated many extensions to add a resized 32x32 .xpm icon. The original 48x48 icon in .xtdesktop remains for continued compatibiliy with DSL 3.x and prior versions. Now when 4.0 is loading an extension, either at boot up or dynamically a check is made to see if an xpm icon is in /tmp/mydsl.icons and if so the application specific one is used otherwise the fallback generic "open box" icon will be used. |