diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index 1211675..06991d7 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -49,7 +49,7 @@ void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){ break; } - } else if (self == widgets->UpdateIntervalDefaultCheck){ + } else if (self == widgets->UpdateIntervalDefaultCheck||self == widgets->UpdateIntervalSpin|| self == widgets->UpdateIntervalCombo || self == widgets->BootCheck){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UpdateIntervalDefaultCheck))){ yon_config_remove_by_key(AUTOUPDATE_interval); } else { @@ -600,6 +600,16 @@ void on_web_publish_add(GtkWidget *,main_window *widgets){ g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_web_publish_accept),dict); } +void on_scrolled_window_size_allocate(GtkWidget *, GdkRectangle *allocation, repo_add_window *window){ + if (allocation->height<100){ + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox))),GTK_POLICY_NEVER,GTK_POLICY_NEVER); + gtk_widget_set_size_request(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox)),-1,allocation->height); + } else { + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox))),GTK_POLICY_NEVER,GTK_POLICY_ALWAYS); + gtk_widget_set_size_request(gtk_widget_get_parent(gtk_widget_get_parent(window->SourceListBox)),-1,100); + } +} + void on_repo_add(GtkWidget *, main_window *widgets){ gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree))); repo_add_window *window = yon_repo_add_window_new(); @@ -810,7 +820,8 @@ void on_repo_edit(GtkWidget *,main_window *widgets){ void on_web_publish_edit(GtkWidget *,main_window *widgets){ web_publication_add_window *window = yon_web_publication_add_window_new(); - yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_REPO_LABEL,icon_path,"web_publish_window"); + gtk_label_set_text(GTK_LABEL(window->HeadLabel),EDIT_WEB_LABEL); + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_WEB_LABEL,icon_path,"web_publish_window"); dictionary *dict = NULL; yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); @@ -877,7 +888,8 @@ void on_web_publish_edit(GtkWidget *,main_window *widgets){ void on_mirror_edit(GtkWidget *,main_window *widgets){ mirror_add_window *window = yon_mirror_add_window_new(); - yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_REPO_LABEL,icon_path,"mirror_window"); + gtk_label_set_text(GTK_LABEL(window->HeadLabel),EDIT_WEB_LABEL); + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_WEB_LABEL,icon_path,"mirror_window"); dictionary *dict = NULL; yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); @@ -886,7 +898,8 @@ void on_mirror_edit(GtkWidget *,main_window *widgets){ char *target; GtkTreeIter iter; - gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree)),NULL,&iter); + GtkTreeModel *model; + gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree)),&model,&iter); gtk_tree_model_get(GTK_TREE_MODEL(widgets->MirrorList),&iter,0,&target,-1); gtk_entry_set_text(GTK_ENTRY(window->NameEntry),target); window->name = target; @@ -900,12 +913,10 @@ void on_mirror_edit(GtkWidget *,main_window *widgets){ yon_ubl_status_highlight_incorrect(window->TypeEntry); return; } - char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->TypeCombo)); - char *full_name = yon_char_unite(type,"@",target,NULL); gtk_entry_set_text(GTK_ENTRY(window->TypeEntry),""); GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_path_add_path); gtk_box_pack_start(GTK_BOX(window->PathBox),yon_gtk_builder_get_widget(builder,"PathRemovalBox"),0,0,2); - gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder,"PathEntry")),full_name); + gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder,"PathEntry")),target); g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),gtk_builder_get_object(builder,"PathRemovalBox")); g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),gtk_builder_get_object(builder,"PathRemovalBox")); g_object_unref(G_OBJECT(builder)); @@ -1357,7 +1368,9 @@ repo_add_window *yon_repo_add_window_new(){ window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton"); window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel"); + window->SignLevelLabel = yon_gtk_builder_get_widget(builder,"SignLevelLabel"); window->SourceBox = yon_gtk_builder_get_widget(builder,"SourceBox"); + window->SourceListBox = yon_gtk_builder_get_widget(builder,"SourceListBox"); window->RepoSourceAddButton = yon_gtk_builder_get_widget(builder,"RepoSourceAddButton"); window->NeverRadio = yon_gtk_builder_get_widget(builder,"NeverRadio"); window->OptionalRadio = yon_gtk_builder_get_widget(builder,"OptionalRadio"); @@ -1383,7 +1396,9 @@ repo_add_window *yon_repo_add_window_new(){ g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageEnableSearchCheck); g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageEnableUpdateCheck); g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageSysupgradeCheck); + // g_signal_connect(G_OBJECT(window->SourceListBox),"size-allocate",G_CALLBACK(on_scrolled_window_size_allocate),window); gtk_widget_show(window->Window); + gtk_label_set_text(GTK_LABEL(window->SignLevelLabel),SIGN_LEVEL_LABEL); return window; } @@ -1610,8 +1625,12 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->PublicationCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->PublicationUpdateButton); g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->UpdateIntervalCombo); g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->UpdateIntervalSpin); + g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->BootCheck); + g_signal_connect(G_OBJECT(widgets->BootCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_connect(G_OBJECT(widgets->UpdateIntervalSpin),"changed",G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_connect(G_OBJECT(widgets->UpdateIntervalCombo),"changed",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->UpdateModeCombo),"changed",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h index f2cc8c6..6a9e348 100644 --- a/source/ubl-settings-update.h +++ b/source/ubl-settings-update.h @@ -152,6 +152,7 @@ typedef struct { GtkWidget *UsageEnableSearchCheck; GtkWidget *UsageEnableUpdateCheck; GtkWidget *UsageDefaultCheck; + GtkWidget *SourceListBox; GtkWidget *RepoSignConditionCombo; GtkWidget *RepoSignCheckCombo; GtkWidget *RepoSourceButton; @@ -163,6 +164,7 @@ typedef struct { GtkWidget *EnabledCheck; GtkWidget *AcceptButton; GtkWidget *CancelButton; + GtkWidget *SignLevelLabel; GtkWidget *NeverRadio; GtkWidget *OptionalRadio; @@ -311,6 +313,8 @@ void on_password_accept(); void on_password_open(GtkWidget *, web_publication_add_window *window); +void on_scrolled_window_size_allocate(GtkWidget *, GdkRectangle *allocation, repo_add_window *window); + password_window *yon_password_window_new(); repo_add_window *yon_repo_add_window_new(); web_publication_add_window *yon_web_publication_add_window_new(); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index dd2850c..d36784d 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -10,122 +10,154 @@ #define REMOVE_REPO_WARNING_LABEL _("Are you sure want to remove repository?") #define NO_SHARED_REPOS_LABEL _("No repositories were chosen to share") + #define ADD_WEB_LABEL _("Add repository for publication") + #define EDIT_WEB_LABEL _("Edit repository for publication") + #define PASSWORD_MISMATCH_LABEL _("passwords do not match") - // #define _LABEL _("Update") - // #define _LABEL _("Repositories") - // #define _LABEL _("Publication") - // #define _LABEL _("WEB-publication") - // #define _LABEL _("Mirror publication") - // #define _LABEL _("Date of last automatic update: ") - // #define _LABEL _("Automatic update") - // #define _LABEL _("First update all modules and then the system") - // #define _LABEL _("Update only modules") - // #define _LABEL _("Update everything in the order of the specified repositories") - // #define _LABEL _("Update mode:") - // #define _LABEL _("Update interval:") - // #define _LABEL _("Boot") - // #define _LABEL _("Minutes") - // #define _LABEL _("Hours") - // #define _LABEL _("Days") - // #define _LABEL _("Months") - // #define _LABEL _("Repositories from which the update will occur") - // #define _LABEL _("Repositories list:") - // #define _LABEL _("Default") - // #define _LABEL _("Choose") - // #define _LABEL _("Chosen") - // #define _LABEL _("Repository") - // #define _LABEL _("Manage repository list") - // #define _LABEL _("Disable system repositories") - // #define _LABEL _("Update") - // #define _LABEL _("Move up") - // #define _LABEL _("Move down") - // #define _LABEL _("Add") - // #define _LABEL _("Edit") - // #define _LABEL _("Remove") - // #define _LABEL _("Enabled") - // #define _LABEL _("Source") - // #define _LABEL _("Signature level") - // #define _LABEL _("Usage level") - // #define _LABEL _("Repository connection configuration") - // #define _LABEL _("Setting up a connection to a distributed repository network and publishing your repositories") - // #define _LABEL _("Connect and publish") - // #define _LABEL _("Recieve DB packages from shared network") - // #define _LABEL _("Repositories for publishing") - // #define _LABEL _("Repositories list:") - // #define _LABEL _("All repositories") - // #define _LABEL _("Choose") - // #define _LABEL _("Accept") - // #define _LABEL _("Repository name") - // #define _LABEL _("Setting up publication of storage and/or repositories as a local WEB resource") - // #define _LABEL _("Authorization parameters") - // #define _LABEL _("Storage") - // #define _LABEL _("Chosen repositories") - // #define _LABEL _("Reviewer") - // #define _LABEL _("Port") - // #define _LABEL _("Name") - // #define _LABEL _("Password/Hash type") - // #define _LABEL _("Password/Password hash") - // #define _LABEL _("Setting up publication of a lazy mirror of connected repositories as a local WEB resource") - // #define _LABEL _("Publish lazy mirror") - // #define _LABEL _("Type") - // #define _LABEL _("Resource URL") - // #define _LABEL _("Configure") - // #define _LABEL _("Mirror publish configuration") - // #define _LABEL _("Service port:") - // #define _LABEL _("Cache directory:") - // #define _LABEL _("Duration of inactivity (in seconds):") - // #define _LABEL _("Timeout (in seconds) for loading internel cache:") - // #define _LABEL _("Work through proxy:") - // #define _LABEL _("User agent:") - // #define _LABEL _("Standard expression for cron:") - // #define _LABEL _("The number of consecutie days that systems on the network have not been updated:") - // #define _LABEL _("The number of consecutive days wthout an update requested:") - // #define _LABEL _("Add mirror") - // #define _LABEL _("Repository name:") - // #define _LABEL _("Repository type:") - // #define _LABEL _("WEB link") - // #define _LABEL _("Proxy server") - // #define _LABEL _("Mirrors file") - // #define _LABEL _("Source:") - // #define _LABEL _("Configuration") - // #define _LABEL _("Sign level:") - // #define _LABEL _("Enable repository update") - // #define _LABEL _("Enable repository search") - // #define _LABEL _("Enable installation of packages from this repository during --sync operation") - // #define _LABEL _("Allow this repository to be a valid source of packages when running --sysupgrade") - // #define _LABEL _("Add repository for publication") - // #define _LABEL _("Enable publishing of local repository as WEB resource") - // #define _LABEL _("Path to publication directory:") - // #define _LABEL _("Port:") - // #define _LABEL _("Publishing parameters") - // #define _LABEL _("Enable WEB file browser") - // #define _LABEL _("Authorization parameters") - // #define _LABEL _("Set") - // #define _LABEL _("Username:") - // #define _LABEL _("User password:") - // #define _LABEL _("Not encrypted") - // #define _LABEL _("Encrypted with SHA256") - // #define _LABEL _("Encrypted with SHA512") - // #define _LABEL _("System") - // #define _LABEL _("Minutes") - // #define _LABEL _("Hours") - // #define _LABEL _("Days") - // #define _LABEL _("Months") - // #define _LABEL _("Sign level") - // #define _LABEL _("Password input") - // #define _LABEL _("Password:") - // #define _LABEL _("Repeat password:") - // #define _LABEL _("Entryption:") - // #define _LABEL _("Do not encrypt password") - // #define _LABEL _("Password hash:") - - - - - - - - + #define REPO_TOOLTIP_LABEL _("file://\t\t- Directory URL prefix for repository\n\ +ftp://\t\t- FTP URL prefix for repository\n\ +http://\t\t- HTTP URL prefix for repository\n\ +https://\t\t- HTTPS URL prefix for repository\n\ +Configuration - configuration path") + #define MIRROR_TOOLTIP_LABEL _("url - web-link for repository. It is allowed to write multiple, separating with comma (,)\n\ +http_proxy - proxy-server for repository, replaces 'http_proxy'. Single parameter per repository\n\ +mirrorlist - mirrors file, make sure server URL is NOT included in this file! Single parameter per repository") +#define SIGN_LEVEL_LABEL _("- Never - Signature verification will not be performed. Primary\n\ +\t- PackageNever - Packages only. Secondary\n\ +\t- DatabaseNever - Database only. Secondary\n\ +- Optional - Signatures will be verified if present, but unsigned databases and packages will also be accepted. Primary\n\ +\t- PackageOptional - Packages only. Secondary\n\ +\t- DatabaseOptional - Database only.\n\ +- Required - Signatures will be required for all packages and databases. Primary\n\ +\t- PackageRequired - Packages only. Secondary\n\ +\t- DatabaseRequired - Database only. Secondary\n\ +- TrustedOnly - If signature is verified for packages and database, it must be in the keyring and fully trusted; marginal trust not applicable\n\ +\t- PackageTrustedOnly - If signature is verified only for packages\n\ +\t- DatabaseTrustedOnly - If signature is verified only for database\n\ +- TrustAll - If signature is verified, it must be in keyring, but does not need to have a trust level assigned (e.g. unknown or marginal trust)\n\ +\t- PackageTrustAll - If signature is verified only for packages\n\ +\t- DatabaseTrustAll - If signature is verified only for database\n") + /* + #define _LABEL _("every") + #define _LABEL _("Resource link of file path") + #define _LABEL _("Open file explorer") + #define _LABEL _("Add source") + #define _LABEL _("Username") + #define _LABEL _("User password") + #define _LABEL _("Storage path to publish") + #define _LABEL _("The full URL of where to find the database, packages, and signatures (if available) for this repository. Multiple can be specified, separated by commas (,)") + #define _LABEL _("Update") + #define _LABEL _("Repositories") + #define _LABEL _("Publication") + #define _LABEL _("WEB-publication") + #define _LABEL _("Mirror publication") + #define _LABEL _("Date of last automatic update:") + #define _LABEL _("Date of last automatic update") + #define _LABEL _("Automatic update") + #define _LABEL _("First update all modules and then the system") + #define _LABEL _("Update only modules") + #define _LABEL _("Update everything in the order of the specified repositories") + #define _LABEL _("Update mode:") + #define _LABEL _("Update interval:") + #define _LABEL _("Update mode") + #define _LABEL _("Update interval") + #define _LABEL _("Boot") + #define _LABEL _("Minutes") + #define _LABEL _("Hours") + #define _LABEL _("Days") + #define _LABEL _("Months") + #define _LABEL _("Repositories from which the update will occur") + #define _LABEL _("Repositories list:") + #define _LABEL _("Repositories list") + #define _LABEL _("Default") + #define _LABEL _("Choose") + #define _LABEL _("Chosen") + #define _LABEL _("Repository") + #define _LABEL _("Manage repository list") + #define _LABEL _("Disable system repositories") + #define _LABEL _("Update") + #define _LABEL _("Move up") + #define _LABEL _("Move down") + #define _LABEL _("Add") + #define _LABEL _("Edit") + #define _LABEL _("Remove") + #define _LABEL _("Enabled") + #define _LABEL _("Source") + #define _LABEL _("Signature level") + #define _LABEL _("Usage level") + #define _LABEL _("Repository connection configuration") + #define _LABEL _("Setting up a connection to a distributed repository network and publishing your repositories") + #define _LABEL _("Connect and publish") + #define _LABEL _("Recieve DB packages from shared network") + #define _LABEL _("Repositories for publishing") + #define _LABEL _("Repositories list:") + #define _LABEL _("All repositories") + #define _LABEL _("Choose") + #define _LABEL _("Accept") + #define _LABEL _("Repository name") + #define _LABEL _("Setting up publication of storage and/or repositories as a local WEB resource") + #define _LABEL _("Authorization parameters") + #define _LABEL _("Storage") + #define _LABEL _("Chosen repositories") + #define _LABEL _("Reviewer") + #define _LABEL _("Port") + #define _LABEL _("Name") + #define _LABEL _("Password/Hash type") + #define _LABEL _("Password/Password hash") + #define _LABEL _("Setting up publication of a lazy mirror of connected repositories as a local WEB resource") + #define _LABEL _("Publish lazy mirror") + #define _LABEL _("Type") + #define _LABEL _("Resource URL") + #define _LABEL _("Configure") + #define _LABEL _("Mirror publish configuration") + #define _LABEL _("Service port:") + #define _LABEL _("Cache directory:") + #define _LABEL _("Duration of inactivity (in seconds):") + #define _LABEL _("Timeout (in seconds) for loading internel cache:") + #define _LABEL _("Work through proxy:") + #define _LABEL _("User agent:") + #define _LABEL _("Standard expression for cron:") + #define _LABEL _("The number of consecutie days that systems on the network have not been updated:") + #define _LABEL _("The number of consecutive days wthout an update requested:") + #define _LABEL _("Add mirror") + #define _LABEL _("Repository name:") + #define _LABEL _("Repository type:") + #define _LABEL _("WEB link") + #define _LABEL _("Proxy server") + #define _LABEL _("Mirrors file") + #define _LABEL _("Source:") + #define _LABEL _("Configuration") + #define _LABEL _("Sign level:") + #define _LABEL _("Enable repository update") + #define _LABEL _("Enable repository search") + #define _LABEL _("Enable installation of packages from this repository during --sync operation") + #define _LABEL _("Allow this repository to be a valid source of packages when running --sysupgrade") + #define _LABEL _("Enable publishing of local repository as WEB resource") + #define _LABEL _("Path to publication directory:") + #define _LABEL _("Port:") + #define _LABEL _("Publishing parameters") + #define _LABEL _("Enable WEB file browser") + #define _LABEL _("Authorization parameters") + #define _LABEL _("Set") + #define _LABEL _("Username:") + #define _LABEL _("User password:") + #define _LABEL _("Not encrypted") + #define _LABEL _("Encrypted with SHA256") + #define _LABEL _("Encrypted with SHA512") + #define _LABEL _("System") + #define _LABEL _("Minutes") + #define _LABEL _("Hours") + #define _LABEL _("Days") + #define _LABEL _("Months") + #define _LABEL _("Sign level") + #define _LABEL _("Password input") + #define _LABEL _("Password:") + #define _LABEL _("Repeat password:") + #define _LABEL _("Entryption:") + #define _LABEL _("Do not encrypt password") + #define _LABEL _("Password hash:") + + */ #endif \ No newline at end of file diff --git a/ubl-settings-update-mirror-add.glade b/ubl-settings-update-mirror-add.glade index ade5c7d..46f836b 100644 --- a/ubl-settings-update-mirror-add.glade +++ b/ubl-settings-update-mirror-add.glade @@ -75,6 +75,7 @@ True True + Repository name True @@ -137,6 +138,9 @@ True False + url - web-link for repository. It is allowed to write multiple, separating with comma (,) +http_proxy - proxy-server for repository, replaces 'http_proxy'. Single parameter per repository +mirrorlist - mirrors file, make sure server URL is NOT included in this file! Single parameter per repository 0 WEB link @@ -154,6 +158,7 @@ True True + Resource link of file path True @@ -163,9 +168,12 @@ + 28 + 28 True True True + Open file explorer image1