private void b_src_viewer_open_Click(object sender, EventArgs e) { if ((null != m_sel_header) && (1 == m_sel_items.Count)) { if (!(m_sel_items[0].Tag as conv_core.cImageFile).open()) { MessageBox.Show( this, "'" + m_sel_items[0].ToolTipText + "' does not exist. Viewer will not be opened.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); return; } ; ImageViewForm form = new ImageViewForm(); form.set_colors(m_colors); form.file_name = (m_sel_items[0].Tag as conv_core.cImageFile).path; form.set_imagelist(m_sel_items[0]); form.ShowDialog(this); form.get_colors(m_colors); OptionsController.save_colors(m_colors); } ; }
private void load_history(object sender, EventArgs e) { string file_name = (sender as ToolStripItem).Text; OptionsController.history_add(m_history, file_name); OptionsController.save_history(m_history); load_project(file_name); }
private void form_close_req(object sender, FormClosingEventArgs e) { if (ConvertProcessor.in_process) { switch (MessageBox.Show( this, "Texture converting is in progress now, would you wish to stop it and halt the program?", "Converting in progress", MessageBoxButtons.YesNo, MessageBoxIcon.Question )) { case DialogResult.Yes: ConvertProcessor.cancel(); break; case DialogResult.No: e.Cancel = true; return; } ; } ; ModificationWatchdog.stop_watch(); if (t_mod.Enabled) { switch (MessageBox.Show( this, "Project is modified, but not saved. Save it before exit?", "Project not saved", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question )) { case DialogResult.Yes: b_save_ButtonClick(b_save, e); break; case DialogResult.Cancel: e.Cancel = true; return; } ; } ; conv_core.workbench.free(); OptionsController.save_history(m_history); OptionsController.save_options(this); m_log = null; }
private void b_open_Click(object sender, EventArgs e) { if (ConvertProcessor.in_process) { return; } ; if (t_mod.Enabled) { switch (MessageBox.Show(this, "Current project is not saved. Save it?", "Save request", MessageBoxButtons.YesNoCancel)) { case DialogResult.Yes: b_save_ButtonClick(sender, e); break; case DialogResult.Cancel: return; } ; } ; dw_open.Title = "Open project file"; dw_open.InitialDirectory = t_base_dir.Text; dw_open.FileName = m_file_name; dw_open.Filter = file_desc + "|*." + file_ext + "|Any file|*.*"; dw_open.FilterIndex = 0; dw_open.Multiselect = false; switch (dw_open.ShowDialog(this)) { case DialogResult.OK: if (!load_project(dw_open.FileName)) { MessageBox.Show( this, "Failed to load project file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); } else { OptionsController.history_add(m_history, dw_open.FileName); OptionsController.save_history(m_history); }; break; } ; }
public MainForm() { InitializeComponent(); m_log = new LogForm(); conv_core.workbench.log_event = m_log.log_message; conv_core.workbench.init(Path.GetDirectoryName(Application.ExecutablePath)); if (!conv_core.workbench.ready) { MessageBox.Show( this, "Failed to init converter environment", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); } ; OptionsController.load_history(m_history); OptionsController.load_options(this); OptionsController.load_colors(m_colors); ModificationWatchdog.start_watch(this); switch (lv_files.Sorting) { case SortOrder.Ascending: b_sort_sources.Image = b_sort_ascend.Image; break; case SortOrder.Descending: b_sort_sources.Image = b_sort_descend.Image; break; case SortOrder.None: b_sort_sources.Image = b_sort_none.Image; break; } ; t_mod.Enabled = false; b_new_Click(null, null); pb_progress.Visible = false; }