|
|
#include <gtk/gtk.h>
|
|
|
#include <gtk/gtkx.h>
|
|
|
#include <locale.h>
|
|
|
#include <stdio.h>
|
|
|
#include <unistd.h>
|
|
|
#include <stdlib.h>
|
|
|
#include <libintl.h>
|
|
|
#include <getopt.h>
|
|
|
#include <libintl.h>
|
|
|
#include <sys/types.h>
|
|
|
#include <fcntl.h>
|
|
|
#include <libublsettings.h>
|
|
|
#include <libublsettings-gtk3.h>
|
|
|
#include <libublsettingsui-gtk3.h>
|
|
|
#ifdef WEBKIT_FOUND
|
|
|
#include <webkit2/webkit2.h>
|
|
|
#endif
|
|
|
#include "ubl-strings.h"
|
|
|
|
|
|
#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-repomanager"
|
|
|
|
|
|
#define _(String) gettext(String)
|
|
|
|
|
|
#define glade_path "/com/ublinux/ui/ubl-settings-repomanager.glade"
|
|
|
#define glade_path_repo_add "/com/ublinux/ui/ubl-settings-repomanager-add.glade"
|
|
|
#define glade_path_storage_config "/com/ublinux/ui/ubl-settings-repomanager-configuration.glade"
|
|
|
#define banner_path "/com/ublinux/images/ubl-settings-repomanager-banner.png"
|
|
|
#define CssPath "/com/ublinux/css/ubl-settings-repomanager.css"
|
|
|
#define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL)
|
|
|
#define icon_path "com.ublinux.ubl-settings-repomanager"
|
|
|
|
|
|
#define folder_no_edits "com.ublinux.libublsettingsui-gtk3.folder-symbolic"
|
|
|
#define document_no_edits "com.ublinux.libublsettingsui-gtk3.key-symbolic"
|
|
|
#define document_deleted "com.ublinux.ubl-settings-repomanager.key-red-symbolic"
|
|
|
#define document_added "com.ublinux.ubl-settings-repomanager.key-green-symbolic"
|
|
|
|
|
|
#define LocalePath "/usr/share/locale"
|
|
|
#define LocaleName "ubl-settings-repomanager"
|
|
|
typedef char* string;
|
|
|
|
|
|
#define get_package_info_command(filename) yon_char_unite("LC_ALL=EN pacman -Q --info --file ",filename," |sed -e 's/ */ /g' -e 's/ : /:/g' -e 's/\\n/ /g'",NULL)
|
|
|
#define get_saved_package_info_command(path,filename) yon_char_unite("LC_ALL=EN pacman -Q --info --file $(find \"",path,"\" -name \"*",filename,"*\" -not -name *.sig |head -n 1)|sed -e 's/ */ /g' -e 's/ : /:/g' -e 's/\\n/ /g'",NULL)
|
|
|
|
|
|
#define get_gpg_keys_command yon_char_unite(yon_ubl_check_root()==1 ? yon_char_unite("su - ",yon_ubl_root_user_get()," -c \"gpg --list-signatures\"",NULL):"gpg --list-signatures"," | grep '^sig 3' | cut -d' ' -f10,11,13- | sort -u |sed -e 's/[0-9]*-[0-9]*-[0-9]* //g'",NULL)
|
|
|
|
|
|
string version_application;
|
|
|
|
|
|
char *local;
|
|
|
|
|
|
typedef struct {
|
|
|
template_config_fields
|
|
|
GtkTreeStore *tree_store;
|
|
|
int lock_root;
|
|
|
} config;
|
|
|
|
|
|
typedef struct {
|
|
|
template_window_fields
|
|
|
GtkWidget *UpdateButton;
|
|
|
GtkWidget *DBConfigurationButton;
|
|
|
GtkWidget *AddButton;
|
|
|
GtkWidget *MoveButton;
|
|
|
GtkWidget *RemoveButton;
|
|
|
GtkWidget *CloudButton;
|
|
|
GtkWidget *ReposTree;
|
|
|
GtkWidget *RepoFileTree;
|
|
|
GtkWidget *SearchEntry;
|
|
|
GtkWidget *RepoPackagesTree;
|
|
|
GtkWidget *InformationLabel;
|
|
|
GtkTreeStore *RepoList;
|
|
|
GtkListStore *RepoFileList;
|
|
|
GtkListStore *RepoPackagesTre;
|
|
|
} main_window;
|
|
|
|
|
|
typedef struct {
|
|
|
GtkWidget *MainWindow;
|
|
|
GtkWidget *StatusBox;
|
|
|
GtkWidget *HeadLabel;
|
|
|
GtkWidget *CancelButton;
|
|
|
GtkWidget *AddButton;
|
|
|
GtkWidget *MoveSourceFrame;
|
|
|
GtkWidget *MoveSourceStorageEntry;
|
|
|
GtkWidget *MoveSourceRepoEntry;
|
|
|
GtkWidget *MoveSourceArchEntry;
|
|
|
GtkWidget *MoveTargetFrame;
|
|
|
GtkWidget *MoveTargetStorageEntry;
|
|
|
GtkWidget *MoveTargetRepoEntry;
|
|
|
GtkWidget *MoveTargetArchEntry;
|
|
|
GtkWidget *StorageCombo;
|
|
|
GtkWidget *RepositoryCombo;
|
|
|
GtkWidget *ArchitectureCombo;
|
|
|
GtkWidget *PackageSignCombo;
|
|
|
GtkWidget *RepoSignCombo;
|
|
|
GtkWidget *AddPackageButton;
|
|
|
GtkWidget *RemoveButton;
|
|
|
GtkWidget *PackagesTree;
|
|
|
GtkWidget *InfoLabel;
|
|
|
GtkListStore *PackagesList;
|
|
|
} repo_add_window;
|
|
|
|
|
|
typedef struct {
|
|
|
GtkWidget *MainWindow;
|
|
|
GtkWidget *HeadLabel;
|
|
|
GtkWidget *CancelButton;
|
|
|
GtkWidget *AcceptButton;
|
|
|
GtkWidget *StatusBox;
|
|
|
GtkWidget *StoragePathEntry;
|
|
|
GtkWidget *OpenExistingButton;
|
|
|
GtkWidget *CreateNewButton;
|
|
|
GtkWidget *DisableButton;
|
|
|
GtkWidget *DeleteButton;
|
|
|
GtkWidget *ReposBox;
|
|
|
GtkWidget *AddEntry;
|
|
|
GtkWidget *AddRepoButton;
|
|
|
} storage_config_window;
|
|
|
|
|
|
main_window *setup_window(); |