Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Haarsma <phaseIV@zonnet.nl>2003-04-28 15:17:21 +0400
committerRob Haarsma <phaseIV@zonnet.nl>2003-04-28 15:17:21 +0400
commit52f6a630ce7e1723e9aceb3fd395349e4098357b (patch)
treea64361cf9b26d2284f62934dc1130882867388e6 /source/blender/src/editimasel.c
parent71ffa4775252cb3dfe93011e24fc31ab7360bbb4 (diff)
Added rename/delete popups to the file and imageselect windows.
Redesigned the userpreference window layout. (not finished yet) Enhanced the texteditor with; a rightmousemenu, clipboard text support (for windows !) and the alt-m keystroke generates a 3d text object. (up to 1000 characters) (1, 2, 3, 4 and 7 from http://www.tncci.com/blender/feats.html)
Diffstat (limited to 'source/blender/src/editimasel.c')
-rw-r--r--source/blender/src/editimasel.c63
1 files changed, 56 insertions, 7 deletions
diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c
index c4da07e4c7c..d2c43a9efbf 100644
--- a/source/blender/src/editimasel.c
+++ b/source/blender/src/editimasel.c
@@ -62,6 +62,7 @@
#include "BIF_interface.h"
#include "BIF_imasel.h"
#include "BIF_mywindow.h"
+#include "BIF_toolbox.h"
#include "BSE_filesel.h"
#include "BSE_drawimasel.h"
@@ -94,6 +95,7 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
short mval[2];
short area_event;
short queredraw = 0;
+ int ret = 0;
char name[256];
char *selname;
static double prevtime=0;
@@ -335,6 +337,15 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
break;
+ case IKEY:
+ if ((G.qual == 0)&&(simasel->file)){
+ sprintf(name, "$IMAGEEDITOR %s%s", simasel->dir, simasel->file);
+ system(name);
+ queredraw = 1;
+ }
+
+ break;
+
case PKEY:
if(G.qual & LR_SHIFTKEY) {
extern char bprogname[]; /* usiblender.c */
@@ -353,15 +364,24 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
break;
- case IKEY:
- if ((G.qual == 0)&&(simasel->file)){
- sprintf(name, "$IMAGEEDITOR %s%s", simasel->dir, simasel->file);
- system(name);
- queredraw = 1;
- }
+ case RKEY:
+ case XKEY:
+ if (simasel->hilite_ima){
+ strcpy(name, simasel->dir);
+ strcat(name, simasel->hilite_ima->file_name);
+ if( okee("Remove %s", name) ) {
+ ret = BLI_delete(name, 0, 0);
+ if (ret) {
+ error("Command failed, see console");
+ } else {
+ clear_ima_dir(simasel);
+ queredraw = 1;
+ }
+ }
+ }
break;
-
+
case PADPLUSKEY:
case EQUALKEY:
BLI_newname(simasel->file, +1);
@@ -411,3 +431,32 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
+void clever_numbuts_imasel()
+{
+ SpaceImaSel *simasel;
+ static char orgname[FILE_MAXDIR+FILE_MAXFILE+12];
+ static char filename[FILE_MAXDIR+FILE_MAXFILE+12];
+ static char newname[FILE_MAXDIR+FILE_MAXFILE+12];
+ int len;
+
+ simasel= curarea->spacedata.first;
+ len = 110;
+
+ if (simasel->hilite_ima){
+ BLI_make_file_string(G.sce, orgname, simasel->dir, simasel->hilite_ima->file_name);
+ strcpy(filename, simasel->hilite_ima->file_name);
+
+ add_numbut(0, TEX, "", 0, len, filename, "Rename Image");
+ if( do_clever_numbuts("Rename Image", 1, REDRAW) ) {
+ BLI_make_file_string(G.sce, newname, simasel->dir, filename);
+
+ if( strcmp(orgname, newname) != 0 ) {
+ BLI_rename(orgname, newname);
+
+ clear_ima_dir(simasel);
+ }
+ }
+
+ scrarea_queue_winredraw(curarea);
+ }
+}