Пример #1
0
    void on_button_delete_clicked(object o, EventArgs args)
    {
        string selectedName = getSelectedName();

        if (selectedName == "")
        {
            return;
        }

        if (UtilGtk.CountRows(store) <= 1)
        {
            new DialogMessage(Constants.MessageTypes.WARNING,
                              Catalog.GetString("Sorry, cannot delete all rows.") + "\n");
            return;
        }

        //treeview
        UtilGtk.RemoveRow(treeview_select, store);                              //1 delete row
        UtilGtk.TreeviewSelectFirstRow(treeview_select, store, true);           //2 selects another row (use first)

        //SQL
        Sqlite.DeleteFromName(false, Constants.EncoderConfigurationTable, "name", selectedName);
    }