added option to not copy screenshots
+ moved select all checkbox to top row, centered. Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
This commit is contained in:
		@@ -12,7 +12,8 @@ bool InstanceCopyPrefs::allTrue() const
 | 
				
			|||||||
        copyResourcePacks &&
 | 
					        copyResourcePacks &&
 | 
				
			||||||
        copyShaderPacks &&
 | 
					        copyShaderPacks &&
 | 
				
			||||||
        copyServers &&
 | 
					        copyServers &&
 | 
				
			||||||
        copyMods;
 | 
					        copyMods &&
 | 
				
			||||||
 | 
					        copyScreenshots;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Returns a single RegEx string of the selected folders/files to filter out (ex: ".minecraft/saves|.minecraft/server.dat")
 | 
					// Returns a single RegEx string of the selected folders/files to filter out (ex: ".minecraft/saves|.minecraft/server.dat")
 | 
				
			||||||
@@ -38,6 +39,9 @@ QString InstanceCopyPrefs::getSelectedFiltersAsRegex() const
 | 
				
			|||||||
    if(!copyMods)
 | 
					    if(!copyMods)
 | 
				
			||||||
        filters << "coremods" << "mods" << "config";
 | 
					        filters << "coremods" << "mods" << "config";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if(!copyScreenshots)
 | 
				
			||||||
 | 
					        filters << "screenshots";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // If we have any filters to add, join them as a single regex string to return:
 | 
					    // If we have any filters to add, join them as a single regex string to return:
 | 
				
			||||||
    if (!filters.isEmpty()) {
 | 
					    if (!filters.isEmpty()) {
 | 
				
			||||||
        const QString MC_ROOT = "[.]?minecraft/";
 | 
					        const QString MC_ROOT = "[.]?minecraft/";
 | 
				
			||||||
@@ -84,6 +88,11 @@ bool InstanceCopyPrefs::isCopyModsEnabled() const
 | 
				
			|||||||
    return copyMods;
 | 
					    return copyMods;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool InstanceCopyPrefs::isCopyScreenshotsEnabled() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return copyScreenshots;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ======= Setters =======
 | 
					// ======= Setters =======
 | 
				
			||||||
void InstanceCopyPrefs::enableCopySaves(bool b)
 | 
					void InstanceCopyPrefs::enableCopySaves(bool b)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -119,3 +128,8 @@ void InstanceCopyPrefs::enableCopyMods(bool b)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    copyMods = b;
 | 
					    copyMods = b;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void InstanceCopyPrefs::enableCopyScreenshots(bool b)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    copyScreenshots = b;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@ struct InstanceCopyPrefs {
 | 
				
			|||||||
    [[nodiscard]] bool isCopyShaderPacksEnabled() const;
 | 
					    [[nodiscard]] bool isCopyShaderPacksEnabled() const;
 | 
				
			||||||
    [[nodiscard]] bool isCopyServersEnabled() const;
 | 
					    [[nodiscard]] bool isCopyServersEnabled() const;
 | 
				
			||||||
    [[nodiscard]] bool isCopyModsEnabled() const;
 | 
					    [[nodiscard]] bool isCopyModsEnabled() const;
 | 
				
			||||||
 | 
					    [[nodiscard]] bool isCopyScreenshotsEnabled() const;
 | 
				
			||||||
    // Setters
 | 
					    // Setters
 | 
				
			||||||
    void enableCopySaves(bool b);
 | 
					    void enableCopySaves(bool b);
 | 
				
			||||||
    void enableKeepPlaytime(bool b);
 | 
					    void enableKeepPlaytime(bool b);
 | 
				
			||||||
@@ -26,6 +27,7 @@ struct InstanceCopyPrefs {
 | 
				
			|||||||
    void enableCopyShaderPacks(bool b);
 | 
					    void enableCopyShaderPacks(bool b);
 | 
				
			||||||
    void enableCopyServers(bool b);
 | 
					    void enableCopyServers(bool b);
 | 
				
			||||||
    void enableCopyMods(bool b);
 | 
					    void enableCopyMods(bool b);
 | 
				
			||||||
 | 
					    void enableCopyScreenshots(bool b);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   protected: // data
 | 
					   protected: // data
 | 
				
			||||||
    bool copySaves = true;
 | 
					    bool copySaves = true;
 | 
				
			||||||
@@ -35,4 +37,5 @@ struct InstanceCopyPrefs {
 | 
				
			|||||||
    bool copyShaderPacks = true;
 | 
					    bool copyShaderPacks = true;
 | 
				
			||||||
    bool copyServers = true;
 | 
					    bool copyServers = true;
 | 
				
			||||||
    bool copyMods = true;
 | 
					    bool copyMods = true;
 | 
				
			||||||
 | 
					    bool copyScreenshots = true;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -84,6 +84,7 @@ CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent)
 | 
				
			|||||||
    ui->copyShaderPacksCheckbox->setChecked(m_selectedOptions.isCopyShaderPacksEnabled());
 | 
					    ui->copyShaderPacksCheckbox->setChecked(m_selectedOptions.isCopyShaderPacksEnabled());
 | 
				
			||||||
    ui->copyServersCheckbox->setChecked(m_selectedOptions.isCopyServersEnabled());
 | 
					    ui->copyServersCheckbox->setChecked(m_selectedOptions.isCopyServersEnabled());
 | 
				
			||||||
    ui->copyModsCheckbox->setChecked(m_selectedOptions.isCopyModsEnabled());
 | 
					    ui->copyModsCheckbox->setChecked(m_selectedOptions.isCopyModsEnabled());
 | 
				
			||||||
 | 
					    ui->copyScreenshotsCheckbox->setChecked(m_selectedOptions.isCopyScreenshotsEnabled());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CopyInstanceDialog::~CopyInstanceDialog()
 | 
					CopyInstanceDialog::~CopyInstanceDialog()
 | 
				
			||||||
@@ -135,6 +136,7 @@ void CopyInstanceDialog::checkAllCheckboxes(const bool& b)
 | 
				
			|||||||
    ui->copyShaderPacksCheckbox->setChecked(b);
 | 
					    ui->copyShaderPacksCheckbox->setChecked(b);
 | 
				
			||||||
    ui->copyServersCheckbox->setChecked(b);
 | 
					    ui->copyServersCheckbox->setChecked(b);
 | 
				
			||||||
    ui->copyModsCheckbox->setChecked(b);
 | 
					    ui->copyModsCheckbox->setChecked(b);
 | 
				
			||||||
 | 
					    ui->copyScreenshotsCheckbox->setChecked(b);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Check the "Select all" checkbox if all options are already selected:
 | 
					// Check the "Select all" checkbox if all options are already selected:
 | 
				
			||||||
@@ -212,3 +214,9 @@ void CopyInstanceDialog::on_copyModsCheckbox_stateChanged(int state)
 | 
				
			|||||||
    m_selectedOptions.enableCopyMods(state == Qt::Checked);
 | 
					    m_selectedOptions.enableCopyMods(state == Qt::Checked);
 | 
				
			||||||
    updateSelectAllCheckbox();
 | 
					    updateSelectAllCheckbox();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void CopyInstanceDialog::on_copyScreenshotsCheckbox_stateChanged(int state)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_selectedOptions.enableCopyScreenshots(state == Qt::Checked);
 | 
				
			||||||
 | 
					    updateSelectAllCheckbox();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,6 +54,7 @@ slots:
 | 
				
			|||||||
    void on_copyShaderPacksCheckbox_stateChanged(int state);
 | 
					    void on_copyShaderPacksCheckbox_stateChanged(int state);
 | 
				
			||||||
    void on_copyServersCheckbox_stateChanged(int state);
 | 
					    void on_copyServersCheckbox_stateChanged(int state);
 | 
				
			||||||
    void on_copyModsCheckbox_stateChanged(int state);
 | 
					    void on_copyModsCheckbox_stateChanged(int state);
 | 
				
			||||||
 | 
					    void on_copyScreenshotsCheckbox_stateChanged(int state);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    void checkAllCheckboxes(const bool& b);
 | 
					    void checkAllCheckboxes(const bool& b);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@
 | 
				
			|||||||
    <x>0</x>
 | 
					    <x>0</x>
 | 
				
			||||||
    <y>0</y>
 | 
					    <y>0</y>
 | 
				
			||||||
    <width>341</width>
 | 
					    <width>341</width>
 | 
				
			||||||
    <height>385</height>
 | 
					    <height>399</height>
 | 
				
			||||||
   </rect>
 | 
					   </rect>
 | 
				
			||||||
  </property>
 | 
					  </property>
 | 
				
			||||||
  <property name="windowTitle">
 | 
					  <property name="windowTitle">
 | 
				
			||||||
@@ -112,25 +112,31 @@
 | 
				
			|||||||
     </item>
 | 
					     </item>
 | 
				
			||||||
    </layout>
 | 
					    </layout>
 | 
				
			||||||
   </item>
 | 
					   </item>
 | 
				
			||||||
 | 
					   <item>
 | 
				
			||||||
 | 
					    <layout class="QHBoxLayout" name="selectAllButtonLayout">
 | 
				
			||||||
 | 
					     <item>
 | 
				
			||||||
 | 
					      <widget class="QCheckBox" name="selectAllCheckbox">
 | 
				
			||||||
 | 
					       <property name="sizePolicy">
 | 
				
			||||||
 | 
					        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
 | 
				
			||||||
 | 
					         <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					         <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					        </sizepolicy>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="layoutDirection">
 | 
				
			||||||
 | 
					        <enum>Qt::LeftToRight</enum>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>Select all</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="checked">
 | 
				
			||||||
 | 
					        <bool>false</bool>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					    </layout>
 | 
				
			||||||
 | 
					   </item>
 | 
				
			||||||
   <item>
 | 
					   <item>
 | 
				
			||||||
    <layout class="QGridLayout" name="copyOptionsLayout">
 | 
					    <layout class="QGridLayout" name="copyOptionsLayout">
 | 
				
			||||||
     <item row="3" column="0">
 | 
					 | 
				
			||||||
      <widget class="QCheckBox" name="copySavesCheckbox">
 | 
					 | 
				
			||||||
       <property name="text">
 | 
					 | 
				
			||||||
        <string>Copy saves</string>
 | 
					 | 
				
			||||||
       </property>
 | 
					 | 
				
			||||||
      </widget>
 | 
					 | 
				
			||||||
     </item>
 | 
					 | 
				
			||||||
     <item row="6" column="0">
 | 
					 | 
				
			||||||
      <widget class="QCheckBox" name="copyResPacksCheckbox">
 | 
					 | 
				
			||||||
       <property name="enabled">
 | 
					 | 
				
			||||||
        <bool>true</bool>
 | 
					 | 
				
			||||||
       </property>
 | 
					 | 
				
			||||||
       <property name="text">
 | 
					 | 
				
			||||||
        <string>Copy resource packs</string>
 | 
					 | 
				
			||||||
       </property>
 | 
					 | 
				
			||||||
      </widget>
 | 
					 | 
				
			||||||
     </item>
 | 
					 | 
				
			||||||
     <item row="6" column="1">
 | 
					     <item row="6" column="1">
 | 
				
			||||||
      <widget class="QCheckBox" name="copyModsCheckbox">
 | 
					      <widget class="QCheckBox" name="copyModsCheckbox">
 | 
				
			||||||
       <property name="toolTip">
 | 
					       <property name="toolTip">
 | 
				
			||||||
@@ -151,17 +157,10 @@
 | 
				
			|||||||
       </property>
 | 
					       </property>
 | 
				
			||||||
      </widget>
 | 
					      </widget>
 | 
				
			||||||
     </item>
 | 
					     </item>
 | 
				
			||||||
     <item row="5" column="1">
 | 
					     <item row="3" column="0">
 | 
				
			||||||
      <widget class="QCheckBox" name="copyServersCheckbox">
 | 
					      <widget class="QCheckBox" name="copySavesCheckbox">
 | 
				
			||||||
       <property name="text">
 | 
					       <property name="text">
 | 
				
			||||||
        <string>Copy servers</string>
 | 
					        <string>Copy saves</string>
 | 
				
			||||||
       </property>
 | 
					 | 
				
			||||||
      </widget>
 | 
					 | 
				
			||||||
     </item>
 | 
					 | 
				
			||||||
     <item row="1" column="1">
 | 
					 | 
				
			||||||
      <widget class="QCheckBox" name="keepPlaytimeCheckbox">
 | 
					 | 
				
			||||||
       <property name="text">
 | 
					 | 
				
			||||||
        <string>Keep play time</string>
 | 
					 | 
				
			||||||
       </property>
 | 
					       </property>
 | 
				
			||||||
      </widget>
 | 
					      </widget>
 | 
				
			||||||
     </item>
 | 
					     </item>
 | 
				
			||||||
@@ -172,10 +171,34 @@
 | 
				
			|||||||
       </property>
 | 
					       </property>
 | 
				
			||||||
      </widget>
 | 
					      </widget>
 | 
				
			||||||
     </item>
 | 
					     </item>
 | 
				
			||||||
     <item row="1" column="0">
 | 
					     <item row="5" column="1">
 | 
				
			||||||
      <widget class="QCheckBox" name="selectAllCheckbox">
 | 
					      <widget class="QCheckBox" name="copyServersCheckbox">
 | 
				
			||||||
       <property name="text">
 | 
					       <property name="text">
 | 
				
			||||||
        <string>Select all</string>
 | 
					        <string>Copy servers</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="6" column="0">
 | 
				
			||||||
 | 
					      <widget class="QCheckBox" name="copyResPacksCheckbox">
 | 
				
			||||||
 | 
					       <property name="enabled">
 | 
				
			||||||
 | 
					        <bool>true</bool>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>Copy resource packs</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="1" column="0">
 | 
				
			||||||
 | 
					      <widget class="QCheckBox" name="keepPlaytimeCheckbox">
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>Keep play time</string>
 | 
				
			||||||
 | 
					       </property>
 | 
				
			||||||
 | 
					      </widget>
 | 
				
			||||||
 | 
					     </item>
 | 
				
			||||||
 | 
					     <item row="1" column="1">
 | 
				
			||||||
 | 
					      <widget class="QCheckBox" name="copyScreenshotsCheckbox">
 | 
				
			||||||
 | 
					       <property name="text">
 | 
				
			||||||
 | 
					        <string>Copy screenshots</string>
 | 
				
			||||||
       </property>
 | 
					       </property>
 | 
				
			||||||
      </widget>
 | 
					      </widget>
 | 
				
			||||||
     </item>
 | 
					     </item>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user