Sortable tree in File Browser, gc issue 2678

This commit is contained in:
Ingo
2015-03-19 18:51:41 +01:00
parent 167058c274
commit f86fd06b11
32 changed files with 103 additions and 27 deletions

View File

@@ -29,6 +29,7 @@ CURVEEDITOR_TOOLTIPLOAD;Carrega corba de fitxer
CURVEEDITOR_TOOLTIPPASTE;Enganxa corba del portap.
CURVEEDITOR_TOOLTIPSAVE;Desa la corba actual
CURVEEDITOR_TYPE;Tipus:
DIRBROWSER_FOLDERS;Carpetes
EDITWINDOW_TITLE;Edita imatge
EXIFFILTER_APERTURE;Obertura
EXIFFILTER_CAMERA;Càmera

View File

@@ -29,6 +29,7 @@ CURVEEDITOR_TOOLTIPLINEAR;重置曲线
CURVEEDITOR_TOOLTIPLOAD;读取曲线
CURVEEDITOR_TOOLTIPSAVE;保存曲线
CURVEEDITOR_TYPE;类型:
DIRBROWSER_FOLDERS;文件夹
EDITWINDOW_TITLE;图片修改
EXIFFILTER_APERTURE;光圈
EXIFFILTER_CAMERA;相机

View File

@@ -11,6 +11,7 @@ CURVEEDITOR_SAVEDLGLABEL;正儲存曲線...
CURVEEDITOR_TOOLTIPLINEAR;重置曲線
CURVEEDITOR_TOOLTIPLOAD;載入曲線
CURVEEDITOR_TOOLTIPSAVE;儲存曲線
DIRBROWSER_FOLDERS;文件夾
EXIFFILTER_APERTURE;Aperture
EXIFFILTER_CAMERA;Camera
EXIFFILTER_FOCALLEN;Focal Length

View File

@@ -63,6 +63,7 @@ CURVEEDITOR_TOOLTIPLOAD;Načíst křivku ze souboru.
CURVEEDITOR_TOOLTIPPASTE;Vložit křivku ze schránky.
CURVEEDITOR_TOOLTIPSAVE;Uložit současnou křivku.
CURVEEDITOR_TYPE;Typ
DIRBROWSER_FOLDERS;Složky
EDITWINDOW_TITLE;Editace obrázku
EDIT_OBJECT_TOOLTIP;V náhledovém okně zobrazí widget umožňující přizpůsobení nástroje.
EDIT_PIPETTE_TOOLTIP;Pro přidání bodu na křivku, podržte klávesu Ctrl a klikněte levým tlačítkem na vybraný bod v náhledu obrázku.\nPro úpravu bodu podržte klávesu Ctrl a klikněte levým tlačítkem na odpovídající oblast v náhledu, následně uvolněte klávesu Ctrl (pokud si přejete jemné změny) a za stálého držení levého tlačítka myši pohybujte myší nahoru a dolů což bude posouvat bod na křivce nahoru a dolů.

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Gem kurve...
CURVEEDITOR_TOOLTIPLINEAR;Nulstil kurve til lineær
CURVEEDITOR_TOOLTIPLOAD;Indlæs kurve fra fil
CURVEEDITOR_TOOLTIPSAVE;Gem nuværende kurve
DIRBROWSER_FOLDERS;Mapper
EXIFFILTER_APERTURE;Blænde
EXIFFILTER_CAMERA;Kamera
EXIFFILTER_FOCALLEN;Brændvidde

View File

@@ -49,6 +49,7 @@ CURVEEDITOR_TOOLTIPLOAD;Kurve aus Datei laden
CURVEEDITOR_TOOLTIPPASTE;Kurve aus Zwischenablage einfügen
CURVEEDITOR_TOOLTIPSAVE;Kurve speichern
CURVEEDITOR_TYPE;Typ
DIRBROWSER_FOLDERS;Verzeichnisse
EDITWINDOW_TITLE;Bildbearbeitung
EXIFFILTER_APERTURE;Blende
EXIFFILTER_CAMERA;Kamera

View File

@@ -91,6 +91,7 @@ CURVEEDITOR_TOOLTIPLOAD;Abrir una curva desde un archivo
CURVEEDITOR_TOOLTIPPASTE;Pegar curva desde el portapapeles
CURVEEDITOR_TOOLTIPSAVE;Guardar curva actual
CURVEEDITOR_TYPE;Tipo:
DIRBROWSER_FOLDERS;Carpetas
EDITWINDOW_TITLE;Edición de imagen
EDIT_OBJECT_TOOLTIP;Muestra un instrumento en la ventana de previo, el cual le permitirá ajustar esta herramienta.
EDIT_PIPETTE_TOOLTIP;Para agregar un punto de ajuste en la curva , mantenga presionada la tecla Ctrl mientras oprime el botón izquierdo del ratón sobre el punto deseado en el previo de la imagen.\nPara ajustar el punto, mantenga presionada la tecla Ctrl mientras oprime el botón izquierdo del ratón sobre la correspondiente area en el previo y muevase hacia arriba y/o hacia abajo, logrando un ajuste fino del punto en la curva. Si desea un ajuste mayor, libere la tecla Ctrl.

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Kurba gorde...
CURVEEDITOR_TOOLTIPLINEAR;Kurba lineala berrabiarazi
CURVEEDITOR_TOOLTIPLOAD;Artxibo batetik kurba ireki
CURVEEDITOR_TOOLTIPSAVE;Uneko kurba gorde
DIRBROWSER_FOLDERS;Karpetak
EXIFFILTER_APERTURE;Aperture
EXIFFILTER_CAMERA;Camera
EXIFFILTER_FOCALLEN;Focal Length

View File

@@ -30,6 +30,7 @@ CURVEEDITOR_TOOLTIPLOAD;Charger une courbe depuis un fichier
CURVEEDITOR_TOOLTIPPASTE;Colle la courbe du presse-papier
CURVEEDITOR_TOOLTIPSAVE;Enregistrer la courbe actuelle
CURVEEDITOR_TYPE;Type:
DIRBROWSER_FOLDERS;Répertoires
EDITWINDOW_TITLE;Édition d'image
EDIT_OBJECT_TOOLTIP;Affiche des éléments dans la fenêtre de prévisualisation qui vous permettront d'ajuster cet outil.
EDIT_PIPETTE_TOOLTIP;Pour ajouter un point d'ajustement de la courbe, maintenez la touche Ctrl préssée et cliquez dans l'image avec le bouton gauche.\nPour ajuster le point, pressez la touche Ctrl lors du clic-gauche sur la zone correspondande dans l'apperçu, puis relachez Ctrl (sauf si vous désirez un control plus fin) et tout en gardant le bouton gauche appuyé, déplacez le curseur vers le haut ou le bas pour ajuster la position du point.

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Αποθήκευση καμπλης...
CURVEEDITOR_TOOLTIPLINEAR;Επαναφορά καμπύλης σε γραμμική
CURVEEDITOR_TOOLTIPLOAD;Φόρτωση καμπύλης απο αρχείο
CURVEEDITOR_TOOLTIPSAVE;Αποθήκευση παρούσας καμπύλης
DIRBROWSER_FOLDERS;Φάκελοι
EXIFFILTER_APERTURE;Aperture
EXIFFILTER_CAMERA;Camera
EXIFFILTER_FOCALLEN;Focal Length

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;שמור עקמה
CURVEEDITOR_TOOLTIPLINEAR;החזר עקמה לישירה
CURVEEDITOR_TOOLTIPLOAD;הטען עקמה
CURVEEDITOR_TOOLTIPSAVE;שמור עקמה נוכחית
DIRBROWSER_FOLDERS;תיקיות
EXIFFILTER_APERTURE;Aperture
EXIFFILTER_CAMERA;Camera
EXIFFILTER_FOCALLEN;Focal Length

View File

@@ -34,6 +34,7 @@ CURVEEDITOR_TOOLTIPLOAD;Carica una curva da file
CURVEEDITOR_TOOLTIPPASTE;Incolla la curva dagli appunti
CURVEEDITOR_TOOLTIPSAVE;Salva la curva corrente
CURVEEDITOR_TYPE;Tipologia:
DIRBROWSER_FOLDERS;Cartelle
EDITWINDOW_TITLE;Modifica immagine
EDIT_OBJECT_TOOLTIP;Mostra un widget nella finestra anteprima che ti permette di configurare questo strumento.
EDIT_PIPETTE_TOOLTIP;Per aggiungere un punto di regolazione alla curva, tieni premuto il tasto Ctrl e fai click sul punto desiderato nell'anteprima dell'immagine.\nPer sistemare il punto, tieni premuto il tasto Ctrl mentre fai click sulla corrispondente area nell'anteprima, poi lascia il tasto Ctrl (a meno che non desideri un controllo fine) e mentre tieni premuto il tasto sinistro del mouse, muovilo in su e in giù per muovere il punto su e giù sulla curva.

View File

@@ -57,6 +57,7 @@ CURVEEDITOR_TOOLTIPLOAD;ファイルからカーブを読み込む
CURVEEDITOR_TOOLTIPPASTE;クリップボードからカーブを貼り付け
CURVEEDITOR_TOOLTIPSAVE;現在のカーブを保存
CURVEEDITOR_TYPE;タイプ:
DIRBROWSER_FOLDERS;フォルダ
EDITWINDOW_TITLE;画像編集
EDIT_OBJECT_TOOLTIP;この機能を使うための目安に、プレビュー画面にガイドを表示する
EDIT_PIPETTE_TOOLTIP;カーブ上に調整ポイントを追加するには、Ctrlキーを押しながら、プレビューの画像上の目標ポイントを左クリックします。\n追加されたそのポイントを調整するには、Ctrlキーを押しながら、プレビュー画像のそのポイントに当たる部分を左クリックします。それからCtrlキーを離し微妙な調整をする場合はそのまま、左クリックしたままマウスを画面上で上下に動かすと、それに合わせてトーンカーブが調整されます。

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Saglabāt līkni...
CURVEEDITOR_TOOLTIPLINEAR;Iztaisnot līkni
CURVEEDITOR_TOOLTIPLOAD;Ielādēt līkni no faila
CURVEEDITOR_TOOLTIPSAVE;Saglabāt esošo līkni
DIRBROWSER_FOLDERS;Mapes
EXIFFILTER_APERTURE;Atvērums
EXIFFILTER_CAMERA;Kamera
EXIFFILTER_FOCALLEN;Fokusa garums

View File

@@ -29,6 +29,7 @@ CURVEEDITOR_TOOLTIPLOAD;Görbe betöltése
CURVEEDITOR_TOOLTIPPASTE;Görbe beillesztése a vágólapról
CURVEEDITOR_TOOLTIPSAVE;Görbe mentése
CURVEEDITOR_TYPE;Típus:
DIRBROWSER_FOLDERS;Mappák
EDITWINDOW_TITLE;Kép szerkesztése
EXIFFILTER_APERTURE;Rekesz
EXIFFILTER_CAMERA;Fényképezőgép

View File

@@ -42,6 +42,7 @@ CURVEEDITOR_TOOLTIPLOAD;Laad curve uit bestand
CURVEEDITOR_TOOLTIPPASTE;Plak curve van klembord
CURVEEDITOR_TOOLTIPSAVE;Bewaar huidige curve
CURVEEDITOR_TYPE;Type:
DIRBROWSER_FOLDERS;Mappen
EDITWINDOW_TITLE;Bewerk afbeelding
EDIT_OBJECT_TOOLTIP;Toont een widget in het voorbeeld scherm waarmee de werking van het gereedschap kan worden aangepast.
EDIT_PIPETTE_TOOLTIP;Voeg een punt toe aan de curve door de Ctrl toets ingedrukt te houden en tegelijkertijd te links-klikken op de gewenste plek op het voorbeeld.\nOm een punt te wijzigen, hou de Ctrl toets ingedrukt en links-klik tegelijkertijd op het gewenste gebied in het voorbeeld, en laat daarna de Ctrl toets los (behalve wanneer fijne controle is gewenst), blijf de linker muis knop ingedrukt houden en beweeg de muis naar boven of beneden om dit punt te verschuiven op de curve.

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Lagre kurve...
CURVEEDITOR_TOOLTIPLINEAR;Nullstil kurve til linjær
CURVEEDITOR_TOOLTIPLOAD;Lagre kurve fra fil
CURVEEDITOR_TOOLTIPSAVE;Lagre nåværende kurve
DIRBROWSER_FOLDERS;Mapper
EXIFFILTER_APERTURE;Blender
EXIFFILTER_CAMERA;Kamera
EXIFFILTER_FOCALLEN;Fokallengde

View File

@@ -38,6 +38,7 @@ CURVEEDITOR_TOOLTIPLOAD;Wczytaj krzywą z pliku
CURVEEDITOR_TOOLTIPPASTE;Wstaw krzywą ze schowka
CURVEEDITOR_TOOLTIPSAVE;Zapisz krzywą
CURVEEDITOR_TYPE;Typ:
DIRBROWSER_FOLDERS;Katalogi
EDITWINDOW_TITLE;Edytor obrazu
EDIT_OBJECT_TOOLTIP;Wyświetla widżet na podglądzie który ułatwia ustawienie narzędzia.
EDIT_PIPETTE_TOOLTIP;Aby dodać punkt do krzywej należy trzymac wciśnięty klawisz Ctrl podczas kliknięcia lewym guzikiem myszki na danym obszarze głównego podglądu.\nAby zmienic ustawienie już istniejącego punktu, należy trzymać wduszony klawisz Ctrl podczas kliknięcia lewym guzikiem myszki na danym obszarze głównego podglądu, następnie należy puścić klawisz Ctrl (chyba że chodzi nam o bardzo precyzyjne ustawienie dzieki spowolnieniu jakie trzymanie klawisza Ctrl nam daje) i podczas trzymania lewego guzika myszki należy myszką ruszać w pionie aby odpowiednio manipulować punktem w pionie.

View File

@@ -38,6 +38,7 @@ CURVEEDITOR_TOOLTIPLOAD;Wczytaj krzywa z pliku
CURVEEDITOR_TOOLTIPPASTE;Wstaw krzywa ze schowka
CURVEEDITOR_TOOLTIPSAVE;Zapisz krzywa
CURVEEDITOR_TYPE;Typ:
DIRBROWSER_FOLDERS;Katalogi
EDITWINDOW_TITLE;Edytor obrazu
EDIT_OBJECT_TOOLTIP;Wyswietla widzet na podgladzie ktory ulatwia ustawienie narzedzia.
EDIT_PIPETTE_TOOLTIP;Aby dodac punkt do krzywej nalezy trzymac wcisniety klawisz Ctrl podczas klikniecia lewym guzikiem myszki na danym obszarze glownego podgladu.\nAby zmienic ustawienie juz istniejacego punktu, nalezy trzymac wduszony klawisz Ctrl podczas klikniecia lewym guzikiem myszki na danym obszarze glownego podgladu, nastepnie nalezy puscic klawisz Ctrl (chyba ze chodzi nam o bardzo precyzyjne ustawienie dzieki spowolnieniu jakie trzymanie klawisza Ctrl nam daje) i podczas trzymania lewego guzika myszki nalezy myszka ruszac w pionie aby odpowiednio manipulowac punktem w pionie.

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Salvar Curva...
CURVEEDITOR_TOOLTIPLINEAR;Restaurar curva para linha
CURVEEDITOR_TOOLTIPLOAD;Carregar uma Curva a Partir de Arquivo
CURVEEDITOR_TOOLTIPSAVE;Salvar Arquivo Atual
DIRBROWSER_FOLDERS;Folders
EXIFFILTER_APERTURE;Abertura
EXIFFILTER_CAMERA;Câmera
EXIFFILTER_FOCALLEN;Distância Focal

View File

@@ -36,6 +36,7 @@ CURVEEDITOR_TOOLTIPLOAD;Загрузить тоновую кривую
CURVEEDITOR_TOOLTIPPASTE;Вставить кривую из буфера обмена
CURVEEDITOR_TOOLTIPSAVE;Сохранить тоновую кривую
CURVEEDITOR_TYPE;Тип:
DIRBROWSER_FOLDERS;Папки
EDITWINDOW_TITLE;Редактор
EXIFFILTER_APERTURE;Диафрагма
EXIFFILTER_CAMERA;Камера

View File

@@ -28,6 +28,7 @@ CURVEEDITOR_TOOLTIPLOAD;Учитава кривуљу из датотеке
CURVEEDITOR_TOOLTIPPASTE;Убацује кривуљу из оставе
CURVEEDITOR_TOOLTIPSAVE;Чува тренутну кривуљу
CURVEEDITOR_TYPE;Врста:
DIRBROWSER_FOLDERS;Фасцикле
EDITWINDOW_TITLE;Уређивање слике
EXIFFILTER_APERTURE;Отвор бленде
EXIFFILTER_CAMERA;Фото апарат

View File

@@ -28,6 +28,7 @@ CURVEEDITOR_TOOLTIPLOAD;Učitava krivulju iz datoteke
CURVEEDITOR_TOOLTIPPASTE;Ubacuje krivulju iz ostave
CURVEEDITOR_TOOLTIPSAVE;Čuva trenutnu krivulju
CURVEEDITOR_TYPE;Vrsta:
DIRBROWSER_FOLDERS;Fascikle
EDITWINDOW_TITLE;Uređivanje slike
EXIFFILTER_APERTURE;Otvor blende
EXIFFILTER_CAMERA;Foto aparat

View File

@@ -21,6 +21,7 @@ CURVEEDITOR_TOOLTIPLINEAR;Resetovať krivku na lineárnu
CURVEEDITOR_TOOLTIPLOAD;Načítať krivku zo súboru
CURVEEDITOR_TOOLTIPSAVE;Uložiť súčasnú krivku
CURVEEDITOR_TYPE;Typ:
DIRBROWSER_FOLDERS;Priečinky
EXIFFILTER_APERTURE;Clona
EXIFFILTER_CAMERA;Fotoaparát
EXIFFILTER_FOCALLEN;Ohnisková vzdialenosť

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Tallenna käyrä...
CURVEEDITOR_TOOLTIPLINEAR;Palauta suoraksi
CURVEEDITOR_TOOLTIPLOAD;Lataa käyrä tiedostosta
CURVEEDITOR_TOOLTIPSAVE;Tallenna käyrä
DIRBROWSER_FOLDERS;Kansiot
EXIFFILTER_APERTURE;Aukko
EXIFFILTER_CAMERA;Kamera
EXIFFILTER_FOCALLEN;Polttoväli

View File

@@ -32,6 +32,7 @@ CURVEEDITOR_TOOLTIPLOAD;Ladda kurva från fil
CURVEEDITOR_TOOLTIPPASTE;Klistra in kurva från klippbordet
CURVEEDITOR_TOOLTIPSAVE;Spara nuvarande kurva
CURVEEDITOR_TYPE;Typ:
DIRBROWSER_FOLDERS;Mappar
EDITWINDOW_TITLE;Bildredigering
EXIFFILTER_APERTURE;Bländare
EXIFFILTER_CAMERA;Kamera

View File

@@ -9,6 +9,7 @@ CURVEEDITOR_SAVEDLGLABEL;Eğriyi kaydet...
CURVEEDITOR_TOOLTIPLINEAR;Eğriyi düzelt
CURVEEDITOR_TOOLTIPLOAD;Kayıtlı bir eğriyi yü
CURVEEDITOR_TOOLTIPSAVE;Kullanılan eğriyi kaydet
DIRBROWSER_FOLDERS;Klasörler
EXIFFILTER_APERTURE;Aperture
EXIFFILTER_CAMERA;Camera
EXIFFILTER_FOCALLEN;Focal Length

View File

@@ -32,6 +32,7 @@ CURVEEDITOR_TOOLTIPLOAD;Load a curve from file.
CURVEEDITOR_TOOLTIPPASTE;Paste curve from clipboard.
CURVEEDITOR_TOOLTIPSAVE;Save current curve.
CURVEEDITOR_TYPE;Type:
DIRBROWSER_FOLDERS;Folders
EDITWINDOW_TITLE;Image Edit
EDIT_OBJECT_TOOLTIP;Displays a widget on the preview window which lets you adjust this tool.
EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve.

View File

@@ -22,6 +22,7 @@
#include <windows.h>
#endif
#include "options.h"
#include "multilangmgr.h"
#include "../rtengine/safegtk.h"
#include <cstring>
@@ -30,7 +31,17 @@
#define CHECKTIME 5000
DirBrowser::DirBrowser () : expandSuccess(false)
struct DirNameComparator {
template<class T>
bool operator()(T const &firstDir, T const &secondDir) const {
return options.dirBrowserSortType == Gtk::SORT_ASCENDING ? firstDir < secondDir : firstDir > secondDir;
}
};
DirBrowser::DirBrowser () : dirTreeModel(),
dtColumns(),
tvc(M("DIRBROWSER_FOLDERS")),
expandSuccess(false)
#ifdef WIN32
, volumes(0)
#endif
@@ -40,7 +51,8 @@ DirBrowser::DirBrowser () : expandSuccess(false)
scrolledwindow4 = Gtk::manage ( new Gtk::ScrolledWindow() );
// dirtree->set_flags(Gtk::CAN_FOCUS);
dirtree->set_headers_visible(false);
dirtree->set_headers_visible();
dirtree->set_headers_clickable();
dirtree->set_rules_hint(false);
dirtree->set_reorderable(false);
dirtree->set_enable_search(false);
@@ -74,19 +86,27 @@ void DirBrowser::fillDirTree () {
Gtk::CellRendererPixbuf* render_pb = Gtk::manage ( new Gtk::CellRendererPixbuf () );
tvc.pack_start (*render_pb, false);
tvc.add_attribute(*render_pb, "pixbuf-expander-closed", 1);
tvc.add_attribute(*render_pb, "pixbuf", 1);
tvc.add_attribute(*render_pb, "pixbuf-expander-open", 0);
tvc.add_attribute(*render_pb, "pixbuf-expander-closed", dtColumns.icon2);
tvc.add_attribute(*render_pb, "pixbuf", dtColumns.icon2);
tvc.add_attribute(*render_pb, "pixbuf-expander-open", dtColumns.icon1);
tvc.pack_start (crt);
tvc.add_attribute(crt, "text", 2);
tvc.add_attribute(crt, "text", dtColumns.filename);
dirtree->append_column(tvc);
tvc.set_sort_order(options.dirBrowserSortType);
tvc.set_sort_column(dtColumns.filename);
tvc.set_sort_indicator(true);
tvc.set_clickable();
dirTreeModel->set_sort_column(dtColumns.filename, options.dirBrowserSortType);
crt.property_ypad() = 0;
render_pb->property_ypad() = 0;
dirtree->append_column(tvc);
dirtree->signal_row_expanded().connect(sigc::mem_fun(*this, &DirBrowser::row_expanded));
dirtree->signal_row_activated().connect(sigc::mem_fun(*this, &DirBrowser::row_activated));
dirTreeModel->signal_sort_column_changed().connect(sigc::mem_fun(*this, &DirBrowser::on_sort_column_changed));
}
#ifdef WIN32
@@ -196,29 +216,52 @@ void DirBrowser::fillRoot () {
#endif
}
void DirBrowser::on_sort_column_changed() const {
options.dirBrowserSortType = tvc.get_sort_order();
}
void DirBrowser::row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path) {
expandSuccess = false;
int todel = iter->children().size();
// We will disable model's sorting because it decreases speed of inserting new items
// in list tree dramatically. Therefore will do:
// 1) Disable sorting in model
// 2) Manually sort data by DirNameComparator
// 3) Enable sorting in model again for UI (sorting by click on header)
int prevSortColumn;
Gtk::SortType prevSortType;
dirTreeModel->get_sort_column_id(prevSortColumn, prevSortType);
dirTreeModel->set_sort_column(Gtk::TreeSortable::DEFAULT_UNSORTED_COLUMN_ID, Gtk::SORT_ASCENDING);
std::vector<Glib::ustring> subDirs;
typedef std::vector<Glib::ustring> DirPathType;
DirPathType subDirs;
Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname));
safe_build_subdir_list (dir, subDirs, options.fbShowHidden);
if (subDirs.empty())
dirtree->collapse_row (path);
else {
std::sort (subDirs.begin(), subDirs.end());
for (size_t i=0; i<subDirs.size(); i++)
addDir (iter, subDirs[i]);
if (subDirs.empty()) {
dirtree->collapse_row(path);
}
else {
Gtk::TreeNodeChildren children = iter->children();
std::list<Gtk::TreeIter> forErase(children.begin(), children.end());
for (int i=0; i<todel; i++)
dirTreeModel->erase (iter->children().begin());
expandSuccess = true;
}
DirNameComparator comparator;
sort(subDirs.begin(), subDirs.end(), comparator);
for (DirPathType::const_iterator it = subDirs.begin(), end = subDirs.end(); it != end; ++it) {
addDir(iter, *it);
}
for (std::list<Gtk::TreeIter>::const_iterator it = forErase.begin(), end = forErase.end(); it != end; ++it) {
dirTreeModel->erase(*it);
}
dirTreeModel->set_sort_column(prevSortColumn, prevSortType);
expandSuccess = true;
}
#ifdef WIN32
Glib::RefPtr<WinDirMonitor> monitor = Glib::RefPtr<WinDirMonitor>(new WinDirMonitor (iter->get_value (dtColumns.dirname), this));
iter->set_value (dtColumns.monitor, monitor);
@@ -265,8 +308,8 @@ void DirBrowser::addDir (const Gtk::TreeModel::iterator& iter, const Glib::ustri
Gtk::TreeModel::iterator child = dirTreeModel->append(iter->children());
child->set_value (dtColumns.filename, dirname);
child->set_value (0, openfolder);
child->set_value (1, closedfolder);
child->set_value (dtColumns.icon1, openfolder);
child->set_value (dtColumns.icon2, closedfolder);
Glib::ustring fullname = Glib::build_filename (iter->get_value (dtColumns.dirname), dirname);
child->set_value (dtColumns.dirname, fullname);
Gtk::TreeModel::iterator fooRow = dirTreeModel->append(child->children());

View File

@@ -52,10 +52,11 @@ class DirBrowser : public Gtk::VBox, public DirBrowserRemoteInterface
DirTreeColumns() { add(icon1); add(icon2); add(filename); add(dirname); add(monitor); }
};
DirTreeColumns dtColumns;
Gtk::TreeViewColumn tvc;
Gtk::CellRendererText crt;
Gtk::CellRendererPixbuf crb;
DirTreeColumns dtColumns;
Gtk::TreeView *dirtree;
Gtk::ScrolledWindow *scrolledwindow4;
@@ -92,6 +93,7 @@ class DirBrowser : public Gtk::VBox, public DirBrowserRemoteInterface
DirBrowser ();
void fillDirTree ();
void on_sort_column_changed() const;
void row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path);
void row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
void file_changed (const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<Gio::File>& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName);

View File

@@ -276,6 +276,7 @@ void Options::setDefaults () {
detailWindowHeight = -1;
dirBrowserWidth = 260;
dirBrowserHeight = 350;
dirBrowserSortType = Gtk::SORT_ASCENDING;
preferencesWidth = 800;
preferencesHeight = 0;
toolPanelWidth = 400;
@@ -790,6 +791,7 @@ if (keyFile.has_group ("GUI")) {
if (keyFile.has_key ("GUI", "DetailWindowHeight")) detailWindowHeight = keyFile.get_integer ("GUI", "DetailWindowHeight");
if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth");
if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight");
if (keyFile.has_key ("GUI", "SortType")) dirBrowserSortType = static_cast<Gtk::SortType>(keyFile.get_integer ("GUI", "SortType"));
if (keyFile.has_key ("GUI", "PreferencesWidth")) preferencesWidth = keyFile.get_integer ("GUI", "PreferencesWidth");
if (keyFile.has_key ("GUI", "PreferencesHeight")) preferencesHeight = keyFile.get_integer ("GUI", "PreferencesHeight");
if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth");
@@ -1008,8 +1010,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_string ("External Editor", "GimpDir", gimpDir);
keyFile.set_string ("External Editor", "PhotoshopDir", psDir);
keyFile.set_string ("External Editor", "CustomEditor", customEditorProg);
keyFile.set_boolean ("File Browser", "BrowseOnlyRaw", fbOnlyRaw);
keyFile.set_boolean ("File Browser", "BrowserShowsDate", fbShowDateTime);
keyFile.set_boolean ("File Browser", "BrowserShowsExif", fbShowBasicExif);
@@ -1115,6 +1116,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_integer ("GUI", "DetailWindowHeight", detailWindowHeight);
keyFile.set_integer ("GUI", "DirBrowserWidth", dirBrowserWidth);
keyFile.set_integer ("GUI", "DirBrowserHeight", dirBrowserHeight);
keyFile.set_integer ("GUI", "SortType", dirBrowserSortType);
keyFile.set_integer ("GUI", "PreferencesWidth", preferencesWidth);
keyFile.set_integer ("GUI", "PreferencesHeight", preferencesHeight);
keyFile.set_integer ("GUI", "SaveAsDialogWidth", saveAsDialogWidth);

View File

@@ -98,6 +98,7 @@ class Options {
Glib::ustring dateFormat;
int adjusterDelay;
int startupDir;
Gtk::SortType dirBrowserSortType;
Glib::ustring startupPath;
Glib::ustring profilePath; // can be an absolute or relative path; depending on this value, bundled profiles may not be found
bool useBundledProfiles; // only used if multiUser == true