Only make the export button sensitive if there's something to export
authorJohannes Mueller <github@johannes-mueller.org>
Wed, 12 Jul 2017 15:44:35 +0000 (17:44 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 15 Jul 2017 09:37:24 +0000 (11:37 +0200)
gtk2_ardour/template_dialog.cc

index daba8bdd7f4bf72a56b5820197fb7af8ac0703b7..52db6fb1db80287e2150bc065cff9c3eb01cb3ec 100644 (file)
@@ -114,7 +114,7 @@ TemplateManager::TemplateManager ()
        vb_btns->pack_start (_export_all_templates_button, false, false);
        vb_btns->pack_start (_import_template_set_button, false, false);
 
-       _export_all_templates_button.set_sensitive (true);
+       _export_all_templates_button.set_sensitive (false);
        _export_all_templates_button.signal_clicked().connect (sigc::mem_fun (*this, &TemplateManager::export_all_templates));
 
        _import_template_set_button.set_sensitive (true);
@@ -145,6 +145,8 @@ TemplateManager::setup_model (const vector<TemplateInfo>& templates)
                row[_template_columns.name] = it->name;
                row[_template_columns.path] = it->path;
        }
+
+       _export_all_templates_button.set_sensitive (!templates.empty ());
 }
 
 void