Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Jump to develop mode page instand of common info page. #213

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions src/deb-installer/model/deblistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,27 +1120,35 @@ void DebListModel::slotShowDevelopModeWindow()
qInfo() << "OS version:" << osVerStr;
}

//2.打开控制中心
if (osVerStr == "20") { // V20模式
QString command = "dbus-send --print-reply "
"--dest=com.deepin.dde.ControlCenter "
"/com/deepin/dde/ControlCenter "
"com.deepin.dde.ControlCenter.ShowModule "
"\"string:commoninfo\"";
unlock->startDetached(command);
unlock->waitForFinished();
} else if (osVerStr == "23") { // V23模式
// 2.打开控制中心
if (osVerStr == "20") { // V20模式
QDBusInterface interface("com.deepin.dde.ControlCenter", "/com/deepin/dde/ControlCenter", "com.deepin.dde.ControlCenter");
if (interface.isValid()) {
interface.call("ShowPage", "commoninfo", "Developer Mode");
}

QDBusError error = interface.lastError();
if (error.isValid()) {
qWarning() << QString("DBus ControlCenter.ShowPage failed, Type: %1 MSG: %2").arg(error.type()).arg(error.message());
}

} else if (osVerStr == "23") { // V23模式
if (unlock->exitCode() != QProcess::NormalExit) {
QString command = "dbus-send --print-reply "
"--dest=org.deepin.dde.ControlCenter1 "
"/org/deepin/dde/ControlCenter1 "
"org.deepin.dde.ControlCenter1.ShowPage "
"\"string:commoninfo\"";
unlock->startDetached(command);
unlock->waitForFinished();
QDBusInterface interface(
"org.deepin.dde.ControlCenter1", "/org/deepin/dde/ControlCenter1", "org.deepin.dde.ControlCenter1");
if (interface.isValid()) {
interface.call("ShowPage", "commoninfo", "Developer Mode");
}

QDBusError error = interface.lastError();
if (error.isValid()) {
qWarning()
<< QString("DBus ControlCenter.ShowPage failed, Type: %1 MSG: %2").arg(error.type()).arg(error.message());
}
}

} else {
qWarning() << "Unknown OS version, connot open dde-control-center";
qWarning() << qPrintable("Unknown OS version, connot open dde-control-center");
}

unlock->deleteLater();
Expand Down
Loading