Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
9bfb54f5
Commit
9bfb54f5
authored
Dec 05, 2008
by
goro
Browse files
Migrate Perforce plugin to PathChooser
parent
8f757bd4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/perforce/settingspage.cpp
View file @
9bfb54f5
...
...
@@ -39,18 +39,20 @@
#include <QtGui/QFileDialog>
using
namespace
Perforce
::
Internal
;
using
namespace
Core
::
Utils
;
SettingsPageWidget
::
SettingsPageWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
m_ui
.
setupUi
(
this
);
connect
(
m_ui
.
browseButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
browseForCommand
()));
m_ui
.
pathChooser
->
setPromptDialogTitle
(
tr
(
"Perforce Command"
));
m_ui
.
pathChooser
->
setExpectedKind
(
PathChooser
::
Command
);
}
PerforceSettings
SettingsPageWidget
::
settings
()
const
{
PerforceSettings
rc
;
rc
.
p4Command
=
m_ui
.
p
4CmdLineEdit
->
text
();
rc
.
p4Command
=
m_ui
.
p
athChooser
->
path
();
rc
.
defaultEnv
=
m_ui
.
defaultCheckBox
->
isChecked
();
rc
.
p4Port
=
m_ui
.
portLineEdit
->
text
();
rc
.
p4Client
=
m_ui
.
clientLineEdit
->
text
();
...
...
@@ -60,21 +62,13 @@ PerforceSettings SettingsPageWidget::settings() const
void
SettingsPageWidget
::
setSettings
(
const
PerforceSettings
&
s
)
{
m_ui
.
p
4CmdLineEdit
->
set
Text
(
s
.
p4Command
);
m_ui
.
p
athChooser
->
set
Path
(
s
.
p4Command
);
m_ui
.
defaultCheckBox
->
setChecked
(
s
.
defaultEnv
);
m_ui
.
portLineEdit
->
setText
(
s
.
p4Port
);
m_ui
.
clientLineEdit
->
setText
(
s
.
p4Client
);
m_ui
.
userLineEdit
->
setText
(
s
.
p4User
);
}
void
SettingsPageWidget
::
browseForCommand
()
{
const
QString
cmd
=
QFileDialog
::
getOpenFileName
(
window
(),
tr
(
"Perforce Command"
));
if
(
!
cmd
.
isEmpty
())
m_ui
.
p4CmdLineEdit
->
setText
(
cmd
);
}
SettingsPage
::
SettingsPage
()
{
}
...
...
src/plugins/perforce/settingspage.h
View file @
9bfb54f5
...
...
@@ -54,9 +54,6 @@ public:
PerforceSettings
settings
()
const
;
void
setSettings
(
const
PerforceSettings
&
);
private
slots
:
;
void
browseForCommand
();
private:
Ui
::
SettingsPage
m_ui
;
};
...
...
src/plugins/perforce/settingspage.ui
View file @
9bfb54f5
...
...
@@ -36,14 +36,7 @@
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"p4CmdLineEdit"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"browseButton"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
<widget
class=
"Core::Utils::PathChooser"
name=
"pathChooser"
native=
"true"
/>
</item>
</layout>
</item>
...
...
@@ -120,11 +113,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>
Core::Utils::PathChooser
</class>
<extends>
QWidget
</extends>
<header
location=
"global"
>
utils/pathchooser.h
</header>
<container>
1
</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>
portLineEdit
</tabstop>
<tabstop>
clientLineEdit
</tabstop>
<tabstop>
userLineEdit
</tabstop>
<tabstop>
p4CmdLineEdit
</tabstop>
</tabstops>
<resources/>
<connections>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment