Skip to content

Commit

Permalink
settings form is revised
Browse files Browse the repository at this point in the history
  • Loading branch information
pardus committed Dec 18, 2019
1 parent 63a8001 commit d9cca9e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 86 deletions.
3 changes: 2 additions & 1 deletion src/loginform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ void LoginForm::LoginTimerFinished(){

case 0:

qInfo() << "Login start for " + toolButtons[(lastuserindex + 1) % 3]->text().trimmed();


ui->waitlabel->setText(tr("Authenticating"));
pageTransition(ui->waitpage);
Expand All @@ -1213,6 +1213,7 @@ void LoginForm::LoginTimerFinished(){
} else{
userid = toolButtons[(lastuserindex+ 1) % 3]->text();
}
qInfo() << "Login start for " + userid;

qInfo() << "User name is sending";
m_Greeter.authenticate(userid.trimmed());
Expand Down
29 changes: 1 addition & 28 deletions src/networkdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,11 @@ void NetworkDialog::SetText(QString Text){
void NetworkDialog::addService(QString Text){


ui->servicecomboBox->addItem(Text, Text);

}

static bool hidden = false;

void NetworkDialog::on_restartservicebutton_clicked()
{
char *setcommand;
char cmd_array[256];
memset(cmd_array,0,sizeof(cmd_array));

QString actionName = ui->servicecomboBox->itemData(ui->servicecomboBox->currentIndex()).toString();

if(actionName == NULL)
return;


QByteArray ba;
ba = actionName.toLatin1();
setcommand = ba.data();

close();
hidden =true;

sprintf(cmd_array, "systemctl restart %s &",setcommand);
system(cmd_array);

emit servicereset();

logButtonClicked = false;

}

void NetworkDialog::on_logbutton_clicked()
{
Expand Down
1 change: 0 additions & 1 deletion src/networkdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class NetworkDialog : public QDialog
void servicereset(void);

private slots:
void on_restartservicebutton_clicked();

void on_logbutton_clicked();

Expand Down
37 changes: 1 addition & 36 deletions src/networkdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -91,42 +91,7 @@ QComboBox::down-arrow {
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="servicecomboBox">
<property name="minimumSize">
<size>
<width>150</width>
<height>30</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="restartservicebutton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string>Restart Service</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="logbutton">
<property name="minimumSize">
<size>
Expand All @@ -148,7 +113,7 @@ QComboBox::down-arrow {
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<item row="1" column="0" colspan="2">
<widget class="QTextEdit" name="NDtextEdit">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
Expand Down
12 changes: 6 additions & 6 deletions src/settingsform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,19 @@ void SettingsForm::on_NwpushButton_clicked()

}

nwDialog->setFixedHeight((line_count + 1) * 20 + 50);
nwDialog->setFixedWidth(this->width() + 100);
nwDialog->setFixedHeight((line_count + 1) * 30 + 50);
nwDialog->setFixedWidth(this->width() + 200);
QPoint pt_g = QWidget::mapToGlobal(this->pos());
QPoint pt = this->pos();

uint labelx = ((pt_g.x() - pt.x())+ (this->width() - 100)/2) - ((nwDialog->width()) / 2);
uint labelx = ((pt_g.x() - pt.x())+ (this->width() - 200)/2) - ((nwDialog->width()) / 2);

nwDialog->logButtonClicked = false;
nwDialog->SetText(networkInfoString);

nwDialog->setGeometry(labelx, (pt_g.y() - pt.y()) - ((line_count + 1) * 20 + 50), 0, 0);
nwDialog->setFixedHeight((line_count + 1) * 20 + 50);
nwDialog->setFixedWidth(this->width() + 100);
nwDialog->setGeometry(labelx, (pt_g.y() - pt.y()) - ((line_count + 1) * 30 + 50), 0, 0);
nwDialog->setFixedHeight((line_count + 1) * 30 + 50);
nwDialog->setFixedWidth(this->width() + 200);

nwDialog->exec();
nwDialog->clearFocus();
Expand Down
28 changes: 14 additions & 14 deletions src/settingsform.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>408</width>
<height>109</height>
<width>260</width>
<height>165</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -129,9 +129,9 @@ QComboBox::down-arrow {
<widget class="QComboBox" name="kybrdcomboBox">
<property name="geometry">
<rect>
<x>167</x>
<y>60</y>
<width>135</width>
<x>115</x>
<y>65</y>
<width>140</width>
<height>45</height>
</rect>
</property>
Expand Down Expand Up @@ -361,8 +361,8 @@ QComboBox::down-arrow {
<widget class="QPushButton" name="NwpushButton">
<property name="geometry">
<rect>
<x>310</x>
<y>60</y>
<x>50</x>
<y>65</y>
<width>60</width>
<height>45</height>
</rect>
Expand Down Expand Up @@ -408,10 +408,10 @@ QComboBox::down-arrow {
<widget class="QLabel" name="hostnamelabel">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>201</width>
<height>41</height>
<x>44</x>
<y>5</y>
<width>211</width>
<height>55</height>
</rect>
</property>
<property name="text">
Expand All @@ -424,9 +424,9 @@ QComboBox::down-arrow {
<widget class="QComboBox" name="sessioncomboBox">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>150</width>
<x>115</x>
<y>115</y>
<width>140</width>
<height>45</height>
</rect>
</property>
Expand Down

0 comments on commit d9cca9e

Please sign in to comment.