added import files into Profile menu

This commit is contained in:
Rafael 2016-04-13 00:47:07 +02:00
parent 6ff8de8972
commit f35647f76c
5 changed files with 25 additions and 4 deletions

View file

@ -325,8 +325,8 @@ void ProfileInterface::pictureDeleted_f(QWidget *picWidget_)
SnapmaticWidget *picWidget = (SnapmaticWidget*)picWidget_; SnapmaticWidget *picWidget = (SnapmaticWidget*)picWidget_;
SnapmaticPicture *picture = picWidget->getPicture(); SnapmaticPicture *picture = picWidget->getPicture();
if (picWidget->isSelected()) { picWidget->setSelected(false); } if (picWidget->isSelected()) { picWidget->setSelected(false); }
picWidget->close();
widgets.remove(picWidget); widgets.remove(picWidget);
picWidget->close();
picWidget->deleteLater(); picWidget->deleteLater();
pictures.removeAll(picture); pictures.removeAll(picture);
delete picture; delete picture;
@ -774,3 +774,8 @@ void ProfileInterface::deleteSelected()
QMessageBox::information(this, tr("Remove selected"), tr("No Snapmatic pictures or Savegames files are selected")); QMessageBox::information(this, tr("Remove selected"), tr("No Snapmatic pictures or Savegames files are selected"));
} }
} }
void ProfileInterface::importFiles()
{
on_cmdImport_clicked();
}

View file

@ -53,6 +53,7 @@ public slots:
void deselectAllWidgets(); void deselectAllWidgets();
void exportSelected(); void exportSelected();
void deleteSelected(); void deleteSelected();
void importFiles();
private slots: private slots:
void on_cmdCloseProfile_clicked(); void on_cmdCloseProfile_clicked();

View file

@ -250,3 +250,8 @@ void UserInterface::on_actionOptions_triggered()
optionsDialog->deleteLater(); optionsDialog->deleteLater();
delete optionsDialog; delete optionsDialog;
} }
void UserInterface::on_action_Import_triggered()
{
profileUI->importFiles();
}

View file

@ -53,6 +53,7 @@ private slots:
void on_actionExport_selected_triggered(); void on_actionExport_selected_triggered();
void on_actionDelete_selected_triggered(); void on_actionDelete_selected_triggered();
void on_actionOptions_triggered(); void on_actionOptions_triggered();
void on_action_Import_triggered();
private: private:
ProfileDatabase *profileDB; ProfileDatabase *profileDB;

View file

@ -154,11 +154,12 @@
<property name="title"> <property name="title">
<string>&amp;Profile</string> <string>&amp;Profile</string>
</property> </property>
<addaction name="actionSelect_all"/> <addaction name="action_Import"/>
<addaction name="actionDeselect_all"/>
<addaction name="separator"/>
<addaction name="actionExport_selected"/> <addaction name="actionExport_selected"/>
<addaction name="actionDelete_selected"/> <addaction name="actionDelete_selected"/>
<addaction name="separator"/>
<addaction name="actionSelect_all"/>
<addaction name="actionDeselect_all"/>
</widget> </widget>
<addaction name="menuFile"/> <addaction name="menuFile"/>
<addaction name="menuEdit"/> <addaction name="menuEdit"/>
@ -229,6 +230,14 @@
<string>Ctrl+R</string> <string>Ctrl+R</string>
</property> </property>
</action> </action>
<action name="action_Import">
<property name="text">
<string>&amp;Import files...</string>
</property>
<property name="shortcut">
<string>Ctrl+I</string>
</property>
</action>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>