diff --git a/Changelog b/Changelog index cee037f3e..f74d117c6 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ * Unreleased - Christophe Dumez - v2.6.0 + - FEATURE: Use system icons (Linux, Qt >= 4.6) - FEATURE: Simplify program preferences * Sun Dec 5 2010 - Christophe Dumez - v2.5.0 diff --git a/src/misc.h b/src/misc.h index 84495f9e8..cb76bf59a 100644 --- a/src/misc.h +++ b/src/misc.h @@ -41,10 +41,7 @@ #include #include #include - -#ifndef DISABLE_GUI #include -#endif #include #include @@ -85,17 +82,30 @@ public: return libtorrent::sha1_hash(qPrintable(hash)); } -#ifndef DISABLE_GUI - static inline QIcon getIcon(const QString& id) { + static inline QIcon getIcon(const QString& iconId) { #if (QT_VERSION >= QT_VERSION_CHECK(4,6,0)) - const QIcon icon = QIcon::fromTheme(id, QIcon(":/Icons/oxygen/"+id+".png")); + const QIcon icon = QIcon::fromTheme(iconId, QIcon(":/Icons/oxygen/"+iconId+".png")); #else - const QIcon icon(":/Icons/oxygen/"+id+".png"); + const QIcon icon(":/Icons/oxygen/"+iconId+".png"); #endif Q_ASSERT(!icon.isNull()); return icon; } + + static QString getIconPath(const QString &iconId) { +#if (QT_VERSION >= QT_VERSION_CHECK(4,6,0)) + QString path = QDir::temp().absoluteFilePath(iconId+".png"); + if(!QFile::exists(path)) { + const QIcon icon = QIcon::fromTheme(iconId); + if(icon.isNull()) return ":/Icons/oxygen/"+iconId+".png"; + QPixmap px = icon.pixmap(32); + px.save(path); + } + return path; +#else + return ":/Icons/oxygen/"+iconId+".png"; #endif + } static void chmod644(const QDir& folder); diff --git a/src/webui/css/style.css b/src/webui/css/style.css index ddfaf9889..9e58b13b6 100644 --- a/src/webui/css/style.css +++ b/src/webui/css/style.css @@ -164,7 +164,7 @@ a.propButton img { #contextmenu { border:1px solid #999; padding:0; background:#eee; list-style-type:none; display:none; width: 164px;} #contextmenu .separator { border-top:1px solid #999; } #contextmenu li { margin:0; padding:0;} -#contextmenu li a { display:block; padding:5px 10px 5px 35px; font-size:12px; text-decoration:none; font-family:tahoma,arial,sans-serif; color:#000; background-position:8px 2px; background-repeat:no-repeat; } +#contextmenu li a { display:block; padding:5px 10px 5px 5px; font-size:12px; text-decoration:none; font-family:tahoma,arial,sans-serif; color:#000; } #contextmenu li a:hover { background-color:#ddd; } #contextmenu li a.disabled { color:#ccc; font-style:italic; } #contextmenu li a.disabled:hover { background-color:#eee; } @@ -195,18 +195,12 @@ a.propButton img { left: auto; } -/* context menu items */ -#contextmenu li a.pause { background-image:url(../images/skin/pause22.png); } -#contextmenu li a.start { background-image:url(../images/skin/play22.png); } -#contextmenu li a.recheck { background-image:url(../images/oxygen/gear.png); } -#contextmenu li a.delete { background-image:url(../images/skin/delete22.png); } -#contextmenu li a.deleteHD { background-image:url(../images/skin/delete_perm22.png); } -#contextmenu li a.uploadLimit { background-image:url(../images/skin/seeding.png); } -#contextmenu li a.downloadLimit { background-image:url(../images/skin/download.png); } -#contextmenu li a.prioTop { background-image:url(../images/oxygen/go-top22.png); } -#contextmenu li a.prioUp { background-image:url(../images/oxygen/go-up22.png); } -#contextmenu li a.prioDown { background-image:url(../images/oxygen/go-down22.png); } -#contextmenu li a.prioBottom { background-image:url(../images/oxygen/go-bottom22.png); } +#contextmenu li img { + width: 16px; + height: 16px; + margin-bottom: -4px; + -ms-interpolation-mode : bicubic; +} /* Sliders */ diff --git a/src/webui/html/index.html b/src/webui/html/index.html index 8e5abb019..134771b7f 100644 --- a/src/webui/html/index.html +++ b/src/webui/html/index.html @@ -43,28 +43,28 @@
  • _(Edit)
  • _(&Tools)
  • _(&Help)
  • @@ -72,38 +72,36 @@
    - + - - - - + + - - + + - +
    diff --git a/src/webui/html/preferences_content.html b/src/webui/html/preferences_content.html index 320cac3c2..546a24991 100644 --- a/src/webui/html/preferences_content.html +++ b/src/webui/html/preferences_content.html @@ -95,7 +95,7 @@ - +
    _(Watched Folder)_(Download here)
    Add
    Add
    diff --git a/src/webui/html/prop-trackers.html b/src/webui/html/prop-trackers.html index 666009b0f..b0642787b 100644 --- a/src/webui/html/prop-trackers.html +++ b/src/webui/html/prop-trackers.html @@ -2,7 +2,7 @@ - + diff --git a/src/webui/httpconnection.cpp b/src/webui/httpconnection.cpp index c89652901..6ef6244e8 100644 --- a/src/webui/httpconnection.cpp +++ b/src/webui/httpconnection.cpp @@ -217,9 +217,11 @@ void HttpConnection::respond() { } else { if(list[1] == "preferences") { respondPreferencesJson(); + return; } else { if(list[1] == "transferInfo") { respondGlobalTransferInfoJson(); + return; } } } @@ -233,14 +235,21 @@ void HttpConnection::respond() { return; } } - if (list[0] == "images") { - list[0] = "Icons"; + // Icons from theme + qDebug() << "list[0]" << list[0]; + if(list[0] == "theme" && list.size() == 2) { + url = misc::getIconPath(list[1]); + qDebug() << "There icon:" << url; } else { - if(list.last().endsWith(".html")) - list.prepend("html"); - list.prepend("webui"); + if (list[0] == "images") { + list[0] = "Icons"; + } else { + if(list.last().endsWith(".html")) + list.prepend("html"); + list.prepend("webui"); + } + url = ":/" + list.join("/"); } - url = ":/" + list.join("/"); QFile file(url); if(!file.open(QIODevice::ReadOnly)) {
    _(URL) _(URL) _(Status) _(Peers) _(Message)