7#if defined(UNIX) || defined(MACOSX)
18#pragma GCC diagnostic push
19#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
22#define TIMER_INTERVAL 100
40 gtk_widget_hide(
sWin);
46 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
sProgressBar),
81 char ini_path[PATH_MAX];
82 snprintf(ini_path,
sizeof(ini_path),
"%s.ini",
sProgramPath);
87 strcpy(strings.
title,
"LibreOffice Update");
88 strcpy(strings.
info,
"Please wait while we update your installation.");
91 sWin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
95 static GdkPixbuf *pixbuf;
97 g_signal_connect(G_OBJECT(
sWin),
"delete_event",
100 gtk_window_set_title(GTK_WINDOW(
sWin), strings.
title);
101 gtk_window_set_type_hint(GTK_WINDOW(
sWin), GDK_WINDOW_TYPE_HINT_DIALOG);
102 gtk_window_set_position(GTK_WINDOW(
sWin), GTK_WIN_POS_CENTER_ALWAYS);
103 gtk_window_set_resizable(GTK_WINDOW(
sWin),
FALSE);
104 gtk_window_set_decorated(GTK_WINDOW(
sWin),
TRUE);
105 gtk_window_set_deletable(GTK_WINDOW(
sWin),
FALSE);
106 pixbuf = gdk_pixbuf_new_from_xpm_data (
icon_data);
107 gtk_window_set_icon(GTK_WINDOW(
sWin), pixbuf);
108 g_object_unref(pixbuf);
110 GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
111 gtk_box_set_homogeneous(GTK_BOX(vbox),
true);
113 gtk_misc_set_alignment(GTK_MISC(
sLabel), 0.0f, 0.0f);
121 gtk_container_set_border_width(GTK_CONTAINER(
sWin), 10);
122 gtk_container_add(GTK_CONTAINER(
sWin), vbox);
123 gtk_widget_show_all(
sWin);
144#pragma GCC diagnostic pop
struct _GtkWidget GtkWidget
static gboolean UpdateDialog(gpointer)
static gboolean OnDeleteEvent(GtkWidget *, GdkEvent *, gpointer)
static GtkWidget * sLabel
static gboolean sEnableUI
static const char * sProgramPath
static GtkWidget * sProgressBar
void UpdateProgressUI(float progress)
static float sProgressVal
int InitProgressUI(int *pargc, char ***pargv)
static const char * icon_data[]
int ReadStrings(const NS_tchar *path, const char *keyList, unsigned int numStrings, char results[][MAX_TEXT_LEN], const char *section)
A very basic parser for updater.ini taken mostly from nsINIParser.cpp that can be used by standalone ...