diff --git a/src/GUI.cpp b/src/GUI.cpp index 8a14e028d..d2e90509d 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -82,13 +82,7 @@ using namespace libtorrent; GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), displaySpeedInTitle(false), force_exit(false) { setupUi(this); - setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)) -#if defined(Q_WS_WIN) - +" [Windows]" -#elif defined(Q_WS_MAC) - +" [Mac OS X]" -#endif - ); + setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION))); // Setting icons this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png"))); actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png"))); @@ -187,6 +181,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis setUnifiedTitleAndToolBarOnMac(true); #endif + // View settings + actionTop_tool_bar->setChecked(Preferences::isToolbarDisplayed()); + actionSpeed_in_title_bar->setChecked(Preferences::speedInTitleBar()); + show(); // Load Window state and sizes @@ -781,12 +779,6 @@ void GUI::loadPreferences(bool configure_session) { } #endif // General - const bool new_displaySpeedInTitle = Preferences::speedInTitleBar(); - if(!new_displaySpeedInTitle && new_displaySpeedInTitle != displaySpeedInTitle) { - // Reset title - setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent vx.x").arg(QString::fromUtf8(VERSION))); - } - displaySpeedInTitle = new_displaySpeedInTitle; if(Preferences::isToolbarDisplayed()) { toolBar->setVisible(true); toolBar->layout()->setSpacing(7); @@ -1010,6 +1002,24 @@ void GUI::on_actionOptions_triggered() { } } +void GUI::on_actionTop_tool_bar_triggered() { + bool is_visible = static_cast(sender())->isChecked(); + toolBar->setVisible(is_visible); + Preferences::setToolbarDisplayed(is_visible); +} + +void GUI::on_actionSpeed_in_title_bar_triggered() { + displaySpeedInTitle = static_cast(sender())->isChecked(); + Preferences::showSpeedInTitleBar(displaySpeedInTitle); + if(displaySpeedInTitle) + updateGUI(); + else + setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION))); +} + + + + /***************************************************** * * * HTTP Downloader * @@ -1024,4 +1034,3 @@ void GUI::on_actionDownload_from_URL_triggered() { connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&))); } } - diff --git a/src/GUI.h b/src/GUI.h index df67e23f8..8e2533b71 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -164,6 +164,10 @@ private: SearchEngine *searchEngine; // RSS QPointer rssWidget; + +private slots: + void on_actionSpeed_in_title_bar_triggered(); + void on_actionTop_tool_bar_triggered(); }; #endif diff --git a/src/options_imp.cpp b/src/options_imp.cpp index de1f67cf0..9854e72fe 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -193,13 +193,11 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ // General tab connect(comboI18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); connect(comboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); - connect(checkSpeedInTitle, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(checkAltRowColors, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(checkNoSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); 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(checkDisplayToolbar, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(checkNoSplash, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(checkDeleteTorrentFiles, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); // Downloads tab @@ -375,13 +373,11 @@ void options_imp::saveOptions(){ settings.beginGroup("General"); settings.setValue(QString::fromUtf8("Locale"), getLocale()); settings.setValue(QString::fromUtf8("Style"), getStyle()); - settings.setValue(QString::fromUtf8("SpeedInTitleBar"), speedInTitleBar()); settings.setValue(QString::fromUtf8("AlternatingRowColors"), checkAltRowColors->isChecked()); settings.setValue(QString::fromUtf8("SystrayEnabled"), systrayIntegration()); settings.setValue(QString::fromUtf8("CloseToTray"), closeToTray()); settings.setValue(QString::fromUtf8("MinimizeToTray"), minimizeToTray()); settings.setValue(QString::fromUtf8("StartMinimized"), startMinimized()); - settings.setValue(QString::fromUtf8("ToolbarDisplayed"), isToolbarDisplayed()); settings.setValue(QString::fromUtf8("NoSplashScreen"), isSlashScreenDisabled()); Preferences::setDeleteTorrentFilesAsDefault(checkDeleteTorrentFiles->isChecked()); // End General preferences @@ -604,10 +600,8 @@ void options_imp::loadOptions(){ // General preferences setLocale(Preferences::getLocale()); setStyle(Preferences::getStyle()); - checkSpeedInTitle->setChecked(Preferences::speedInTitleBar()); checkAltRowColors->setChecked(Preferences::useAlternatingRowColors()); checkNoSystray->setChecked(!Preferences::systrayIntegration()); - checkDisplayToolbar->setChecked(Preferences::isToolbarDisplayed()); checkNoSplash->setChecked(Preferences::isSlashScreenDisabled()); checkDeleteTorrentFiles->setChecked(Preferences::deleteTorrentFilesAsDefault()); if(checkNoSystray->isChecked()) { @@ -1282,10 +1276,6 @@ bool options_imp::isSlashScreenDisabled() const { return checkNoSplash->isChecked(); } -bool options_imp::speedInTitleBar() const { - return checkSpeedInTitle->isChecked(); -} - bool options_imp::preAllocateAllFiles() const { return checkPreallocateAll->isChecked(); } @@ -1502,10 +1492,6 @@ QString options_imp::getFilter() const{ return textFilterPath->text(); } -bool options_imp::isToolbarDisplayed() const { - return checkDisplayToolbar->isChecked(); -} - // Web UI void options_imp::enableWebUi(bool checkBoxValue){ diff --git a/src/options_imp.h b/src/options_imp.h index 235565788..07626fd8c 100644 --- a/src/options_imp.h +++ b/src/options_imp.h @@ -67,13 +67,11 @@ protected: // General options QString getLocale() const; QString getStyle() const; - bool speedInTitleBar() const; bool systrayIntegration() const; bool minimizeToTray() const; bool closeToTray() const; bool startMinimized() const; bool isSlashScreenDisabled() const; - bool isToolbarDisplayed() const; // Downloads QString getSavePath() const; bool isTempPathEnabled() const; diff --git a/src/preferences.h b/src/preferences.h index ec079a42d..38cfde52f 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -97,6 +97,11 @@ public: return settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool(); } + static void showSpeedInTitleBar(bool show) { + QSettings settings("qBittorrent", "qBittorrent"); + settings.setValue(QString::fromUtf8("Preferences/General/SpeedInTitleBar"), show); + } + static bool speedInTitleBar() { QSettings settings("qBittorrent", "qBittorrent"); return settings.value(QString::fromUtf8("Preferences/General/SpeedInTitleBar"), false).toBool(); @@ -117,6 +122,11 @@ public: settings.setValue(QString::fromUtf8("Preferences/General/SystrayEnabled"), enabled); } + static void setToolbarDisplayed(bool displayed) { + QSettings settings("qBittorrent", "qBittorrent"); + settings.setValue(QString::fromUtf8("Preferences/General/ToolbarDisplayed"), displayed); + } + static bool isToolbarDisplayed() { QSettings settings("qBittorrent", "qBittorrent"); return settings.value(QString::fromUtf8("Preferences/General/ToolbarDisplayed"), true).toBool(); diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 9d580ec7b..fd9b2373f 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -1036,11 +1036,11 @@ void TransferListWidget::displayListMenu(const QPoint&) { connect(&actionPause, SIGNAL(triggered()), this, SLOT(pauseSelectedTorrents())); QAction actionDelete(QIcon(QString::fromUtf8(":/Icons/skin/delete.png")), tr("Delete"), 0); connect(&actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelectedTorrents())); - QAction actionPreview_file(QIcon(QString::fromUtf8(":/Icons/skin/preview.png")), tr("Preview file"), 0); + QAction actionPreview_file(QIcon(QString::fromUtf8(":/Icons/skin/preview.png")), tr("Preview file..."), 0); connect(&actionPreview_file, SIGNAL(triggered()), this, SLOT(previewSelectedTorrents())); - QAction actionSet_upload_limit(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")), tr("Limit upload rate"), 0); + QAction actionSet_upload_limit(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")), tr("Limit upload rate..."), 0); connect(&actionSet_upload_limit, SIGNAL(triggered()), this, SLOT(setUpLimitSelectedTorrents())); - QAction actionSet_download_limit(QIcon(QString::fromUtf8(":/Icons/skin/download.png")), tr("Limit download rate"), 0); + QAction actionSet_download_limit(QIcon(QString::fromUtf8(":/Icons/skin/download.png")), tr("Limit download rate..."), 0); connect(&actionSet_download_limit, SIGNAL(triggered()), this, SLOT(setDlLimitSelectedTorrents())); QAction actionOpen_destination_folder(QIcon(QString::fromUtf8(":/Icons/oxygen/folder.png")), tr("Open destination folder"), 0); connect(&actionOpen_destination_folder, SIGNAL(triggered()), this, SLOT(openSelectedTorrentsFolder())); diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index 9e0cabe8c..af4c63358 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -29,7 +29,7 @@ 0 0 914 - 26 + 25 @@ -58,10 +58,12 @@ - Options + &Tools - + + + @@ -69,11 +71,18 @@ - + + + &View + + + + + @@ -125,17 +134,17 @@ - Open torrent + &Add File... - Exit + E&xit - Preferences + &Options... @@ -175,12 +184,12 @@ - Download from URL + Add &URL... - Create torrent + Torrent &creator @@ -253,7 +262,7 @@ :/Icons/oxygen/log.png:/Icons/oxygen/log.png - Console + &Log viewer... Log Window @@ -268,6 +277,28 @@ Use alternative speed limits + + + true + + + Top &tool bar + + + Display top tool bar + + + + + true + + + &Speed in title bar + + + Show transfer speed in title bar + + diff --git a/src/ui/options.ui b/src/ui/options.ui index af587ac6c..4b87d8dce 100644 --- a/src/ui/options.ui +++ b/src/ui/options.ui @@ -17,7 +17,7 @@ - Preferences + Options @@ -240,9 +240,9 @@ 0 - -109 - 506 - 515 + 0 + 524 + 406 @@ -252,6 +252,9 @@ User interface + + 0 + @@ -335,16 +338,6 @@ - - - - Display top toolbar - - - true - - - @@ -353,187 +346,188 @@ - + - Display current speed in title bar + On torrent deletion, also delete files on hard disk as a default + + + + + + + Transfer list + + + + 0 + - + - On torrent deletion, also delete files on hard disk as a default + Use alternating row colors + + + true - + + + + 50 + false + + - Transfer list + Action on double-click - - - + + true + + + + 0 + + + - Use alternating row colors - - - true + Downloading torrents: - - + + - + 0 0 - - QGroupBox::title { -font-weight: normal; -margin-left: -2px; -} -QGroupBox { - border-width: 0; -} + + 0 - - Action on double click: + + + Start / Stop + + + + + Open destination folder + + + + + No action + + + + + + + + Completed torrents: - - - - - - - Downloading: - - - - - - - - 0 - 0 - - - - 0 - - - - Start/Stop - - - - - Open folder - - - - - No action - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Completed: - - - - - - - - Start/Stop - - - - - Open folder - - - - - No action - - - - - - - - - - - - - - - - System tray icon - - + + - - - Disable system tray icon - - - - - - - Close to tray - - + + Start / Stop + - - - Minimize to tray - - - false - - + + Open destination folder + - - - Start minimized - - + + No action + - - - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + System tray icon + + + + 0 + + + + + Disable system tray icon + + + + + + + Minimize to tray + + + false + + + + + + + Close to tray + + + + + + + Start minimized + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -3046,8 +3040,8 @@ QGroupBox { 0 0 - 98 - 28 + 62 + 18 @@ -3095,7 +3089,6 @@ QGroupBox { tabOption comboI18n comboStyle - checkSpeedInTitle checkNoSystray checkCloseToSystray checkMinimizeToSysTray