Second attempt to fix bug #59

This commit is contained in:
Hombre
2010-09-15 23:36:30 +02:00
parent b30a93116e
commit 3a59d404dd
9 changed files with 37 additions and 49 deletions

View File

@@ -10,7 +10,7 @@ MultiUser=true
Language=English (US) Language=English (US)
Theme=Gray Theme=Gray
Version=300 Version=300
FirstRun=false FirstRun=true
[External Editor] [External Editor]
EditorKind=1 EditorKind=1
@@ -50,7 +50,7 @@ JpegQuality=100
PngCompression=6 PngCompression=6
PngBps=8 PngBps=8
TiffBps=8 TiffBps=8
SaveProcParams=false SaveProcParams=true
PathTemplate=%p1/converted/%f PathTemplate=%p1/converted/%f
PathFolder= PathFolder=
UsePathTemplate=true UsePathTemplate=true
@@ -65,8 +65,12 @@ SaveParamsToCache=true
LoadParamsFromLocation=0 LoadParamsFromLocation=0
[GUI] [GUI]
WindowWidth=1000
WindowHeight=900
WindowMaximized=false
FileBrowserHeight=250 FileBrowserHeight=250
ToolPanelWidth=270 ToolPanelWidth=750
BrowserToolPanelWidth=750
HistoryPanelWidth=230 HistoryPanelWidth=230
LastPreviewScale=5 LastPreviewScale=5
LastCropSize=1 LastCropSize=1

View File

@@ -50,7 +50,7 @@ JpegQuality=100
PngCompression=6 PngCompression=6
PngBps=8 PngBps=8
TiffBps=8 TiffBps=8
SaveProcParams=false SaveProcParams=true
PathTemplate=%p1/converted/%f PathTemplate=%p1/converted/%f
PathFolder= PathFolder=
UsePathTemplate=true UsePathTemplate=true
@@ -65,10 +65,12 @@ SaveParamsToCache=true
LoadParamsFromLocation=0 LoadParamsFromLocation=0
[GUI] [GUI]
WindowWidth=1024 WindowWidth=1000
WindowHeight=700 WindowHeight=900
WindowMaximized=false
FileBrowserHeight=250 FileBrowserHeight=250
ToolPanelWidth=270 ToolPanelWidth=750
BrowserToolPanelWidth=750
HistoryPanelWidth=230 HistoryPanelWidth=230
LastPreviewScale=5 LastPreviewScale=5
LastCropSize=1 LastCropSize=1

View File

@@ -10,7 +10,7 @@ MultiUser=true
Language=English (US) Language=English (US)
Theme=Gray Theme=Gray
Version=300 Version=300
FirstRun=false FirstRun=true
[External Editor] [External Editor]
EditorKind=1 EditorKind=1
@@ -50,7 +50,7 @@ JpegQuality=100
PngCompression=6 PngCompression=6
PngBps=8 PngBps=8
TiffBps=8 TiffBps=8
SaveProcParams=false SaveProcParams=true
PathTemplate=%p1/converted/%f PathTemplate=%p1/converted/%f
PathFolder= PathFolder=
UsePathTemplate=true UsePathTemplate=true
@@ -65,8 +65,12 @@ SaveParamsToCache=true
LoadParamsFromLocation=0 LoadParamsFromLocation=0
[GUI] [GUI]
WindowWidth=1000
WindowHeight=900
WindowMaximized=false
FileBrowserHeight=250 FileBrowserHeight=250
ToolPanelWidth=270 ToolPanelWidth=750
BrowserToolPanelWidth=750
HistoryPanelWidth=230 HistoryPanelWidth=230
LastPreviewScale=5 LastPreviewScale=5
LastCropSize=1 LastCropSize=1

View File

@@ -192,6 +192,7 @@ EditorPanel::EditorPanel () : beforePreviewHandler(NULL), beforeIarea(NULL), par
hpanedr->pack1(*hpanedl, true, true); hpanedr->pack1(*hpanedl, true, true);
hpanedr->pack2(*vboxright, false, true); hpanedr->pack2(*vboxright, false, true);
hpanedr->set_position(options.toolPanelWidth);
pack_start (*hpanedr); pack_start (*hpanedr);
show_all (); show_all ();
@@ -229,12 +230,6 @@ EditorPanel::EditorPanel () : beforePreviewHandler(NULL), beforeIarea(NULL), par
} }
bool EditorPanel::beforeClosing () {
options.toolPanelWidth = vboxright->get_width ();
return true;
}
EditorPanel::~EditorPanel () { EditorPanel::~EditorPanel () {
history->setHistoryBeforeLineListener (NULL); history->setHistoryBeforeLineListener (NULL);
@@ -268,12 +263,6 @@ EditorPanel::~EditorPanel () {
delete saveAsDialog; delete saveAsDialog;
} }
void EditorPanel::on_realize () {
Gtk::VBox::on_realize ();
vboxright->set_size_request (options.toolPanelWidth, -1);
}
void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) { void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) {
// initialize everything // initialize everything
@@ -854,7 +843,7 @@ bool EditorPanel::idle_sentToGimp(ProgressConnector<int> *pc,rtengine::IImage16*
void EditorPanel::saveOptions () { void EditorPanel::saveOptions () {
options.historyPanelWidth = hpanedl->get_position (); options.historyPanelWidth = hpanedl->get_position ();
options.toolPanelWidth = vboxright->get_width (); options.toolPanelWidth = hpanedr->get_position ();
} }
void EditorPanel::historyBeforeLineChanged (const rtengine::procparams::ProcParams& params) { void EditorPanel::historyBeforeLineChanged (const rtengine::procparams::ProcParams& params) {

View File

@@ -104,8 +104,6 @@ class EditorPanel : public Gtk::VBox,
virtual ~EditorPanel (); virtual ~EditorPanel ();
void open (Thumbnail* tmb, rtengine::InitialImage* isrc); void open (Thumbnail* tmb, rtengine::InitialImage* isrc);
bool beforeClosing ();
void on_realize ();
void setParent (RTWindow* p) { parent = p; } void setParent (RTWindow* p) { parent = p; }

View File

@@ -101,6 +101,8 @@ FilePanel::FilePanel () : parent(NULL) {
pack1(*dirpaned, true, true); pack1(*dirpaned, true, true);
pack2(*rightBox, true, true); pack2(*rightBox, true, true);
set_position(options.browserToolPanelWidth);
fileCatalog->setFileSelectionChangeListener (tpc); fileCatalog->setFileSelectionChangeListener (tpc);
fileCatalog->setFileSelectionListener (this); fileCatalog->setFileSelectionListener (this);
@@ -109,12 +111,6 @@ FilePanel::FilePanel () : parent(NULL) {
show_all (); show_all ();
} }
void FilePanel::on_realize () {
Gtk::HPaned::on_realize ();
rightBox->set_size_request (options.browserToolPanelWidth, -1);
}
void FilePanel::init () { void FilePanel::init () {
dirBrowser->fillDirTree (); dirBrowser->fillDirTree ();
@@ -167,7 +163,7 @@ void FilePanel::saveOptions () {
options.dirBrowserWidth = dirpaned->get_position (); options.dirBrowserWidth = dirpaned->get_position ();
options.dirBrowserHeight = placespaned->get_position (); options.dirBrowserHeight = placespaned->get_position ();
options.browserToolPanelWidth = rightBox->get_width (); options.browserToolPanelWidth = get_position();
if (options.startupDir==STARTUPDIR_LAST && fileCatalog->lastSelectedDir ()!="") if (options.startupDir==STARTUPDIR_LAST && fileCatalog->lastSelectedDir ()!="")
options.startupPath = fileCatalog->lastSelectedDir (); options.startupPath = fileCatalog->lastSelectedDir ();
fileCatalog->closeDir (); fileCatalog->closeDir ();

View File

@@ -56,8 +56,6 @@ class FilePanel : public Gtk::HPaned,
public: public:
FilePanel (); FilePanel ();
void on_realize ();
void setParent (RTWindow* p) { parent = p; } void setParent (RTWindow* p) { parent = p; }
void init (); // dont call it directly, the constructor calls it as idle source void init (); // dont call it directly, the constructor calls it as idle source
void open (const Glib::ustring& d); // open a file or a directory void open (const Glib::ustring& d); // open a file or a directory

View File

@@ -61,8 +61,8 @@ void Options::setDefaults () {
profilePath = "profiles"; profilePath = "profiles";
dirBrowserWidth = 200; dirBrowserWidth = 200;
dirBrowserHeight = 150; dirBrowserHeight = 150;
toolPanelWidth = 250; toolPanelWidth = 700;
browserToolPanelWidth = 250; browserToolPanelWidth = 700;
historyPanelWidth = 150; historyPanelWidth = 150;
lastScale = 4; lastScale = 4;
lastCropSize = 1; lastCropSize = 1;

View File

@@ -144,7 +144,6 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
void RTWindow::remEditorPanel (EditorPanel* ep) { void RTWindow::remEditorPanel (EditorPanel* ep) {
if (ep->beforeClosing ()) {
ep->saveOptions (); ep->saveOptions ();
epanels.erase (ep->getFileName()); epanels.erase (ep->getFileName());
filesEdited.erase (ep->getFileName ()); filesEdited.erase (ep->getFileName ());
@@ -154,7 +153,6 @@ void RTWindow::remEditorPanel (EditorPanel* ep) {
if (mainNB->get_current_page () == mainNB->page_num (*bpanel)) if (mainNB->get_current_page () == mainNB->page_num (*bpanel))
mainNB->set_current_page (mainNB->page_num (*fpanel)); mainNB->set_current_page (mainNB->page_num (*fpanel));
}
// TODO: ask what to do: close & apply, close & apply selection, close & revert, cancel // TODO: ask what to do: close & apply, close & apply selection, close & revert, cancel
} }
@@ -233,7 +231,6 @@ bool RTWindow::on_delete_event(GdkEventAny* event) {
else else
options.windowMaximized = true; options.windowMaximized = true;
Options::save (); Options::save ();
hide(); hide();
return true; return true;