Commit Graph

60 Commits

Author SHA1 Message Date
Marta Marczykowska-Górecka
32078242c9
Code deduplication and cleanup
Moved loop handling, exception handling and program
running methods of the gui tools to the utils file.

fixes QubesOS/qubes-issues#5342
2019-09-26 22:31:39 +02:00
Marek Marczykowski-Górecki
1edf363efe
Merge remote-tracking branch 'origin/pr/172'
* origin/pr/172:
  Say which repository caused the error in warnings
  Only make qrexec calls when necessary
  Squash more PyLint warnings
  Decode stderr in repo qrexec calls
  Fix error handling
  Fix `self` being undefined when showing warnings
  Only apply repo preferences when "OK" is clicked
  Don't use asserts for error handling
  Check that repo management succeeded
  Remove unnecessary assert
  Squash some PyLint warnings
  Add UI for managing Qubes update repositories
  Fix typo

Fixes QubesOS/qubes-issues#4550
2019-08-28 16:42:01 +02:00
AJ Jordan
7245603628
Say which repository caused the error in warnings 2019-07-03 01:48:55 -07:00
AJ Jordan
352c0d0386
Only make qrexec calls when necessary
This helps in situations where the qrexec calls are forbidden; it also
prevents settings from being unintentionally changed and gives a
noticeable performance boost when the "OK" button is clicked.
2019-07-03 01:46:39 -07:00
AJ Jordan
e0919beec1
Squash more PyLint warnings
This definitely worked before, and I haven't touched this code recently
so I have no idea why these errors are just now popping up... but
whatever.
2019-07-02 16:04:04 -07:00
AJ Jordan
6a5823b74a
Decode stderr in repo qrexec calls
Before this change, "foobar\n" on stderr would be rendered (in the
warning dialog) as "b'foobar\n'", which is ugly. Now it'll be rendered
just as "foobar", followed by an actual newline character.
2019-07-02 13:45:21 -07:00
AJ Jordan
4931bf9401
Fix error handling
Apparently Python exceptions don't take **kwargs, so we just pass a
dictionary as the second (regular) argument. While we're at it, we
pretty-print said dictionary when displaying error messages.
2019-07-02 13:37:29 -07:00
AJ Jordan
33ef478626
Fix self being undefined when showing warnings 2019-07-02 13:07:06 -07:00
AJ Jordan
026a844a91
Only apply repo preferences when "OK" is clicked 2019-07-02 12:36:29 -07:00
AJ Jordan
f3305b8288
Don't use asserts for error handling 2019-07-02 12:36:22 -07:00
AJ Jordan
8f9989a61d
Check that repo management succeeded 2019-07-01 17:23:49 -07:00
AJ Jordan
047cfbc407
Remove unnecessary assert
First of all, the method that was being called has asserts of its own,
so it's guaranteed to either succeed or crash the program with
AssertionError. Second, asserts are optimized out by the interpreter
when -O is passed. Therefore, this code is buggy because it sometimes
wouldn't be run, but we need the side effects.
2019-07-01 17:23:48 -07:00
AJ Jordan
df48c749c4
Squash some PyLint warnings 2019-07-01 17:23:46 -07:00
AJ Jordan
fdd06d32a5
Add UI for managing Qubes update repositories
Depends on QubesOS/qubes-core-admin-linux#48

Fixes QubesOS/qubes-issues#4550
2019-07-01 17:23:40 -07:00
AJ Jordan
a8df324b2d
Fix typo 2019-07-01 17:23:31 -07:00
Marta Marczykowska-Górecka
e79724f9db
Update Qt version used in qubesmanager to Qt5
Fixed dependencies, places where obsolete functions stopped working,
code fragments that started throwing warnings and an .ui file that
stopped being readable after the update.
2019-05-30 21:33:49 +02:00
Marta Marczykowska-Górecka
733f00ddf2
Fixed unnecessary property set in Global Settings 2019-05-03 14:41:01 +02:00
Marta Marczykowska-Górecka
b9316bcd62
Fixed bug in Global Settings
Incorrect handling of Check dom0 updates being set to false.

fixes QubesOS/qubes-issues#4988
2019-05-03 14:41:00 +02:00
Marta Marczykowska-Górecka
00ccce4816
Fixed minor errors found when debugging feature settings
the check-updates default was being incorrectly set
2019-03-21 14:47:03 +01:00
M. Vefa Bicakci
7df475e0aa
global_settings: Use MiB, not M as the unit
Prior to this commit, clicking on the "OK" button in the global settings
window would cause the dom0 memory boost and minimum VM memory fields to
be saved incorrectly, due to the fact that the code calculates the
values to be saved using the "MiB" as the units (i.e., factors of
1024), whereas the code would save the corresponding string into the
qmemman configuration file with the "M" suffix (indicating factors of
1000 instead of 1024).

Due to this bug, the aforementioned fields' values would be scaled down
every time the user clicked on the "OK" button in the global settings
window. For example, if the user entered 400 and hit 'OK', opening the
global settings window again would show the value 381.
2019-01-16 21:17:52 -05:00
Marta Marczykowska-Górecka
a4c63cc939
And also fixed problem with setting default template to None
The bug was the same.
2018-07-22 23:57:50 +02:00
Marta Marczykowska-Górecka
6377983f9a
Fixed problem with setting default_dispvm to None in Global Settings
fixes QubesOS/qubes-issues#4114
2018-07-22 23:55:09 +02:00
Marta Marczykowska-Górecka
efa2b2d858
Remove templates from listing in UpdateVM and ClockVm in Global Settings
A user should not be able to set a TemplateVM as an UpdateVM or ClockVM
in Global Settings.

fixes QubesOS/qubes-issues#1831
2018-07-12 21:22:15 +02:00
Marta Marczykowska-Górecka
7ed386985d
Added default_dispvm to Global Settings
Added "default dispvm" to Global Settings.

references QubesOS/qubes-issues#3688
2018-03-14 22:21:33 +01:00
Marta Marczykowska-Górecka
91538f1aaf
Apply changes in global settings only when actual changes occurred
Fixed apply methods to check if there is an actual need to apply
changes.
2018-03-02 14:30:56 +01:00
Marta Marczykowska-Górecka
43520331f2
Fix pylint's critique 2018-03-02 01:04:02 +01:00
Marta Marczykowska-Górecka
b08ce9524f
Replaced single check vm updates checkbox
Now there is a checkbox for the default for new VMs, and two
buttons to either disable checking for updates in all VMs or enable it
in all VMs.
2018-02-22 22:24:34 +01:00
Marta Marczykowska-Górecka
02117b1870
Restored check-dom0-updates functionality in Global Settings
Currently it uses a workaround, manually creating a file in
/var/lib/qubes/updates; once the appropriate attribute will start working
it will be used instead.
2018-02-22 22:22:45 +01:00
Marta Marczykowska-Górecka
0700275586
De-uglify kernel selection in Global Settings
Replaced kernel selection with utils.prepare_kernel; also added option
to utils.prepare_choice to treat empty string as None (applicable to
kernels).
2018-02-22 22:22:42 +01:00
Marta Marczykowska-Górecka
4882013a32
De-uglify default template in Global Settings
Replaced old, manual vm list with a nicer, less disgusting
utils.prepare_vm_choice approach.
2018-02-22 22:21:39 +01:00
Marta Marczykowska-Górecka
84d7e8bf9c
Allow setting default NetVM to None in Global Settings
Replaced old, manual vm list with a nicer, less disgusting
utils.prepare_vm_choice approach.
2018-02-22 22:21:39 +01:00
Marta Marczykowska-Górecka
29a56d9c88
Fixed error in setting Clockvm to None in Global Settings
Replaced old, manual vm list with a nicer, less disgusting
utils.prepare_vm_choice approach.
2018-02-22 22:21:39 +01:00
Marta Marczykowska-Górecka
c1e9074cb9
Fixed error in setting Updatevm to None in Global Settings
Replaced old, manual vm list with a nicer, less disgusting
utils.prepare_vm_choice approach.
2018-02-22 22:21:39 +01:00
Marta Marczykowska-Górecka
5f1e4803fe
Applied corrections from @marmarek 2017-11-17 17:42:19 +01:00
Marta Marczykowska-Górecka
135060dfe7
Final corrections
Errors that my local pylint ignored and travis' pylint didn't.
2017-11-14 15:44:43 +01:00
Marta Marczykowska-Górecka
8cfc93c70c
Misc errors part 2
Renamed variable from 'input' to 'input_string' and moved imports to a
better place (that is, at the beginning of the module and not inside of
a function).
2017-11-09 17:57:21 +01:00
Marta Marczykowska-Górecka
59a9b7da40
Redefined variable type
Marked places where redefining variable type was actually sensible as
such.
2017-11-09 17:41:09 +01:00
Marta Marczykowska-Górecka
ff4ee713b1
Removed unnecessary global variables
Removed three variables set to global, which were all used only in their
respective "main" function.
2017-11-09 17:41:09 +01:00
Marta Marczykowska-Górecka
6e5d611f70
Fixed invalid names
Fixed camel case, too long and too short variable and function names.
2017-11-09 16:18:16 +01:00
Marta Marczykowska-Górecka
2b24abb8c8
Fixed trailing and bad whitespaces
Fixed trailing and bad whitespaces
2017-11-06 23:55:58 +01:00
Marta Marczykowska-Górecka
91572eea2d
Fixed too-long lines
Fixed lines over 80 characters.
2017-11-06 23:55:58 +01:00
Marta Marczykowska-Górecka
c252e9ec3c
Fixed wildcard imports
Fixed wildcard imports and any further problems resulting from them.
2017-11-06 23:55:58 +01:00
Marta Marczykowska-Górecka
3009610a62
Fixed GPL license
Replaced old, address-having, too-many-characters-in-a-line version with
the new one with URL.
2017-11-06 21:06:30 +01:00
Marek Marczykowski-Górecki
07162ba089
use 'klass' property instead of actual VM object class
The later is going to be generic QubesVM class, to save admin.vm.List
calls.
2017-10-07 00:22:41 +02:00
Wojtek Porczyk
2c3df7bd67 spring cleaning part 5: more python3 fixes 2017-07-12 14:54:14 +02:00
Marta Marczykowska-Górecka
5daa35a301
update globalsettingsdlg for new API 2017-06-25 17:31:10 +02:00
Marek Marczykowski-Górecki
7c602bf7d2
i18n: wrap strings with self.tr
Allow translations to handle strings defined in code.

Fixes QubesOS/qubes-issues#2599
2017-01-22 13:22:26 +01:00
Marek Marczykowski-Górecki
eac2df7e18
Do not allow setting dom0 as any system VM
Fixes QubesOS/qubes-issues#1379
2015-12-17 22:49:45 +01:00
Marek Marczykowski-Górecki
0f2e999230
Do not allow setting dom0 as default netvm
Fixes QubesOS/qubes-issues#1379
2015-12-13 01:21:41 +01:00
Marek Marczykowski-Górecki
1d02420f86
global settings: VMs 'updates check' status now can be also retrieved
qubesos/qubes-issues#892
2015-08-05 01:24:52 +02:00