OSDN Git Service

Added "do nothing" item to post-operation sub-menu.
authorlordmulder <mulder2@gmx.de>
Mon, 26 Feb 2018 19:38:37 +0000 (20:38 +0100)
committerlordmulder <mulder2@gmx.de>
Mon, 26 Feb 2018 19:38:37 +0000 (20:38 +0100)
gui/win_main.ui
res/resources.qrc
src/version.h
src/win_main.cpp

index 5888042..dc51cfc 100644 (file)
      <addaction name="separator"/>
      <addaction name="actionPostOp_PowerDown"/>
      <addaction name="actionPostOp_Hibernate"/>
+     <addaction name="separator"/>
+     <addaction name="actionPostOp_DoNothing"/>
     </widget>
     <addaction name="actionOpen"/>
     <addaction name="actionCreateJob"/>
    </property>
    <property name="icon">
     <iconset resource="../res/resources.qrc">
-     <normaloff>:/buttons/power_save.png</normaloff>:/buttons/power_save.png</iconset>
+     <normaloff>:/buttons/snow_flake.png</normaloff>:/buttons/snow_flake.png</iconset>
    </property>
    <property name="text">
     <string>Hibernate Computer</string>
    </property>
   </action>
+  <action name="actionPostOp_DoNothing">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="checked">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset resource="../res/resources.qrc">
+     <normaloff>:/buttons/cross_grey.png</normaloff>:/buttons/cross_grey.png</iconset>
+   </property>
+   <property name="text">
+    <string>Do Nothing</string>
+   </property>
+  </action>
  </widget>
  <tabstops>
   <tabstop>buttonAddJob</tabstop>
index d58f398..205c29f 100644 (file)
@@ -1,7 +1,6 @@
 <!DOCTYPE RCC>
 <RCC version="1.0">
   <qresource>
-    <file>icons/movie.ico</file>
     <file>buttons/accept.png</file>
     <file>buttons/add.png</file>
     <file>buttons/arrow_down.png</file>
@@ -17,6 +16,7 @@
     <file>buttons/computer.png</file>
     <file>buttons/control_pause.png</file>
     <file>buttons/cross.png</file>
+    <file>buttons/cross_grey.png</file>
     <file>buttons/cup.png</file>
     <file>buttons/disk.png</file>
     <file>buttons/door_in.png</file>
@@ -49,6 +49,7 @@
     <file>buttons/shield_exclamation.png</file>
     <file>buttons/shield_green.png</file>
     <file>buttons/shield_grey.png</file>
+    <file>buttons/snow_flake.png</file>
     <file>buttons/suspended.png</file>
     <file>buttons/text_wrapping.png</file>
     <file>buttons/transmit.png</file>
@@ -58,6 +59,7 @@
     <file>buttons/wrench.png</file>
     <file>buttons/x264.png</file>
     <file>buttons/x265.png</file>
+    <file>icons/movie.ico</file>
     <file>images/avisynth.png</file>
     <file>images/help.png</file>
     <file>images/loading.gif</file>
     <file>images/update_wizard.png</file>
     <file>images/x264.png</file>
     <file>images/x265.png</file>
-    <file>sounds/shutdown.wav</file>
     <file>sounds/beep.wav</file>
     <file>sounds/beep2.wav</file>
-    <file>sounds/tada.wav</file>
-    <file>sounds/shattering.wav</file>
     <file>sounds/failure.wav</file>
+    <file>sounds/shattering.wav</file>
+    <file>sounds/shutdown.wav</file>
+    <file>sounds/tada.wav</file>
   </qresource>
 </RCC>
index 14a126c..ef53e80 100644 (file)
@@ -26,7 +26,7 @@
 #define VER_X264_MAJOR 2
 #define VER_X264_MINOR 8
 #define VER_X264_PATCH 6
-#define VER_X264_BUILD 1122
+#define VER_X264_BUILD 1123
 
 #define VER_X264_PORTABLE_EDITION (0)
 
index 0f00a3c..82c17e2 100644 (file)
@@ -218,6 +218,7 @@ MainWindow::MainWindow(const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, MUtil
        connect(ui->actionOpen,             SIGNAL(triggered()), this, SLOT(openActionTriggered()));
        connect(ui->actionCleanup_Finished, SIGNAL(triggered()), this, SLOT(cleanupActionTriggered()));
        connect(ui->actionCleanup_Enqueued, SIGNAL(triggered()), this, SLOT(cleanupActionTriggered()));
+       connect(ui->actionPostOp_DoNothing, SIGNAL(triggered()), this, SLOT(postOpActionTriggered()));
        connect(ui->actionPostOp_PowerDown, SIGNAL(triggered()), this, SLOT(postOpActionTriggered()));
        connect(ui->actionPostOp_Hibernate, SIGNAL(triggered()), this, SLOT(postOpActionTriggered()));
        connect(ui->actionAbout,            SIGNAL(triggered()), this, SLOT(showAbout()));
@@ -225,6 +226,7 @@ MainWindow::MainWindow(const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, MUtil
        connect(ui->actionCheckForUpdates,  SIGNAL(triggered()), this, SLOT(checkUpdates()));
        ui->actionCleanup_Finished->setData(QVariant(bool(0)));
        ui->actionCleanup_Enqueued->setData(QVariant(bool(1)));
+       ui->actionPostOp_DoNothing->setData(QVariant(POST_OP_DONOTHING));
        ui->actionPostOp_PowerDown->setData(QVariant(POST_OP_POWERDOWN));
        ui->actionPostOp_Hibernate->setData(QVariant(POST_OP_HIBERNATE));
        ui->actionPostOp_Hibernate->setEnabled(MUtils::OS::is_hibernation_supported());
@@ -432,26 +434,15 @@ void MainWindow::postOpActionTriggered(void)
                if (data.isValid() && (data.type() == QVariant::Int))
                {
                        const postOp_t mode = (postOp_t)data.toInt();
-                       if (sender->isChecked())
+                       if ((mode >= POST_OP_DONOTHING) && (mode <= POST_OP_HIBERNATE))
                        {
                                m_postOperation = mode;
-                               if (mode != POST_OP_POWERDOWN)
-                               {
-                                       ui->actionPostOp_PowerDown->setChecked(false);
-                               }
-                               if (mode != POST_OP_HIBERNATE)
-                               {
-                                       ui->actionPostOp_Hibernate->setChecked(false);
-                               }
-                       }
-                       else
-                       {
-                               m_postOperation = POST_OP_DONOTHING;
+                               ui->actionPostOp_PowerDown->setChecked(mode == POST_OP_POWERDOWN);
+                               ui->actionPostOp_Hibernate->setChecked(mode == POST_OP_HIBERNATE);
+                               ui->actionPostOp_DoNothing->setChecked(mode == POST_OP_DONOTHING);
                        }
                }
        }
-
-       qWarning("Post-operation: %d", m_postOperation);
 }
 
 /*