Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-windows
Commits
5f4da8b5
Commit
5f4da8b5
authored
Apr 06, 2020
by
Ming Rui Zhang
Browse files
settingswidget: add option for enabling or disabling running the application on startup
Change-Id: Ie8a9ed96b59c972c937037645c9972472fd32b16
parent
efbfa72f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/settingswidget.cpp
View file @
5f4da8b5
...
...
@@ -234,6 +234,8 @@ SettingsWidget::SettingsWidget(QWidget* parent)
connect
(
ui
->
closeOrMinCheckBox
,
&
QAbstractButton
::
clicked
,
this
,
&
SettingsWidget
::
slotSetClosedOrMin
);
connect
(
ui
->
applicationOnStartUpCheckBox
,
&
QAbstractButton
::
clicked
,
this
,
&
SettingsWidget
::
slotSetRunOnStartUp
);
connect
(
ui
->
downloadButton
,
&
QAbstractButton
::
clicked
,
this
,
&
SettingsWidget
::
openDownloadFolderSlot
);
connect
(
ui
->
checkUpdateButton
,
&
QAbstractButton
::
clicked
,
this
,
&
SettingsWidget
::
checkForUpdateSlot
);
...
...
@@ -909,6 +911,7 @@ SettingsWidget::populateGeneralSettings()
Utils
::
setElidedText
(
ui
->
downloadButton
,
downloadPath
);
ui
->
closeOrMinCheckBox
->
setChecked
(
settings
.
value
(
SettingsKey
::
closeOrMinimized
).
toBool
());
ui
->
applicationOnStartUpCheckBox
->
setChecked
(
Utils
::
CheckStartupLink
(
L"Jami"
));
auto
notifs
=
settings
.
value
(
SettingsKey
::
enableNotifications
).
toBool
();
ui
->
notificationCheckBox
->
setChecked
(
notifs
);
...
...
@@ -952,6 +955,18 @@ SettingsWidget::slotSetClosedOrMin(bool state)
settings
.
setValue
(
SettingsKey
::
closeOrMinimized
,
state
);
}
void
SettingsWidget
::
slotSetRunOnStartUp
(
bool
state
)
{
if
(
Utils
::
CheckStartupLink
(
L"Jami"
))
{
if
(
!
state
)
{
Utils
::
DeleteStartupLink
(
L"Jami"
);
}
}
else
if
(
state
)
{
Utils
::
CreateStartupLink
(
L"Jami"
);
}
}
void
SettingsWidget
::
checkForUpdateSlot
()
{
...
...
src/settingswidget.h
View file @
5f4da8b5
...
...
@@ -132,6 +132,7 @@ private slots:
void
slotSetNotifications
(
bool
state
);
void
checkForUpdateSlot
();
void
slotSetClosedOrMin
(
bool
state
);
void
slotSetRunOnStartUp
(
bool
state
);
void
openDownloadFolderSlot
();
void
openRecordFolderSlot
();
void
slotAlwaysRecordingClicked
(
bool
state
);
...
...
src/settingswidget.ui
View file @
5f4da8b5
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
919
</width>
<height>
6
90
</height>
<width>
890
</width>
<height>
6
56
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -39,8 +39,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
917
</width>
<height>
6
88
</height>
<width>
888
</width>
<height>
6
54
</height>
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
...
...
@@ -668,6 +668,34 @@
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"applicationOnStartUpLayout"
>
<item>
<widget
class=
"ToggleSwitch"
name=
"applicationOnStartUpCheckBox"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"font"
>
<font>
<pointsize>
10
</pointsize>
</font>
</property>
<property
name=
"text"
stdset=
"0"
>
<string>
Run on Startup
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_22"
>
<property
name=
"leftMargin"
>
...
...
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