Esempio n. 1
0
void document_save_start_cb (Document *doc, gpointer user_data)
{
  /* show status in statusbar */
  const gchar *short_filename;
  g_object_get(doc, "short_filename", &short_filename, NULL);
  gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0,_("Saving %s"), short_filename);
}
Esempio n. 2
0
void on_reload1_activate(GtkWidget *widget)
{
    if (!document_get_saved_status(document_manager_get_current_document(main_window.docmg))) {
        GtkWidget *file_revert_dialog;
        file_revert_dialog = gtk_message_dialog_new(GTK_WINDOW(main_window.window),GTK_DIALOG_DESTROY_WITH_PARENT,GTK_MESSAGE_QUESTION,GTK_BUTTONS_YES_NO,
                             _("Are you sure you wish to reload the current file, losing your changes?"));
        gtk_window_set_title(GTK_WINDOW(file_revert_dialog), "Question");
        gint result = gtk_dialog_run (GTK_DIALOG (file_revert_dialog));
        if (result==GTK_RESPONSE_YES) {
            gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0,_("Opening %s"),
                                              document_get_shortfilename(document_manager_get_current_document(main_window.docmg)));
            document_reload(document_manager_get_current_document(main_window.docmg));
        }
        gtk_widget_destroy(file_revert_dialog);
    } else {
        gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0,_("Opening %s"),
                                          document_get_shortfilename(document_manager_get_current_document(main_window.docmg)));

        document_reload(document_manager_get_current_document(main_window.docmg));
    }
}
Esempio n. 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));
        }
    }
}
Esempio n. 4
0
void document_manager_document_reload(DocumentManager *docmg)
{
  gphpedit_debug(DEBUG_DOC_MANAGER);
  if (!docmg) return ;
  DocumentManagerDetails *docmgdet = DOCUMENT_MANAGER_GET_PRIVATE(docmg);
  gboolean saved;
  g_object_get(docmgdet->current_document, "saved", &saved, NULL);
  if (!saved) {
    gint result = yes_no_dialog (_("Question"), _("Are you sure you wish to reload the current file, losing your changes?"));
    if (result==GTK_RESPONSE_NO) return ;
  }
  const gchar *short_filename;
  g_object_get(docmgdet->current_document, "short_filename", &short_filename, NULL);
  gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0,_("Reloading %s"), short_filename);
  documentable_reload(DOCUMENTABLE(docmgdet->current_document));
}
Esempio n. 5
0
void document_loader_help_file_not_found_cb (DocumentLoader *doclod, gpointer user_data)
{
  gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0,"%s",_("Could not find the required command in the online help"));
  g_object_unref(doclod);
}
Esempio n. 6
0
void document_loader_need_mounting_cb (DocumentLoader *doclod, gpointer user_data)
{
  gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0,"%s", 
    _("Error filesystem not mounted. Mounting filesystem, this will take a few seconds..."));
}
Esempio n. 7
0
static void document_marker_not_found_cb (Document *doc, gpointer user_data)
{
  gphpedit_statusbar_flash_message (GPHPEDIT_STATUSBAR(main_window.appbar),0 , "%s",_("No marker found"));
}