Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Add a button to open the config file in a text editor #9890
Conversation
fanquake
added
the
GUI
label
Mar 1, 2017
|
Concept ACK |
|
Nice. |
|
@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. |
Yes. We need to watch out here. The configuration levels are complex.
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? |
|
I added the information dialog |
| + boost::filesystem::path pathConfig = GetConfigFile(BITCOIN_CONF_FILENAME); | ||
| + | ||
| + /* Create the file */ | ||
| + std::fstream fs(pathConfig.c_str(), std::fstream::app); |
jonasschnelli
Mar 17, 2017
Member
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,
|
Currently the build is failing on Windows (over Gitian): Otherwise this works fine. Tested on OSX and Ubuntu. |
|
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 |
|
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. |
|
Testing 541f8d8 on OS X. 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? |
|
Tested ACK 9ab9e7d (https://bitcoin.jonasschnelli.ch/build/69) |











ericshawlinux commentedFeb 28, 2017
•
Edited 1 time
-
ericshawlinux
Feb 28, 2017
This button was described in issue #9655
I added it to the options dialog