Commit a59d55b4 authored by glpzzz's avatar glpzzz
Browse files

System icons in linux

parent 49169c87
......@@ -23,11 +23,11 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="tabInfo">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="help-about" resource="../images.qrc">
<normaloff>:/actions/icons/info.png</normaloff>:/actions/icons/info.png</iconset>
</attribute>
<attribute name="title">
......@@ -41,7 +41,7 @@
</widget>
<widget class="QWidget" name="tabTranslators">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="view-list-text" resource="../images.qrc">
<normaloff>:/actions/icons/translators.png</normaloff>:/actions/icons/translators.png</iconset>
</attribute>
<attribute name="title">
......@@ -55,7 +55,7 @@
</widget>
<widget class="QWidget" name="tab">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="tools" resource="../images.qrc">
<normaloff>:/actions/icons/legal.png</normaloff>:/actions/icons/legal.png</iconset>
</attribute>
<attribute name="title">
......@@ -79,7 +79,7 @@
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="story-editor" resource="../images.qrc">
<normaloff>:/actions/icons/changelog.png</normaloff>:/actions/icons/changelog.png</iconset>
</attribute>
<attribute name="title">
......
......@@ -82,7 +82,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="list-add" resource="../images.qrc">
<normaloff>:/actions/icons/add.png</normaloff>:/actions/icons/add.png</iconset>
</property>
<property name="iconSize">
......@@ -105,7 +105,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="list-remove" resource="../images.qrc">
<normaloff>:/actions/icons/remove.png</normaloff>:/actions/icons/remove.png</iconset>
</property>
</widget>
......@@ -204,7 +204,7 @@
<string>Edit</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="document-edit" resource="../images.qrc">
<normaloff>:/actions/icons/edit_preset.png</normaloff>:/actions/icons/edit_preset.png</iconset>
</property>
</widget>
......@@ -260,7 +260,7 @@
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="system-search" resource="../images.qrc">
<normaloff>:/actions/icons/search.png</normaloff>:/actions/icons/search.png</iconset>
</property>
</widget>
......
......@@ -29,7 +29,7 @@
</property>
<widget class="QWidget" name="tab_audio">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="audio-headphones" resource="../images.qrc">
<normaloff>:/actions/icons/audio.png</normaloff>:/actions/icons/audio.png</iconset>
</attribute>
<attribute name="title">
......@@ -194,7 +194,7 @@
</widget>
<widget class="QWidget" name="tab_video">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="camera-video" resource="../images.qrc">
<normaloff>:/actions/icons/video.png</normaloff>:/actions/icons/video.png</iconset>
</attribute>
<attribute name="title">
......@@ -444,7 +444,7 @@
</widget>
<widget class="QWidget" name="tab_time">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="preview-add-zone" resource="../images.qrc">
<normaloff>:/actions/icons/time.png</normaloff>:/actions/icons/time.png</iconset>
</attribute>
<attribute name="title">
......@@ -481,7 +481,7 @@
<string comment="Cut video; select a range to convert">Cut</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="edit-cut" resource="../images.qrc">
<normaloff>:/actions/icons/cut.png</normaloff>:/actions/icons/cut.png</iconset>
</property>
</widget>
......@@ -492,7 +492,7 @@
<string>&amp;Preview</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="preview-render-on" resource="../images.qrc">
<normaloff>:/actions/icons/preview_play.png</normaloff>:/actions/icons/preview_play.png</iconset>
</property>
</widget>
......@@ -539,7 +539,7 @@
</widget>
<widget class="QWidget" name="tab_advanced">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="settings-configure" resource="../images.qrc">
<normaloff>:/actions/icons/settings.png</normaloff>:/actions/icons/settings.png</iconset>
</attribute>
<attribute name="title">
......
......@@ -49,7 +49,7 @@
<string>Mark as Begin</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="flag" resource="../images.qrc">
<normaloff>:/actions/icons/mark.png</normaloff>:/actions/icons/mark.png</iconset>
</property>
</widget>
......@@ -60,7 +60,7 @@
<string>Seek to Begin</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="go-first" resource="../images.qrc">
<normaloff>:/actions/icons/seek_to_begin.png</normaloff>:/actions/icons/seek_to_begin.png</iconset>
</property>
</widget>
......@@ -79,7 +79,7 @@
<string>Play Selection</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-playback-start" resource="../images.qrc">
<normaloff>:/actions/icons/preview_play.png</normaloff>:/actions/icons/preview_play.png</iconset>
</property>
</widget>
......@@ -92,7 +92,7 @@
<string>Mark as End</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="flag" resource="../images.qrc">
<normaloff>:/actions/icons/mark.png</normaloff>:/actions/icons/mark.png</iconset>
</property>
</widget>
......@@ -103,7 +103,7 @@
<string>Seek to End</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="go-last" resource="../images.qrc">
<normaloff>:/actions/icons/seek_to_end.png</normaloff>:/actions/icons/seek_to_end.png</iconset>
</property>
</widget>
......
......@@ -295,33 +295,45 @@ void MainWindow::conversion_stopped()
void MainWindow::update_poweroff_button(int id)
{
const char *icon_id = "";
const char *icon_theme = "";
QString title = "Shutdown Options";
QString status_tip = "Shutdown Options";
switch (id) {
case PowerManagement::SHUTDOWN:
icon_id = ":/actions/icons/system_shutdown.png";
icon_theme = "system-shutdown";
title = tr("Shutdown");
status_tip = tr("Shutdown when all tasks are done.");
break;
case PowerManagement::SUSPEND:
icon_id = ":/actions/icons/system_suspend.png";
icon_theme = "system-suspend";
title = tr("Suspend");
status_tip = tr("Suspend when all tasks are done.");
break;
case PowerManagement::HIBERNATE:
icon_id = ":/actions/icons/system_hibernate.png";
icon_theme = "system-suspend-hibernate";
title = tr("Hibernate");
status_tip = tr("Hibernate when all tasks are done.");
break;
default:
Q_ASSERT(!"Incorrect id! Be sure to handle every power action in switch().");
}
m_poweroff_button->setIcon(QIcon(icon_id));
m_poweroff_button->setToolTip(status_tip);
m_poweroff_button->setStatusTip(status_tip);
ui->actionPoweroff->setIcon(QIcon(icon_id));
ui->actionPoweroff->setText(title);
ui->actionPoweroff->setStatusTip(status_tip);
#ifdef Q_OS_LINUX
m_poweroff_button->setIcon(QIcon::fromTheme(icon_theme));
ui->actionPoweroff->setIcon(QIcon::fromTheme(icon_theme));
#else
m_poweroff_button->setIcon(QIcon(icon_id));
ui->actionPoweroff->setIcon(QIcon(icon_id));
#endif
}
void MainWindow::received_update_result(int status)
......@@ -566,28 +578,38 @@ void MainWindow::setup_poweroff_button()
// Insert all actions into the list.
for (int i=0; i<PowerManagement::ACTION_COUNT; i++) {
const char *icon_id = "";
const char *icon_theme = "";
QString text = "Shutdown Options";
switch (i) {
case PowerManagement::SHUTDOWN:
//: Shutdown the computer (completely poweroff)
text = tr("Shutdown");
icon_id = ":/actions/icons/system_shutdown.png";
icon_theme = "system-shutdown";
break;
case PowerManagement::SUSPEND:
//: Suspend the computer (sleep to ram, standby)
text = tr("Suspend");
icon_id = ":/actions/icons/system_suspend.png";
icon_theme = "system-suspend";
break;
case PowerManagement::HIBERNATE:
//: Hibernate the computer (sleep to disk, completely poweroff)
text = tr("Hibernate");
icon_id = ":/actions/icons/system_hibernate.png";
icon_theme = "system-suspend-hibertate";
break;
default:
Q_ASSERT(!"Incorrect id! Be sure to implement every power action in switch().");
}
actionList.append(new QAction(QIcon(icon_id)
, text, this));
#ifdef Q_OS_LINUX
QIcon icon = QIcon::fromTheme(icon_theme);
#else
QIcon icon(icon_id);
#endif
actionList.append(new QAction(icon, text, this));
}
// Add all actions into the menu (from list)
......
......@@ -189,7 +189,7 @@
</widget>
<action name="actionAddFiles">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="document-new" resource="../images.qrc">
<normaloff>:/actions/icons/add.png</normaloff>:/actions/icons/add.png</iconset>
</property>
<property name="text">
......@@ -213,7 +213,7 @@
</action>
<action name="actionExit">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="application-exit" resource="../images.qrc">
<normaloff>:/actions/icons/exit.png</normaloff>:/actions/icons/exit.png</iconset>
</property>
<property name="text">
......@@ -225,7 +225,7 @@
</action>
<action name="actionStartConversion">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-playback-start" resource="../images.qrc">
<normaloff>:/actions/icons/start.png</normaloff>:/actions/icons/start.png</iconset>
</property>
<property name="text">
......@@ -240,7 +240,7 @@
</action>
<action name="actionStopConversion">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-playback-stop" resource="../images.qrc">
<normaloff>:/actions/icons/stop.png</normaloff>:/actions/icons/stop.png</iconset>
</property>
<property name="text">
......@@ -252,7 +252,7 @@
</action>
<action name="actionSetParameters">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="applications-utilities" resource="../images.qrc">
<normaloff>:/actions/icons/settings.png</normaloff>:/actions/icons/settings.png</iconset>
</property>
<property name="text">
......@@ -279,7 +279,7 @@
</action>
<action name="actionOpenOutputFolder">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="folder-open" resource="../images.qrc">
<normaloff>:/actions/icons/open_folder.png</normaloff>:/actions/icons/open_folder.png</iconset>
</property>
<property name="text">
......@@ -303,7 +303,7 @@
</action>
<action name="actionRemoveSelectedItems">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="edit-delete" resource="../images.qrc">
<normaloff>:/actions/icons/remove.png</normaloff>:/actions/icons/remove.png</iconset>
</property>
<property name="text">
......@@ -315,7 +315,7 @@
</action>
<action name="actionRemoveCompletedItems">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="weather-clear" resource="../images.qrc">
<normaloff>:/actions/icons/remove_completed.png</normaloff>:/actions/icons/remove_completed.png</iconset>
</property>
<property name="text">
......@@ -330,7 +330,7 @@
</action>
<action name="actionClearList">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="edit-clear" resource="../images.qrc">
<normaloff>:/actions/icons/clear.png</normaloff>:/actions/icons/clear.png</iconset>
</property>
<property name="text">
......@@ -345,7 +345,7 @@
</action>
<action name="actionRetry">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="edit-undo" resource="../images.qrc">
<normaloff>:/actions/icons/retry.png</normaloff>:/actions/icons/retry.png</iconset>
</property>
<property name="text">
......@@ -360,7 +360,7 @@
</action>
<action name="actionRetryAll">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-playlist-repeat" resource="../images.qrc">
<normaloff>:/actions/icons/retry_all.png</normaloff>:/actions/icons/retry_all.png</iconset>
</property>
<property name="text">
......@@ -372,7 +372,7 @@
</action>
<action name="actionOptions">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="preferences-system" resource="../images.qrc">
<normaloff>:/actions/icons/configure.png</normaloff>:/actions/icons/configure.png</iconset>
</property>
<property name="text">
......@@ -384,7 +384,7 @@
</action>
<action name="actionAbout">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="help-about" resource="../images.qrc">
<normaloff>:/actions/icons/about.png</normaloff>:/actions/icons/about.png</iconset>
</property>
<property name="text">
......@@ -396,7 +396,7 @@
</action>
<action name="actionChangeOutputFilename">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="edit-paste" resource="../images.qrc">
<normaloff>:/actions/icons/edit_file_name.png</normaloff>:/actions/icons/edit_file_name.png</iconset>
</property>
<property name="text">
......@@ -408,7 +408,7 @@
</action>
<action name="actionChangeOutputDirectory">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="folder" resource="../images.qrc">
<normaloff>:/actions/icons/edit_folder_name.png</normaloff>:/actions/icons/edit_folder_name.png</iconset>
</property>
<property name="text">
......@@ -420,19 +420,16 @@
</action>
<action name="actionPoweroff">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="system-shutdown" resource="../images.qrc">
<normaloff>:/actions/icons/poweroff.png</normaloff>:/actions/icons/poweroff.png</iconset>
</property>
<property name="text">
<string>Poweroff</string>
</property>
<property name="shortcut">
<string notr="true"/>
</property>
</action>
<action name="actionShowErrorMessage">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="dialog-error" resource="../images.qrc">
<normaloff>:/actions/icons/error.png</normaloff>:/actions/icons/error.png</iconset>
</property>
<property name="text">
......@@ -441,7 +438,7 @@
</action>
<action name="actionCheckUpdate">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="system-software-update" resource="../images.qrc">
<normaloff>:/actions/icons/check_update.png</normaloff>:/actions/icons/check_update.png</iconset>
</property>
<property name="text">
......@@ -450,7 +447,7 @@
</action>
<action name="actionCut">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="edit-cut" resource="../images.qrc">
<normaloff>:/actions/icons/cut.png</normaloff>:/actions/icons/cut.png</iconset>
</property>
<property name="text">
......
......@@ -215,6 +215,17 @@ void MediaPlayerWidget::refreshTimeDisplay()
void MediaPlayerWidget::refreshButtonState()
{
#ifdef Q_OS_LINUX
QIcon icon = QIcon::fromTheme("media-playback-play");
switch (mplayer->state()) {
case MyQMPwidget::PlayingState:
icon = QIcon::fromTheme("media-playback-pause"); break;
default:
break;
}
ui->btnPlayPause->setIcon(icon);
#else
QString button_icon = ":/actions/icons/media-playback-start";
switch (mplayer->state()) {
case MyQMPwidget::PlayingState:
......@@ -223,6 +234,9 @@ void MediaPlayerWidget::refreshButtonState()
break;
}
ui->btnPlayPause->setIcon(QIcon(button_icon));
#endif
}
void MediaPlayerWidget::playerStateChanged()
......
......@@ -34,7 +34,7 @@
<item>
<widget class="QPushButton" name="btnPlayPause">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-playback-start" resource="../images.qrc">
<normaloff>:/actions/icons/media-playback-start.png</normaloff>:/actions/icons/media-playback-start.png</iconset>
</property>
</widget>
......@@ -42,7 +42,7 @@
<item>
<widget class="QPushButton" name="btnReset">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-skip-backward" resource="../images.qrc">
<normaloff>:/actions/icons/media-skip-backward.png</normaloff>:/actions/icons/media-skip-backward.png</iconset>
</property>
</widget>
......@@ -53,7 +53,7 @@
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-seek-backward" resource="../images.qrc">
<normaloff>:/actions/icons/media-seek-backward.png</normaloff>:/actions/icons/media-seek-backward.png</iconset>
</property>
</widget>
......@@ -61,7 +61,7 @@
<item>
<widget class="QPushButton" name="btnForward">
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-seek-forward" resource="../images.qrc">
<normaloff>:/actions/icons/media-seek-forward.png</normaloff>:/actions/icons/media-seek-forward.png</iconset>
</property>
</widget>
......
......@@ -27,7 +27,7 @@
</property>
<widget class="QWidget" name="tab">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="configure" resource="../images.qrc">
<normaloff>:/actions/icons/edit_preset.png</normaloff>:/actions/icons/edit_preset.png</iconset>
</attribute>
<attribute name="title">
......@@ -68,7 +68,7 @@
</widget>
<widget class="QWidget" name="tabFFmpeg">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-playlist-repeat" resource="../images.qrc">
<normaloff>:/app/icons/ffmpeg_large.png</normaloff>:/app/icons/ffmpeg_large.png</iconset>
</attribute>
<attribute name="title">
......@@ -110,7 +110,7 @@
</widget>
<widget class="QWidget" name="tabTools">
<attribute name="icon">
<iconset resource="../images.qrc">
<iconset theme="tools" resource="../images.qrc">
<normaloff>:/actions/icons/configure.png</normaloff>:/actions/icons/configure.png</iconset>
</attribute>
<attribute name="title">
......
......@@ -58,7 +58,7 @@
<string notr="true">DoAction</string>
</property>
<property name="icon">
<iconset theme="ok">
<iconset theme="dialog-ok">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
......@@ -69,7 +69,7 @@
<string>Cancel</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="dialog-cancel" resource="../images.qrc">
<normaloff>:/actions/icons/dialog_cancel.png</normaloff>:/actions/icons/dialog_cancel.png</iconset>
</property>
</widget>
......
......@@ -35,7 +35,7 @@
<string>Play Selected Range</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<iconset theme="media-playback-start" resource="../images.qrc">
<normaloff>:/actions/icons/preview_play.png</normaloff>:/actions/icons/preview_play.png</iconset>
</property>
</widget>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment