Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-paa-bittet
soitool
Commits
41cda4d8
Commit
41cda4d8
authored
5 years ago
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
#86 Fjernet ModulePlaceholder
parent
3913b190
No related branches found
Branches containing commit
No related tags found
1 merge request
!50
#86 Modul: Autentiseringstavle
Pipeline
#77856
failed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
soitool/new_module_dialog.py
+0
-24
0 additions, 24 deletions
soitool/new_module_dialog.py
soitool/soi_workspace_widget.py
+19
-33
19 additions, 33 deletions
soitool/soi_workspace_widget.py
with
19 additions
and
57 deletions
soitool/new_module_dialog.py
+
0
−
24
View file @
41cda4d8
...
...
@@ -20,36 +20,12 @@ from soitool.modules.module_authentification_board import (
)
class
ModulePlaceholder
(
ModuleBase
):
"""
Dummy module used only to fill dialog with content while developing.
"""
def
get_size
(
self
):
"""
Not used.
"""
raise
NotImplementedError
def
get_data
(
self
):
"""
Not used.
"""
raise
NotImplementedError
@staticmethod
def
get_user_friendly_name
():
"""
Get placeholder name.
"""
return
"
Modul
"
@staticmethod
def
get_icon
():
"""
Get standard placeholder icon.
"""
return
QIcon
(
"
soitool/media/placeholder.png
"
)
# Constant holding all modules the user can choose from. This is intended as a
# point of extensibility. Further modules that are developed can simply be
# placed here, and the rest of the program will respect them.
MODULE_CHOICES
=
[
TableModule
,
AuthentificationBoardModule
,
ModulePlaceholder
,
ModulePlaceholder
,
]
...
...
This diff is collapsed.
Click to expand it.
soitool/soi_workspace_widget.py
+
19
−
33
View file @
41cda4d8
...
...
@@ -16,7 +16,7 @@ from soitool.soi import SOI, ModuleType, ModuleNameTaken
from
soitool.module_list
import
ModuleList
from
soitool.inline_editable_soi_view
import
InlineEditableSOIView
from
soitool.setup_settings
import
Setup
from
soitool.new_module_dialog
import
NewModuleDialog
,
ModulePlaceholder
from
soitool.new_module_dialog
import
NewModuleDialog
from
soitool.dialog_wrappers
import
exec_warning_dialog
...
...
@@ -102,41 +102,27 @@ class SOIWorkspaceWidget(QWidget):
module_widget_implementation
=
chosen_module
.
widget_implementation
is_attachment
=
new_module_dialog
.
checkbox_attachment
.
isChecked
()
if
module_widget_implementation
is
ModulePlaceholder
:
# no module name means the user expects one to be generated
# autogenerated name is not meant to be pretty, it's just meant
# to be unique
if
not
module_name
:
module_name
=
"
{} {}
"
.
format
(
module_choice
,
str
(
len
(
self
.
soi
.
modules
)
+
len
(
self
.
soi
.
attachments
)
+
1
),
)
try
:
self
.
soi
.
add_module
(
module_name
,
module_widget_implementation
(),
is_attachment
,
)
except
ModuleNameTaken
:
exec_warning_dialog
(
text
=
"
Modulen ble ikke lagt til.
"
,
informative_text
=
"
Den valgte modulen er ikke
"
"
implementert. Modulen er trolig bare valgbar for å fylle
"
"
ut valgene til flere moduler er implementert.
"
,
informative_text
=
"
Navnet du valgte er allerede i
"
"
bruk. Modulnavn må være unike. Velg et unikt
"
"
modulnavn, eller la programmet lage et navn
"
"
automatisk.
"
,
)
else
:
# no module name means the user expects one to be generated
# autogenerated name is not meant to be pretty, it's just meant
# to be unique
if
not
module_name
:
module_name
=
"
{} {}
"
.
format
(
module_choice
,
str
(
len
(
self
.
soi
.
modules
)
+
len
(
self
.
soi
.
attachments
)
+
1
),
)
try
:
self
.
soi
.
add_module
(
module_name
,
module_widget_implementation
(),
is_attachment
,
)
except
ModuleNameTaken
:
exec_warning_dialog
(
text
=
"
Modulen ble ikke lagt til.
"
,
informative_text
=
"
Navnet du valgte er allerede i
"
"
bruk. Modulnavn må være unike. Velg et unikt
"
"
modulnavn, eller la programmet lage et navn
"
"
automatisk.
"
,
)
elif
dialogcode
==
QDialog
.
DialogCode
.
Rejected
:
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment