2525 SOURCE_REPOSITORY_URL ,
2626 contribution_guides_base_url ,
2727)
28+ from qtribu .gui .wdg_authoring import AuthoringWidget
29+ from qtribu .gui .wdg_editing_compliance import EditingPolicyWidget
2830from qtribu .toolbelt import NetworkRequestsManager , PlgLogger , PlgOptionsManager
2931from qtribu .toolbelt .commons import open_url_in_browser
3032
3133
3234class ArticleForm (QDialog ):
3335 """QDialog form to submit an article."""
3436
37+ # type hints for sub-widgets
38+ wdg_author : AuthoringWidget
39+ wdg_editing_compliance : EditingPolicyWidget
40+
3541 def __init__ (self , parent : Optional [QWidget ] = None ):
3642 """Constructor.
3743
@@ -53,17 +59,6 @@ def initGui(self) -> None:
5359 # custom icon
5460 self .setWindowIcon (ICON_ARTICLE )
5561
56- # publication
57- self .cbb_license .addItems (
58- [
59- "Creative Commons International BY-NC-SA 4.0" ,
60- "Creative Commons International BY-SA 4.0" ,
61- "Creative Commons International BY 4.0" ,
62- "Beerware (Révision 42)" ,
63- "autre - merci de préciser dans le champ libre en fin de formulaire" ,
64- ]
65- )
66-
6762 # connect help button
6863 self .btn_box .helpRequested .connect (
6964 partial (
@@ -79,6 +74,13 @@ def initGui(self) -> None:
7974 self .tr ("Submit" )
8075 )
8176
77+ # custom sub-widget
78+ self .wdg_editing_compliance .frm_rdp .hide ()
79+ self .wdg_editing_compliance .chb_transparency .setText (
80+ self .wdg_editing_compliance .chb_transparency .text ()
81+ + self .tr ("\n If not, I give some details in the comment area." )
82+ )
83+
8284 # set the minimum proposed date to 2 weeks from
8385 today : QDate = QDate .currentDate ()
8486 min_date : QDate = today .addDays (14 )
@@ -174,16 +176,17 @@ def on_btn_submit(self) -> Union[bool, str, None]:
174176 if not self .check_required_fields ():
175177 return False
176178
177- completed_url = (
178- f"{ self .ISSUE_FORM_BASE_URL } "
179+ completed_url : str = (
180+ f"{ self .issue_form_url } "
179181 f"&in_author_name={ self .wdg_author .lne_firstname .text ()} "
180182 f"{ self .wdg_author .lne_lastname .text ()} "
181183 f"&in_author_mail={ self .wdg_author .lne_email .text ()} "
182184 f"&in_author_linkedin={ self .wdg_author .lne_linkedin_account .text ()} "
183185 f"&in_author_mastodon={ self .wdg_author .lne_mastodon_account .text ()} "
184186 f"&in_author_twitter={ self .wdg_author .lne_twitter_account .text ()} "
185187 f"&in_author_license=true"
186- f"&cb_author_content_relationship={ self .chb_transparency .isChecked ()} "
188+ f"&cb_author_content_relationship={ self .wdg_editing_compliance .chb_transparency .isChecked ()} "
189+ f"&cb_author_aware_ai_guidelines={ self .wdg_editing_compliance .chb_genai_editing_policy .isChecked ()} "
187190 f"&in_art_title={ self .lne_title .text ()} "
188191 f"&in_art_date={ self .dte_proposed_date .date ().toString ('dd/MM/yyyy' )} "
189192 f"&tx_art_content={ self .txt_description .toPlainText ()} "
@@ -192,7 +195,7 @@ def on_btn_submit(self) -> Union[bool, str, None]:
192195 f"&title=[Proposition] { self .lne_title .text ()} - { __title__ } { __version__ } "
193196 )
194197 self .log (message = f"Opening issue form: { completed_url } " , log_level = 4 )
195- url_opened = open_url_in_browser (url = completed_url )
198+ url_opened : bool = open_url_in_browser (url = completed_url )
196199 if url_opened :
197200 self .log (
198201 message = self .tr ("Issue form URL opened in default system web browser." ),
0 commit comments