static void update_status_combobox(MainWindow *main_window, Documentable *document) { if (main_window->is_app_closing) return ; gint type = -1; if (document) g_object_get(document, "type", &type, NULL); /* set statuscombo */ switch(type) { case(TAB_PHP): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("PHP/HTML/XML")); break; case (TAB_CSS): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("CSS")); break; case (TAB_CXX): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("C/C++")); break; case (TAB_COBOL): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("Cobol")); break; case (TAB_SQL): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("SQL")); break; case (TAB_PERL): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("Perl")); break; case (TAB_PYTHON): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("Python")); break; default: set_status_combo_item (GPHPEDIT_STATUSBAR(main_window->appbar),_("Text-Plain")); } }
void update_status_combobox(Document *document) { if (is_app_closing) return ; /* set statuscombo */ switch(document_get_document_type(document)) { case(TAB_PHP): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("PHP/HTML/XML")); break; case (TAB_CSS): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("CSS")); break; case (TAB_CXX): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("C/C++")); break; case (TAB_COBOL): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("Cobol")); break; case (TAB_SQL): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("SQL")); break; case (TAB_PERL): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("Perl")); break; case (TAB_PYTHON): set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("Python")); break; default: set_status_combo_item (GPHPEDIT_STATUSBAR(main_window.appbar),_("Text-Plain")); } }
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); }
void update_zoom_level(MainWindow *main_window, Documentable *doc) { gphpedit_debug(DEBUG_MAIN_WINDOW); guint zoom_level = 100; if (doc) g_object_get(doc, "zoom_level", &zoom_level, NULL); gphpedit_statusbar_set_zoom_level(GPHPEDIT_STATUSBAR(main_window->appbar), zoom_level); }
static void main_window_create_appbar(MainWindow *main_window) { GtkWidget *statusbox = get_widget_from_builder(main_window, "statusbox"); gtk_widget_show (statusbox); main_window->appbar = gphpedit_statusbar_new (main_window); gtk_box_pack_start(GTK_BOX(statusbox), main_window->appbar, FALSE, TRUE, 1); gphpedit_statusbar_set_zoom_level(GPHPEDIT_STATUSBAR(main_window->appbar), 100); if (get_preferences_manager_show_statusbar(main_window->prefmg)) gtk_widget_show (main_window->appbar); }
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)); } }
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)); } } }
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)); }
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); }
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...")); }
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")); }
static void document_ovr_changed_cb (Document *doc, gboolean status, gpointer user_data) { gphpedit_statusbar_set_overwrite (GPHPEDIT_STATUSBAR(main_window.appbar), status); }
void document_pos_changed_cb (Document *doc, gint pos, gint col, gpointer user_data) { gphpedit_statusbar_set_cursor_position (GPHPEDIT_STATUSBAR(main_window.appbar), pos, col); }