Skip to content

Commit 2abbae7

Browse files
committed
feat: register backend objects in QML and build UI shell
- Register NvidiaDetector, NvidiaInstaller, NvidiaUpdater as QML context properties in main.cpp - Build Main.qml with sidebar navigation + StackLayout - Implement SidebarMenu component with page switching - Build DriverPage with GPU info, driver install/remove/update buttons, Secure Boot warning, and status log panel
1 parent e462b58 commit 2abbae7

4 files changed

Lines changed: 490 additions & 18 deletions

File tree

src/main.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#include <QApplication>
2-
#include <QQmlApplicationEngine>
3-
#include <QQmlContext>
4-
#include <QIcon>
1+
#include <QApplication>\n#include <QQmlApplicationEngine>\n#include <QQmlContext>\n#include <QIcon>
2+
3+
#include "backend/nvidia/detector.h"
4+
#include "backend/nvidia/installer.h"
5+
#include "backend/nvidia/updater.h"
56

67
int main(int argc, char *argv[])
78
{
@@ -16,13 +17,22 @@ int main(int argc, char *argv[])
1617
app.setOrganizationDomain("github.com/Acik-Kaynak-Gelistirme-Toplulugu");
1718
app.setWindowIcon(QIcon::fromTheme("ro-control"));
1819

20+
// Backend nesneleri
21+
NvidiaDetector detector;
22+
NvidiaInstaller installer;
23+
NvidiaUpdater updater;
24+
1925
// QML motorunu başlat
2026
QQmlApplicationEngine engine;
2127

28+
// Backend'i QML'e aç
29+
engine.rootContext()->setContextProperty("nvidiaDetector", &detector);
30+
engine.rootContext()->setContextProperty("nvidiaInstaller", &installer);
31+
engine.rootContext()->setContextProperty("nvidiaUpdater", &updater);
32+
2233
// Ana QML dosyasını yükle
2334
using namespace Qt::StringLiterals;
2435
const QUrl url(u"qrc:/rocontrol/src/qml/Main.qml"_s);
25-
2636

2737
// QML yüklenemezse uygulamayı kapat
2838
QObject::connect(

src/qml/Main.qml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
import QtQuick
22
import QtQuick.Controls
3+
import QtQuick.Layouts
34

4-
// Ana pencere — ilerleyen branch'lerde sidebar + sayfa navigasyonu eklenecek
55
ApplicationWindow {
66
id: root
77
visible: true
8-
width: 900
9-
height: 600
8+
width: 1000
9+
height: 650
10+
minimumWidth: 800
11+
minimumHeight: 500
1012
title: "ro-Control"
13+
color: "#11111b"
1114

12-
Text {
13-
anchors.centerIn: parent
14-
text: "ro-Control — cmake-setup ✓"
15-
font.pixelSize: 24
15+
Row {
16+
anchors.fill: parent
17+
18+
SidebarMenu {
19+
id: sidebar
20+
height: parent.height
21+
}
22+
23+
StackLayout {
24+
id: stack
25+
width: parent.width - sidebar.width
26+
height: parent.height
27+
currentIndex: sidebar.currentIndex
28+
29+
DriverPage {}
30+
MonitorPage {}
31+
SettingsPage {}
32+
}
1633
}
1734
}

src/qml/components/SidebarMenu.qml

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,96 @@
11
import QtQuick
2+
import QtQuick.Controls
23

3-
// SidebarMenu — ilerleyen branch'lerde doldurulacak
4-
Item {}
4+
Rectangle {
5+
id: sidebar
6+
width: 220
7+
color: "#181825"
8+
9+
property int currentIndex: 0
10+
11+
ListModel {
12+
id: menuModel
13+
ListElement {
14+
label: "Sürücü Yönetimi"
15+
}
16+
ListElement {
17+
label: "Sistem İzleme"
18+
}
19+
ListElement {
20+
label: "Ayarlar"
21+
}
22+
}
23+
24+
Column {
25+
anchors.fill: parent
26+
spacing: 0
27+
28+
// Başlık
29+
Item {
30+
width: parent.width
31+
height: 70
32+
33+
Label {
34+
anchors.centerIn: parent
35+
text: "ro-Control"
36+
font.pixelSize: 22
37+
font.bold: true
38+
color: "#cdd6f4"
39+
}
40+
}
41+
42+
Rectangle {
43+
width: parent.width - 32
44+
height: 1
45+
anchors.horizontalCenter: parent.horizontalCenter
46+
color: "#313244"
47+
}
48+
49+
Item {
50+
width: 1
51+
height: 12
52+
}
53+
54+
Repeater {
55+
model: menuModel
56+
57+
delegate: Rectangle {
58+
id: menuItem
59+
required property int index
60+
required property string label
61+
62+
width: sidebar.width - 16
63+
height: 44
64+
x: 8
65+
radius: 8
66+
color: sidebar.currentIndex === menuItem.index ? "#313244" : mouseArea.containsMouse ? "#1e1e2e" : "transparent"
67+
68+
Label {
69+
anchors.verticalCenter: parent.verticalCenter
70+
leftPadding: 16
71+
text: menuItem.label
72+
font.pixelSize: 14
73+
color: sidebar.currentIndex === menuItem.index ? "#89b4fa" : "#a6adc8"
74+
}
75+
76+
MouseArea {
77+
id: mouseArea
78+
anchors.fill: parent
79+
hoverEnabled: true
80+
cursorShape: Qt.PointingHandCursor
81+
onClicked: sidebar.currentIndex = menuItem.index
82+
}
83+
}
84+
}
85+
}
86+
87+
// Versiyon — alt köşe
88+
Label {
89+
anchors.bottom: parent.bottom
90+
anchors.horizontalCenter: parent.horizontalCenter
91+
anchors.bottomMargin: 16
92+
text: "v" + Qt.application.version
93+
font.pixelSize: 11
94+
color: "#585b70"
95+
}
96+
}

0 commit comments

Comments
 (0)