Implement showing the DataFormatOptionsDialog

This commit is contained in:
Michael Becker 2014-08-10 23:45:52 -04:00
parent 983abea496
commit 8f3c9a62a4

View File

@ -19,7 +19,9 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
namespace UniversalEditor.Engines.GTK
using UniversalEditor.UserInterface;
namespace UniversalEditor.Engines.GTK.Dialogs
{
public partial class DataFormatOptionsDialog : Gtk.Dialog
{
@ -27,6 +29,45 @@ namespace UniversalEditor.Engines.GTK
{
this.Build();
}
public static bool ShowDialog(ref DataFormat df, DataFormatOptionsDialogType type)
{
DataFormatReference dfr = df.MakeReference();
switch (type)
{
case DataFormatOptionsDialogType.Export:
{
if (dfr.ExportOptions.Count > 0)
{
DataFormatOptionsDialog dlg = new DataFormatOptionsDialog();
switch ((Gtk.ResponseType)dlg.Run())
{
case Gtk.ResponseType.Cancel:
{
return false;
}
}
}
break;
}
case DataFormatOptionsDialogType.Import:
{
if (dfr.ImportOptions.Count > 0)
{
DataFormatOptionsDialog dlg = new DataFormatOptionsDialog();
switch ((Gtk.ResponseType)dlg.Run())
{
case Gtk.ResponseType.Cancel:
{
return false;
}
}
}
break;
}
}
return true;
}
}
}