-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
100 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,42 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>icon/01d.png</file> | ||
<file>icon/02n.png</file> | ||
<file>icon/50d.png</file> | ||
<file>icon/50n.png</file> | ||
<file>icon/04n.png</file> | ||
<file>icon/13d.png</file> | ||
<file>icon/11n.png</file> | ||
<file>icon/09n.png</file> | ||
<file>icon/02d.png</file> | ||
<file>icon/11d.png</file> | ||
<file>icon/10d.png</file> | ||
<file>icon/13n.png</file> | ||
<file>icon/04d.png</file> | ||
<file>icon/03n.png</file> | ||
<file>icon/09d.png</file> | ||
<file>icon/01n.png</file> | ||
<file>icon/10n.png</file> | ||
<file>icon/03d.png</file> | ||
<file>icon/na.png</file> | ||
<file>icon/Simple/10n.png</file> | ||
<file>icon/Simple/03n.png</file> | ||
<file>icon/Simple/09d.png</file> | ||
<file>icon/Simple/10d.png</file> | ||
<file>icon/Simple/na.png</file> | ||
<file>icon/Simple/13n.png</file> | ||
<file>icon/Simple/01d.png</file> | ||
<file>icon/Simple/04n.png</file> | ||
<file>icon/Simple/50n.png</file> | ||
<file>icon/Simple/50d.png</file> | ||
<file>icon/Simple/04d.png</file> | ||
<file>icon/Simple/01n.png</file> | ||
<file>icon/Simple/13d.png</file> | ||
<file>icon/Simple/02n.png</file> | ||
<file>icon/Simple/11d.png</file> | ||
<file>icon/Simple/03d.png</file> | ||
<file>icon/Simple/09n.png</file> | ||
<file>icon/Simple/11n.png</file> | ||
<file>icon/Simple/02d.png</file> | ||
<file>icon/Default/01d.png</file> | ||
<file>icon/Default/02d.png</file> | ||
<file>icon/Default/03n.png</file> | ||
<file>icon/Default/11d.png</file> | ||
<file>icon/Default/10d.png</file> | ||
<file>icon/Default/50n.png</file> | ||
<file>icon/Default/50d.png</file> | ||
<file>icon/Default/04d.png</file> | ||
<file>icon/Default/01n.png</file> | ||
<file>icon/Default/na.png</file> | ||
<file>icon/Default/11n.png</file> | ||
<file>icon/Default/13n.png</file> | ||
<file>icon/Default/13d.png</file> | ||
<file>icon/Default/04n.png</file> | ||
<file>icon/Default/09n.png</file> | ||
<file>icon/Default/10n.png</file> | ||
<file>icon/Default/03d.png</file> | ||
<file>icon/Default/09d.png</file> | ||
<file>icon/Default/02n.png</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,8 +166,8 @@ void WeatherPlugin::invokedMenuItem(const QString &itemKey, const QString &menuI | |
|
||
void WeatherPlugin::MBAbout() | ||
{ | ||
QMessageBox aboutMB(QMessageBox::NoIcon, "HTYWeather 5.2", "About\n\nDeepin Linux Dock Weather Plugin.\nAuthor: 黄颖\nE-mail: [email protected]\nSource: https://github.com/sonichy/WEATHER_DDE_DOCK\nAPI: https://openweathermap.org/forecast5"); | ||
aboutMB.setIconPixmap(QPixmap(":/icon/01d.png")); | ||
QMessageBox aboutMB(QMessageBox::NoIcon, "HTYWeather 5.3", "About\n\nDeepin Linux Dock Weather Plugin.\nAuthor: 黄颖\nE-mail: [email protected]\nSource: https://github.com/sonichy/WEATHER_DDE_DOCK\nAPI: https://openweathermap.org/forecast5"); | ||
aboutMB.setIconPixmap(QPixmap(":/icon/Default/01d.png")); | ||
aboutMB.exec(); | ||
} | ||
|
||
|
@@ -246,23 +246,56 @@ void WeatherPlugin::set() | |
hbox = new QHBoxLayout; | ||
label = new QLabel("Search your city and country in openweathermap.org"); | ||
hbox->addWidget(label); | ||
/* | ||
hbox = new QHBoxLayout; | ||
label = new QLabel("IconPath"); | ||
hbox->addWidget(label); | ||
lineEdit_iconPath = new QLineEdit; | ||
lineEdit_iconPath->setText(m_settings.value("icon_path","").toString()); | ||
lineEdit_iconPath->setText(m_settings.value("IconPath","").toString()); | ||
QAction *action = new QAction(this); | ||
action->setIcon(QIcon::fromTheme("folder")); | ||
lineEdit_iconPath->addAction(action, QLineEdit::TrailingPosition); | ||
//connect(action, SIGNAL(triggered(bool)), this, SLOT(BrowserIconPath())); | ||
connect(action, &QAction::triggered, this, [=](){ | ||
QString iconPath = QFileDialog::getExistingDirectory(dialog, "Icon Path", m_settings.value("icon_path","").toString()); | ||
QString iconPath = QFileDialog::getExistingDirectory(dialog, "Icon Path", m_settings.value("IconPath","").toString()); | ||
if (iconPath != "") { | ||
lineEdit_iconPath->setText(iconPath); | ||
} | ||
}); | ||
hbox->addWidget(lineEdit_iconPath); | ||
vbox->addLayout(hbox); | ||
*/ | ||
hbox = new QHBoxLayout; | ||
label = new QLabel("Icon Theme (PNG only)"); | ||
hbox->addWidget(label); | ||
QComboBox *comboBox_iconTheme = new QComboBox; | ||
comboBox_iconTheme->addItem(QIcon(":icon/Default/01d.png"), "Default"); | ||
comboBox_iconTheme->addItem(QIcon(":icon/Simple/01d.png"), "Simple"); | ||
QString iconTheme = m_settings.value("IconTheme","").toString(); | ||
if(iconTheme == "" || !iconTheme.startsWith("/")){ | ||
comboBox_iconTheme->addItem("Custom"); | ||
}else{ | ||
comboBox_iconTheme->addItem(QIcon(iconTheme + "/01d.png"), iconTheme); | ||
} | ||
comboBox_iconTheme->setCurrentText(iconTheme); | ||
//connect(comboBox_iconTheme, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [=](int index){ | ||
connect(comboBox_iconTheme, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), [=](int index){ | ||
if(index == 2){ | ||
QString siconTheme = QFileDialog::getExistingDirectory(dialog, "Icon Theme", iconTheme); | ||
if(siconTheme != ""){ | ||
QString icon_path = siconTheme + "/01d.png"; | ||
QFile file(icon_path); | ||
if(file.exists()){ | ||
comboBox_iconTheme->setItemText(index, siconTheme); | ||
comboBox_iconTheme->setItemIcon(index, QIcon(icon_path)); | ||
}else{ | ||
QMessageBox MB(QMessageBox::Critical, "Error", icon_path + " does not exists !"); | ||
MB.exec(); | ||
} | ||
} | ||
} | ||
}); | ||
hbox->addWidget(comboBox_iconTheme); | ||
vbox->addLayout(hbox); | ||
QPushButton *pushButton_confirm = new QPushButton("Confirm"); | ||
QPushButton *pushButton_cancel = new QPushButton("Cancel"); | ||
connect(pushButton_confirm, SIGNAL(clicked()), dialog, SLOT(accept())); | ||
|
@@ -275,7 +308,8 @@ void WeatherPlugin::set() | |
if(dialog->exec() == QDialog::Accepted){ | ||
m_settings.setValue("city", lineEdit_city->text()); | ||
m_settings.setValue("country", comboBox->currentText()); | ||
m_settings.setValue("icon_path", lineEdit_iconPath->text()); | ||
//m_settings.setValue("IconPath", lineEdit_iconPath->text()); | ||
m_settings.setValue("IconTheme", comboBox_iconTheme->currentText()); | ||
forcastApplet->updateWeather(); | ||
} | ||
dialog->close(); | ||
|