tint2conf: backup config when writing
git-svn-id: http://tint2.googlecode.com/svn/trunk@765 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
committed by
mrovi9000@gmail.com
parent
aa9e1afdf2
commit
6ba25fa945
@@ -22,6 +22,7 @@
|
|||||||
#include "properties_rw.h"
|
#include "properties_rw.h"
|
||||||
#include "../launcher/apps-common.h"
|
#include "../launcher/apps-common.h"
|
||||||
#include "../launcher/icon-theme-common.h"
|
#include "../launcher/icon-theme-common.h"
|
||||||
|
#include "../util/common.h"
|
||||||
|
|
||||||
#define ROW_SPACING 10
|
#define ROW_SPACING 10
|
||||||
#define COL_SPACING 8
|
#define COL_SPACING 8
|
||||||
@@ -163,8 +164,15 @@ void panel_move_item_up(GtkWidget *widget, gpointer data);
|
|||||||
void applyClicked(GtkWidget *widget, gpointer data)
|
void applyClicked(GtkWidget *widget, gpointer data)
|
||||||
{
|
{
|
||||||
char *file = get_current_theme_file_name();
|
char *file = get_current_theme_file_name();
|
||||||
if (file)
|
if (file) {
|
||||||
|
if (config_is_manual(file)) {
|
||||||
|
gchar *backup_path = g_strdup_printf("%s.backup.%ld", file, time(NULL));
|
||||||
|
copy_file(file, backup_path);
|
||||||
|
g_free(backup_path);
|
||||||
|
}
|
||||||
|
|
||||||
config_save_file(file);
|
config_save_file(file);
|
||||||
|
}
|
||||||
int unused = system("killall -SIGUSR1 tint2");
|
int unused = system("killall -SIGUSR1 tint2");
|
||||||
(void)unused;
|
(void)unused;
|
||||||
g_free(file);
|
g_free(file);
|
||||||
|
|||||||
Reference in New Issue
Block a user