change samplelist save button to quick save button

This commit is contained in:
niels
2015-08-03 11:57:26 +02:00
parent 23779a3a3b
commit 0399d8e9e7
2 changed files with 26 additions and 1 deletions

View File

@@ -11509,7 +11509,7 @@ YUV (current)</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Save Samplelist</property>
<signal name="clicked" handler="on_button_samplelist_save_clicked" />
<signal name="clicked" handler="on_button_samplelist_qsave_clicked" />
<child>
<widget class="GtkAlignment" id="alignment55">
<property name="visible">True</property>

View File

@@ -838,6 +838,9 @@ void on_button_samplelist_load_clicked(GtkWidget *widget, gpointer user_data)
g_free(filename );
}
}
static char samplelist_name[1024];
static int has_samplelist_name = 0;
void on_button_samplelist_save_clicked(GtkWidget *widget, gpointer user_data)
{
gchar *filename = dialog_save_file( "Save samplelist");
@@ -845,10 +848,32 @@ void on_button_samplelist_save_clicked(GtkWidget *widget, gpointer user_data)
{
multi_vims( VIMS_SAMPLE_SAVE_SAMPLELIST, "%s", filename );
vj_msg(VEEJAY_MSG_INFO, "Saved samples to %s", filename);
strncpy( samplelist_name, filename,strlen(filename));
has_samplelist_name = 1;
g_free(filename);
}
}
void on_button_samplelist_qsave_clicked(GtkWidget *widget, gpointer user_data)
{
if( has_samplelist_name == 0 ) {
gchar *filename = dialog_save_file( "Save samplelist");
if(filename)
{
multi_vims( VIMS_SAMPLE_SAVE_SAMPLELIST, "%s", filename );
vj_msg(VEEJAY_MSG_INFO, "Saved samples to %s", filename);
strncpy( samplelist_name, filename, strlen(filename));
g_free(filename);
has_samplelist_name = 1;
}
}
else {
multi_vims( VIMS_SAMPLE_SAVE_SAMPLELIST, "%s" , samplelist_name );
vj_msg(VEEJAY_MSG_INFO, "Quick saved samples to %s" , samplelist_name );
}
}
void on_spin_samplestart_value_changed(GtkWidget *widget, gpointer user_data)
{
if(!info->status_lock)