fixing #1799
This commit is contained in:
parent
f069b3ead9
commit
5db1edfdeb
3 changed files with 16 additions and 7 deletions
|
@ -374,12 +374,7 @@ GLiveSupport :: configure(const xmlpp::Element & element)
|
||||||
// save the configuration so we can modify it later
|
// save the configuration so we can modify it later
|
||||||
// TODO: move configuration code to the OptionsContainer class?
|
// TODO: move configuration code to the OptionsContainer class?
|
||||||
Ptr<Glib::ustring>::Ref configFileName(new Glib::ustring);
|
Ptr<Glib::ustring>::Ref configFileName(new Glib::ustring);
|
||||||
struct passwd * pwd = getpwuid(getuid());
|
configFileName->append(Glib::get_home_dir());
|
||||||
if (pwd) {
|
|
||||||
configFileName->append(pwd->pw_dir);
|
|
||||||
} else {
|
|
||||||
throw std::logic_error("this never happens: getpwuid() returned 0");
|
|
||||||
}
|
|
||||||
configFileName->append(configFileDirStr);
|
configFileName->append(configFileDirStr);
|
||||||
mkdir(configFileName->c_str(), 0700); // create dir if does not exist
|
mkdir(configFileName->c_str(), 0700); // create dir if does not exist
|
||||||
configFileName->append(configFileNameStr);
|
configFileName->append(configFileNameStr);
|
||||||
|
|
|
@ -254,6 +254,9 @@ UploadFileWindow :: UploadFileWindow (
|
||||||
closeButton->signal_clicked().connect(sigc::mem_fun(*this,
|
closeButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||||
&UploadFileWindow::onCloseButtonClicked));
|
&UploadFileWindow::onCloseButtonClicked));
|
||||||
|
|
||||||
|
// set the file chooser's default folder to the user's home directory
|
||||||
|
fileChooserFolder = Glib::get_home_dir();
|
||||||
|
|
||||||
// show everything
|
// show everything
|
||||||
set_name("uploadFileWindow");
|
set_name("uploadFileWindow");
|
||||||
set_default_size(350, 500);
|
set_default_size(350, 500);
|
||||||
|
@ -281,11 +284,15 @@ UploadFileWindow :: onChooseFileButtonClicked(void) throw ()
|
||||||
std::exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dialog->set_name("uploadFileChooserDialog");
|
||||||
|
gLiveSupport->getWindowPosition(dialog);
|
||||||
|
|
||||||
|
dialog->set_current_folder(fileChooserFolder);
|
||||||
dialog->set_transient_for(*this);
|
dialog->set_transient_for(*this);
|
||||||
|
|
||||||
//Add response buttons the the dialog:
|
//Add response buttons the the dialog:
|
||||||
dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
|
dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
|
||||||
dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
|
dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
|
||||||
|
|
||||||
int result = dialog->run();
|
int result = dialog->run();
|
||||||
|
|
||||||
|
@ -293,6 +300,8 @@ UploadFileWindow :: onChooseFileButtonClicked(void) throw ()
|
||||||
clearEverything();
|
clearEverything();
|
||||||
fileNameEntry->set_text(dialog->get_filename());
|
fileNameEntry->set_text(dialog->get_filename());
|
||||||
updateFileInfo();
|
updateFileInfo();
|
||||||
|
fileChooserFolder = dialog->get_current_folder();
|
||||||
|
gLiveSupport->putWindowPosition(dialog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -203,6 +203,11 @@ class UploadFileWindow : public GuiWindow
|
||||||
*/
|
*/
|
||||||
FileType fileType;
|
FileType fileType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The starting folder for the file chooser dialog.
|
||||||
|
*/
|
||||||
|
Glib::ustring fileChooserFolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the information for the file to upload, based on the
|
* Update the information for the file to upload, based on the
|
||||||
* value of the fileNameEntry text entry field.
|
* value of the fileNameEntry text entry field.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue