comparison settingsdialog.cpp @ 195:ff0d76dcb3b8

* Don't close proc input on finished() -- causes crash on program failure on Windows * Use merge binary from settings, even if empty -- sometimes user may wish to set an empty string to avoid having an external merge program * Revert labels to line edits in settings dialog, for a similar reason (permit setting empty value) * Avoid showing hard hyphens on Windows, they don't look right * Use preformatted text for merge outcome dialog (but format3 would be better)
author Chris Cannam
date Fri, 24 Dec 2010 13:14:45 +0000
parents bf366e0b9050
children 34417b6e4345
comparison
equal deleted inserted replaced
194:5ca49523892f 195:ff0d76dcb3b8
69 69
70 row = 0; 70 row = 0;
71 71
72 pathsLayout->addWidget(new QLabel(tr("Mercurial (hg) program:")), row, 0); 72 pathsLayout->addWidget(new QLabel(tr("Mercurial (hg) program:")), row, 0);
73 73
74 m_hgPathLabel = new QLabel(); 74 m_hgPathLabel = new QLineEdit();
75 m_hgPathLabel->setText(settings.value("hgbinary").toString()); 75 m_hgPathLabel->setText(settings.value("hgbinary").toString());
76 pathsLayout->addWidget(m_hgPathLabel, row, 2); 76 pathsLayout->addWidget(m_hgPathLabel, row, 2);
77 77
78 QPushButton *browse = new QPushButton(tr("Browse...")); 78 QPushButton *browse = new QPushButton(tr("Browse..."));
79 pathsLayout->addWidget(browse, row++, 1); 79 pathsLayout->addWidget(browse, row++, 1);
80 connect(browse, SIGNAL(clicked()), this, SLOT(hgPathBrowse())); 80 connect(browse, SIGNAL(clicked()), this, SLOT(hgPathBrowse()));
81 81
82 pathsLayout->addWidget(new QLabel(tr("External diff program:")), row, 0); 82 pathsLayout->addWidget(new QLabel(tr("External diff program:")), row, 0);
83 83
84 m_diffPathLabel = new QLabel(); 84 m_diffPathLabel = new QLineEdit();
85 m_diffPathLabel->setText(settings.value("extdiffbinary").toString()); 85 m_diffPathLabel->setText(settings.value("extdiffbinary").toString());
86 pathsLayout->addWidget(m_diffPathLabel, row, 2); 86 pathsLayout->addWidget(m_diffPathLabel, row, 2);
87 87
88 browse = new QPushButton(tr("Browse...")); 88 browse = new QPushButton(tr("Browse..."));
89 pathsLayout->addWidget(browse, row++, 1); 89 pathsLayout->addWidget(browse, row++, 1);
90 connect(browse, SIGNAL(clicked()), this, SLOT(diffPathBrowse())); 90 connect(browse, SIGNAL(clicked()), this, SLOT(diffPathBrowse()));
91 91
92 pathsLayout->addWidget(new QLabel(tr("External file-merge program:")), row, 0); 92 pathsLayout->addWidget(new QLabel(tr("External file-merge program:")), row, 0);
93 93
94 m_mergePathLabel = new QLabel(); 94 m_mergePathLabel = new QLineEdit();
95 m_mergePathLabel->setText(settings.value("mergebinary").toString()); 95 m_mergePathLabel->setText(settings.value("mergebinary").toString());
96 pathsLayout->addWidget(m_mergePathLabel, row, 2); 96 pathsLayout->addWidget(m_mergePathLabel, row, 2);
97 97
98 browse = new QPushButton(tr("Browse...")); 98 browse = new QPushButton(tr("Browse..."));
99 pathsLayout->addWidget(browse, row++, 1); 99 pathsLayout->addWidget(browse, row++, 1);
100 connect(browse, SIGNAL(clicked()), this, SLOT(mergePathBrowse())); 100 connect(browse, SIGNAL(clicked()), this, SLOT(mergePathBrowse()));
101 101
102 pathsLayout->addWidget(new QLabel(tr("External text editor:")), row, 0); 102 pathsLayout->addWidget(new QLabel(tr("External text editor:")), row, 0);
103 103
104 m_editPathLabel = new QLabel(); 104 m_editPathLabel = new QLineEdit();
105 m_editPathLabel->setText(settings.value("editorbinary").toString()); 105 m_editPathLabel->setText(settings.value("editorbinary").toString());
106 pathsLayout->addWidget(m_editPathLabel, row, 2); 106 pathsLayout->addWidget(m_editPathLabel, row, 2);
107 107
108 browse = new QPushButton(tr("Browse...")); 108 browse = new QPushButton(tr("Browse..."));
109 pathsLayout->addWidget(browse, row++, 1); 109 pathsLayout->addWidget(browse, row++, 1);
113 113
114 settings.beginGroup("Locations"); 114 settings.beginGroup("Locations");
115 115
116 pathsLayout->addWidget(new QLabel(tr("EasyHg Mercurial extension:")), row, 0); 116 pathsLayout->addWidget(new QLabel(tr("EasyHg Mercurial extension:")), row, 0);
117 117
118 m_extensionPathLabel = new QLabel(); 118 m_extensionPathLabel = new QLineEdit();
119 m_extensionPathLabel->setText(settings.value("extensionpath").toString()); 119 m_extensionPathLabel->setText(settings.value("extensionpath").toString());
120 pathsLayout->addWidget(m_extensionPathLabel, row, 2); 120 pathsLayout->addWidget(m_extensionPathLabel, row, 2);
121 121
122 browse = new QPushButton(tr("Browse...")); 122 browse = new QPushButton(tr("Browse..."));
123 pathsLayout->addWidget(browse, row++, 1); 123 pathsLayout->addWidget(browse, row++, 1);
170 { 170 {
171 browseFor(tr("EasyHg Mercurial extension"), m_extensionPathLabel); 171 browseFor(tr("EasyHg Mercurial extension"), m_extensionPathLabel);
172 } 172 }
173 173
174 void 174 void
175 SettingsDialog::browseFor(QString title, QLabel *edit) 175 SettingsDialog::browseFor(QString title, QLineEdit *edit)
176 { 176 {
177 QString origin = edit->text(); 177 QString origin = edit->text();
178 178
179 if (origin == "") { 179 if (origin == "") {
180 #ifdef Q_OS_WIN32 180 #ifdef Q_OS_WIN32