You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ubl-settings-repomanager/source/ubl-settings-repomanager.h

191 lines
5.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include "ubl-utils.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 "../compile/ubl-cmake.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_repo_path "/com/ublinux/ui/ubl-settings-repomanager-windows.glade"
#define glade_sign_path "/com/ublinux/ui/ubl-settings-repomanager-sign.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.ubl-settings-repomanager.folder-symbolic"
#define folder_deleted "com.ublinux.ubl-settings-repomanager.folder-red-symbolic"
#define folder_added "com.ublinux.ubl-settings-repomanager.folder-green-symbolic"
#define document_no_edits "com.ublinux.ubl-settings-repomanager.document-symbolic"
#define document_deleted "com.ublinux.ubl-settings-repomanager.document-red-symbolic"
#define document_added "com.ublinux.ubl-settings-repomanager.document-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 {
GtkTreeStore *tree_store;
int always_open_documentation;
int win_pos_x;
int win_pos_y;
int win_width;
int win_height;
int socket_id;
int load_socket_id;
int save_socket_id;
int lock_help;
int lock_save_local;
int lock_save_global;
int lock_load_global;
int lock_root;
} config;
typedef struct {
GtkWidget *Window;
GtkWidget *HatLabel;
GtkWidget *PlugBox;
GtkWidget *MovePaned;
GtkWidget *HeadOverlay;
GtkWidget *HeadImage;
GtkWidget *HeadBox;
GtkWidget *HeadTitleLabel;
GtkWidget *HeadInfoLabel;
GtkWidget *StatusBox;
GtkWidget *StatusIcon;
GtkWidget *StatusLabel;
GtkWidget *SaveLabel;
GtkWidget *SaveMenuItem;
GtkWidget *SaveGlobalMenuItem;
GtkWidget *SaveLocalMenuItem;
GtkWidget *RightBox;
GtkWidget *LoadLabel;
GtkWidget *LoadGlobalMenuItem;
GtkWidget *LoadLocalMenuItem;
GtkWidget *LeftBox;
GtkWidget *DocumentationMenuItem;
GtkWidget *AboutMenuItem;
GtkWidget *GeneralTabLabel;
GtkWidget *PublicationTabLabel;
GtkWidget *CreateButton;
GtkWidget *LoadFromNetButton;
GtkWidget *ConfigureButton;
GtkWidget *DeleteButton;
GtkWidget *LoadFromLocalButton;
GtkWidget *SwitchPublishButton;
GtkWidget *CheckDependencesButton;
GtkWidget *SignButton;
GtkWidget *AddPackageButton;
GtkWidget *RemovePackageButton;
GtkWidget *RepoTree;
GtkWidget *TrustedRepoCheck;
GtkWidget *ServerTypeLabel;
GtkWidget *ServerTypeCombo;
GtkWidget *IpAdressLabel;
GtkWidget *IpAdressCombo;
GtkWidget *PortLabel;
GtkWidget *PortSpin;
GtkWidget *OutputEntry;
GtkWidget *CopyButton;
GtkWidget *PublishButton;
GtkWidget *CodeNameLabel;
GtkWidget *CodeNameInfoLabel;
GtkWidget *BranchLabel;
GtkWidget *BranchInfoLabel;
GtkWidget *VersionLabel;
GtkWidget *VersionInfoLabel;
GtkWidget *ArchitectureLabel;
GtkWidget *ArchitectureInfoLabel;
GtkWidget *ComponentsLabel;
GtkWidget *DependencesInfoLabel;
GtkWidget *SignatureLabel;
GtkWidget *SignatureInfoLabel;
GtkWidget *Finder;
GtkWidget *SaveButton;
GtkWidget *NameBox;
GtkWidget *VersionBox;
GtkWidget *ArchitectureBox;
GtkWidget *DependenceBox;
GtkWidget *SignatureBox;
} main_window;
typedef struct {
GtkWidget *Window;
GtkWidget *NameEntry;
GtkWidget *BranchesTree;
GtkWidget *CancelButton;
GtkWidget *SaveButton;
GtkCellRenderer *BranchCell;
GtkWidget *repoChooseFolderButton;
GtkListStore *BranchesListStore;
GtkWidget *PathLabel;
char *path;
} repo_create_window;
typedef struct {
GtkWidget *Window;
GtkWidget *HeaderLabel;
GtkWidget *KeysCombo;
GtkWidget *CloseButton;
GtkWidget *SaveButton;
} repo_sign_window;
typedef struct {
GtkWidget *Window;
GtkWidget *HatText;
GtkWidget *HeaderText;
GtkWidget *InfoText;
GtkWidget *AlwaysOpenCheck;
GtkWidget *CloseButton;
GtkWidget *AcceptButton;
} documentation_confirmation_window;
typedef enum {
YON_REPO_LINE_REPO_TYPE,
YON_REPO_LINE_FILE_TYPE,
YON_REPO_LINE_BRANCH_TYPE
} YON_REPO_LINE_TYPE;
main_window *setup_window();
void yon_add_file(main_window *widgets);
GtkTreeIter *yon_repo_append(main_window *widgets, char *name, YON_REPO_LINE_TYPE type);
void yon_repo_remove_package(main_window *widgets);
void yon_repo_remove(main_window *widgets);
void on_repo_configure_done(GtkWidget *self, dictionary *dict);