void SludgeFloorMaker::on_filechooserbutton_file_set(GtkFileChooser *theChooser) { char *filename; gboolean success = 0; filename = gtk_file_chooser_get_filename(theChooser); if (filename == NULL) return; flipBackslashes(&filename); if (strlen(filename) > 4) { char * extension = filename + strlen(filename) - 4; if (!strcmp(extension, ".png") || !strcmp(extension, ".PNG")) { success = loadSpriteFromPNG(filename, &backdrop, 0); } else if (!strcmp(extension, ".tga") || !strcmp(extension, ".TGA")) { success = loadSpriteFromTGA(filename, &backdrop, 0); } } else { errorBox("Can't load image", "I don't recognise the file type. TGA and PNG are the supported file types."); } if (success) { setFolderFromFilename(filename); backdrop.sprites[0].height = -backdrop.sprites[0].height; activateZoomButtons(backdrop.sprites[0].width, -backdrop.sprites[0].height); showStatusbar(backdrop.sprites[0].width, -backdrop.sprites[0].height); on_zoom_fit_clicked(); reshape(); render_timer_event(theDrawingarea); } g_free(filename); }
void SludgeZBufferMaker::postOpen() { gtk_adjustment_set_upper( theSliderAdjustment, backdrop.total-1 ); gtk_adjustment_set_upper( theYAdjustment, -backdrop.sprites[0].height*2 ); // *2 to allow obscuring characters exiting to the bottom setBuffer(1); setBufferY(backdrop.sprites[buffer()].special); char buf[5]; sprintf(buf, "%i", backdrop.total-1); gtk_label_set_text(theNumBuffersLabel, buf); activateZoomButtons(backdrop.sprites[0].width, -backdrop.sprites[0].height); showStatusbar(backdrop.sprites[0].width, -backdrop.sprites[0].height); on_zoom_fit_clicked(); reshape(); loadZTextures(&backdrop); render_timer_event(theDrawingarea); setupButtons(); }
void SimpleUI::setupActions() { KStdAction::open( napp, SLOT(fileOpen()), actionCollection(), "_file_open" ); new KAction( i18n("&Properties"), 0, propertiesDialog, SLOT(show()), actionCollection(), "_file_properties" ); KStdAction::quit( napp, SLOT(quit()), actionCollection(), "_file_quit"); NoatunStdAction::playlist( actionCollection(), "view_playlist" ); actionCollection()->insert(video->action( "half_size" )); actionCollection()->insert(video->action( "normal_size" )); actionCollection()->insert(video->action( "double_size" )); actionCollection()->insert(video->action( "fullscreen_mode" )); actionCollection()->insert(napp->pluginActionMenu()); menubarAction = KStdAction::showMenubar(this, SLOT(showMenubar()), actionCollection()); statusbarAction = KStdAction::showStatusbar(this, SLOT(showStatusbar()), actionCollection()); NoatunStdAction::effects( actionCollection(), "effects" ); NoatunStdAction::equalizer( actionCollection(), "equalizer" ); NoatunStdAction::loop( actionCollection(), "loop_style" ); KStdAction::preferences( napp, SLOT(preferences()), actionCollection() ); }