[kde-doc-english] [ark] /: Rename the File menu as Archive menu
Elvis Angelaccio
elvis.angelaccio at kdemail.net
Thu Jan 14 19:13:10 UTC 2016
Git commit 7f83b4125b43da58c9bd08aacc64ee4164bb060e by Elvis Angelaccio.
Committed on 14/01/2016 at 19:06.
Pushed by elvisangelaccio into branch 'master'.
Rename the File menu as Archive menu
Since an archive is a file that contains other files, the current Ark menu
structure can be confusing. The File menu currently contains actions regarding the
archive, while the Action menu contains actions regarding the files within the
archive.
This patch renames the File menu as Archive menu, to reduce this ambiguity.
Task: T915
Differential Revision: D788
GUI:
M +11 -4 app/arkui.rc
M +6 -4 app/mainwindow.cpp
M +4 -4 part/ark_part.rc
M +1 -1 part/part.cpp
M +0 -1 part/part.h
http://commits.kde.org/ark/7f83b4125b43da58c9bd08aacc64ee4164bb060e
diff --git a/app/arkui.rc b/app/arkui.rc
index 6775c33..ea842d5 100644
--- a/app/arkui.rc
+++ b/app/arkui.rc
@@ -1,8 +1,15 @@
<!DOCTYPE kpartgui>
-<kpartgui name="ark" version="12">
+<kpartgui name="ark" version="13">
<MenuBar>
- <Menu name="file">
+ <Menu name="archive">
+ <text>&Archive</text>
+ <Action name="ark_file_new"/>
+ <Action name="ark_file_open"/>
+ <Action name="ark_file_open_recent"/>
+ <Separator/>
<DefineGroup name="file_save" append="save_merge"/>
+ <Separator/>
+ <Action name="ark_quit"/>
</Menu>
<Merge/>
<Menu name="settings">
@@ -11,7 +18,7 @@
</MenuBar>
<ToolBar noMerge="1" name="mainToolBar">
<text>Main Toolbar</text>
- <Action name="file_new"/>
- <Action name="file_open"/>
+ <Action name="ark_file_new"/>
+ <Action name="ark_file_open"/>
</ToolBar>
</kpartgui>
diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp
index 6fc1226..6c11bd9 100644
--- a/app/mainwindow.cpp
+++ b/app/mainwindow.cpp
@@ -162,11 +162,13 @@ bool MainWindow::loadPart()
void MainWindow::setupActions()
{
- m_newAction = KStandardAction::openNew(this, SLOT(newArchive()), actionCollection());
- m_openAction = KStandardAction::open(this, SLOT(openArchive()), actionCollection());
- KStandardAction::quit(this, SLOT(quit()), actionCollection());
+ m_newAction = actionCollection()->addAction(KStandardAction::New, QStringLiteral("ark_file_new"), this, SLOT(newArchive()));
+ m_openAction = actionCollection()->addAction(KStandardAction::Open, QStringLiteral("ark_file_open"), this, SLOT(openArchive()));
+ actionCollection()->addAction(KStandardAction::Quit, QStringLiteral("ark_quit"), this, SLOT(quit()));
+
+ m_recentFilesAction = KStandardAction::openRecent(this, SLOT(openUrl(QUrl)), Q_NULLPTR);
+ actionCollection()->addAction(QStringLiteral("ark_file_open_recent"), m_recentFilesAction);
- m_recentFilesAction = KStandardAction::openRecent(this, SLOT(openUrl(QUrl)), actionCollection());
m_recentFilesAction->setToolBarMode(KRecentFilesAction::MenuMode);
m_recentFilesAction->setToolButtonPopupMode(QToolButton::DelayedPopup);
m_recentFilesAction->setIconText(i18nc("action, to open an archive", "Open"));
diff --git a/part/ark_part.rc b/part/ark_part.rc
index 48176c1..8698f6a 100644
--- a/part/ark_part.rc
+++ b/part/ark_part.rc
@@ -1,9 +1,9 @@
<!DOCTYPE kpartgui>
-<kpartgui name="ark_part" version="3">
+<kpartgui name="ark_part" version="4">
<MenuBar>
- <Menu name="file">
- <text>&File</text>
- <Action name="file_save_as" group="file_save"/>
+ <Menu name="archive">
+ <text>&Archive</text>
+ <Action name="ark_file_save_as" group="file_save"/>
</Menu>
<Menu name="action">
<text>&Action</text>
diff --git a/part/part.cpp b/part/part.cpp
index 781c82f..c5b322d 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -286,7 +286,7 @@ void Part::setupActions()
connect(m_showInfoPanelAction, &QAction::triggered,
this, &Part::slotToggleInfoPanel);
- m_saveAsAction = KStandardAction::saveAs(this, SLOT(slotSaveAs()), actionCollection());
+ actionCollection()->addAction(KStandardAction::SaveAs, QStringLiteral("ark_file_save_as"), this, SLOT(slotSaveAs()));
m_openFileAction = actionCollection()->addAction(QStringLiteral("openfile"));
m_openFileAction->setText(i18nc("open a file with external program", "&Open File"));
diff --git a/part/part.h b/part/part.h
index 1253038..9913ce9 100644
--- a/part/part.h
+++ b/part/part.h
@@ -131,7 +131,6 @@ private:
QAction *m_addFilesAction;
QAction *m_addDirAction;
QAction *m_deleteFilesAction;
- QAction *m_saveAsAction;
KToggleAction *m_showInfoPanelAction;
InfoPanel *m_infoPanel;
QSplitter *m_splitter;
More information about the kde-doc-english
mailing list