Release 7.1

This commit is contained in:
Victor Tran 2017-12-10 23:20:51 +11:00
parent 4c0b7618b6
commit bcf41f0fda
18 changed files with 102 additions and 54 deletions

View file

@ -9,8 +9,6 @@ extern void EndSession(EndSessionWait::shutdownType type);
AppsListModel::AppsListModel(BTHandsfree* bt, QObject *parent) : QAbstractListModel(parent) { AppsListModel::AppsListModel(BTHandsfree* bt, QObject *parent) : QAbstractListModel(parent) {
this->bt = bt; this->bt = bt;
loadData(); loadData();
connect(NativeFilter, SIGNAL(DoRetranslation()), this, SLOT(loadData()));
} }
AppsListModel::~AppsListModel() { AppsListModel::~AppsListModel() {

View file

@ -105,6 +105,7 @@ InfoPaneDropdown::InfoPaneDropdown(WId MainWindowId, QWidget *parent) :
ui->userSettingsDeleteUser->setProperty("type", "destructive"); ui->userSettingsDeleteUser->setProperty("type", "destructive");
ui->userSettingsDeleteUserAndData->setProperty("type", "destructive"); ui->userSettingsDeleteUserAndData->setProperty("type", "destructive");
ui->userSettingsDeleteUserOnly->setProperty("type", "destructive"); ui->userSettingsDeleteUserOnly->setProperty("type", "destructive");
ui->resetDeviceButton->setProperty("type", "destructive");
QPalette powerStretchPalette = ui->PowerStretchSwitch->palette(); QPalette powerStretchPalette = ui->PowerStretchSwitch->palette();
QPalette flightModePalette = ui->FlightSwitch->palette(); QPalette flightModePalette = ui->FlightSwitch->palette();
@ -143,6 +144,10 @@ InfoPaneDropdown::InfoPaneDropdown(WId MainWindowId, QWidget *parent) :
ui->kdeconnectLabel->setVisible(false); ui->kdeconnectLabel->setVisible(false);
} }
if (!QFile("/usr/bin/scallop").exists()) {
ui->resetDeviceButton->setVisible(false);
}
//Set up networking //Set up networking
QDBusInterface networkInterface("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager", QDBusConnection::systemBus(), this); QDBusInterface networkInterface("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager", QDBusConnection::systemBus(), this);
connect(ui->NetworkManager, SIGNAL(updateBarDisplay(QString,QIcon)), this, SIGNAL(networkLabelChanged(QString,QIcon))); connect(ui->NetworkManager, SIGNAL(updateBarDisplay(QString,QIcon)), this, SIGNAL(networkLabelChanged(QString,QIcon)));
@ -418,10 +423,6 @@ InfoPaneDropdown::InfoPaneDropdown(WId MainWindowId, QWidget *parent) :
//Set up timer ringtones //Set up timer ringtones
ringtone = new QMediaPlayer(this, QMediaPlayer::LowLatency); ringtone = new QMediaPlayer(this, QMediaPlayer::LowLatency);
connect(NativeFilter, &NativeEventFilter::DoRetranslation, [=] {
ui->retranslateUi(this);
});
connect(AudioMan, &AudioManager::QuietModeChanged, [=](AudioManager::quietMode mode) { connect(AudioMan, &AudioManager::QuietModeChanged, [=](AudioManager::quietMode mode) {
ui->quietModeSound->setChecked(false); ui->quietModeSound->setChecked(false);
ui->quietModeNotification->setChecked(false); ui->quietModeNotification->setChecked(false);
@ -956,16 +957,22 @@ void InfoPaneDropdown::startTimer(QTime time) {
QMediaPlaylist* playlist = new QMediaPlaylist(); QMediaPlaylist* playlist = new QMediaPlaylist();
#ifdef BLUEPRINT
QString ringtonesPath = "/usr/share/sounds/theshellb/tones/";
#else
QString ringtonesPath = "/usr/share/sounds/theshell/tones/";
#endif
if (ui->timerToneSelect->currentText() == tr("Happy Bee")) { if (ui->timerToneSelect->currentText() == tr("Happy Bee")) {
playlist->addMedia(QMediaContent(QUrl("qrc:/sounds/tones/happybee"))); playlist->addMedia(QMediaContent(QUrl::fromLocalFile(ringtonesPath + "happybee.ogg")));
} else if (ui->timerToneSelect->currentText() == tr("Playing in the Dark")) { } else if (ui->timerToneSelect->currentText() == tr("Playing in the Dark")) {
playlist->addMedia(QMediaContent(QUrl("qrc:/sounds/tones/playinginthedark"))); playlist->addMedia(QMediaContent(QUrl::fromLocalFile(ringtonesPath + "playinginthedark.ogg")));
} else if (ui->timerToneSelect->currentText() == tr("Ice Cream Truck")) { } else if (ui->timerToneSelect->currentText() == tr("Ice Cream Truck")) {
playlist->addMedia(QMediaContent(QUrl("qrc:/sounds/tones/icecream"))); playlist->addMedia(QMediaContent(QUrl::fromLocalFile(ringtonesPath + "icecream.ogg")));
} else if (ui->timerToneSelect->currentText() == tr("Party Complex")) { } else if (ui->timerToneSelect->currentText() == tr("Party Complex")) {
playlist->addMedia(QMediaContent(QUrl("qrc:/sounds/tones/party"))); playlist->addMedia(QMediaContent(QUrl::fromLocalFile(ringtonesPath + "party.ogg")));
} else if (ui->timerToneSelect->currentText() == tr("Salty Ditty")) { } else if (ui->timerToneSelect->currentText() == tr("Salty Ditty")) {
playlist->addMedia(QMediaContent(QUrl("qrc:/sounds/tones/saltyditty"))); playlist->addMedia(QMediaContent(QUrl::fromLocalFile(ringtonesPath + "saltyditty.ogg")));
} }
playlist->setPlaybackMode(QMediaPlaylist::Loop); playlist->setPlaybackMode(QMediaPlaylist::Loop);
ringtone->setPlaylist(playlist); ringtone->setPlaylist(playlist);
@ -2339,8 +2346,6 @@ void InfoPaneDropdown::on_localeList_currentRowChanged(int currentRow)
//Fill locale box //Fill locale box
Internationalisation::fillLanguageBox(ui->localeList); Internationalisation::fillLanguageBox(ui->localeList);
emit NativeFilter->DoRetranslation();
} }
void InfoPaneDropdown::on_StatusBarSwitch_toggled(bool checked) void InfoPaneDropdown::on_StatusBarSwitch_toggled(bool checked)
@ -3311,3 +3316,16 @@ void InfoPaneDropdown::on_removeAutostartButton_clicked()
toast->show(this); toast->show(this);
} }
} }
void InfoPaneDropdown::on_resetDeviceButton_clicked()
{
QProcess::startDetached("scallop --reset");
this->close();
}
void InfoPaneDropdown::changeEvent(QEvent *event) {
if (event->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
}
QDialog::changeEvent(event);
}

View file

@ -434,6 +434,8 @@ private slots:
void on_removeAutostartButton_clicked(); void on_removeAutostartButton_clicked();
void on_resetDeviceButton_clicked();
public slots: public slots:
void getNetworks(); void getNetworks();
@ -463,6 +465,8 @@ private:
void mousePressEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event);
void changeEvent(QEvent* event);
QTimer* timer = NULL; QTimer* timer = NULL;
int timerNotificationId = 0; int timerNotificationId = 0;
QTimer* eventTimer; QTimer* eventTimer;

View file

@ -356,7 +356,7 @@
<item> <item>
<widget class="AnimatedStackedWidget" name="pageStack"> <widget class="AnimatedStackedWidget" name="pageStack">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>5</number>
</property> </property>
<widget class="QWidget" name="clockFrame"> <widget class="QWidget" name="clockFrame">
<property name="autoFillBackground"> <property name="autoFillBackground">
@ -375,7 +375,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-344</y> <y>0</y>
<width>1151</width> <width>1151</width>
<height>1038</height> <height>1038</height>
</rect> </rect>
@ -611,14 +611,14 @@
<second>0</second> <second>0</second>
<year>1969</year> <year>1969</year>
<month>9</month> <month>9</month>
<day>6</day> <day>5</day>
</datetime> </datetime>
</property> </property>
<property name="date"> <property name="date">
<date> <date>
<year>1969</year> <year>1969</year>
<month>9</month> <month>9</month>
<day>6</day> <day>5</day>
</date> </date>
</property> </property>
<property name="displayFormat"> <property name="displayFormat">
@ -1947,7 +1947,7 @@
<item> <item>
<widget class="QStackedWidget" name="settingsTabs"> <widget class="QStackedWidget" name="settingsTabs">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>13</number>
</property> </property>
<widget class="QWidget" name="StartupSettings"> <widget class="QWidget" name="StartupSettings">
<layout class="QVBoxLayout" name="verticalLayout_9"> <layout class="QVBoxLayout" name="verticalLayout_9">
@ -2052,7 +2052,8 @@
<string>Remove</string> <string>Remove</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="list-remove"/> <iconset theme="list-remove">
<normaloff>.</normaloff>.</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -4796,7 +4797,7 @@ Items that will be kept if you choose to keep files:
</widget> </widget>
<widget class="QWidget" name="DangerSettings"> <widget class="QWidget" name="DangerSettings">
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
<item row="5" column="0"> <item row="6" column="0">
<spacer name="verticalSpacer_12"> <spacer name="verticalSpacer_12">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -4886,6 +4887,19 @@ Items that will be kept if you choose to keep files:
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="2">
<widget class="QPushButton" name="resetDeviceButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Reset Device</string>
</property>
<property name="icon">
<iconset theme="view-refresh"/>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="AboutSettings"> <widget class="QWidget" name="AboutSettings">

View file

@ -104,7 +104,7 @@ public:
languageBox->addItem(new QListWidgetItem(QIcon::fromTheme("flag-se"), tr("Swedish") + " (Svenska)")); languageBox->addItem(new QListWidgetItem(QIcon::fromTheme("flag-se"), tr("Swedish") + " (Svenska)"));
break; break;
case ltLT: case ltLT:
languageBox->addItem(new QListWidgetItem(QIcon::fromTheme("flag-lt"), tr("Lithuanian") + " (Lietuviškai)")); languageBox->addItem(new QListWidgetItem(QIcon::fromTheme("flag-lt"), tr("Lithuanian") + " (Lietuvių)"));
break; break;
case inID: case inID:
languageBox->addItem(new QListWidgetItem(QIcon::fromTheme("flag-in"), tr("Indonesian") + " (Bahasa Indonesia)")); languageBox->addItem(new QListWidgetItem(QIcon::fromTheme("flag-in"), tr("Indonesian") + " (Bahasa Indonesia)"));

View file

@ -235,10 +235,6 @@ MainWindow::MainWindow(QWidget *parent) :
this->setFocusPolicy(Qt::NoFocus); this->setFocusPolicy(Qt::NoFocus);
connect(NativeFilter, &NativeEventFilter::DoRetranslation, [=] {
ui->retranslateUi(this);
});
QMenu* quietModeMenu = new QMenu(); QMenu* quietModeMenu = new QMenu();
quietModeMenu->addSection(tr("Quiet Mode")); quietModeMenu->addSection(tr("Quiet Mode"));
quietModeMenu->addAction(ui->actionNone); quietModeMenu->addAction(ui->actionNone);
@ -2023,3 +2019,10 @@ void MainWindow::on_networkStrength_clicked()
void MainWindow::enterEvent(QEvent *event) { void MainWindow::enterEvent(QEvent *event) {
doUpdate(); doUpdate();
} }
void MainWindow::changeEvent(QEvent *event) {
if (event->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
}
QMainWindow::changeEvent(event);
}

View file

@ -230,6 +230,7 @@ private:
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
bool eventFilter(QObject *watched, QEvent *event); bool eventFilter(QObject *watched, QEvent *event);
void enterEvent(QEvent* event); void enterEvent(QEvent* event);
void changeEvent(QEvent* event);
InfoPaneDropdown *infoPane; InfoPaneDropdown *infoPane;

View file

@ -154,10 +154,6 @@ void Menu::show() {
//Show Tutorial Screen //Show Tutorial Screen
TutorialWin->showScreen(TutorialWindow::GatewaySearch); TutorialWin->showScreen(TutorialWindow::GatewaySearch);
connect(NativeFilter, &NativeEventFilter::DoRetranslation, [=] {
ui->retranslateUi(this);
});
} }
void Menu::changeEvent(QEvent *event) { void Menu::changeEvent(QEvent *event) {
@ -166,6 +162,9 @@ void Menu::changeEvent(QEvent *event) {
if (!this->isActiveWindow()) { if (!this->isActiveWindow()) {
this->close(); this->close();
} }
} else if (event->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
((AppsListModel*) ui->appsListView->model())->loadData();
} }
} }

View file

@ -59,7 +59,6 @@ public:
signals: signals:
void SysTrayEvent(long opcode, long data2, long data3, long data4); void SysTrayEvent(long opcode, long data2, long data3, long data4);
void DoRetranslation();
public slots: public slots:

View file

@ -11,11 +11,6 @@ NetworkWidget::NetworkWidget(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
connect(NativeFilter, &NativeEventFilter::DoRetranslation, [=] {
ui->retranslateUi(this);
updateDevices();
});
ui->knownNetworksDeleteButton->setProperty("type", "destructive"); ui->knownNetworksDeleteButton->setProperty("type", "destructive");
QDBusConnection::systemBus().connect(nmInterface->service(), nmInterface->path(), nmInterface->interface(), "DeviceAdded", this, SLOT(updateDevices())); QDBusConnection::systemBus().connect(nmInterface->service(), nmInterface->path(), nmInterface->interface(), "DeviceAdded", this, SLOT(updateDevices()));
@ -896,3 +891,11 @@ void NetworkWidget::on_tetheringButton_clicked()
{ {
ui->stackedWidget->setCurrentIndex(5); ui->stackedWidget->setCurrentIndex(5);
} }
void NetworkWidget::changeEvent(QEvent *event) {
if (event->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
updateDevices();
}
QWidget::changeEvent(event);
}

View file

@ -106,6 +106,8 @@ class NetworkWidget : public QWidget
private: private:
Ui::NetworkWidget *ui; Ui::NetworkWidget *ui;
void changeEvent(QEvent* event);
QDBusInterface* nmInterface = new QDBusInterface("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager", QDBusConnection::systemBus()); QDBusInterface* nmInterface = new QDBusInterface("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager", QDBusConnection::systemBus());
bool flightMode = false; bool flightMode = false;
}; };

View file

@ -13,10 +13,6 @@ NotificationsWidget::NotificationsWidget(QWidget *parent) :
ndbus->setParentWidget(this); ndbus->setParentWidget(this);
ui->scrollArea->installEventFilter(this); ui->scrollArea->installEventFilter(this);
connect(NativeFilter, &NativeEventFilter::DoRetranslation, [=] {
ui->retranslateUi(this);
});
} }
NotificationsWidget::~NotificationsWidget() NotificationsWidget::~NotificationsWidget()
@ -95,3 +91,11 @@ void NotificationsWidget::updateNotificationCount() {
emit numNotificationsChanged(count); emit numNotificationsChanged(count);
} }
void NotificationsWidget::changeEvent(QEvent *event) {
if (event->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
}
QWidget::changeEvent(event);
}

View file

@ -37,6 +37,7 @@ private:
Ui::NotificationsWidget *ui; Ui::NotificationsWidget *ui;
bool eventFilter(QObject *watched, QEvent *event); bool eventFilter(QObject *watched, QEvent *event);
void changeEvent(QEvent* event);
QMap<int, NotificationObject*> notifications; QMap<int, NotificationObject*> notifications;
QList<NotificationAppGroup*> notificationGroups; QList<NotificationAppGroup*> notificationGroups;

View file

@ -152,11 +152,6 @@ Onboarding::Onboarding(QWidget *parent) :
} }
}); });
timer->start(); timer->start();
connect(NativeFilter, &NativeEventFilter::DoRetranslation, [=] {
ui->retranslateUi(this);
ui->welcomeLabel->setText(tr("Welcome to theShell %1!").arg(TS_VERSION));
});
} }
Onboarding::~Onboarding() Onboarding::~Onboarding()
@ -307,8 +302,6 @@ void Onboarding::on_localeList_currentRowChanged(int currentRow)
//Fill locale box //Fill locale box
Internationalisation::fillLanguageBox(ui->localeList); Internationalisation::fillLanguageBox(ui->localeList);
emit NativeFilter->DoRetranslation();
} }
void Onboarding::on_enableStatusBarButton_clicked() void Onboarding::on_enableStatusBarButton_clicked()
@ -363,3 +356,12 @@ void Onboarding::on_exitStackedWidget_currentChanged(int arg1)
ui->backButton->setVisible(false); ui->backButton->setVisible(false);
} }
} }
void Onboarding::changeEvent(QEvent *event) {
if (event->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
ui->welcomeLabel->setText(tr("Welcome to theShell %1!").arg(TS_VERSION));
}
QDialog::changeEvent(event);
}

View file

@ -74,6 +74,7 @@ private:
Ui::Onboarding *ui; Ui::Onboarding *ui;
void reject(); void reject();
void changeEvent(QEvent* event);
int buttonCurrentLanguage = 0; int buttonCurrentLanguage = 0;
QSettings settings; QSettings settings;

View file

@ -40,13 +40,6 @@
<file alias="cancelled.svg">flight/cancelled.svg</file> <file alias="cancelled.svg">flight/cancelled.svg</file>
<file alias="unknown.svg">flight/unknown.svg</file> <file alias="unknown.svg">flight/unknown.svg</file>
</qresource> </qresource>
<qresource prefix="/sounds/tones">
<file alias="happybee">happybee.ogg</file>
<file alias="playinginthedark">playinginthedark.ogg</file>
<file alias="icecream">icecream.ogg</file>
<file alias="party">party.ogg</file>
<file alias="saltyditty">saltyditty.ogg</file>
</qresource>
<qresource prefix="/backgrounds"> <qresource prefix="/backgrounds">
<file alias="blueprint">backgrounds/blueprint</file> <file alias="blueprint">backgrounds/blueprint</file>
<file alias="triangles">backgrounds/triangles</file> <file alias="triangles">backgrounds/triangles</file>

View file

@ -193,12 +193,18 @@ unix {
translations.files = translations/* translations.files = translations/*
xsession.path = /usr/share/xsessions xsession.path = /usr/share/xsessions
ringtones.files = tones/*
blueprint { blueprint {
translations.path = /usr/share/theshellb/translations translations.path = /usr/share/theshellb/translations
xsession.files = theshellb.desktop xsession.files = theshellb.desktop
ringtones.path = /usr/share/sounds/theshellb/tones
} else { } else {
translations.path = /usr/share/theshell/translations translations.path = /usr/share/theshell/translations
xsession.files = theshell.desktop xsession.files = theshell.desktop
ringtones.path = /usr/share/sounds/theshell/tones
} }
INSTALLS += target translations xsession INSTALLS += target translations xsession

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.4.1, 2017-12-05T00:19:06. --> <!-- Written by QtCreator 4.4.1, 2017-12-08T16:25:47. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>