-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ManageWorkingFolderDialog to handle favorite directories
- Loading branch information
Showing
16 changed files
with
320 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "ManageWorkingFolderDialog.h" | ||
#include "ui_ManageWorkingFolderDialog.h" | ||
|
||
ManageWorkingFolderDialog::ManageWorkingFolderDialog(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::ManageWorkingFolderDialog) | ||
{ | ||
ui->setupUi(this); | ||
settings_ = global->appsettings; | ||
SettingWorkingFolderForm::loadFavoliteDirs(&settings_.favorite_working_dirs); | ||
ui->widget->reset(nullptr, &settings_); | ||
ui->widget->exchange(false); | ||
} | ||
|
||
ManageWorkingFolderDialog::~ManageWorkingFolderDialog() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void ManageWorkingFolderDialog::accept() | ||
{ | ||
ui->widget->exchange(true); | ||
SettingWorkingFolderForm::saveFavoliteDirs(settings_.favorite_working_dirs); | ||
global->appsettings.favorite_working_dirs = settings_.favorite_working_dirs; | ||
QDialog::accept(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef MANAGEWORKINGFOLDERDIALOG_H | ||
#define MANAGEWORKINGFOLDERDIALOG_H | ||
|
||
#include "main.h" | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class ManageWorkingFolderDialog; | ||
} | ||
|
||
class ManageWorkingFolderDialog : public QDialog { | ||
Q_OBJECT | ||
private: | ||
ApplicationSettings settings_; | ||
public: | ||
explicit ManageWorkingFolderDialog(QWidget *parent = nullptr); | ||
~ManageWorkingFolderDialog(); | ||
|
||
private: | ||
Ui::ManageWorkingFolderDialog *ui; | ||
|
||
// QDialog interface | ||
public slots: | ||
void accept(); | ||
}; | ||
|
||
#endif // MANAGEWORKINGFOLDERDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ManageWorkingFolderDialog</class> | ||
<widget class="QDialog" name="ManageWorkingFolderDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Dialog</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="SettingWorkingFolderForm" name="widget" native="true"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pushButton"> | ||
<property name="text"> | ||
<string>OK</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pushButton_2"> | ||
<property name="text"> | ||
<string>Cancel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>SettingWorkingFolderForm</class> | ||
<extends>QWidget</extends> | ||
<header>SettingWorkingFolderForm.h</header> | ||
<container>1</container> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>pushButton</sender> | ||
<signal>clicked()</signal> | ||
<receiver>ManageWorkingFolderDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>233</x> | ||
<y>281</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>210</x> | ||
<y>278</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>pushButton_2</sender> | ||
<signal>clicked()</signal> | ||
<receiver>ManageWorkingFolderDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>375</x> | ||
<y>274</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>394</x> | ||
<y>279</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
Oops, something went wrong.