Skip to content

Commit

Permalink
Modify: Keep the dialog size
Browse files Browse the repository at this point in the history
  • Loading branch information
ambiesoft committed Apr 13, 2023
1 parent 99a4e05 commit 886225d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
4 changes: 4 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023/04/14 1.22.42
Modify: Added "Choose..." on the Exteral Tools dialog
Modify: Keep the dialog size

2023/04/12 1.22.41
Add ${appfullpath} and ${appdirectoryfullpath} to external tool macros

Expand Down
5 changes: 4 additions & 1 deletion src/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Consts
Q_CONSTEXPR char ORGANIZATION[] = "Ambiesoft";
Q_CONSTEXPR char APPDOMAIN[] = "ambiesoft.com";
Q_CONSTEXPR char APPNAME[] = "SceneExplorer";
Q_CONSTEXPR char APPVERSION[] = "1.22.41";
Q_CONSTEXPR char APPVERSION[] = "1.22.42";


Q_CONSTEXPR char KEY_STYLE[] = "style";
Expand Down Expand Up @@ -91,6 +91,7 @@ Q_CONSTEXPR char KEY_FONT_STATUSBAR[] = "fontstatusbar";
Q_CONSTEXPR char KEY_FONT_DOCKINGWINDOW[] = "fontdockingwindow";

Q_CONSTEXPR char KEY_EXTERNALTOOLS_LASTSELECTEDEXEDIR[] = "externaltoolslastselectedexedir";
Q_CONSTEXPR char KEY_EXTERNALTOOLS_DIALOGGEOMETRY[] = "externaltoolsdialoggeometry";

Q_CONSTEXPR char KEY_EXTERNALTOOLS_COUNT[] = "externaltoolscount";
Q_CONSTEXPR char KEY_EXTERNALTOOLS_GROUPPRIX[] = "externaltool_";
Expand All @@ -99,6 +100,8 @@ Q_CONSTEXPR char KEY_EXTERNALTOOLS_EXE[] = "externaltoolexe";
Q_CONSTEXPR char KEY_EXTERNALTOOLS_ARG[] = "externaltoolarg";
Q_CONSTEXPR char KEY_EXTERNALTOOLS_COUNTASOPEN[] = "externaltoolcountasopen";

Q_CONSTEXPR char KEY_OPTION_DIALOGGEOMETRY[] = "optiondialoggeometry";


Q_CONSTEXPR char KEY_RECENT_OPENDOCUMENTS[] = "recentdocuments";
Q_CONSTEXPR char KEY_SORT[] = "sort";
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void MainWindow::on_tableView_doubleClicked(const QModelIndex &index)

void MainWindow::on_action_Options_triggered()
{
OptionDialog dlg(this);
OptionDialog dlg(settings_,this);
dlg.maxgd_ = optionThreadcountGetDir();
dlg.maxff_ = optionThreadcountThumbnail();
dlg.thumbCount_ = optionThumbCount_;
Expand Down
9 changes: 6 additions & 3 deletions src/optiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
#include "helper.h"
#include "optiondialog.h"

using namespace Consts;
using namespace AmbiesoftQt;

OptionDialog::OptionDialog(QWidget* parent)
OptionDialog::OptionDialog(AmbiesoftQt::IniSettings& settings, QWidget* parent)
: QDialog(parent,GetDefaultDialogFlags()),
settings_(settings),
imagecache_(IC_NEVER)
{
ui.setupUi(this);
Expand All @@ -58,8 +60,8 @@ OptionDialog::OptionDialog(QWidget* parent)
ui.cmbTagMenuFormat->addItem(tr("Submenu with Text"));
ui.cmbTagMenuFormat->addItem(tr("Submenu with Yomi"));



restoreGeometry(settings.value(KEY_OPTION_DIALOGGEOMETRY).toByteArray());
CenterWidgets(this);
setWindowTitle(tr("option"));
}

Expand Down Expand Up @@ -150,6 +152,7 @@ void OptionDialog::showEvent(QShowEvent *ev)
}
void OptionDialog::on_buttonBox_accepted()
{
settings_.setValue(KEY_OPTION_DIALOGGEOMETRY, saveGeometry());
}
void OptionDialog::accept()
{
Expand Down
4 changes: 3 additions & 1 deletion src/optiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef OPTIONDIALOG_H
#define OPTIONDIALOG_H

#include "../../lsMisc/stdQt/inisettings.h"

#include "ui_option.h"

Expand All @@ -31,12 +32,13 @@ class OptionDialog:public QDialog

private:
Ui::Option ui;
AmbiesoftQt::IniSettings& settings_;
QString lastSelectedDir_;

void on_setFileCommon(QLineEdit* le);

public:
OptionDialog(QWidget* parent = nullptr);
OptionDialog(AmbiesoftQt::IniSettings& settings, QWidget* parent = nullptr);

QString mainText_,subText_;
ImageCacheType imagecache_;
Expand Down
5 changes: 5 additions & 0 deletions src/optionexternaltoolsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ OptionExternalToolsDialog::OptionExternalToolsDialog(IniSettings& settings, QWid
ui(new Ui::OptionExternalToolsDialog)
{
ui->setupUi(this);

lastSelectedExeDir_ = settings_.valueString(KEY_EXTERNALTOOLS_LASTSELECTEDEXEDIR);
restoreGeometry(settings.value(KEY_EXTERNALTOOLS_DIALOGGEOMETRY).toByteArray());
CenterWidgets(this);
setWindowTitle(tr("Option") + " | " + tr("External tools"));
}
void OptionExternalToolsDialog::showEvent(QShowEvent *ev)
Expand Down Expand Up @@ -274,6 +277,8 @@ void OptionExternalToolsDialog::on_buttonBox_accepted()
ExternalToolWidgetItem* item = (ExternalToolWidgetItem*)ui->listWidget->item(i);
items_.append(item->GetItem());
}

settings_.setValue(KEY_EXTERNALTOOLS_DIALOGGEOMETRY,saveGeometry());
}
void OptionExternalToolsDialog::UpdateData()
{
Expand Down

0 comments on commit 886225d

Please sign in to comment.