Skip to content

Commit 5129b5a

Browse files
committed
Fixed transforms dialog;
Renamed signals with camel case;
1 parent c68e264 commit 5129b5a

11 files changed

+149
-47
lines changed

MPSEngine.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ struct MPSNotify
1515
};
1616
/* End Utility Structures */
1717

18-
/* BEGIN MPSEngine */
1918
MPSEngine::MPSEngine()
2019
: m_master_token (0),
2120
m_rename_to (L""),
@@ -471,6 +470,4 @@ bool MPSEngine::is_token_current_root(const MPSToken* token) const
471470
return false;
472471

473472
return (token == m_master_token);
474-
}
475-
476-
/* END MPSEngine */
473+
}

MPSMainWindow.cpp

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -379,26 +379,26 @@ void MPSMainWindow::load_dialog_state (const QString& title, const MPSTransformI
379379
/** BEGIN utility methods **/
380380
void MPSMainWindow::connect_events ()
381381
{
382-
connect(m_files_model, SIGNAL(directoryLoaded(QString)), this, SLOT(on_files_model_directory_loaded(QString)));
382+
connect(m_files_model, SIGNAL(directoryLoaded(QString)), this, SLOT(on_filesModelDirectoryLoaded(QString)));
383383

384384
// dialog events
385-
connect(m_dlg_trans_cmb_condition, SIGNAL(currentIndexChanged(int)), this, SLOT(on_cmb_conditions_index_changed(int)));
386-
connect(m_dlg_trans_cmb_action, SIGNAL(currentIndexChanged(int)), this, SLOT(on_cmb_actions_index_changed(int)));
387-
connect(m_dlg_trans_edit_cond_text, SIGNAL(textEdited(const QString&)), this, SLOT(on_edit_cond_text_text_edited(const QString&)));
388-
connect(m_dlg_trans_edit_act_text_1, SIGNAL(textEdited(const QString&)), this, SLOT(on_edit_act_text_text_edited(QString)));
389-
connect(m_dlg_trans_edit_pos, SIGNAL(textChanged(QString)), this, SLOT(on_edit_act_pos_text_changed(const QString&)));
390-
connect(m_dlg_trans_btn_close, SIGNAL(clicked()), this, SLOT(on_btn_close_clicked()));
391-
connect(m_dlg_trans_btn_save, SIGNAL(clicked()), this, SLOT(on_btn_save_clicked()));
385+
connect(m_dlg_trans_cmb_condition, SIGNAL(currentIndexChanged(int)), this, SLOT(on_cmbConditionsIndexChanged(int)));
386+
connect(m_dlg_trans_cmb_action, SIGNAL(currentIndexChanged(int)), this, SLOT(on_cmbActionsIndexChanged(int)));
387+
connect(m_dlg_trans_edit_cond_text, SIGNAL(textEdited(const QString&)), this, SLOT(on_editCondTextTextEdited(const QString&)));
388+
connect(m_dlg_trans_edit_act_text_1, SIGNAL(textEdited(const QString&)), this, SLOT(on_editActionsTextTextEdited(QString)));
389+
connect(m_dlg_trans_edit_pos, SIGNAL(textChanged(QString)), this, SLOT(on_editActionsPosTextChanged(const QString&)));
390+
connect(m_dlg_trans_btn_close, SIGNAL(clicked()), this, SLOT(on_btnCloseClicked()));
391+
connect(m_dlg_trans_btn_save, SIGNAL(clicked()), this, SLOT(on_btnSaveClicked()));
392392

393393
// connect scroll bars' motion
394394
QScrollBar* files_vert_scroll = m_gui_obj.lstFiles->verticalScrollBar();
395395
QScrollBar* files_horiz_scroll = m_gui_obj.lstFiles->horizontalScrollBar();
396396
QScrollBar* rename_to_vert_scroll = m_gui_obj.lstRenames->verticalScrollBar();
397397
QScrollBar* rename_to_horiz_scroll = m_gui_obj.lstRenames->horizontalScrollBar();
398-
connect(files_vert_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_lst_files_vertical_slider_value_changed(int)));
399-
connect(files_horiz_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_lst_files_horizontal_slider_value_changed(int)));
400-
connect(rename_to_vert_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_lst_rename_to_vertical_slider_value_changed(int)));
401-
connect(rename_to_horiz_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_lst_rename_to_horizontal_slider_value_changed(int)));
398+
connect(files_vert_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_listFilesVerticalSliderValueChanged(int)));
399+
connect(files_horiz_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_lstFilesHorizontalSliderValueChanged(int)));
400+
connect(rename_to_vert_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_lstRenameToVerticalSliderValueChanged(int)));
401+
connect(rename_to_horiz_scroll, SIGNAL(valueChanged(int)), this, SLOT(on_lstRenameToHorizontalSliderValueChanged(int)));
402402
}
403403

404404
void MPSMainWindow::create_view_models ()
@@ -431,6 +431,13 @@ void MPSMainWindow::create_view_models ()
431431

432432
m_gui_obj.lstFiles->setModel(m_files_model);
433433
m_gui_obj.lstFiles->setEditTriggers(QAbstractItemView::NoEditTriggers);
434+
435+
// load last path
436+
/*xQString lastPath = "C:\\Users\\USER\\Desktop\\Dan\\NOVA_MUZICA";
437+
QModelIndex index = m_folders_model->setRootPath(lastPath);
438+
m_gui_obj.tvFolders->setRootIndex(index);
439+
*/
440+
434441
}
435442

436443
QString MPSMainWindow::get_drive_label(const QString& drive)
@@ -451,7 +458,7 @@ QString MPSMainWindow::get_drive_label(const QString& drive)
451458
256);
452459
if (!ret) return QString("");
453460
QString name = QString::fromUtf16 ((const ushort*) szVolumeName);
454-
name.trimmed();
461+
(void) name.trimmed();
455462

456463
return name;
457464
}
@@ -1118,7 +1125,7 @@ void MPSMainWindow::on_lstFiles_pressed(const QModelIndex &index)
11181125
on_current_file_changed(index);
11191126
}
11201127

1121-
void MPSMainWindow::on_files_model_directory_loaded (QString)
1128+
void MPSMainWindow::on_filesModelDirectoryLoaded (QString)
11221129
{
11231130
// sort the model before filling in the renames' list
11241131
m_files_model->sort(0);
@@ -1129,22 +1136,22 @@ void MPSMainWindow::on_files_model_directory_loaded (QString)
11291136
m_gui_obj.lstRenames->setEnabled(true);
11301137
}
11311138

1132-
void MPSMainWindow::on_lst_files_vertical_slider_value_changed (int value)
1139+
void MPSMainWindow::on_listFilesVerticalSliderValueChanged (int value)
11331140
{
11341141
m_gui_obj.lstRenames->verticalScrollBar()->setValue(value);
11351142
}
11361143

1137-
void MPSMainWindow::on_lst_files_horizontal_slider_value_changed (int value)
1144+
void MPSMainWindow::on_lstFilesHorizontalSliderValueChanged (int value)
11381145
{
11391146
m_gui_obj.lstRenames->horizontalScrollBar()->setValue(value);
11401147
}
11411148

1142-
void MPSMainWindow::on_lst_rename_to_vertical_slider_value_changed (int value)
1149+
void MPSMainWindow::on_lstRenameToVerticalSliderValueChanged (int value)
11431150
{
11441151
m_gui_obj.lstFiles->verticalScrollBar()->setValue(value);
11451152
}
11461153

1147-
void MPSMainWindow::on_lst_rename_to_horizontal_slider_value_changed (int value)
1154+
void MPSMainWindow::on_lstRenameToHorizontalSliderValueChanged (int value)
11481155
{
11491156
m_gui_obj.lstFiles->horizontalScrollBar()->setValue(value);
11501157
}
@@ -1159,7 +1166,7 @@ void MPSMainWindow::on_btnAddTransform_clicked()
11591166
m_dlg_trans->show();
11601167
}
11611168

1162-
void MPSMainWindow::on_cmb_conditions_index_changed (int idx)
1169+
void MPSMainWindow::on_cmbConditionsIndexChanged (int idx)
11631170
{
11641171
bool is_cond_equals = (idx == m_core_engine.get_available_condition_index(KConditionEqualsID));
11651172
m_dlg_trans_edit_cond_text->setVisible(is_cond_equals);
@@ -1179,7 +1186,7 @@ void MPSMainWindow::on_cmb_conditions_index_changed (int idx)
11791186
m_dlg_trans_edit_cond_text->setFocus();
11801187
}
11811188

1182-
void MPSMainWindow::on_cmb_actions_index_changed(int idx)
1189+
void MPSMainWindow::on_cmbActionsIndexChanged(int idx)
11831190
{
11841191
// action text
11851192
int idx_act_set_sep = m_core_engine.get_available_action_index (KActionSetSeparatorsID);
@@ -1214,23 +1221,23 @@ void MPSMainWindow::on_cmb_actions_index_changed(int idx)
12141221
m_dlg_trans_edit_act_text_1->setFocus();
12151222
}
12161223

1217-
void MPSMainWindow::on_edit_cond_text_text_edited (const QString& text)
1224+
void MPSMainWindow::on_editCondTextTextEdited (const QString& text)
12181225
{
12191226
Q_UNUSED(text);
12201227
QString msg;
12211228
m_dlg_trans_btn_save->setEnabled(can_enable_save_button(msg));
12221229
update_dialog_message(msg);
12231230
}
12241231

1225-
void MPSMainWindow::on_edit_act_text_text_edited (const QString& text)
1232+
void MPSMainWindow::on_editActionsTextTextEdited (const QString& text)
12261233
{
12271234
Q_UNUSED(text);
12281235
QString msg;
12291236
m_dlg_trans_btn_save->setEnabled(can_enable_save_button(msg));
12301237
update_dialog_message(msg);
12311238
}
12321239

1233-
void MPSMainWindow::on_edit_act_pos_text_changed (const QString& text)
1240+
void MPSMainWindow::on_editActionsPosTextChanged (const QString& text)
12341241
{
12351242
Q_UNUSED(text);
12361243
QString msg;
@@ -1245,7 +1252,7 @@ void MPSMainWindow::update_dialog_message (const QString& msg)
12451252
m_dlg_trans_lbl_msg->show();
12461253
}
12471254

1248-
void MPSMainWindow::on_btn_save_clicked()
1255+
void MPSMainWindow::on_btnSaveClicked()
12491256
{
12501257
// construct the information out of the dialog state
12511258
MPSTransformInfo info;
@@ -1289,7 +1296,7 @@ void MPSMainWindow::on_btn_save_clicked()
12891296
m_dlg_trans->close();
12901297
}
12911298

1292-
void MPSMainWindow::on_btn_close_clicked()
1299+
void MPSMainWindow::on_btnCloseClicked()
12931300
{
12941301
m_dlg_trans->close();
12951302
}

MPSMainWindow.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,18 @@ class MPSMainWindow : public QMainWindow, public MPSEngineObserver
104104
void log_to_console (const QString& err_msg);
105105

106106
private slots: // event handlers for tranforms dialog
107-
void on_cmb_conditions_index_changed (int idx);
108-
void on_cmb_actions_index_changed(int idx);
109-
void on_edit_act_text_text_edited (const QString& text);
110-
void on_edit_act_pos_text_changed (const QString& text);
111-
void on_edit_cond_text_text_edited (const QString& text);
112-
void on_btn_save_clicked();
113-
void on_btn_close_clicked();
107+
void on_cmbConditionsIndexChanged (int idx);
108+
void on_cmbActionsIndexChanged(int idx);
109+
void on_editActionsTextTextEdited (const QString& text);
110+
void on_editActionsPosTextChanged (const QString& text);
111+
void on_editCondTextTextEdited (const QString& text);
112+
void on_btnSaveClicked();
113+
void on_btnCloseClicked();
114114

115115
private slots: // event handlers for main window
116116
void on_cmbDrives_currentIndexChanged(int index);
117117
void on_tvFolders_clicked(const QModelIndex& index);
118-
void on_files_model_directory_loaded (QString);
118+
void on_filesModelDirectoryLoaded (QString);
119119
void on_btnAddTransform_clicked();
120120
void on_btnEditTransform_clicked();
121121
void on_btnRemoveTransform_clicked();
@@ -135,10 +135,10 @@ private slots: // event handlers for main window
135135
void on_btnUpcase_clicked();
136136
void on_btnLowcase_clicked();
137137
void on_chkEnableTransforms_stateChanged(int);
138-
void on_lst_files_vertical_slider_value_changed (int value);
139-
void on_lst_files_horizontal_slider_value_changed (int value);
140-
void on_lst_rename_to_vertical_slider_value_changed (int value);
141-
void on_lst_rename_to_horizontal_slider_value_changed (int value);
138+
void on_listFilesVerticalSliderValueChanged (int value);
139+
void on_lstFilesHorizontalSliderValueChanged (int value);
140+
void on_lstRenameToVerticalSliderValueChanged (int value);
141+
void on_lstRenameToHorizontalSliderValueChanged (int value);
142142
void on_editDefaultSeparators_textEdited(const QString&);
143143
void on_lstFiles_entered(const QModelIndex &index);
144144
void on_lstFiles_pressed(const QModelIndex &index);

MPSTransformsContainer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ std::wstring MPSTransformsContainer::get_transform_description_at (int idx) cons
107107

108108
MPSTransformInfo MPSTransformsContainer::get_transform_information_at (int idx) const
109109
{
110-
111110
MPSTransformInfo info;
112111

113-
if (idx < 0 || idx >= static_cast<int> (m_avail_act_info.size()))
112+
if (idx < 0 || idx >= static_cast<int> (m_transforms.size()))
114113
{
115114
#pragma message (FixReminder "On invalid index, maybe should return some default dummy MPSTransformInfo")
116115
return info;

MemphisNow.aps

23.6 KB
Binary file not shown.

MemphisNow.rc

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Microsoft Visual C++ generated resource script.
2+
//
3+
#include "resource.h"
4+
5+
#define APSTUDIO_READONLY_SYMBOLS
6+
/////////////////////////////////////////////////////////////////////////////
7+
//
8+
// Generated from the TEXTINCLUDE 2 resource.
9+
//
10+
#include "winres.h"
11+
12+
/////////////////////////////////////////////////////////////////////////////
13+
#undef APSTUDIO_READONLY_SYMBOLS
14+
15+
/////////////////////////////////////////////////////////////////////////////
16+
// English (United States) resources
17+
18+
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
19+
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
20+
#pragma code_page(1252)
21+
22+
#ifdef APSTUDIO_INVOKED
23+
/////////////////////////////////////////////////////////////////////////////
24+
//
25+
// TEXTINCLUDE
26+
//
27+
28+
1 TEXTINCLUDE
29+
BEGIN
30+
"resource.h\0"
31+
END
32+
33+
2 TEXTINCLUDE
34+
BEGIN
35+
"#include ""winres.h""\r\n"
36+
"\0"
37+
END
38+
39+
3 TEXTINCLUDE
40+
BEGIN
41+
"\r\n"
42+
"\0"
43+
END
44+
45+
#endif // APSTUDIO_INVOKED
46+
47+
48+
/////////////////////////////////////////////////////////////////////////////
49+
//
50+
// Icon
51+
//
52+
53+
// Icon with lowest ID value placed first to ensure application icon
54+
// remains consistent on all systems.
55+
IDI_ICON1 ICON "icons//cat.ico"
56+
57+
#endif // English (United States) resources
58+
/////////////////////////////////////////////////////////////////////////////
59+
60+
61+
62+
#ifndef APSTUDIO_INVOKED
63+
/////////////////////////////////////////////////////////////////////////////
64+
//
65+
// Generated from the TEXTINCLUDE 3 resource.
66+
//
67+
68+
69+
/////////////////////////////////////////////////////////////////////////////
70+
#endif // not APSTUDIO_INVOKED
71+

MemphisNow.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
<ClInclude Include="MPSToken.hpp" />
135135
<ClInclude Include="MPSTokenWidget.hpp" />
136136
<ClInclude Include="MPSTransformsContainer.hpp" />
137+
<ClInclude Include="resource.h" />
137138
<ClInclude Include="transforms\MPSActionBase.hpp" />
138139
<ClInclude Include="transforms\MPSActionChangeCase.hpp" />
139140
<ClInclude Include="transforms\MPSActionEnableDisable.hpp" />
@@ -149,6 +150,9 @@
149150
<ClInclude Include="transforms\MPSTransform.hpp" />
150151
<ClInclude Include="transforms\MPSTransformInfo.hpp" />
151152
</ItemGroup>
153+
<ItemGroup>
154+
<ResourceCompile Include="MemphisNow.rc" />
155+
</ItemGroup>
152156
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
153157
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
154158
<Import Project="$(QtMsBuild)\qt.targets" />

MemphisNow.vcxproj.filters

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@
162162
<ClInclude Include="transforms\MPSTransformInfo.hpp">
163163
<Filter>Header Files\transforms</Filter>
164164
</ClInclude>
165+
<ClInclude Include="resource.h">
166+
<Filter>Header Files</Filter>
167+
</ClInclude>
165168
</ItemGroup>
166169
<ItemGroup>
167170
<QtMoc Include="MPSMainWindow.hpp">
@@ -173,4 +176,9 @@
173176
<Filter>Form Files</Filter>
174177
</QtUic>
175178
</ItemGroup>
179+
<ItemGroup>
180+
<ResourceCompile Include="MemphisNow.rc">
181+
<Filter>Resource Files</Filter>
182+
</ResourceCompile>
183+
</ItemGroup>
176184
</Project>

MemphisNow.vcxproj.user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup />
44
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
5-
<QtLastBackgroundBuild>2022-07-29T15:04:19.7909148Z</QtLastBackgroundBuild>
5+
<QtLastBackgroundBuild>2022-07-29T16:07:51.8932449Z</QtLastBackgroundBuild>
66
</PropertyGroup>
77
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8-
<QtLastBackgroundBuild>2022-07-29T15:04:19.8533597Z</QtLastBackgroundBuild>
8+
<QtLastBackgroundBuild>2022-07-29T16:07:51.9628618Z</QtLastBackgroundBuild>
99
</PropertyGroup>
1010
</Project>

MemphisNowWindow.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>1198</width>
9+
<width>1164</width>
1010
<height>701</height>
1111
</rect>
1212
</property>
@@ -1711,7 +1711,7 @@
17111711
<rect>
17121712
<x>0</x>
17131713
<y>0</y>
1714-
<width>1198</width>
1714+
<width>1164</width>
17151715
<height>22</height>
17161716
</rect>
17171717
</property>

0 commit comments

Comments
 (0)