Inheritance: Gtk.FileChooserDialog
Exemple #1
0
        void on_m_SendFileMenuItem_activate(object o, EventArgs e)
        {
            FileSelector dialog = new FileSelector("Select file to send");

            dialog.Show();
            if (dialog.Run() == (int)Gtk.ResponseType.Ok)
            {
                network.SendFile(selectedNode, dialog.Filename);
            }
            dialog.Destroy();
        }
Exemple #2
0
        private void on_btnImportPublicKey_clicked(object sender, EventArgs e)
        {
            FileSelector f = new FileSelector("Select Public Key");

            try {
                if (f.Run() == (int)ResponseType.Ok)
                {
                    txtPublicKey.Buffer.Text = File.ReadAllText(f.Filename);
                }
                f.Destroy();
            }
            catch (Exception) {
                f.Destroy();
                Gui.ShowMessageDialog("The selected file is not valid.", base.Dialog, Gtk.MessageType.Error, ButtonsType.Ok);
            }
        }
        private void browseButton_clicked(object o, EventArgs args)
        {
            FileSelector selector = new FileSelector("Select Image");

            selector.Show();
            int result = selector.Run();

            if (result == (int)Gtk.ResponseType.Ok)
            {
                try {
                    AddFile(selector.Filename);
                } catch (Exception ex) {
                    selector.Hide();
                    Gui.ShowMessageDialog(ex.Message);
                    return;
                }
            }
            selector.Hide();
        }
Exemple #4
0
 void on_m_SendFileMenuItem_activate(object o, EventArgs e)
 {
     FileSelector dialog = new FileSelector ("Select file to send");
     dialog.Show ();
     if (dialog.Run () == (int)Gtk.ResponseType.Ok) {
         network.SendFile (selectedNode, dialog.Filename);
     }
     dialog.Destroy ();
 }
 private void on_btnImportPublicKey_clicked(object sender, EventArgs e)
 {
     FileSelector f = new FileSelector("Select Public Key");
     try {
         if (f.Run() == (int)ResponseType.Ok) {
             txtPublicKey.Buffer.Text = File.ReadAllText(f.Filename);
         }
         f.Destroy();
     }
     catch (Exception) {
         f.Destroy();
         Gui.ShowMessageDialog ("The selected file is not valid.",base.Dialog, Gtk.MessageType.Error,ButtonsType.Ok);
     }
 }
 private void browseButton_clicked(object o, EventArgs args)
 {
     FileSelector selector = new FileSelector ("Select Image");
     selector.Show ();
     int result = selector.Run ();
     if (result == (int)Gtk.ResponseType.Ok) {
         try {
             AddFile (selector.Filename);
         } catch (Exception ex) {
             selector.Hide ();
             Gui.ShowMessageDialog (ex.Message);
             return;
         }
     }
     selector.Hide ();
 }