mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 09:36:15 +00:00
Changed: Fixed an error when cancelling a merge window, added double click support on merge source. Fixed window scaling on merge windows.
This commit is contained in:
parent
e1a206385b
commit
34d5ecbb5f
5 changed files with 159 additions and 175 deletions
|
@ -6,101 +6,21 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>446</width>
|
<width>640</width>
|
||||||
<height>560</height>
|
<height>576</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>421</width>
|
|
||||||
<height>541</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>FTP Server informations</string>
|
<string>FTP Server informations</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>110</y>
|
|
||||||
<width>401</width>
|
|
||||||
<height>381</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Content</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>141</width>
|
|
||||||
<height>21</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Please select the file</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QTreeWidget" name="fileList">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>381</width>
|
|
||||||
<height>311</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">1</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>500</y>
|
|
||||||
<width>401</width>
|
|
||||||
<height>33</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPushButton" name="doneButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Done</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="cancelButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Cancel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>411</width>
|
|
||||||
<height>81</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
@ -131,8 +51,67 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Content</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Please select the file</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QTreeWidget" name="fileList">
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">1</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>378</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QPushButton" name="doneButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Done</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QPushButton" name="cancelButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="ftp_selection.qrc"/>
|
<include location="ftp_selection.qrc"/>
|
||||||
|
|
|
@ -14,7 +14,9 @@ CSourceDialog::CSourceDialog(QWidget *parent): QDialog(parent)
|
||||||
connect(_ui.ok_button, SIGNAL(clicked()), this, SLOT(OkButtonClicked()));
|
connect(_ui.ok_button, SIGNAL(clicked()), this, SLOT(OkButtonClicked()));
|
||||||
// Set signal and slot for "Cancel Button"
|
// Set signal and slot for "Cancel Button"
|
||||||
connect(_ui.cancel_button, SIGNAL(clicked()), this, SLOT(reject()));
|
connect(_ui.cancel_button, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
_ui.listWidget->setSortingEnabled(false);
|
_ui.sourceSelectionListWidget->setSortingEnabled(false);
|
||||||
|
connect(_ui.sourceSelectionListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
|
||||||
|
this, SLOT(itemDoubleClicked(QListWidgetItem *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert options in the source dialog. Options like: from FTP Server, from Local directory etc.
|
// Insert options in the source dialog. Options like: from FTP Server, from Local directory etc.
|
||||||
|
@ -24,14 +26,20 @@ void CSourceDialog::setSourceOptions(map<QListWidgetItem*,int> options)
|
||||||
|
|
||||||
for(it = options.begin(); it != options.end(); ++it)
|
for(it = options.begin(); it != options.end(); ++it)
|
||||||
{
|
{
|
||||||
_ui.listWidget->addItem((*it).first);
|
_ui.sourceSelectionListWidget->addItem((*it).first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSourceDialog::OkButtonClicked()
|
void CSourceDialog::OkButtonClicked()
|
||||||
{
|
{
|
||||||
selected_item = _ui.listWidget->currentItem();
|
selected_item = _ui.sourceSelectionListWidget->currentItem();
|
||||||
reject();
|
accept();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSourceDialog::itemDoubleClicked(QListWidgetItem *item)
|
||||||
|
{
|
||||||
|
selected_item = item;
|
||||||
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ private:
|
||||||
Ui::SourceSelectionDialog _ui;
|
Ui::SourceSelectionDialog _ui;
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void OkButtonClicked();
|
void OkButtonClicked();
|
||||||
|
void itemDoubleClicked(QListWidgetItem *item);
|
||||||
public:
|
public:
|
||||||
CSourceDialog(QWidget *parent = 0);
|
CSourceDialog(QWidget *parent = 0);
|
||||||
~CSourceDialog(){}
|
~CSourceDialog(){}
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>396</width>
|
<width>316</width>
|
||||||
<height>197</height>
|
<height>155</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -22,30 +22,17 @@
|
||||||
<property name="modal">
|
<property name="modal">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>381</width>
|
|
||||||
<height>181</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Select source for merge operation</string>
|
<string>Select source for merge operation</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<property name="geometry">
|
<item row="0" column="0">
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>30</y>
|
|
||||||
<width>361</width>
|
|
||||||
<height>141</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QListWidget" name="listWidget"/>
|
<widget class="QListWidget" name="sourceSelectionListWidget"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QPushButton" name="ok_button">
|
<widget class="QPushButton" name="ok_button">
|
||||||
|
@ -62,8 +49,11 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
@ -472,17 +472,23 @@ void CMainWindow::mergeSingleFile()
|
||||||
if(dialog->selected_item == local_item) // Local directory
|
if(dialog->selected_item == local_item) // Local directory
|
||||||
{
|
{
|
||||||
file_name = QFileDialog::getOpenFileName(this);
|
file_name = QFileDialog::getOpenFileName(this);
|
||||||
} else if(dialog->selected_item == ftp_item) { // Ftp directory
|
}
|
||||||
|
else if(dialog->selected_item == ftp_item) // Ftp directory
|
||||||
|
{
|
||||||
CFtpSelection* ftp_dialog = new CFtpSelection(this);
|
CFtpSelection* ftp_dialog = new CFtpSelection(this);
|
||||||
ftp_dialog->show();
|
ftp_dialog->show();
|
||||||
ftp_dialog->exec();
|
|
||||||
if(ftp_dialog->status == true)
|
if(ftp_dialog->exec() && ftp_dialog->status == true)
|
||||||
{
|
|
||||||
file_name = ftp_dialog->file->fileName();
|
file_name = ftp_dialog->file->fileName();
|
||||||
|
|
||||||
|
delete ftp_dialog;
|
||||||
}
|
}
|
||||||
} else {
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Make sure we retrieved a file name
|
||||||
|
if(file_name.isEmpty())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
editor_window->activateWindow();
|
editor_window->activateWindow();
|
||||||
CEditorWorksheet* current_window = qobject_cast<CEditorWorksheet*>(editor_window);
|
CEditorWorksheet* current_window = qobject_cast<CEditorWorksheet*>(editor_window);
|
||||||
|
|
Loading…
Reference in a new issue