This button was described in issue #9655
I added it to the options dialog
Concept ACK
Nice. Concept ACK. Will test soon.
bitcoin.conf does not exists (right now, there is no reaction if the file does not exists)<img width="956" alt="bildschirmfoto 2017-03-01 um 22 26 46" src="https://cloud.githubusercontent.com/assets/178464/23482209/8b8fd0ae-fece-11e6-900e-ebb1e65dea0f.png"> <img width="847" alt="bildschirmfoto 2017-03-01 um 22 26 32" src="https://cloud.githubusercontent.com/assets/178464/23482210/8bb4d8b8-fece-11e6-9310-311a6f6be6f6.png">
@jonasschnelli Is this what you had in mind for the layout? I wanted to check before pushing

@ericshawlinux: I think this looks better and is more flexible.
I think so too. I amended my commit from the other day
(I just fixed a mistake I made, I accidentally misplaced a spacer while using Qt-designer. It is back where it belongs now)
I wonder if users might get configured that none of their options show up in the config file...? Not really sure how one might improve on this, though.
I wonder if users might get configured that none of their options show up in the config file...? Not really sure how one might improve on this, though.
Yes. We need to watch out here. The configuration levels are complex.
-arg=val)If a user opens "the" configuration file, he might expect to see all existing configuration values (including the GUI and startup one).
We should probably label the button "open experts configuration file" or similar.
Well it says "Active command-line options override the above options" so maybe if we put the new button above that, the user will know they are different.
An alternative would be to first show an QMessageBox with some infos about how the bitcoin.conf works and after that alert box, open the bitcoin.conf file.
Okay. How does this sound? "The configuration is used to specify advanced user options less any command-line or Qt options. Any command-line options will override this configuration file."
I added the information dialog
416 | @@ -417,6 +417,18 @@ void openDebugLogfile() 417 | QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug))); 418 | } 419 | 420 | +void openBitcoinConf() 421 | +{ 422 | + boost::filesystem::path pathConfig = GetConfigFile(BITCOIN_CONF_FILENAME); 423 | + 424 | + /* Create the file */ 425 | + std::fstream fs(pathConfig.c_str(), std::fstream::app);
Gitian Windows Build is failing here:
qt/guiutil.cpp: In function ‘void GUIUtil::openBitcoinConf()’:
qt/guiutil.cpp:425:58: error: no matching function for call to ‘std::basic_fstream<char>::basic_fstream(const value_type*, const openmode&)’
std::fstream fs(pathConfig.c_str(), std::fstream::app);
^
qt/guiutil.cpp:425:58: note: candidates are:
In file included from /home/ubuntu/build/bitcoin/depends/i686-w64-mingw32/share/../include/boost/filesystem/operations.hpp:45:0,
from /home/ubuntu/build/bitcoin/depends/i686-w64-mingw32/share/../include/boost/filesystem.hpp:17,
from qt/guiutil.h:19,
from qt/guiutil.cpp:5:
/usr/include/c++/4.8/fstream:831:7: note: std::basic_fstream<_CharT, _Traits>::basic_fstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
basic_fstream(const std::string& __s,
ok, I can look at it on monday
Currently the build is failing on Windows (over Gitian): https://bitcoin.jonasschnelli.ch/build/53
Otherwise this works fine. Tested on OSX and Ubuntu.
<img width="729" alt="bildschirmfoto 2017-03-17 um 16 09 09" src="https://cloud.githubusercontent.com/assets/178464/24049790/59c8e0b8-0b2d-11e7-990e-a2a8c9395353.png"> <img width="532" alt="bildschirmfoto 2017-03-17 um 16 09 13" src="https://cloud.githubusercontent.com/assets/178464/24049794/59eeb0a4-0b2d-11e7-8f32-94c6cf52271b.png">
<img width="531" alt="bildschirmfoto 2017-03-17 um 16 17 40" src="https://cloud.githubusercontent.com/assets/178464/24049791/59e95604-0b2d-11e7-9ed4-f75566b31bbf.png"> <img width="583" alt="bildschirmfoto 2017-03-17 um 16 17 32" src="https://cloud.githubusercontent.com/assets/178464/24049792/59ed5f4c-0b2d-11e7-9586-7cc9acc7f574.png">
okay, I had an issue with git for a few minutes, but I think I fixed it now.
as for the code, I changed the mode from std::fstream::app to std::ios_base::app that builds okay with linux, and I think with windows, since I read the error message you sent me.
Thanks... started again a gitian build: https://bitcoin.jonasschnelli.ch/build/60
Still didn't work. I guess I didn't look closely enough at the error before. Now, I think I need to call path.native() instead of path.c_str() based on the constructor declaration.
I will push that soon
Please use qstringToBoostPath and boostPathToQString from GUIUtil to convert between QString and boost::filesystem. They avoid UTF-8 issues that will arise when using other methods.
ok
thanks, I figured it out using boost and didn't need to convert the path there. It should build on windows now
@jonasschnelli could you do the gitian build on your site again? I am pretty confident it will work this time after Laan advised me, I changed it to use boost path and not a c string.
Code looks good to me now, although I wonder about error handling: what happens if the config file is not writable?
When I change the permissions, It asks me how I want to open the file, which doesn't make sense. I can add some logic and show a QMessageBox::critical() dialog if it fails to open the file.
Now an error appears when the file cannot be opened.

Testing 541f8d8 on OS X.
Appearance in the GUI:
Pre opening message:
Unable to open file error message:

I'm wondering if we can word the pre-opening message any better. Could we use Core rather than qt, or is that more confusing?
Maybe replace 'qt options' with 'gui settings'?
Some comments on messages:
I agree, saying "less any..." is not common, but to make it more descriptive and clear I reworded the whole message the best that I could. How is this? "The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file."
Tested ACK 9ab9e7d1 (https://bitcoin.jonasschnelli.ch/build/69)