diff --git a/pythonrewrite/plugins/date/date.py b/pythonrewrite/plugins/date/date.py index 245c6b6..466a81a 100644 --- a/pythonrewrite/plugins/date/date.py +++ b/pythonrewrite/plugins/date/date.py @@ -7,7 +7,7 @@ class date(CryptoBoxPlugin.CryptoBoxPlugin): requestAuth = False rank = 10 - def doAction(self, store=None, year=0, month=0, day=0, hour=0, minute=0): + def doAction(self, store=None, year=None, month=None, day=None, hour=None, minute=None): import datetime if store: try: diff --git a/pythonrewrite/plugins/date/form_date.cs b/pythonrewrite/plugins/date/form_date.cs index 3f58f4b..3dd732a 100644 --- a/pythonrewrite/plugins/date/form_date.cs +++ b/pythonrewrite/plugins/date/form_date.cs @@ -4,10 +4,10 @@ - +


-


- diff --git a/pythonrewrite/plugins/format_fs/volume_format_luks.cs b/pythonrewrite/plugins/format_fs/volume_format_luks.cs index 940ac22..e2c52bb 100644 --- a/pythonrewrite/plugins/format_fs/volume_format_luks.cs +++ b/pythonrewrite/plugins/format_fs/volume_format_luks.cs @@ -7,13 +7,12 @@ - + - - - + +

:

: + +

+ + + +
+ +
diff --git a/pythonrewrite/plugins/language_selection/language_selection.py b/pythonrewrite/plugins/language_selection/language_selection.py new file mode 100644 index 0000000..9b28764 --- /dev/null +++ b/pythonrewrite/plugins/language_selection/language_selection.py @@ -0,0 +1,16 @@ +import CryptoBoxPlugin + + +class language_selection(CryptoBoxPlugin.CryptoBoxPlugin): + + pluginCapabilities = [ "system", "menu" ] + requestAuth = False + rank = 60 + + def doAction(self): + return "language_selection" + + + def getStatus(self): + return "TODO" + diff --git a/pythonrewrite/plugins/language_selection/plugin_icon.png b/pythonrewrite/plugins/language_selection/plugin_icon.png new file mode 100644 index 0000000..fdaa852 Binary files /dev/null and b/pythonrewrite/plugins/language_selection/plugin_icon.png differ diff --git a/pythonrewrite/plugins/language_selection/unittests.py b/pythonrewrite/plugins/language_selection/unittests.py new file mode 100644 index 0000000..6e9b349 --- /dev/null +++ b/pythonrewrite/plugins/language_selection/unittests.py @@ -0,0 +1,10 @@ +import WebInterfaceTestClass + +class unittests(WebInterfaceTestClass.WebInterfaceTestClass): + + def test_read_form(self): + url = self.URL + "language_selection?weblang=en" + self.register_auth(url) + self.cmd.go(url) + self.cmd.find('hoose an interface language') + diff --git a/pythonrewrite/plugins/logs/unittests.py b/pythonrewrite/plugins/logs/unittests.py index 95bc49a..25b7727 100644 --- a/pythonrewrite/plugins/logs/unittests.py +++ b/pythonrewrite/plugins/logs/unittests.py @@ -3,7 +3,7 @@ import WebInterfaceTestClass class unittests(WebInterfaceTestClass.WebInterfaceTestClass): def test_read_logs(self): - log_url = self.URL + "plugins/logs" + log_url = self.URL + "logs" self.register_auth(log_url) self.cmd.go(log_url) self.cmd.find('class="console"') @@ -14,7 +14,7 @@ class unittests(WebInterfaceTestClass.WebInterfaceTestClass): ## 2) the log message does not get lost in a possible stream of log messages log_text = "unittest - just a marker - please ignore" self.cbox.log.error(log_text) - log_url = self.URL + "plugins/logs" + log_url = self.URL + "logs" self.register_auth(log_url) self.cmd.go(log_url) self.cmd.find(log_text) diff --git a/pythonrewrite/plugins/network/form_network.cs b/pythonrewrite/plugins/network/form_network.cs index e2b6786..509e2d5 100644 --- a/pythonrewrite/plugins/network/form_network.cs +++ b/pythonrewrite/plugins/network/form_network.cs @@ -8,7 +8,7 @@ - +

0 ?> - + - +


-

- -
- - "> + icon: shutdown
- - "> + icon: reboot
diff --git a/pythonrewrite/plugins/shutdown/lang/en.hdf b/pythonrewrite/plugins/shutdown/lang/en.hdf index 2321ae2..2356e4a 100644 --- a/pythonrewrite/plugins/shutdown/lang/en.hdf +++ b/pythonrewrite/plugins/shutdown/lang/en.hdf @@ -2,11 +2,12 @@ Name = Shutdown or reboot the computer Link = Shutdown Title.Shutdown = Shutdown computer +Title.ProgressShutdown = The CryptoBox is shutting down +Title.ProgressReboot = The CryptoBox is rebooting Button.Shutdown = Poweroff Button.Reboot = Reboot -Text.ShutdownInfo = You may turn off or reboot your CryptoBox here. SuccessMessage { Shutdown { diff --git a/pythonrewrite/plugins/shutdown/progress_reboot.cs b/pythonrewrite/plugins/shutdown/progress_reboot.cs new file mode 100644 index 0000000..d36ce78 --- /dev/null +++ b/pythonrewrite/plugins/shutdown/progress_reboot.cs @@ -0,0 +1,6 @@ + + +

+ + + diff --git a/pythonrewrite/plugins/shutdown/progress_shutdown.cs b/pythonrewrite/plugins/shutdown/progress_shutdown.cs new file mode 100644 index 0000000..a4afd10 --- /dev/null +++ b/pythonrewrite/plugins/shutdown/progress_shutdown.cs @@ -0,0 +1,6 @@ + + +

+ + + diff --git a/pythonrewrite/plugins/shutdown/root_action.py b/pythonrewrite/plugins/shutdown/root_action.py index de357b7..9aa553b 100755 --- a/pythonrewrite/plugins/shutdown/root_action.py +++ b/pythonrewrite/plugins/shutdown/root_action.py @@ -3,20 +3,20 @@ ## necessary: otherwise CryptoBoxRootActions.py will refuse to execute this script PLUGIN_TYPE = "cryptobox" -POWEROFF_BIN = "/sbin/poweroff" -REBOOT_BIN = "/sbin/reboot" +SHUTDOWN_BIN = "/sbin/shutdown" + +## delay (in seconds) before shutdown +SHUTDOWN_DELAY = 3 import subprocess -import re import sys -import os def call_prog(progy): proc = subprocess.Popen( - shell = False, - args = [progy]) - proc.wait() + shell = False, + args = progy) + proc.communicate() return proc.returncode == 0 @@ -34,9 +34,9 @@ if __name__ == "__main__": sys.exit(1) if args[0] == "reboot": - result = call_prog(REBOOT_BIN) + result = call_prog([SHUTDOWN_BIN, "-t", str(SHUTDOWN_DELAY), "-r", "now"]) elif args[0] == "shutdown": - result = call_prog(POWEROFF_BIN) + result = call_prog([SHUTDOWN_BIN, "-t", str(SHUTDOWN_DELAY), "-h", "now"]) else: sys.stderr.write("%s: illegal argument (%s)\n" % (self_bin, args[0])) sys.exit(1) diff --git a/pythonrewrite/plugins/shutdown/shutdown.py b/pythonrewrite/plugins/shutdown/shutdown.py index d083cbf..0638058 100644 --- a/pythonrewrite/plugins/shutdown/shutdown.py +++ b/pythonrewrite/plugins/shutdown/shutdown.py @@ -6,7 +6,7 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin): pluginCapabilities = [ "system", "menu" ] requestAuth = False - rank = 70 + rank = 90 def doAction(self, type=None): if not type: @@ -14,7 +14,7 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin): elif type == "shutdown": if self.__doShutdown("shutdown"): self.hdf["Data.Success"] = "Plugins.shutdown.Shutdown" - return None + return "progress_shutdown" else: self.hdf["Data.Warning"] = "Plugins.shutdown.ShutdownFailed" return "form_shutdown" @@ -23,7 +23,7 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin): self.hdf["Data.Success"] = "Plugins.shutdown.Reboot" self.hdf["Data.Redirect.URL"] = "" self.hdf["Data.Redirect.Delay"] = REDIRECT_DELAY - return None + return "progress_reboot" else: self.hdf["Data.Warning"] = "Plugins.shutdown.RebootFailed" return "form_shutdown" diff --git a/pythonrewrite/plugins/shutdown/unittests.py b/pythonrewrite/plugins/shutdown/unittests.py index db75182..baa0308 100644 --- a/pythonrewrite/plugins/shutdown/unittests.py +++ b/pythonrewrite/plugins/shutdown/unittests.py @@ -3,9 +3,9 @@ import WebInterfaceTestClass class unittests(WebInterfaceTestClass.WebInterfaceTestClass): def test_read_form(self): - url = self.URL + "plugins/shutdown" + url = self.URL + "shutdown" self.register_auth(url) self.cmd.go(url) - self.cmd.find('plugins/shutdown\?type=reboot') - self.cmd.find('plugins/shutdown\?type=shutdown') + self.cmd.find('shutdown\?type=reboot') + self.cmd.find('shutdown\?type=shutdown') diff --git a/pythonrewrite/plugins/system_preferences/unittests.py b/pythonrewrite/plugins/system_preferences/unittests.py index 5f99c1d..5e0e862 100644 --- a/pythonrewrite/plugins/system_preferences/unittests.py +++ b/pythonrewrite/plugins/system_preferences/unittests.py @@ -3,6 +3,6 @@ import WebInterfaceTestClass class unittests(WebInterfaceTestClass.WebInterfaceTestClass): def test_preferences_overview(self): - self.cmd.go(self.URL + "plugins/system_preferences?weblang=en") + self.cmd.go(self.URL + "system_preferences?weblang=en") self.cmd.find("Preferences") diff --git a/pythonrewrite/plugins/user_manager/lang/en.hdf b/pythonrewrite/plugins/user_manager/lang/en.hdf index 548b81b..3d99c44 100644 --- a/pythonrewrite/plugins/user_manager/lang/en.hdf +++ b/pythonrewrite/plugins/user_manager/lang/en.hdf @@ -1,5 +1,5 @@ Name = User Manager -Link = User Manager +Link = Manage users Title { UserManager = Manage users diff --git a/pythonrewrite/plugins/user_manager/plugin_icon.png b/pythonrewrite/plugins/user_manager/plugin_icon.png index b1fd4eb..e035d2b 100644 Binary files a/pythonrewrite/plugins/user_manager/plugin_icon.png and b/pythonrewrite/plugins/user_manager/plugin_icon.png differ diff --git a/pythonrewrite/plugins/user_manager/unittests.py b/pythonrewrite/plugins/user_manager/unittests.py index 2bdfd47..d2622f2 100644 --- a/pythonrewrite/plugins/user_manager/unittests.py +++ b/pythonrewrite/plugins/user_manager/unittests.py @@ -16,7 +16,7 @@ class unittests(WebInterfaceTestClass.WebInterfaceTestClass): def _gotoPage(self): - url = self.URL + "plugins/user_manager" + url = self.URL + "user_manager" self.register_auth(url) self.cmd.go(url) diff --git a/pythonrewrite/plugins/user_manager/user_list.cs b/pythonrewrite/plugins/user_manager/user_list.cs index db545a5..9938ecc 100644 --- a/pythonrewrite/plugins/user_manager/user_list.cs +++ b/pythonrewrite/plugins/user_manager/user_list.cs @@ -17,7 +17,7 @@

- + @@ -40,7 +40,7 @@

- +

@@ -68,7 +68,7 @@

- + diff --git a/pythonrewrite/plugins/volume_mount/volume_umount.cs b/pythonrewrite/plugins/volume_mount/volume_umount.cs index de2fb33..6002510 100644 --- a/pythonrewrite/plugins/volume_mount/volume_umount.cs +++ b/pythonrewrite/plugins/volume_mount/volume_umount.cs @@ -2,7 +2,7 @@ - +

diff --git a/pythonrewrite/plugins/volume_props/lang/en.hdf b/pythonrewrite/plugins/volume_props/lang/en.hdf index c7b9863..55bbfcc 100644 --- a/pythonrewrite/plugins/volume_props/lang/en.hdf +++ b/pythonrewrite/plugins/volume_props/lang/en.hdf @@ -5,17 +5,30 @@ Title { Properties = Properties ChangeVolumeName = Change the name of this volume ChangePassword = Change the password of this volume + Encryption = Encryption } Button { ContainerNameSet = Change name ChangePassword = Change password + FormatContainer = Format volume } -Text { - UmountBeforeProps = You must deactivate a volume, if you want to change its properties. +Text.FormatForEncryptionSupport = This volume is not encrypted. If you want to turn on encryption, then you have to format the volume. Beware: this will destroy all data of this container. + + +AdviceMessage { + UmountBeforeProps { + Text = You must deactivate a volume, if you want to change its properties. + Link.Text = Deactive volume now + Link.Rel = volume_mount + Link.Attr1.name = action + Link.Attr1.value = umount + Link.Attr2.name = redirect + Link.Attr2.value = volume_props + } } diff --git a/pythonrewrite/plugins/volume_props/unittests.py b/pythonrewrite/plugins/volume_props/unittests.py index 8fb49b5..e91a78d 100644 --- a/pythonrewrite/plugins/volume_props/unittests.py +++ b/pythonrewrite/plugins/volume_props/unittests.py @@ -3,7 +3,7 @@ import WebInterfaceTestClass class unittests(WebInterfaceTestClass.WebInterfaceTestClass): def test_read_form(self): - url = self.URL + "plugins/volume_props?weblang=en&device=%2Fdev%2Floop1" + url = self.URL + "volume_props?weblang=en&device=%2Fdev%2Floop1" self.register_auth(url) self.cmd.go(url) self.cmd.find('Properties') diff --git a/pythonrewrite/plugins/volume_props/volume_properties.cs b/pythonrewrite/plugins/volume_props/volume_properties.cs index cd01d19..92c3fe6 100644 --- a/pythonrewrite/plugins/volume_props/volume_properties.cs +++ b/pythonrewrite/plugins/volume_props/volume_properties.cs @@ -8,7 +8,7 @@ - + @@ -17,10 +17,10 @@ - + - - + @@ -49,14 +49,23 @@ - - + + + + +

+ @@ -35,7 +35,7 @@

+ -

+
+

+
+ + +