Merge lp:~bzoltan/qtcreator-plugin-ubuntu/lp1390476 into lp:qtcreator-plugin-ubuntu

Proposed by Zoltan Balogh
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 312
Merged at revision: 308
Proposed branch: lp:~bzoltan/qtcreator-plugin-ubuntu/lp1390476
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 134 lines (+28/-10)
5 files modified
share/qtcreator/ubuntu/devicespage/NewEmulatorDialog.qml (+16/-1)
share/qtcreator/ubuntu/scripts/local_create_emulator (+4/-3)
src/ubuntu/ubuntuconstants.h (+1/-1)
src/ubuntu/ubuntudevicesmodel.cpp (+5/-3)
src/ubuntu/ubuntudevicesmodel.h (+2/-2)
To merge this branch: bzr merge lp:~bzoltan/qtcreator-plugin-ubuntu/lp1390476
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu SDK team Pending
Review via email: mp+243022@code.launchpad.net

Commit message

Support password setting for new emulators. Fixes LP: #1390476

Description of the change

Support password setting for new emulators. Fixes LP: #1390476

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/qtcreator/ubuntu/devicespage/NewEmulatorDialog.qml'
2--- share/qtcreator/ubuntu/devicespage/NewEmulatorDialog.qml 2014-10-31 10:10:39 +0000
3+++ share/qtcreator/ubuntu/devicespage/NewEmulatorDialog.qml 2014-11-27 12:27:08 +0000
4@@ -50,6 +50,20 @@
5 visible: channel.model[channel.selectedIndex] === "custom channel"
6 }
7
8+ ListItem.ItemSelector {
9+ id: custom_pwd
10+ model: ["Use default password",
11+ "Set custom password"]
12+ }
13+
14+ TextField {
15+ id: inputCustomPassword
16+ echoMode: TextInput.Password
17+ placeholderText: i18n.tr("Password")
18+ visible: custom_pwd.model[custom_pwd.selectedIndex] === "Set custom password"
19+ }
20+
21+
22 Label {
23 id: inputChannelNameError
24 horizontalAlignment: Text.AlignHCenter
25@@ -72,7 +86,8 @@
26 return;
27 devicesModel.createEmulatorImage(inputName.text,
28 arch.model[arch.selectedIndex],
29- (inputChannelName.visible ? inputChannelName.text : channel.model[channel.selectedIndex])
30+ (inputChannelName.visible ? inputChannelName.text : channel.model[channel.selectedIndex]),
31+ (inputCustomPassword.visible ? inputCustomPassword.text : "0000")
32 );
33 PopupUtils.close(dialogue);
34 }
35
36=== modified file 'share/qtcreator/ubuntu/scripts/local_create_emulator'
37--- share/qtcreator/ubuntu/scripts/local_create_emulator 2014-09-30 07:00:38 +0000
38+++ share/qtcreator/ubuntu/scripts/local_create_emulator 2014-11-27 12:27:08 +0000
39@@ -20,8 +20,9 @@
40 EMULATOR_NAME=$2
41 EMULATOR_ARCH=$3
42 EMULATOR_CHANNEL=$4
43-WHOAMI=$5
44-USERHOME=$6
45+EMULATOR_PASSWORD=$5
46+WHOAMI=$6
47+USERHOME=$7
48
49 if [[ -z ${EMULATOR_CHANNEL} ]]; then
50 EMULATOR_CHANNEL="devel"
51@@ -33,6 +34,6 @@
52 mkdir -p ${EMULATOR_PATH}
53 fi
54
55-HOME=${USERHOME} /usr/bin/ubuntu-emulator create ${EMULATOR_NAME} --arch=${EMULATOR_ARCH} --channel=${EMULATOR_CHANNEL}
56+HOME=${USERHOME} /usr/bin/ubuntu-emulator create ${EMULATOR_NAME} --arch=${EMULATOR_ARCH} --channel=${EMULATOR_CHANNEL} --password=${EMULATOR_PASSWORD}
57 chown ${WHOAMI}:${WHOAMI} ${EMULATOR_PATH} -R
58
59
60=== modified file 'src/ubuntu/ubuntuconstants.h'
61--- src/ubuntu/ubuntuconstants.h 2014-11-14 11:29:05 +0000
62+++ src/ubuntu/ubuntuconstants.h 2014-11-27 12:27:08 +0000
63@@ -118,7 +118,7 @@
64 const char UBUNTUDEVICESWIDGET_LOCAL_SEARCH_IMAGES_SCRIPT[] = "%0/local_search_images";
65 const char UBUNTUDEVICESWIDGET_LOCAL_SEARCH_IMAGES[] = "Search configured emulator instances.";
66 const char UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR[] = "Creating new emulator instance.";
67-const char UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR_SCRIPT[] = "%0 %1/local_create_emulator %2 %3 %4 %5 %6 %7";
68+const char UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR_SCRIPT[] = "%0 %1/local_create_emulator %2 %3 %4 %5 %6 %7 %8";
69 const char UBUNTUDEVICESWIDGET_LOCAL_START_EMULATOR[] = "Starting the selected emulator.";
70 const char UBUNTUDEVICESWIDGET_LOCAL_START_EMULATOR_SCRIPT[] = "%0/local_start_emulator";
71 const char UBUNTUDEVICESWIDGET_LOCAL_STOP_EMULATOR_SCRIPT[] = "%0/local_stop_emulator";
72
73=== modified file 'src/ubuntu/ubuntudevicesmodel.cpp'
74--- src/ubuntu/ubuntudevicesmodel.cpp 2014-11-07 12:02:15 +0000
75+++ src/ubuntu/ubuntudevicesmodel.cpp 2014-11-27 12:27:08 +0000
76@@ -787,7 +787,7 @@
77 m_process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_INSTALL_EMULATOR_PACKAGE));
78 }
79
80-void UbuntuDevicesModel::doCreateEmulatorImage(UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel)
81+void UbuntuDevicesModel::doCreateEmulatorImage(UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel, const QString &passwd)
82 {
83 process->stop();
84 QString strEmulatorName = name;
85@@ -804,15 +804,17 @@
86 .arg(strEmulatorName)
87 .arg(arch)
88 .arg(channel)
89+ .arg(passwd)
90 .arg(strUserName)
91 .arg(strUserHome)
92 << QCoreApplication::applicationDirPath());
93 process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR));
94 }
95
96-void UbuntuDevicesModel::createEmulatorImage(const QString &name, const QString &arch, const QString &channel)
97+void UbuntuDevicesModel::createEmulatorImage(const QString &name, const QString &arch, const QString &channel, const QString &passwd)
98 {
99 QString ch = channel;
100+ QString pwd = passwd;
101
102 //to work around a problem in the UITK that clips long text in dropdown menus we use short aliases in the UI
103 //for some channels. Here they are resolved to the correct channel names.
104@@ -831,7 +833,7 @@
105 // elevated priviledges
106 setCancellable(false);
107 beginAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR));
108- doCreateEmulatorImage(m_process,name,arch,ch);
109+ doCreateEmulatorImage(m_process,name,arch,ch,pwd);
110 }
111
112 void UbuntuDevicesModel::queryAdb()
113
114=== modified file 'src/ubuntu/ubuntudevicesmodel.h'
115--- src/ubuntu/ubuntudevicesmodel.h 2014-11-07 12:02:15 +0000
116+++ src/ubuntu/ubuntudevicesmodel.h 2014-11-27 12:27:08 +0000
117@@ -102,7 +102,7 @@
118 bool busy() const;
119 bool emulatorInstalled() const;
120
121- static void doCreateEmulatorImage ( UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel );
122+ static void doCreateEmulatorImage ( UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel, const QString &passwd );
123 signals:
124 void logMessage (const QString &str);
125 void stdOutMessage (const QString &str);
126@@ -126,7 +126,7 @@
127 void triggerKitRemove ( const int devId, const QVariant &kitid );
128 void triggerRedetect ( const int devId );
129 void deleteDevice ( const int devId );
130- void createEmulatorImage ( const QString &name, const QString &arch, const QString &channel );
131+ void createEmulatorImage ( const QString &name, const QString &arch, const QString &channel, const QString &passwd );
132 void startEmulator ( const QString &name );
133 void stopEmulator ( const QString &name );
134 void deleteEmulator ( const QString &name );

Subscribers

People subscribed via source and target branches

to all changes: