Example #1
0
bool
cmd_savef(girara_session_t* session, girara_list_t* argument_list)
{
  g_return_val_if_fail(session != NULL, false);
  g_return_val_if_fail(session->global.data != NULL, false);
  zathura_t* zathura = session->global.data;

  if (zathura->document == NULL) {
    girara_notify(session, GIRARA_ERROR, _("No document opened."));
    return false;
  }

  if (girara_list_size(argument_list) == 1) {
    if (document_save(zathura, girara_list_nth(argument_list, 0), true) == true) {
      girara_notify(session, GIRARA_INFO, _("Document saved."));
    } else {
      girara_notify(session, GIRARA_INFO, _("Failed to save document."));
    }
  } else {
    girara_notify(session, GIRARA_ERROR, _("Invalid number of arguments."));
    return false;
  }

  return true;
}
Example #2
0
static void
validate_and_save_flow()
{
	flow_browse_revalidate_programs(gebr.ui_flow_browse);
	flow_browse_validate_io(gebr.ui_flow_browse);
	flow_browse_info_update();
	document_save(GEBR_GEOXML_DOCUMENT(gebr.flow), TRUE, TRUE);
}
Example #3
0
void on_save1_activate(GtkWidget *widget)
{
    if (document_manager_get_current_document(main_window.docmg)) {
        //if document is Untitled
        if (document_get_untitled(document_manager_get_current_document(main_window.docmg))) {
            on_save_as1_activate(widget);
        } else {
            /* show status in statusbar */
            gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0,_("Saving %s"), document_get_shortfilename(document_manager_get_current_document(main_window.docmg)));
            document_save(document_manager_get_current_document(main_window.docmg));
        }
    }
}