Skip to content

Commit 44a8e1f

Browse files
committed
Work on SSHWizard
Adding some toasts in case of unsuccessful git repo cloning Remove the useless 'check SSH' button
1 parent d61a773 commit 44a8e1f

File tree

5 files changed

+26
-102
lines changed

5 files changed

+26
-102
lines changed

MobileOrg/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
minSdkVersion 17
1212
targetSdkVersion 24
1313
versionCode 1
14-
versionName "1.0"
14+
versionName "2.0.2"
1515
}
1616

1717
useLibrary 'org.apache.http.legacy'

MobileOrg/src/main/java/com/matburt/mobileorg/OrgNodeListActivity.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.view.MenuItem;
2525
import android.view.View;
2626
import android.widget.EditText;
27+
import android.widget.Toast;
2728

2829
import com.matburt.mobileorg.Gui.Outline.OutlineAdapter;
2930
import com.matburt.mobileorg.Gui.SearchActivity;
@@ -36,6 +37,8 @@
3637
import com.matburt.mobileorg.util.OrgUtils;
3738
import com.matburt.mobileorg.util.PreferenceUtils;
3839

40+
import java.io.File;
41+
3942

4043
/**
4144
* An activity representing a list of OrgNodes. This activity
@@ -109,6 +112,12 @@ public void onClick(View view) {
109112
public void onClick(DialogInterface dialog, int whichButton) {
110113
String filename = input.getText().toString();
111114
OrgFile newFile = new OrgFile(filename, filename);
115+
File file = new File(newFile.getFilePath(OrgNodeListActivity.this));
116+
if(file.exists()){
117+
Toast.makeText(OrgNodeListActivity.this, R.string.file_exists, Toast.LENGTH_SHORT)
118+
.show();
119+
return;
120+
}
112121
newFile.addFile(OrgNodeListActivity.this);
113122
((OutlineAdapter) recyclerView.getAdapter()).refresh();
114123
Synchronizer.getInstance().addFile(filename);
@@ -310,7 +319,6 @@ private class SynchServiceReceiver extends BroadcastReceiver {
310319
public void onReceive(Context context, Intent intent) {
311320
boolean syncStart = intent.getBooleanExtra(Synchronizer.SYNC_START, false);
312321
boolean syncDone = intent.getBooleanExtra(Synchronizer.SYNC_DONE, false);
313-
boolean showToast = intent.getBooleanExtra(Synchronizer.SYNC_SHOW_TOAST, false);
314322
int progress = intent.getIntExtra(Synchronizer.SYNC_PROGRESS_UPDATE, -1);
315323

316324
if (syncStart) {

MobileOrg/src/main/java/com/matburt/mobileorg/Synchronizers/JGitWrapper.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
import android.content.ContentResolver;
66
import android.content.ContentValues;
77
import android.content.Context;
8+
import android.content.Intent;
89
import android.os.AsyncTask;
910
import android.util.Log;
1011
import android.widget.Toast;
1112

13+
import com.matburt.mobileorg.EditNodeActivity;
1214
import com.matburt.mobileorg.OrgData.OrgFile;
1315
import com.matburt.mobileorg.OrgData.OrgFileParser;
1416
import com.matburt.mobileorg.OrgData.OrgProviderUtils;
17+
import com.matburt.mobileorg.OrgNodeListActivity;
1518
import com.matburt.mobileorg.R;
1619
import com.matburt.mobileorg.Synchronizers.SshSessionFactory.ConnectionType;
1720
import com.matburt.mobileorg.util.FileUtils;
@@ -347,13 +350,14 @@ protected void onPostExecute(Object exception) {
347350
if (exception == null) {
348351
Toast.makeText(context, "Synchronization successful !", Toast.LENGTH_LONG).show();
349352
((Activity) context).finish();
353+
354+
Intent intent = new Intent(context, OrgNodeListActivity.class);
355+
context.startActivity(intent);
350356
return;
351357
}
352358

353-
if(exception instanceof TransportException){
354-
Toast.makeText(context, "Authentification failed", Toast.LENGTH_LONG).show();
355-
}else if (exception instanceof InvalidRemoteException) {
356-
Toast.makeText(context, "Path does not exist or is not a valid repository", Toast.LENGTH_SHORT).show();
359+
if (exception instanceof InvalidRemoteException) {
360+
Toast.makeText(context, "Path does not exist or is not a valid repository", Toast.LENGTH_LONG).show();
357361
}else if(exception instanceof UnableToPushException) {
358362
// git config receive.denyCurrentBranch ignore
359363
Toast.makeText(context, "Push test failed. Make sure the repository is bare.", Toast.LENGTH_LONG).show();

MobileOrg/src/main/res/layout/wizard_ssh.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@
127127
android:inputType="number"
128128
android:defaultValue="22"
129129
android:singleLine="true"/>
130-
<Button
131-
android:layout_marginTop="20dp"
132-
android:id="@+id/wizard_ssh_login_button"
133-
android:layout_width="wrap_content"
134-
android:layout_height="wrap_content"
135-
android:text="@string/login_ssh"
136-
android:textSize="20dp"/>
130+
<!--<Button-->
131+
<!--android:layout_marginTop="20dp"-->
132+
<!--android:id="@+id/wizard_ssh_login_button"-->
133+
<!--android:layout_width="wrap_content"-->
134+
<!--android:layout_height="wrap_content"-->
135+
<!--android:text="@string/login_ssh"-->
136+
<!--android:textSize="20dp"/>-->
137137
</LinearLayout>
138138
<View
139139
android:layout_width="fill_parent"

MobileOrg/src/main/res/values/strings.xml

Lines changed: 1 addition & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<string name="date">Date</string>
3939
<string name="time">Time</string>
4040
<string name="auth_type">Authentication type:</string>
41+
<string name="file_exists">This file exists already !</string>
4142

4243
<!-- toasts -->
4344
<string name="unselectable_item">You cannot select this item</string>
@@ -277,95 +278,6 @@
277278
<string name="title_agenda_title">Use agenda titles</string>
278279
<string name="summary_agenda_title">Enables use of custom agenda titles. Needs resync of agenda file to take effect</string>
279280
<string name="title_activity_scrolling">ScrollingActivity</string>
280-
<string name="large_text">
281-
"Material is the metaphor.\n\n"
282-
283-
"A material metaphor is the unifying theory of a rationalized space and a system of motion."
284-
"The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
285-
"technologically advanced and open to imagination and magic.\n"
286-
"Surfaces and edges of the material provide visual cues that are grounded in reality. The "
287-
"use of familiar tactile attributes helps users quickly understand affordances. Yet the "
288-
"flexibility of the material creates new affordances that supercede those in the physical "
289-
"world, without breaking the rules of physics.\n"
290-
"The fundamentals of light, surface, and movement are key to conveying how objects move, "
291-
"interact, and exist in space and in relation to each other. Realistic lighting shows "
292-
"seams, divides space, and indicates moving parts.\n\n"
293-
294-
"Bold, graphic, intentional.\n\n"
295-
296-
"The foundational elements of print based design typography, grids, space, scale, color, "
297-
"and use of imagery guide visual treatments. These elements do far more than please the "
298-
"eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
299-
"imagery, large scale typography, and intentional white space create a bold and graphic "
300-
"interface that immerse the user in the experience.\n"
301-
"An emphasis on user actions makes core functionality immediately apparent and provides "
302-
"waypoints for the user.\n\n"
303-
304-
"Motion provides meaning.\n\n"
305-
306-
"Motion respects and reinforces the user as the prime mover. Primary user actions are "
307-
"inflection points that initiate motion, transforming the whole design.\n"
308-
"All action takes place in a single environment. Objects are presented to the user without "
309-
"breaking the continuity of experience even as they transform and reorganize.\n"
310-
"Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
311-
"Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
312-
313-
"3D world.\n\n"
314-
315-
"The material environment is a 3D space, which means all objects have x, y, and z "
316-
"dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
317-
"positive z-axis extending towards the viewer. Every sheet of material occupies a single "
318-
"position along the z-axis and has a standard 1dp thickness.\n"
319-
"On the web, the z-axis is used for layering and not for perspective. The 3D world is "
320-
"emulated by manipulating the y-axis.\n\n"
321-
322-
"Light and shadow.\n\n"
323-
324-
"Within the material environment, virtual lights illuminate the scene. Key lights create "
325-
"directional shadows, while ambient light creates soft shadows from all angles.\n"
326-
"Shadows in the material environment are cast by these two light sources. In Android "
327-
"development, shadows occur when light sources are blocked by sheets of material at "
328-
"various positions along the z-axis. On the web, shadows are depicted by manipulating the "
329-
"y-axis only. The following example shows the card with a height of 6dp.\n\n"
330-
331-
"Resting elevation.\n\n"
332-
333-
"All material objects, regardless of size, have a resting elevation, or default elevation "
334-
"that does not change. If an object changes elevation, it should return to its resting "
335-
"elevation as soon as possible.\n\n"
336-
337-
"Component elevations.\n\n"
338-
339-
"The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
340-
"does not vary from 6dp in one app to 16dp in another app).\n"
341-
"Components may have different resting elevations across platforms, depending on the depth "
342-
"of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
343-
344-
"Responsive elevation and dynamic elevation offsets.\n\n"
345-
346-
"Some component types have responsive elevation, meaning they change elevation in response "
347-
"to user input (e.g., normal, focused, and pressed) or system events. These elevation "
348-
"changes are consistently implemented using dynamic elevation offsets.\n"
349-
"Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
350-
"to the component’s resting state. They ensure that elevation changes are consistent "
351-
"across actions and component types. For example, all components that lift on press have "
352-
"the same elevation change relative to their resting elevation.\n"
353-
"Once the input event is completed or cancelled, the component will return to its resting "
354-
"elevation.\n\n"
355-
356-
"Avoiding elevation interference.\n\n"
357-
358-
"Components with responsive elevations may encounter other components as they move between "
359-
"their resting elevations and dynamic elevation offsets. Because material cannot pass "
360-
"through other material, components avoid interfering with one another any number of ways, "
361-
"whether on a per component basis or using the entire app layout.\n"
362-
"On a component level, components can move or be removed before they cause interference. "
363-
"For example, a floating action button (FAB) can disappear or move off screen before a "
364-
"user picks up a card, or it can move if a snackbar appears.\n"
365-
"On the layout level, design your app layout to minimize opportunities for interference. "
366-
"For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
367-
"when a user tries to pick up one of cards.\n\n"
368-
</string>
369281
<string name="action_settings">Settings</string>
370282

371283
<!-- others -->

0 commit comments

Comments
 (0)