1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 14:57:52 +00:00

Further preferences simplifying

This commit is contained in:
Christophe Dumez 2010-06-21 16:02:21 +00:00
parent e71f144c40
commit 17efa04257
5 changed files with 3 additions and 42 deletions

View File

@ -881,8 +881,6 @@ void GUI::updateGUI() {
}
void GUI::showNotificationBaloon(QString title, QString msg) const {
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
if(settings.value(QString::fromUtf8("Preferences/General/NotificationBaloons"), true).toBool()) {
#ifdef WITH_LIBNOTIFY
if (notify_init ("summary-body")) {
NotifyNotification* notification;
@ -896,10 +894,9 @@ void GUI::showNotificationBaloon(QString title, QString msg) const {
}
#endif
#ifndef Q_WS_MAC
if(systrayIcon)
if(systrayIcon && QSystemTrayIcon::supportsMessages())
systrayIcon->showMessage(title, msg, QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
#endif
}
}
/*****************************************************

View File

@ -199,7 +199,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkMinimizeToSysTray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkStartMinimized, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkSystrayBalloons, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkDisplayToolbar, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkNoSplash, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkDeleteTorrentFiles, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@ -281,15 +280,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(textWebUiPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
// Disable apply Button
applyButton->setEnabled(false);
#ifdef Q_WS_MAC
if(1) {
#else
if(!QSystemTrayIcon::supportsMessages()){
#endif
// Mac OS X doesn't support it yet
checkSystrayBalloons->setChecked(false);
checkSystrayBalloons->setEnabled(false);
}
// Tab selection mecanism
connect(tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
#if LIBTORRENT_VERSION_MINOR < 15
@ -391,7 +381,6 @@ void options_imp::saveOptions(){
settings.setValue(QString::fromUtf8("CloseToTray"), closeToTray());
settings.setValue(QString::fromUtf8("MinimizeToTray"), minimizeToTray());
settings.setValue(QString::fromUtf8("StartMinimized"), startMinimized());
settings.setValue(QString::fromUtf8("NotificationBaloons"), OSDEnabled());
settings.setValue(QString::fromUtf8("ToolbarDisplayed"), isToolbarDisplayed());
settings.setValue(QString::fromUtf8("NoSplashScreen"), isSlashScreenDisabled());
Preferences::setDeleteTorrentFilesAsDefault(checkDeleteTorrentFiles->isChecked());
@ -628,7 +617,6 @@ void options_imp::loadOptions(){
checkCloseToSystray->setChecked(Preferences::closeToTray());
checkMinimizeToSysTray->setChecked(Preferences::minimizeToTray());
checkStartMinimized->setChecked(Preferences::startMinimized());
checkSystrayBalloons->setChecked(Preferences::OSDEnabled());
}
// End General preferences
// Downloads preferences
@ -1016,11 +1004,6 @@ QPair<int,int> options_imp::getGlobalBandwidthLimits() const{
return qMakePair(DL, UP);
}
bool options_imp::OSDEnabled() const {
if(checkNoSystray->isChecked()) return false;
return checkSystrayBalloons->isChecked();
}
bool options_imp::startMinimized() const {
if(checkStartMinimized->isChecked()) return true;
return checkStartMinimized->isChecked();
@ -1175,13 +1158,11 @@ void options_imp::enableMaxConnecsLimitPerTorrent(bool checked){
void options_imp::enableSystrayOptions() {
checkCloseToSystray->setEnabled(true);
checkMinimizeToSysTray->setEnabled(true);
checkSystrayBalloons->setEnabled(true);
}
void options_imp::disableSystrayOptions() {
checkCloseToSystray->setEnabled(false);
checkMinimizeToSysTray->setEnabled(false);
checkSystrayBalloons->setEnabled(false);
}
void options_imp::setSystrayOptionsState(bool checked) {

View File

@ -73,7 +73,6 @@ protected:
bool closeToTray() const;
bool startMinimized() const;
bool isSlashScreenDisabled() const;
bool OSDEnabled() const;
bool isToolbarDisplayed() const;
// Downloads
QString getSavePath() const;

View File

@ -142,11 +142,6 @@ public:
return settings.value(QString::fromUtf8("Preferences/General/NoSplashScreen"), false).toBool();
}
static bool OSDEnabled() {
QSettings settings("qBittorrent", "qBittorrent");
return settings.value(QString::fromUtf8("Preferences/General/NotificationBaloons"), true).toBool();
}
// Downloads
static QString getSavePath() {
QSettings settings("qBittorrent", "qBittorrent");

View File

@ -240,9 +240,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-109</y>
<width>506</width>
<height>543</height>
<height>515</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
@ -526,16 +526,6 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkSystrayBalloons">
<property name="text">
<string>Show notification balloons in tray</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -3110,7 +3100,6 @@ QGroupBox {
<tabstop>checkCloseToSystray</tabstop>
<tabstop>checkMinimizeToSysTray</tabstop>
<tabstop>checkStartMinimized</tabstop>
<tabstop>checkSystrayBalloons</tabstop>
<tabstop>textSavePath</tabstop>
<tabstop>browseSaveDirButton</tabstop>
<tabstop>checkPreallocateAll</tabstop>