mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-30 02:34:56 +01:00
Initialize girara after parsing the configuration
This commit is contained in:
parent
9f5430e449
commit
68bda8550f
1 changed files with 23 additions and 25 deletions
48
zathura.c
48
zathura.c
|
@ -94,11 +94,6 @@ zathura_init(int argc, char* argv[])
|
|||
goto error_out;
|
||||
}
|
||||
|
||||
zathura->ui.session->gtk.embed = embed;
|
||||
if (girara_session_init(zathura->ui.session) == false) {
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
zathura->ui.session->global.data = zathura;
|
||||
zathura->ui.statusbar.file = NULL;
|
||||
zathura->ui.statusbar.buffer = NULL;
|
||||
|
@ -106,6 +101,29 @@ zathura_init(int argc, char* argv[])
|
|||
zathura->ui.page_view = NULL;
|
||||
zathura->ui.index = NULL;
|
||||
|
||||
/* load plugins */
|
||||
zathura_document_plugins_load(zathura);
|
||||
|
||||
/* configuration */
|
||||
config_load_default(zathura);
|
||||
|
||||
/* load global configuration files */
|
||||
config_load_file(zathura, GLOBAL_RC);
|
||||
|
||||
/* load local configuration files */
|
||||
char* configuration_file = g_build_filename(zathura->config.config_dir, ZATHURA_RC, NULL);
|
||||
config_load_file(zathura, configuration_file);
|
||||
free(configuration_file);
|
||||
|
||||
/* initialize girara */
|
||||
zathura->ui.session->gtk.embed = embed;
|
||||
if (girara_session_init(zathura->ui.session) == false) {
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
/* girara events */
|
||||
zathura->ui.session->events.buffer_changed = buffer_changed;
|
||||
|
||||
/* page view */
|
||||
zathura->ui.page_view = gtk_table_new(0, 0, TRUE);
|
||||
if (!zathura->ui.page_view) {
|
||||
|
@ -120,9 +138,6 @@ zathura_init(int argc, char* argv[])
|
|||
|
||||
gtk_widget_show(zathura->ui.page_view);
|
||||
|
||||
/* Put the table in the main window */
|
||||
// gtk_container_add(GTK_CONTAINER (zathura->ui.page_view), table);
|
||||
|
||||
/* statusbar */
|
||||
zathura->ui.statusbar.file = girara_statusbar_item_add(zathura->ui.session, TRUE, TRUE, TRUE, NULL);
|
||||
if (zathura->ui.statusbar.file == NULL) {
|
||||
|
@ -144,23 +159,6 @@ zathura_init(int argc, char* argv[])
|
|||
/* signals */
|
||||
g_signal_connect(G_OBJECT(zathura->ui.session->gtk.window), "destroy", G_CALLBACK(cb_destroy), NULL);
|
||||
|
||||
/* girara events */
|
||||
zathura->ui.session->events.buffer_changed = buffer_changed;
|
||||
|
||||
/* load plugins */
|
||||
zathura_document_plugins_load(zathura);
|
||||
|
||||
/* configuration */
|
||||
config_load_default(zathura);
|
||||
|
||||
/* load global configuration files */
|
||||
config_load_file(zathura, GLOBAL_RC);
|
||||
|
||||
/* load local configuration files */
|
||||
char* configuration_file = g_build_filename(zathura->config.config_dir, ZATHURA_RC, NULL);
|
||||
config_load_file(zathura, configuration_file);
|
||||
free(configuration_file);
|
||||
|
||||
/* save page padding */
|
||||
int* page_padding = girara_setting_get(zathura->ui.session, "page-padding");
|
||||
zathura->global.page_padding = (page_padding) ? *page_padding : 1;
|
||||
|
|
Loading…
Reference in a new issue