folder icon move segv, resources drag scroll bug, memory leaks, global msgqual, po...
authorGood Guy <good1.2guy@gmail.com>
Sat, 21 Oct 2017 00:15:25 +0000 (18:15 -0600)
committerGood Guy <good1.2guy@gmail.com>
Sat, 21 Oct 2017 00:15:25 +0000 (18:15 -0600)
20 files changed:
cinelerra-5.1/cinelerra/Makefile
cinelerra-5.1/cinelerra/aboutprefs.C
cinelerra-5.1/cinelerra/aboutprefs.h
cinelerra-5.1/cinelerra/appearanceprefs.C
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/colorpicker.C
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/playbackprefs.C
cinelerra-5.1/cinelerra/proxy.C
cinelerra-5.1/cinelerra/proxy.h
cinelerra-5.1/cinelerra/statusbar.C
cinelerra-5.1/cinelerra/swindow.C
cinelerra-5.1/guicast/Makefile
cinelerra-5.1/guicast/bclistbox.C
cinelerra-5.1/guicast/bcwindowbase.C
cinelerra-5.1/guicast/language.h
cinelerra-5.1/plugin_config
cinelerra-5.1/plugins/titler/titler.C
cinelerra-5.1/po/xlat.sh

index bd59f62ea7093578ac7e6194992a768125fa7646..638695137ab82c833dbdf90fe22e69f17d0b1f54 100644 (file)
@@ -445,7 +445,7 @@ tags:
 
 
 $(OBJDIR)/%.o:         %.C
-       $(CXX) `cat $(OBJDIR)/c_flags` -c $< -o $@
+       $(CXX) `cat $(OBJDIR)/c_flags` '-DMSGQUAL="$*"' -c $< -o $@
 
 $(OBJDIR)/sha1.o:      sha1.C sha1.h
        $(CXX) `cat $(OBJDIR)/c_flags` -O3 -c $< -o $@
index 8ad411ddee0357b89fd8c19f5583b45ea2d537ae..4702c944e6c1439074d1cb9bfcbb194175c6483d 100644 (file)
 #include "vframe.h"
 #include "versioninfo.h"
 
-
+#ifndef COMPILEDATE
+#define COMPILEDATE "built: " __DATE__ " " __TIME__
+#endif
+const char *AboutPrefs::build_timestamp = COMPILEDATE;
 
 AboutPrefs::AboutPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
  : PreferencesDialog(mwindow, pwindow)
@@ -121,12 +124,9 @@ void AboutPrefs::create_objects()
        draw_text(x, y, license3);
        y += get_text_height(MEDIUMFONT, license3);
 
-#ifndef COMPILEDATE
-#define COMPILEDATE "built: " __DATE__ " " __TIME__
-#endif
-       draw_text(x, y, COMPILEDATE);
+       draw_text(x, y, build_timestamp);
 #if defined(REPOMAINTXT)
-       y += get_text_height(MEDIUMFONT, COMPILEDATE);
+       y += get_text_height(MEDIUMFONT, build_timestamp);
        draw_text(x, y, REPOMAINTXT);
 #endif
 
index 0b9b25b13e60c257ac8b5e2455095ff4d21a490f..ee87dcf1dcbfd8bb01b88e8b438d53a827646ba1 100644 (file)
@@ -31,8 +31,7 @@ public:
        AboutPrefs(MWindow *mwindow, PreferencesWindow *pwindow);
        ~AboutPrefs();
 
-
-
+       static const char *build_timestamp;
        void create_objects();
        ArrayList<BC_ListBoxItem*> about;
 };
index c054e3401d3591a1e29990206e3632a788afba87..1fc61cc04018a06cb60e4bb0194901bd573f13df 100644 (file)
 #include "theme.h"
 
 
-#define MOVE_ALL_EDITS_TITLE N_("Drag all following edits")
-#define MOVE_ONE_EDIT_TITLE N_("Drag only one edit")
-#define MOVE_NO_EDITS_TITLE N_("Drag source only")
-#define MOVE_EDITS_DISABLED_TITLE N_("No effect")
-
-
 AppearancePrefs::AppearancePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
  : PreferencesDialog(mwindow, pwindow)
 {
index da146a611be72b957580146f206159cc79e6d97c..7b717feef86555fd0b2f1efe3b553eaed93f3b39 100644 (file)
@@ -392,19 +392,40 @@ AWindowGUI::AWindowGUI(MWindow *mwindow, AWindow *awindow)
 {
        this->mwindow = mwindow;
        this->awindow = awindow;
-       file_icon = 0;
-       audio_icon = 0;
-       video_icon = 0;
-       folder_icon = 0;
-       clip_icon = 0;
-       label_icon = 0;
-       atransition_icon = 0;  atransition_vframe = 0;
-       vtransition_icon = 0;  vtransition_vframe = 0;
-       aeffect_icon = 0;      aeffect_vframe = 0;
-       ladspa_icon = 0;       ladspa_vframe = 0;
-       veffect_icon = 0;      veffect_vframe = 0;
-       ff_aud_icon = 0;       ff_aud_vframe = 0;
-       ff_vid_icon = 0;       ff_vid_vframe = 0;
+
+       file_vframe = 0;                file_icon = 0;
+       folder_vframe = 0;              folder_icon = 0;
+       audio_vframe = 0;               audio_icon = 0;
+       video_vframe = 0;               video_icon = 0;
+       label_vframe = 0;               label_icon = 0;
+
+       atransition_vframe = 0;         atransition_icon = 0;
+       vtransition_vframe = 0;         vtransition_icon = 0;
+       aeffect_vframe = 0;             aeffect_icon = 0;
+       ladspa_vframe = 0;              ladspa_icon = 0;
+       veffect_vframe = 0;             veffect_icon = 0;
+       ff_aud_vframe = 0;              ff_aud_icon = 0;
+       ff_vid_vframe = 0;              ff_vid_icon = 0;
+
+       aeffect_folder_vframe = 0;      aeffect_folder_icon = 0;
+       atransition_folder_vframe = 0;  atransition_folder_icon = 0;
+       clip_folder_vframe = 0;         clip_folder_icon = 0;
+       label_folder_vframe = 0;        label_folder_icon = 0;
+       media_folder_vframe = 0;        media_folder_icon = 0;
+       proxy_folder_vframe = 0;        proxy_folder_icon = 0;
+       veffect_folder_vframe = 0;      veffect_folder_icon = 0;
+       vtransition_folder_vframe = 0;  vtransition_folder_icon = 0;
+
+       ladspa_vframe = 0;              ladspa_icon = 0;
+       ff_aud_vframe = 0;              ff_aud_icon = 0;
+       ff_vid_vframe = 0;              ff_vid_icon = 0;
+
+       clip_vframe = 0;                clip_icon = 0;
+       atransition_vframe = 0;         atransition_icon = 0;
+       vtransition_vframe = 0;         vtransition_icon = 0;
+       aeffect_vframe = 0;             aeffect_icon = 0;
+       veffect_vframe = 0;             veffect_icon = 0;
+
        plugin_visibility = ((uint64_t)1<<(8*sizeof(uint64_t)-1))-1;
        newfolder_thread = 0;
        asset_menu = 0;
@@ -433,20 +454,8 @@ AWindowGUI::~AWindowGUI()
        displayed_assets[1].remove_all_objects();
 
        delete vicon_thread;
-       delete file_icon;
-       delete audio_icon;
-       delete video_icon;
-       delete folder_icon;
-       delete clip_icon;
-       delete label_icon;
-       delete atransition_icon;
-       delete vtransition_icon;
-       delete aeffect_icon;
-       delete veffect_icon;
-       delete ladspa_icon;
-       delete ff_aud_icon;
-       delete ff_vid_icon;
        delete newfolder_thread;
+
        delete asset_menu;
        delete clip_menu;
        delete label_menu;
@@ -457,6 +466,28 @@ AWindowGUI::~AWindowGUI()
        delete folderlist_menu;
        delete temp_picon;
        delete remove_plugin;
+
+       delete file_vframe;             delete file_icon;
+       delete folder_vframe;           delete folder_icon;
+       delete audio_vframe;            delete audio_icon;
+       delete video_vframe;            delete video_icon;
+       delete label_vframe;            delete label_icon;
+       delete clip_vframe;             delete clip_icon;
+       delete aeffect_folder_vframe;   delete aeffect_folder_icon;
+       delete atransition_folder_vframe; delete atransition_folder_icon;
+       delete veffect_folder_vframe;   delete veffect_folder_icon;
+       delete vtransition_folder_vframe; delete vtransition_folder_icon;
+       delete clip_folder_vframe;      delete clip_folder_icon;
+       delete label_folder_vframe;     delete label_folder_icon;
+       delete media_folder_vframe;     delete media_folder_icon;
+       delete proxy_folder_vframe;     delete proxy_folder_icon;
+       delete ladspa_vframe;           delete ladspa_icon;
+       delete ff_aud_vframe;           delete ff_aud_icon;
+       delete ff_vid_vframe;           delete ff_vid_icon;
+       delete atransition_vframe;      delete atransition_icon;
+       delete vtransition_vframe;      delete vtransition_icon;
+       delete aeffect_vframe;          delete aeffect_icon;
+       delete veffect_vframe;          delete veffect_icon;
 }
 
 bool AWindowGUI::protected_pixmap(BC_Pixmap *icon)
@@ -576,22 +607,16 @@ void AWindowGUI::create_objects()
        mwindow->theme->get_awindow_sizes(this);
        load_defaults(mwindow->defaults);
 
-       add_subwindow(asset_list = new AWindowAssets(mwindow,
-               this,
-               mwindow->theme->alist_x,
-               mwindow->theme->alist_y,
-               mwindow->theme->alist_w,
-               mwindow->theme->alist_h));
+       add_subwindow(asset_list = new AWindowAssets(mwindow, this,
+               mwindow->theme->alist_x, mwindow->theme->alist_y,
+               mwindow->theme->alist_w, mwindow->theme->alist_h));
 
        vicon_thread = new VIconThread(asset_list);
        vicon_thread->start();
 
-       add_subwindow(divider = new AWindowDivider(mwindow,
-               this,
-               mwindow->theme->adivider_x,
-               mwindow->theme->adivider_y,
-               mwindow->theme->adivider_w,
-               mwindow->theme->adivider_h));
+       add_subwindow(divider = new AWindowDivider(mwindow, this,
+               mwindow->theme->adivider_x, mwindow->theme->adivider_y,
+               mwindow->theme->adivider_w, mwindow->theme->adivider_h));
 
        divider->set_cursor(HSEPARATE_CURSOR, 0, 0);
 
@@ -771,8 +796,8 @@ void AWindowRemovePluginGUI::create_objects()
        add_subwindow(title);
        y += title->get_h() + 5;
        list = new BC_ListBox(x, y,
-                get_w() - 20, ok_button->get_y() - y - 5, LISTBOX_TEXT, &plugin_list,
-                0, 0, 1, 0, 0, LISTBOX_SINGLE, ICON_LEFT, 0);
+               get_w() - 20, ok_button->get_y() - y - 5, LISTBOX_TEXT, &plugin_list,
+               0, 0, 1, 0, 0, LISTBOX_SINGLE, ICON_LEFT, 0);
        add_subwindow(list);
        show_window();
 }
@@ -1116,13 +1141,15 @@ void AWindowGUI::sort_assets()
        default:
                sort_picons(&assets);
        }
-
+// reset xyposition
+       asset_list->update_format(asset_list->get_format(), 0);
        update_assets();
 }
 
 void AWindowGUI::sort_folders()
 {
        sort_picons(&folders);
+       folder_list->update_format(folder_list->get_format(), 0);
        update_assets();
 }
 
@@ -1926,13 +1953,13 @@ AddPluginItem::AddPluginItem(AddTools *menu, char const *text, int idx)
        this->idx = idx;
        uint64_t msk = (uint64_t)1 << idx, vis = menu->gui->plugin_visibility;
        int chk = (msk & vis) ? 1 : 0;
-        set_checked(chk);
+       set_checked(chk);
 }
 
 int AddPluginItem::handle_event()
 {
-        int chk = get_checked() ^ 1;
-        set_checked(chk);
+       int chk = get_checked() ^ 1;
+       set_checked(chk);
        uint64_t msk = (uint64_t)1 << idx, vis = menu->gui->plugin_visibility;
        menu->gui->plugin_visibility = chk ? vis | msk : vis & ~msk;
        menu->gui->update_effects();
@@ -2004,8 +2031,8 @@ int AWindowListFormat::handle_event()
 
 void AWindowListFormat::update()
 {
-        set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
-                (char*)_("Display icons") : (char*)_("Display text"));
+       set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
+               (char*)_("Display icons") : (char*)_("Display text"));
 }
 
 AWindowListSort::AWindowListSort(MWindow *mwindow, AWindowGUI *gui)
index a95f6ef381089faefa14f756fad665c6f3e33be1..924d989bed530f5108a0d255e3be83afe9171862 100644 (file)
@@ -35,9 +35,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#undef MSGQUAL
-#define MSGQUAL "colorpicker"
-
 #define PALETTE_DATA "palette.dat"
 
 ColorPicker::ColorPicker(int do_alpha, const char *title)
index 90c67b1a5acb5fdc80d25b815ac353bec936e684..e1d69537e766c2569ea64f509db5c4e81d89e720 100644 (file)
@@ -40,10 +40,10 @@ N_("Drag source only")
 N_("No effect")
 #endif
 
-#define MOVE_ALL_EDITS_TITLE "Drag all following edits"
-#define MOVE_ONE_EDIT_TITLE "Drag only one edit"
-#define MOVE_NO_EDITS_TITLE "Drag source only"
-#define MOVE_EDITS_DISABLED_TITLE "No effect"
+#define MOVE_ALL_EDITS_TITLE N_("Drag all following edits")
+#define MOVE_ONE_EDIT_TITLE N_("Drag only one edit")
+#define MOVE_NO_EDITS_TITLE N_("Drag source only")
+#define MOVE_EDITS_DISABLED_TITLE N_("No effect")
 
 InterfacePrefs::InterfacePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
  : PreferencesDialog(mwindow, pwindow)
index 1aa06bacab9eecb97a2f23c6a231638ff57c69da..238c17aa43a09938d5a7bad1ade30d2fdef7e48e 100644 (file)
@@ -18,6 +18,7 @@
  *
  */
 
+#include "aboutprefs.h"
 #include "asset.h"
 #include "assets.h"
 #include "atrack.h"
@@ -3400,7 +3401,7 @@ void MWindow::trap_hook(FILE *fp, void *vp)
        mwindow->dump_edl(fp);
        fprintf(fp, "\nUNDO:\n");
        mwindow->dump_undo(fp);
-       fprintf(fp, "\nEXE:\n");
+       fprintf(fp, "\nEXE: %s\n", AboutPrefs::build_timestamp);
        mwindow->dump_exe(fp);
 }
 
index 91adc592dca8dcd3e8381626b25661c3aafb7c9d..d84913135a954c3c7305e6da3d962b3fbf88c015 100644 (file)
@@ -147,7 +147,7 @@ SET_TRACE
        int y1 = y + (window->get_h() - BC_Title::calculate_h(this, txt)) / 2;
        add_subwindow(title1 = new BC_Title(x1, y1, txt));
        x1 += title1->get_w() + margin;
-       add_subwindow(framerate_title = new BC_Title(x1, y1, _("--"), MEDIUMFONT, RED));
+       add_subwindow(framerate_title = new BC_Title(x1, y1, "--", MEDIUMFONT, RED));
        draw_framerate(0);
        y += window->get_h() + 2*margin;
 
index faafc8005f36ab2d533e093fa3ed602c3ebb6bb1..7f729f37ebe561305178998382a48ddac87a5f92 100644 (file)
@@ -55,6 +55,11 @@ ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
 {
        this->mwindow = mwindow;
        set_alt();
+       dialog = 0;
+}
+ProxyMenuItem::~ProxyMenuItem()
+{
+       delete dialog;
 }
 
 void ProxyMenuItem::create_objects()
index 1404593f986e1a529cab4fa9580f2353359ee8a2..c2ad5486ba1c455a4165a70735e906f486bb28c3 100644 (file)
@@ -43,6 +43,7 @@ class ProxyMenuItem : public BC_MenuItem
 {
 public:
        ProxyMenuItem(MWindow *mwindow);
+       ~ProxyMenuItem();
 
        int handle_event();
        void create_objects();
index b7e97138106e03aa235a81ac0f0a6e633ed9f256..4e86de5916f346b2926d6826cc33993d39dba551 100644 (file)
@@ -112,7 +112,7 @@ void StatusBar::show_message(const char *text, int color)
 void StatusBar::reset_default_message()
 {
        status_color = -1;
-       strcpy(default_msg, _("Welcome to cinelerra"));
+       strcpy(default_msg, _("Welcome to Cinelerra."));
 }
 void StatusBar::update_default_message()
 {
index fd173764f8eab5d61e4d4218c986e0a3af099422..ea052eebb2580a6684aa5552e6f08a736cd66184 100644 (file)
@@ -114,7 +114,7 @@ int SWindowLoadFile::handle_event()
 }
 
 SWindowSaveFile::SWindowSaveFile(SWindowGUI *gui, int x, int y)
- : BC_GenericButton(x, y, _("Save"))
+ : BC_GenericButton(x, y, C_("Save"))
 {
        this->sw_gui = gui;
 }
index 2fa43288724faacb1431a4f67554cef4c30aae83..52090e20f4d80b7abf9bfde318bf5d550d8b12b2 100644 (file)
@@ -118,7 +118,7 @@ install:
 $(LIBOBJS) $(OBJS) $(CUTOBJ):
 
 $(OBJDIR)/%.o:          %.C
-       $(CXX) `cat $(OBJDIR)/c_flags` -c $< -o $@
+       $(CXX) `cat $(OBJDIR)/c_flags` '-DMSGQUAL="$*"' -c $< -o $@
 
 $(OBJDIR)/bootstrap: bootstrap.c
 $(OBJDIR)/pngtoh: pngtoh.c
index 0c3057d1d99ed47838741a38fa648cee5b71f7ea..fb57b17de864b2999c7b5500ed35410f0cb2d5a0 100644 (file)
@@ -3688,19 +3688,26 @@ int BC_ListBox::drag_start_event()
                                {
                                        int cx, cy;
                                        get_abs_cursor_xy(cx, cy);
-                                       cx -= item_return->icon_vframe->get_w() / 2,
-                                       cy -= item_return->icon_vframe->get_h() / 2;
-                                       if( item_return->icon_vframe )
+                                       if( item_return->icon_vframe ) {
+                                               cx -= item_return->icon_vframe->get_w() / 2,
+                                               cy -= item_return->icon_vframe->get_h() / 2;
                                                drag_popup = new BC_DragWindow(this,
                                                        item_return->icon_vframe, cx, cy);
+                                       }
                                        else
 // this probably works not!
-                                       if( item_return->icon )
+                                       if( item_return->icon ) {
+                                               cx -= item_return->icon->get_w() / 2,
+                                               cy -= item_return->icon->get_h() / 2;
                                                drag_popup = new BC_DragWindow(this,
                                                        item_return->icon, cx, cy);
-                                       else
+                                       }
+                                       else {
+                                               cx -= drag_icon_vframe->get_w() / 2,
+                                               cy -= drag_icon_vframe->get_h() / 2;
                                                drag_popup = new BC_DragWindow(this,
                                                        drag_icon_vframe, cx, cy);
+                                       }
                                        current_operation = DRAG_ITEM;
 // require shift down for scrolling
                                        if( allow_drag < 0 && shift_down() )
index 12e6c34a6faf3645f36f5aa394f74a7b753f9555..2794830f6c8eb6d8febca0419a7a76507e8f9426 100644 (file)
@@ -177,6 +177,7 @@ BC_WindowBase::~BC_WindowBase()
                         &BC_WindowBase::mediumfont,
                         &BC_WindowBase::largefont,
                         &BC_WindowBase::bigfont,
+                        &BC_WindowBase::clockfont,
                };
                for( int i=sizeof(xfont)/sizeof(xfont[0]); --i>=0; )
                        XFreeFont(display, this->*xfont[i]);
@@ -193,6 +194,7 @@ BC_WindowBase::~BC_WindowBase()
                         &BC_WindowBase::bold_smallfont_xft,
                         &BC_WindowBase::bold_mediumfont_xft,
                         &BC_WindowBase::bold_largefont_xft,
+                        &BC_WindowBase::clockfont_xft,
                };
                for( int i=sizeof(xft_font)/sizeof(xft_font[0]); --i>=0; ) {
                        XftFont *xft = (XftFont *)(this->*xft_font[i]);
index 83092869f47e66c17f273fa715d828795fc07ba9..c9e0d7ef6f05f35cf59e596192efb40de2f72a59 100644 (file)
@@ -36,7 +36,9 @@
 // D_: msgid decorated as: qual_id#msg_id explicitly
 // see po/xlat.sh for details
 
+#ifndef MSGQUAL
 #define MSGQUAL 0
+#endif
 // qualifier from MSGQUAL
 #define C_(msgid) ((MSGQUAL)? msgqual(MSGQUAL,msgid) : gettext(msgid))
 // qualifier from msgid
index 5615a62efbd49413e26dc35f8f71e97a35927ea6..c4d3516df50cab3da512ffa1c0e9cda75b444c35 100644 (file)
@@ -52,8 +52,8 @@ clean::
 wc:
        cat *.C *.h | wc
 
-$(OBJS):
-       $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.C) -o $*.o
+$(OBJDIR)/%.o:          %.C
+       $(CXX) `cat $(OBJDIR)/c_flags` '-DMSGQUAL="$*"' -c $< -o $@
 
 val-%:
        @echo $($(subst val-,,$@))
index 3e13abecfff6ec0ba0f4888175f80dc099ea242c..e52da6db3b74ef5482357d34638ce54538f1db82 100644 (file)
@@ -25,7 +25,6 @@
 // Additional support for UTF-8 by
 // Paolo Rampino aka Akirad <info at tuttoainternet.it>
 
-
 #include "asset.h"
 #include "bccmodels.h"
 #include "bcsignals.h"
@@ -1145,7 +1144,7 @@ TitleMain::~TitleMain()
        delete outline_engine;
 }
 
-const char* TitleMain::plugin_title() { return _("Title"); }
+const char* TitleMain::plugin_title() { return C_("Title"); }
 int TitleMain::is_realtime() { return 1; }
 int TitleMain::is_synthesis() { return 1; }
 
index 51c3e88c89c4acc15161aedd5f3b5813ffb2983c..3521ae9f4685a903f3545f5c17959afb9bf2d216 100755 (executable)
@@ -25,7 +25,8 @@ done | while read f ; do
 #   code C_("xxx") [... code _("yyy")]
 #to:
 #   code D_("qual_id#xxx") [... code D_("qual_id#yyy")]
-  sed -n "$f" > "$cin_dir/$f" -f - <<<'1,1{x; s/.*/_("/; x}
+  bn=${f##*/}; fn=${bn%.*}
+  sed -n "$f" > "$cin_dir/$f" -f - <<<'1,1{x; s/.*/D_("'$fn'#/; x}; t n1
 :n1 s/^\(#define MSGQUAL[      ]\)/\1/; t n4
 :n2 s/\<C_("/\
 /; t n3; P; d; n; b n1