#
#
# patch "guitone/res/forms/switch_workspace.ui"
# from [84d6a64e2f799a5cb951836b6293045bbb34c324]
# to [25519f7cd2c2dc10c6da8c687ffe18cf46cf8102]
#
# patch "guitone/res/i18n/guitone_de.ts"
# from [3dfb593e7bf0a3b023a4aaf32f65a59fb7a03ecb]
# to [e2d0e1ece65602423d9df61828e8d0911b4579b3]
#
# patch "guitone/src/view/dialogs/RevisionManifest.cpp"
# from [e35d765f7bc50c3dbd3497a9b87c2d73e53be2cd]
# to [87c413184dee30b528d784b2f67d448d45f10ff7]
#
# patch "guitone/src/view/dialogs/RevisionManifest.h"
# from [5c1fb28b9275b8bd7c49500f3116f7e5ceff1921]
# to [b80762f7d4c1d059349eefdfcb2e69fa8c175842]
#
# patch "guitone/src/view/dialogs/SwitchWorkspaceRevision.cpp"
# from [a622d1e2fedd078e3307ca233bdf1298554de5a6]
# to [127bd106bdfb66f43381f824a2a831a8eb97a4d0]
#
# patch "guitone/src/view/dialogs/SwitchWorkspaceRevision.h"
# from [4bd70e9d2d2583e5919f07072d3d581506c6f0b0]
# to [563297ef26ccbcbcfbb94e0d60d30a2ff3ddd272]
#
============================================================
--- guitone/res/forms/switch_workspace.ui 84d6a64e2f799a5cb951836b6293045bbb34c324
+++ guitone/res/forms/switch_workspace.ui 25519f7cd2c2dc10c6da8c687ffe18cf46cf8102
@@ -68,7 +68,7 @@
Qt::Vertical
-
+
0
@@ -100,7 +100,7 @@
false
- Select first revision
+ Select as first revision
@@ -110,7 +110,7 @@
false
- Select second revision
+ Select as second revision
============================================================
--- guitone/res/i18n/guitone_de.ts 3dfb593e7bf0a3b023a4aaf32f65a59fb7a03ecb
+++ guitone/res/i18n/guitone_de.ts e2d0e1ece65602423d9df61828e8d0911b4579b3
@@ -1118,30 +1118,45 @@ monotone gab zurück:
RevisionManifest
-
+
Fehler
-
+
Kann keine Dateien auf Ihrer Plattform öffnen - bitte kontaktieren Sie den Autor über dieses Problem.
-
+
Bitte schliessen Sie diesen Dialog, um die temporäre Datei zu entfernen.
-
+
Information
-
+
- Sie können keine Verzeichnisse öffnen, die nicht ausgecheckt wurden.
+ Sie können keine Verzeichnisse öffnen, die nicht ausgecheckt wurden.
+
+
+
+ Datei öffnen
+
+
+
+
+ Selektierte speichern
+
+
+
+
+ Alle speichern
+
Select
@@ -1209,12 +1224,12 @@ monotone gab zurück:
Revision
-
+
Ungültige Auswahl
-
+
Die eingegebene Auswahl kann nicht ausgeführt werden: %1
@@ -1224,24 +1239,24 @@ monotone gab zurück:
Kombiniert
-
+
Konnte Kommando nicht ausführen
-
+
Konnte '%1' nicht ausführen - eventuell läuft noch ein anderes Kommando?
- Erste Revision auswählen
+ Erste Revision auswählen
- Zweite Revision auswählen
+ Zweite Revision auswählen
@@ -1249,15 +1264,35 @@ monotone gab zurück:
Ãnderungen anzeigen
-
+
Erste: %1...
-
+
Zweite: %1...
+
+
+
+ Als erste Revision auswählen
+
+
+
+
+ Als zweite Revision auswählen
+
+
+
+
+ Dateien
+
+
+
+
+ Zeige Dateien dieser Revision
+
Tags
============================================================
--- guitone/src/view/dialogs/RevisionManifest.cpp e35d765f7bc50c3dbd3497a9b87c2d73e53be2cd
+++ guitone/src/view/dialogs/RevisionManifest.cpp 87c413184dee30b528d784b2f67d448d45f10ff7
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
RevisionManifest::RevisionManifest(QWidget* parent, QString rev)
: Dialog(parent), revision(rev)
@@ -52,6 +53,11 @@ RevisionManifest::RevisionManifest(QWidg
this, SLOT(openFile(const QModelIndex &))
);
+ connect(
+ manifestView, SIGNAL(contextMenuRequested(const QModelIndexList &, const QPoint &)),
+ this, SLOT(contextMenuRequested(const QModelIndexList &, const QPoint &))
+ );
+
if (!manifestModel->readManifest(revision))
{
qCritical("RevisionManifest: couldn't execute readManifest");
@@ -93,15 +99,8 @@ void RevisionManifest::openFile(const QM
ManifestEntry * entry = static_cast(index.internalPointer());
- if (entry->is_directory)
- {
- QMessageBox::information(
- this,
- tr("Information"),
- tr("You can't open directories which are not checked out.")
- );
- return;
- }
+ // return silently
+ if (entry->is_directory) return;
Monotone * mtn = Monotone::singleton();
@@ -170,3 +169,40 @@ void RevisionManifest::openFile(const QM
file.remove();
}
+void RevisionManifest::contextMenuRequested(const QModelIndexList & indexList, const QPoint & pos)
+{
+ if (indexList.size() == 0) return;
+
+ QMenu menu(this);
+ QFont activeFont;
+ activeFont.setBold(true);
+
+ QAction * actOpenFile = menu.addAction(tr("Open file"));
+ QAction * actSaveSelected = menu.addAction(tr("Save selected"));
+ QAction * actSaveAll = menu.addAction(tr("Save all"));
+
+ if (indexList.size() == 1 &&
+ !static_cast(indexList.at(0).internalPointer())->is_directory)
+ {
+ actOpenFile->setFont(activeFont);
+ }
+ else
+ {
+ actOpenFile->setVisible(false);
+ }
+
+ QAction * act = menu.exec(pos);
+ if (act == actOpenFile)
+ {
+ openFile(indexList.at(0));
+ }
+ else if (act == actSaveSelected)
+ {
+ // TODO: some method call
+ }
+ else if (act == actSaveAll)
+ {
+ // TODO: some method call
+ }
+}
+
============================================================
--- guitone/src/view/dialogs/RevisionManifest.h 5c1fb28b9275b8bd7c49500f3116f7e5ceff1921
+++ guitone/src/view/dialogs/RevisionManifest.h b80762f7d4c1d059349eefdfcb2e69fa8c175842
@@ -41,6 +41,7 @@ private slots:
void saveSelectedFiles();
void saveAllFiles();
void openFile(const QModelIndex &);
+ void contextMenuRequested(const QModelIndexList &, const QPoint &);
};
#endif
============================================================
--- guitone/src/view/dialogs/SwitchWorkspaceRevision.cpp a622d1e2fedd078e3307ca233bdf1298554de5a6
+++ guitone/src/view/dialogs/SwitchWorkspaceRevision.cpp 127bd106bdfb66f43381f824a2a831a8eb97a4d0
@@ -90,11 +90,15 @@ SwitchWorkspaceRevision::SwitchWorkspace
this, SLOT(enableDiffButtons(const QModelIndex &))
);
- // show the manifest on double-click
+ // show the manifest on double-click and right-click (context menu)
connect(
revisionList, SIGNAL(doubleClicked(const QModelIndex &)),
- this, SLOT(openManifestDialog(const QModelIndex &))
+ this, SLOT(revListDoubleClicked(const QModelIndex &))
);
+ connect(
+ revisionList, SIGNAL(contextMenuRequested(const QModelIndexList &, const QPoint &)),
+ this, SLOT(contextMenuRequested(const QModelIndexList &, const QPoint &))
+ );
// handle selector errors
connect(
@@ -127,7 +131,15 @@ SwitchWorkspaceRevision::SwitchWorkspace
okButton->setEnabled(false);
}
-SwitchWorkspaceRevision::~SwitchWorkspaceRevision() {}
+SwitchWorkspaceRevision::~SwitchWorkspaceRevision()
+{
+ delete selectorModel;
+ delete sortModel;
+ delete certsModel;
+ delete branchesModel;
+ delete tagsModel;
+ delete keysModel;
+}
void SwitchWorkspaceRevision::triggerRevisionSearch()
{
@@ -340,13 +352,44 @@ void SwitchWorkspaceRevision::readCerts(
}
}
-void SwitchWorkspaceRevision::openManifestDialog(const QModelIndex & index)
+void SwitchWorkspaceRevision::openManifestDialog(const QString & rev)
{
+ RevisionManifest dlg(this, rev);
+ dlg.exec();
+}
+
+void SwitchWorkspaceRevision::revListDoubleClicked(const QModelIndex & index)
+{
if (!index.isValid()) return;
+ openManifestDialog(index.data().toString());
+}
+
+void SwitchWorkspaceRevision::contextMenuRequested(const QModelIndexList & indexList, const QPoint & pos)
+{
+ if (indexList.size() == 0) return;
+ QString rev(indexList.at(0).data().toString());
- QString rev(index.data().toString());
+ QMenu menu(this);
+ QFont activeFont;
+ activeFont.setBold(true);
- RevisionManifest dlg(this, rev);
- dlg.exec();
+ QAction * actOpenManifest = menu.addAction(tr("View files in this revision"));
+ actOpenManifest->setFont(activeFont);
+ QAction * actSetFirstRevision = menu.addAction(tr("Select as first revision"));
+ QAction * actSetSecondRevision = menu.addAction(tr("Select as second revision"));
+
+ QAction * act = menu.exec(pos);
+ if (act == actOpenManifest)
+ {
+ openManifestDialog(rev);
+ }
+ else if (act == actSetFirstRevision)
+ {
+ setFirstRevision();
+ }
+ else if (act == actSetSecondRevision)
+ {
+ setSecondRevision();
+ }
}
============================================================
--- guitone/src/view/dialogs/SwitchWorkspaceRevision.h 4bd70e9d2d2583e5919f07072d3d581506c6f0b0
+++ guitone/src/view/dialogs/SwitchWorkspaceRevision.h 563297ef26ccbcbcfbb94e0d60d30a2ff3ddd272
@@ -41,6 +41,8 @@ private:
~SwitchWorkspaceRevision();
private:
+ void openManifestDialog(const QString &);
+
Select * selectorModel;
Toposort * sortModel;
Certs * certsModel;
@@ -64,7 +66,8 @@ private slots:
void enableDiffButtons(const QModelIndex &);
void showDiffDialog();
void readCerts(const QModelIndex &);
- void openManifestDialog(const QModelIndex &);
+ void revListDoubleClicked(const QModelIndex &);
+ void contextMenuRequested(const QModelIndexList &, const QPoint &);
};
#endif