Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the option for specify the project title on packaged project #615

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion qfieldsync/gui/package_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def __init__(self, iface, project, offline_editing, parent=None):
self.qfield_preferences = Preferences()
self.dirsToCopyWidget = DirsToCopyWidget()
self.__project_configuration = ProjectConfiguration(self.project)
self.project_lbl.setText(get_project_title(self.project))
self.packaged_project_filename.setText(self.project.baseName())
self.packaged_project_title.setText(get_project_title(self.project))

self.button_box.button(QDialogButtonBox.Save).setText(self.tr("Create"))
self.button_box.button(QDialogButtonBox.Save).clicked.connect(
self.package_project
Expand Down Expand Up @@ -171,6 +173,8 @@ def package_project(self):
offline_convertor = OfflineConverter(
self.project,
export_folder,
self.packaged_project_filename.text(),
self.packaged_project_title.text(),
area_of_interest,
area_of_interest_crs,
self.qfield_preferences.value("attachmentDirs"),
Expand Down
4 changes: 3 additions & 1 deletion qfieldsync/gui/synchronize_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def start_synchronization(self):
self.offline_editing.synchronize()

project_config = ProjectConfiguration(QgsProject.instance())
original_path = Path(project_config.original_project_path or "")
original_path = Path(
current_path or project_config.original_project_path or ""
)

if not original_path.exists():
answer = QMessageBox.warning(
Expand Down
75 changes: 47 additions & 28 deletions qfieldsync/ui/package_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,61 @@
<x>0</x>
<y>0</y>
<width>599</width>
<height>570</height>
<height>700</height>
</rect>
</property>
<property name="windowTitle">
<string>Package Project for QField</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
<widget class="QLabel" name="label_2">
<property name="styleSheet">
<string notr="true">bold</string>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Project:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="project_lbl">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
<property name="text">
<string>&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Packaged Project Name&lt;/span&gt;&lt;/p&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
SeqLaz marked this conversation as resolved.
Show resolved Hide resolved
</widget>
</item>
<item>
<widget class="QLineEdit" name="packaged_project_filename">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Packaged Project Title&lt;/span&gt;&lt;/p&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
SeqLaz marked this conversation as resolved.
Show resolved Hide resolved
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="packaged_project_title">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="stackedWidget">
Expand Down
Loading