Add config option startup_notifications = 0/1

git-svn-id: http://tint2.googlecode.com/svn/trunk@737 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000
2015-03-21 13:39:43 +00:00
committed by mrovi9000@gmail.com
parent c900bc24b2
commit 5faf063f96
7 changed files with 76 additions and 44 deletions

View File

@@ -108,7 +108,7 @@ GtkWidget *launcher_apps_dirs;
GtkWidget *launcher_icon_size, *launcher_icon_theme, *launcher_padding_x, *launcher_padding_y, *launcher_spacing;
GtkWidget *margin_x, *margin_y;
GtkWidget *launcher_background;
GtkWidget *startup_notifications;
IconThemeWrapper *icon_theme;
GtkListStore *backgrounds;
@@ -1780,7 +1780,7 @@ void create_launcher(GtkWidget *parent)
gtk_widget_show(label);
gtk_box_pack_start(GTK_BOX(parent), label, FALSE, FALSE, 0);
table = gtk_table_new(6, 10, FALSE);
table = gtk_table_new(7, 10, FALSE);
gtk_widget_show(table);
gtk_box_pack_start(GTK_BOX(parent), table, FALSE, FALSE, 0);
gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);
@@ -1836,7 +1836,6 @@ void create_launcher(GtkWidget *parent)
gtk_widget_show(label);
gtk_table_attach(GTK_TABLE(table), label, 6, 7, 2, 3, GTK_FILL, 0, 0, 0);
launcher_icon_theme = gtk_combo_box_new_with_model(GTK_TREE_MODEL(icon_themes));
GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(launcher_icon_theme), renderer, FALSE);
@@ -1845,6 +1844,15 @@ void create_launcher(GtkWidget *parent)
gtk_widget_show(launcher_icon_theme);
gtk_table_attach(GTK_TABLE(table), launcher_icon_theme, 7, 8, 2, 3, GTK_FILL, 0, 0, 0);
label = gtk_label_new(_("Startup notifications"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
gtk_table_attach(GTK_TABLE(table), label, 2, 3, 3, 4, GTK_FILL, 0, 0, 0);
startup_notifications = gtk_check_button_new();
gtk_widget_show(startup_notifications);
gtk_table_attach(GTK_TABLE(table), startup_notifications, 3, 4, 3, 4, GTK_FILL, 0, 0, 0);
change_paragraph(parent);
GtkTreeIter iter;

View File

@@ -121,7 +121,7 @@ extern GtkWidget *launcher_apps_dirs;
extern GtkWidget *launcher_icon_size, *launcher_icon_theme, *launcher_padding_x, *launcher_padding_y, *launcher_spacing;
extern GtkWidget *margin_x, *margin_y;
extern GtkWidget *launcher_background;
extern GtkWidget *startup_notifications;
extern IconThemeWrapper *icon_theme;
void load_desktop_file(const char *file, gboolean selected);

View File

@@ -393,6 +393,7 @@ void config_write_launcher(FILE *fp)
g_free(icon_theme);
icon_theme = NULL;
}
fprintf(fp, "startup_notifications = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(startup_notifications)) ? 1 : 0);
int index;
for (index = 0; ; index++) {
@@ -1119,6 +1120,9 @@ void add_entry(char *key, char *value)
else if (strcmp(key, "launcher_icon_theme") == 0) {
set_current_icon_theme(value);
}
else if (strcmp(key, "startup_notifications") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(startup_notifications), atoi(value));
}
/* Tooltip */
else if (strcmp(key, "tooltip_show_timeout") == 0) {